Equipment control method and device based on energy demand and storage medium
By constructing and integrating approximate kernel function and nuclear ridge regression model, the problems of high computational complexity and lack of comprehensive management of multi-energy types are solved, and efficient and intelligent energy demand prediction and control are achieved, which significantly reduces cost and computational complexity.
Patent Information
- Application Number
- CN202510178444.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-27
AI Technical Summary
The existing energy management system has high computational complexity, model training requires a large amount of labeled data, which is costly, and mainly focuses on monitoring and control of a single energy type. It lacks comprehensive management of multiple energy types, has a low degree of intelligence, and lacks the ability to automatically optimize and intelligent decision-making.
By obtaining historical energy data, an approximate nuclear function and nuclear ridge regression model is constructed, and the energy demand prediction model is integrated to obtain the energy demand prediction model, and the current energy demand information is obtained based on the current energy data and prediction model, and the operation of home equipment is intelligently controlled to realize the monitoring and control of multi-dimensional energy types.
It improves the accuracy and computing efficiency of energy demand forecasts, simplifies computing complexity, significantly reduces costs, and achieves the comprehensive management of various energy types and efficient energy use, achieving the purpose of energy conservation and emission reduction.
Smart Images

Figure CN120044809A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of smart homes, for example, to a device control method, device, and storage medium based on energy demand. Background Art
[0002] With the development of technology and the increasing demand for energy management, the energy management system of smart homes has gradually become a research and application hotspot. In the related art, traditional machine learning models or deep learning models are used in the energy management system for energy prediction and control. However, this results in a relatively high computational complexity of the energy management system, and a large amount of labeled data is required for the training process of the model, causing a relatively high cost. Moreover, the energy management system mainly focuses on the monitoring and control of a single energy type, lacking the comprehensive management of multiple energy types, with a relatively low degree of intelligence in energy conservation and lacking the ability of automatic optimization and intelligent decision-making.
[0003] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present disclosure, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0004] To provide a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary is not a comprehensive review, nor is it intended to identify key / important elements or delineate the scope of protection of these embodiments. Instead, it serves as a preamble to the detailed description that follows.
[0005] Embodiments of the present disclosure provide a device control method, device, and storage medium based on energy demand, which helps to improve the accuracy and computational efficiency of energy demand prediction, simplifies the computational complexity, and significantly reduces the cost.
[0006] According to a first aspect of the present disclosure, a device control method based on energy demand is provided. The device control method includes:
[0007] Obtain historical energy data, where the historical energy data represents energy consumption data and energy consumption impact data;
[0008] Construct an approximate kernel function using the historical energy data, and construct a kernel ridge regression model using the historical energy data;
[0009] Fuse the approximate kernel function and the kernel ridge regression model to obtain an energy demand prediction model;
[0010] Obtain current energy data, and obtain current energy demand information based on the current energy data and the energy demand prediction model;
[0011] Control the operation of corresponding home appliances based on the current energy demand information.
[0012] In some embodiments, constructing an approximate kernel function using historical energy data includes:
[0013] Evaluating each candidate kernel function type based on historical energy data, and determining a target kernel function type based on the evaluation results of each candidate kernel function type;
[0014] Optimizing a pre-constructed random matrix and random function based on historical energy data;
[0015] Constructing an approximate kernel function that implements variational random features based on the target kernel function type, and the optimized random matrix and random function.
[0016] In some embodiments, evaluating each candidate kernel function type based on historical energy data, and determining a target kernel function type based on the evaluation results of each candidate kernel function type, includes:
[0017] Determining the data characteristics of historical energy data under each kernel function type;
[0018] Validating each candidate kernel function type using historical energy data to obtain an evaluation metric for each candidate kernel function type;
[0019] Determining a target kernel function type among the candidate kernel function types based on the data characteristics of historical energy data and the evaluation metrics of each candidate kernel function type.
[0020] In some embodiments, optimizing a pre-constructed random matrix and random function based on historical energy data includes:
[0021] Defining a first objective function for the approximate error, and initializing the random feature parameters of the pre-constructed random matrix and random function;
[0022] Calculating a first gradient of the first objective function with respect to the random feature parameters based on historical energy data, and adjusting the random feature parameters based on the first gradient;
[0023] Determining the dimension of the low-dimensional random feature space jointly corresponding to the random matrix and the random function through cross-validation.
[0024] In some embodiments, constructing a kernel ridge regression model using historical energy data includes:
[0025] Defining a second objective function for the kernel ridge regression model, where the second objective function includes a squared error loss term and a regularization term;
[0026] Initializing the coefficients to be solved for the kernel ridge regression model;
[0027] Calculate the second gradient of the second objective function with respect to the kernel ridge regression model based on historical energy data;
[0028] Adjust the coefficients according to the second gradient until the preset convergence condition is met.
[0029] In some embodiments, an approximate kernel function is fused with the kernel ridge regression model to obtain an energy demand prediction model, including: replacing the original kernel function in the kernel ridge regression model with the approximate kernel function, and using the kernel ridge regression model containing the approximate kernel function as the energy demand prediction model.
[0030] In some embodiments, an approximate kernel function is fused with the kernel ridge regression model to obtain an energy demand prediction model, including: connecting the output of the approximate kernel function to the input of the kernel ridge regression model to obtain the energy demand prediction model.
[0031] According to a second aspect of the present disclosure, there is provided a device control device based on energy demand, the device control device including:
[0032] A historical data acquisition module configured to acquire historical energy data, where the historical energy data represents energy consumption data and energy consumption impact data;
[0033] A function model construction module configured to construct an approximate kernel function using the historical energy data and construct a kernel ridge regression model using the historical energy data;
[0034] A prediction model acquisition module configured to fuse the approximate kernel function with the kernel ridge regression model to obtain an energy demand prediction model;
[0035] An energy demand prediction module configured to acquire current energy data and obtain current energy demand information based on the current energy data and the energy demand prediction model;
[0036] A device control module configured to control the operation of corresponding home appliances based on the current energy demand information.
[0037] According to a third aspect of the present disclosure, there is provided a device control device based on energy demand, including a processor and a memory storing program instructions, the processor being configured to execute the device control method based on energy demand provided in the first aspect of the present disclosure when running the program instructions.
[0038] According to a fourth aspect of the present disclosure, there is provided a storage medium storing computer program instructions, the computer program instructions being configured to execute the device control method based on energy demand provided in the first aspect of the present disclosure when run by a processor.
[0039] The device control method, device, and storage medium based on energy demand provided by the embodiments of the present disclosure can achieve the following technical effects:
[0040] The device control method based on energy demand provided by the embodiments of the present disclosure uses energy usage data and environmental data in multiple dimensions as energy data, and constructs an approximate kernel function and a kernel ridge regression model for realizing variational stochastic features by using the energy data. An energy demand prediction model that can accurately predict energy demand is obtained by fusing the approximate kernel function and the kernel ridge regression model, so as to intelligently control the operation of home devices according to the energy demand, realize the monitoring and control of multi-dimensional energy types, ensure the efficient management and optimization of energy usage, and achieve the purpose of energy conservation and emission reduction. The energy demand prediction model obtained based on the fusion of the approximate kernel function and the kernel ridge regression model can effectively process high-dimensional data and non-linear relationships, helps to improve the accuracy and calculation efficiency of energy demand prediction, and simplifies the calculation complexity. Moreover, a large amount of labeled data is not required in the process of obtaining the energy demand prediction model, which significantly reduces the cost.
[0041] The above general description and the following description are only exemplary and explanatory, and are not used to limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] One or more embodiments are exemplarily illustrated by the corresponding drawings. These exemplary illustrations and the drawings do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements. The drawings do not constitute a scale limitation, and among them:
[0043] Figure 1 is an energy management system provided by the embodiments of the present disclosure;
[0044] Figure 2 is a schematic flowchart of a device control method based on energy demand provided by the embodiments of the present disclosure;
[0045] Figure 3 is a schematic flowchart of another device control method based on energy demand provided by the embodiments of the present disclosure;
[0046] Figure 4 is a schematic flowchart of another device control method based on energy demand provided by the embodiments of the present disclosure;
[0047] Figure 5 is a schematic structural diagram of a device control device based on energy demand provided by the embodiments of the present disclosure;
[0048] Figure 6 is a schematic structural diagram of another device control device based on energy demand provided by the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0049] In order to understand the features and technical content of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. The attached drawings are only for reference and explanation purposes and are not used to limit the embodiments of the present disclosure. In the following technical descriptions, for the sake of explanation, multiple details are provided to provide a full understanding of the disclosed embodiments. However, one or more embodiments can still be implemented without these details. In other cases, well-known structures and devices can be shown in a simplified manner to simplify the drawings.
[0050] In the description of the embodiments of the present disclosure, the terms "first", "second", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so as to implement the embodiments of the present disclosure described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion.
[0051] Unless otherwise specified, the term "plurality" means two or more.
[0052] In the embodiments of the present disclosure, the character " / " indicates that the objects before and after are in an "or" relationship. For example, A / B means: A or B.
[0053] The term "and / or" is a description of the association relationship of objects and indicates that three relationships can exist. For example, A and / or B means: A or B, or, the three relationships of A and B.
[0054] The term "corresponding" can refer to an association relationship or a binding relationship. A corresponding to B means that there is an association relationship or a binding relationship between A and B.
[0055] As shown in combination Figure 1 The embodiments of the present disclosure provide an energy management system. The energy management system includes a device control device based on energy demand, a local computing terminal, a user terminal, home appliances and sensors. The device control device based on energy demand is respectively communicatively connected to the local computing terminal and the user terminal. The device control device is communicatively connected to the user terminal, and the local computing terminal is communicatively connected to the home appliances and sensors.
[0056] The device control device based on energy demand can be a server deployed in the cloud. The local computing terminal can be a device with computing capabilities deployed in a user's home. The user terminal can be a mobile phone, a tablet computer, etc. The home appliances include air conditioners, refrigerators, televisions, washing machines, gas stoves, etc. The sensors include smart electricity meters, smart gas meters, smart water meters, temperature sensors, humidity sensors, light sensors, etc.
[0057] Combined with the energy management system provided in the embodiments of the present disclosure, the embodiments of the present disclosure provide a device control method based on energy demand. The execution subject of this method is a device control device based on energy demand (hereinafter referred to as the device control device), such as Figure 2 As shown, the device control method based on energy demand includes:
[0058] S201, the device control device acquires historical energy data.
[0059] In the embodiments of the present disclosure, the historical energy data represents energy consumption data and energy consumption impact data. Some sensors can record energy usage data representing energy consumption, and these sensors include smart electricity meters, smart gas meters, and smart water meters, etc. Some sensors can collect environmental data that affects energy consumption, and these sensors include temperature sensors, humidity sensors, and light sensors, etc. Here, the energy usage data within a past period of time is defined as energy consumption data. The environmental data within a past period of time is defined as historical environmental data, and the historical environmental data is used as energy consumption impact data.
[0060] In the embodiments of the present disclosure, the local computing terminal is communicatively connected to the sensors. The local computing terminal can acquire the energy usage data recorded by the sensors and the collected environmental data, and upload the historical energy data including the historical energy usage data and the historical environmental data to the device control device.
[0061] In some embodiments, the historical energy data can be pre-processed by data cleaning and normalization.
[0062] Optionally, when performing data cleaning on the historical energy data, abnormal data points that deviate significantly from the normal range can be identified and removed through statistical methods. For example, for the electricity consumption in the energy data, if a certain data point is far beyond the range of other data points, it can be determined as an outlier and processed.
[0063] Optionally, when performing data cleaning on the historical energy data, for missing data, different methods can be used for filling, such as mean filling, median filling, or prediction filling using a regression model. If the proportion of missing data is large, a dedicated missing value processing algorithm, such as multiple imputation, can be considered.
[0064] Optionally, when normalizing the historical energy data, it can include maximum normalization and standard normalization. For maximum normalization, the historical energy data is mapped to the [0,1] interval. For a certain feature in the historical energy data, the minimum and maximum values of the feature are determined. For standard normalization, the historical energy data has zero mean and unit variance.
[0065] S202. The device control device constructs an approximate kernel function using historical energy data and constructs a kernel ridge regression model using historical energy data.
[0066] In the embodiments of the present disclosure, the approximate kernel function can implement variational random features, which is a technique in machine learning aimed at approximating non-linear transformations so that data that was originally linearly inseparable becomes linearly separable in a high-dimensional space. Specifically, the variational random features mentioned in the embodiments of the present disclosure refer to the technique of approximating the kernel function by introducing a random feature mapping, which can effectively reduce the computational complexity while maintaining the prediction performance of the model.
[0067] In the embodiments of the present disclosure, Kernel Ridge Regression (KRR) is a machine learning algorithm that combines the advantages of kernel methods and Ridge Regression. It is mainly used to solve regression problems, that is, to predict continuous value outputs. In the application scenario of energy demand prediction, the kernel ridge regression model can be used to predict future energy consumption, which is of great significance for optimizing energy distribution, improving energy efficiency, and reducing costs.
[0068] S203. The device control device fuses the approximate kernel function with the kernel ridge regression model to obtain an energy demand prediction model.
[0069] In the embodiments of the present disclosure, the original kernel function in the kernel ridge regression model can be replaced with the approximate kernel function, and the kernel ridge regression model containing the approximate kernel function is used as the energy demand prediction model.
[0070] In the embodiments of the present disclosure, the output of the approximate kernel function can be connected to the input of the kernel ridge regression model to obtain an energy demand prediction model.
[0071] S204. The device control device obtains current energy data and obtains current energy demand information based on the current energy data and the energy demand prediction model.
[0072] In the embodiments of the present disclosure, the real-time energy usage data is defined as the current energy usage data, and the real-time environmental data is defined as the current environmental data. The current energy data includes the current energy usage data and the current environmental data. The sensor can send the current energy usage data and the current environmental data to the local computing terminal, and the local computing terminal uploads the current energy data including the current energy usage data and the current environmental data to the device control device.
[0073] In an embodiment of the present disclosure, the device control device inputs current energy data into an energy demand prediction model, and uses the energy demand prediction model to predict the current energy demand information. Among them, the current energy demand information represents the energy demand situation of the user's family in a future period of time. Further, different prediction time windows can be set and adjusted according to actual needs. For example, the energy demand for the next hour, day, or week can be predicted.
[0074] S205. The device control device controls the operation of the corresponding home appliances based on the current energy demand information.
[0075] In an embodiment of the present disclosure, the device control device can determine an energy-saving strategy based on the current energy demand information, generate a home appliance control instruction according to the energy-saving strategy, send the home appliance control instruction to the local computing terminal, and the local computing terminal sends the home appliance control instruction to the corresponding home appliance so that the home appliance operates according to the home appliance control instruction. For example, if it is predicted that the energy demand will be high in a future period of time, the temperature setting of the air conditioner can be automatically reduced, unnecessary lighting equipment can be turned off, or the working mode of the home appliance can be adjusted.
[0076] The device control method based on energy demand provided by the embodiments of the present disclosure uses energy usage data and environmental data in multiple dimensions as energy data, and constructs an approximate kernel function and a kernel ridge regression model for realizing variational stochastic features by using the energy data. By fusing the approximate kernel function and the kernel ridge regression model, an energy demand prediction model that can accurately predict the energy demand is obtained, so as to intelligently control the operation of home appliances according to the energy demand, realize the monitoring and control of multi-dimensional energy types, ensure the efficient management and optimization of energy use, and achieve the purpose of energy conservation and emission reduction. The energy demand prediction model obtained based on the fusion of the approximate kernel function and the kernel ridge regression model can effectively process high-dimensional data and non-linear relationships, helps to improve the accuracy and calculation efficiency of energy demand prediction, and simplifies the calculation complexity. Moreover, the process of obtaining the energy demand prediction model does not require a large amount of labeled data, significantly reducing the cost.
[0077] In an embodiment of the present disclosure, the approximate kernel function and the kernel ridge regression model are fused to realize the fusion of variational stochastic features and kernel ridge regression, which can handle high-dimensional and non-linear relationships, while reducing the calculation complexity, making the energy demand prediction more accurate and efficient, and better adapting to the complex energy data environment of the smart home, and providing more accurate energy management suggestions for users.
[0078] In an embodiment of the present disclosure, multiple types of energy such as electricity, gas, and water are considered, and users can comprehensively understand the overall energy usage situation of the family, formulate more comprehensive and effective energy-saving strategies, and achieve more comprehensive energy management and control.
[0079] In the embodiments of the present disclosure, the operation of corresponding home appliances can be controlled based on the current energy demand information, which can respond to changes in energy demand in real time, greatly improving the intelligence level of energy conservation, reducing the trouble of manual operation by users, being more convenient and efficient, and effectively reducing energy consumption.
[0080] The device control method based on energy demand provided by the embodiments of the present disclosure can timely capture changes in the home energy usage situation, ensuring that the system always provides accurate energy management services. In different home environments and usage scenarios, it can quickly adjust strategies, maintain good performance, and provide users with a stable and reliable energy management solution.
[0081] In some embodiments, constructing an approximate kernel function using historical energy data includes: evaluating various candidate kernel function types based on historical energy data, and determining the target kernel function type based on the evaluation results of each candidate kernel function type; optimizing a pre-constructed random matrix and random function based on historical energy data; constructing an approximate kernel function for implementing variational random features based on the target kernel function type, as well as the optimized random matrix and random function.
[0082] Combined Figure 3 As shown, the embodiments of the present disclosure provide another device control method based on energy demand. The device control method based on energy demand includes:
[0083] S301, the device control device obtains historical energy data.
[0084] S302, the device control device evaluates various candidate kernel function types based on historical energy data, and determines the target kernel function type based on the evaluation results of each candidate kernel function type.
[0085] In the embodiments of the present disclosure, the candidate kernel function types include Gaussian kernel function, polynomial kernel function, linear kernel function, Laplace kernel function, and mixed kernel function, etc. Here, each candidate kernel function type can be used to experiment with a small part of representative historical energy data, and the target kernel function type can be determined according to the experimental results.
[0086] In some embodiments, evaluating various candidate kernel function types based on historical energy data, and determining the target kernel function type based on the evaluation results of each candidate kernel function type includes: determining the data characteristics of historical energy data under each kernel function type; verifying various candidate kernel function types using historical energy data, and obtaining the evaluation indexes of each candidate kernel function type; determining the target kernel function type among the candidate kernel function types based on the data characteristics of historical energy data and the evaluation indexes of each candidate kernel function type.
[0087] In an embodiment of the present disclosure, determining the data characteristics of historical energy data under each kernel function type includes: calculating the kernel matrix of historical energy data under each kernel function type, and determining the characteristics of the kernel matrix, such as symmetry and positive definiteness. Here, the symmetry and positive definiteness of the kernel matrix corresponding to each kernel function type are used as the data characteristics of historical energy data under each kernel function type.
[0088] In an embodiment of the present disclosure, the evaluation indicators of candidate kernel function types include indicators such as prediction accuracy and mean square error.
[0089] Optionally, if the data has high dimensions and may have complex non-linear relationships, the Gaussian kernel function can be used as the target kernel function type. The Gaussian kernel function has good generalization ability and can handle non-linear relationships in high-dimensional data.
[0090] Optionally, if the data has a specific structure or known polynomial relationship, the polynomial kernel function can be used as the target kernel function type.
[0091] S303. The device control device optimizes the pre-constructed random matrix and random function based on historical energy data.
[0092] In an embodiment of the present disclosure, optimizing the pre-constructed random matrix and random function based on historical energy data includes: defining a first objective function for the approximation error, and initializing the random feature parameters of the pre-constructed random matrix and random function; calculating the first gradient of the first objective function with respect to the random feature parameters based on historical energy data, and adjusting the random feature parameters based on the first gradient; determining the dimension of the low-dimensional random feature space jointly corresponding to the random matrix and the random function through cross-validation.
[0093] In an embodiment of the present disclosure, taking the Gaussian kernel function as the target kernel function type as an example, the expression of the Gaussian kernel function is as follows: K(x, y) = exp(-γ∥x - y∥ 2 ). In this expression, x and y are input data vectors. In a machine learning task, the input data vector is usually a feature vector, representing the features of data points, and γ is a kernel parameter.
[0094] In an embodiment of the present disclosure, the random matrix is denoted as W, and its dimension is d×D, where d is the dimension of the low-dimensional random feature space and D is the dimension of the original data. For the input data vector x, the feature after random mapping using the random matrix is: b is a random vector.
[0095] In an embodiment of the present disclosure, the expression of the random function is: h(x) = sin(ωx + θ), where ω is a random vector, each element is independently sampled from a specific distribution, and θ is a random offset.
[0096] In the embodiments of the present disclosure, for the input data x, the expression of the random features obtained after the action of the random function multiple times is as follows: φ(x) = [h 1 (x), h 2 (x), …, h d (x)].
[0097] In the embodiments of the present disclosure, the first objective function defining the approximation error may be the mean square error, and the expression of the first objective function is: where n is the number of data samples, and (x i , x j ) is a pair of data samples in the historical energy data.
[0098] For each pair of data samples (x i , x j ) in the historical energy data, calculate the first gradient of the first objective function with respect to the random feature parameters, and adjust the random feature parameters based on the first gradient. Here, the random feature parameters can be adjusted by the following formula: where θ t is the current random feature parameter, α is the learning rate, is the gradient of the objective function, and θ t+1 is the adjusted random feature parameter. Repeat the above steps until the first objective function converges or reaches a certain number of iterations.
[0099] Optionally, the learning rate can be dynamically adjusted, for example, a larger learning rate is used at the beginning to quickly approach the optimal solution, and then the learning rate is gradually decreased to finely adjust the parameters.
[0100] In the embodiments of the present disclosure, the dimension of the low-dimensional random feature space jointly corresponding to the random matrix and the random function is determined by cross-validation, so as to balance the computational efficiency and the approximation accuracy.
[0101] S304. The device control device constructs an approximate kernel function for implementing variational random features based on the target kernel function type, and the optimized random matrix and random function.
[0102] S305. The device control device constructs a kernel ridge regression model using the historical energy data.
[0103] S306. The device control device fuses the approximate kernel function with the kernel ridge regression model to obtain an energy demand prediction model.
[0104] S307. The device control device obtains the current energy data, and obtains the current energy demand information based on the current energy data and the energy demand prediction model.
[0105] S308. The device control device controls the operation of the corresponding home device based on the current energy demand information.
[0106] In some embodiments, a kernel ridge regression model is constructed using historical energy data, including: defining a second objective function of the kernel ridge regression model, where the second objective function includes a squared error loss term and a regularization term; initializing the coefficients to be solved for the kernel ridge regression model; calculating the second gradient of the second objective function with respect to the kernel ridge regression model based on the historical energy data; and adjusting the coefficients according to the second gradient until a preset convergence condition is met.
[0107] Combined with Figure 4 As shown, the embodiments of the present disclosure provide another device control method based on energy demand. The device control method based on energy demand includes:
[0108] S401. The device control device obtains historical energy data.
[0109] S402. The device control device constructs an approximate kernel function using the historical energy data.
[0110] S403. The device control device defines a second objective function of the kernel ridge regression model and initializes the coefficients to be solved for the kernel ridge regression model.
[0111] In the embodiments of the present disclosure, the second objective function includes a squared error loss term and a regularization term.
[0112] The expression of the squared error loss term is: where x i is the input vector, and y i is the corresponding target value (such as the energy consumption value).
[0113] The expression of the regularization term is: L regularization = λ∥w∥ 2 , where λ is the regularization parameter and w is the model parameter.
[0114] In the embodiments of the present disclosure, for kernel ridge regression, the model parameter can be represented by the kernel function, and the expression is as follows: where α i is the coefficient to be solved, and K(x, x i ) is the kernel function. At this time, the regularization term can be expressed as:
[0115] Here, the expression of the second objective function is as follows: L = L squared + L regularization .
[0116] S404. The device control device calculates the second gradient of the second objective function with respect to the kernel ridge regression model based on the historical energy data.
[0117] S405, the device control device adjusts according to the second gradient adjustment coefficient until the preset convergence condition is met.
[0118] In the embodiments of the present disclosure, the coefficient to be solved can be initialized first. For example, the coefficient to be solved is initialized as a zero vector or a random vector. Then, the second gradient of the second objective function with respect to the kernel ridge regression model is calculated based on historical energy data.
[0119] In the embodiments of the present disclosure, the second gradient of the second objective function with respect to the kernel ridge regression model can be calculated by the following formula: Where K represents the kernel matrix, which is a matrix calculated from the input data through a certain kernel function (such as Gaussian kernel, polynomial kernel, etc.), reflecting the similarity between samples. α is the coefficient to be solved, and this coefficient needs to be solved by minimizing the second objective function. y is the target value vector, that is, the true output value in the historical energy data.
[0120] In some embodiments, after initially obtaining the second gradient, the search direction is initialized. After initializing the search direction, iterative updates are performed. In each iteration, the steps of calculating the step size, updating the coefficient, and updating the search direction are executed until the convergence condition is met.
[0121] Optionally, the initialized search direction can be expressed as: Where d0 is the search direction, is the gradient of the second objective function with respect to the coefficient α at the initial point.
[0122] Optionally, the step size can be calculated by the following formula: Where α k represents the step size, λ is the regularization parameter, I is the identity matrix, is the gradient of the second objective function with respect to the coefficient α at the Kth iteration, and d k is the search direction at the Kth iteration.
[0123] Optionally, the coefficient can be updated by the following formula: α k+1 =α k +α k d k , α k+1 is the updated coefficient.
[0124] Optionally, the search direction can be updated by the following formula: d k+1 is the updated search direction, is the gradient of the second objective function with respect to the coefficient α at the (k + 1)th iteration, dk is the search direction at the kth iteration, and β k is a scalar used to determine the relationship between the old and new search directions.
[0125] β k It can be calculated by the following formula: where is the gradient of the second objective function with respect to the coefficient α at the k-th iteration, represents the change in the gradient, represents the dot product of the gradient and the search direction at the k-th iteration.
[0126] In some embodiments, after initially obtaining the second gradient, the Hessian matrix is calculated and then iterative updates are performed. In each iteration, the steps of calculating the update direction and the update coefficient are executed until the convergence condition is met.
[0127] Optionally, the Hessian matrix can be calculated by the following formula: H represents the Hessian matrix, K is the kernel matrix, λ is the regularization parameter, and I is the identity matrix.
[0128] Optionally, the update direction can be calculated by the following formula: where H -1 represents the inverse matrix of the Hessian matrix, is the gradient of the second objective function with respect to the coefficient α.
[0129] Optionally, the coefficient α can be updated by the following formula: α k+1 = α k + α k d k α k+1 is the updated coefficient.
[0130] Optionally, the convergence condition is usually to check whether the norm of the gradient is less than a preset threshold.
[0131] In some embodiments, after adjusting the coefficient according to the second gradient until the preset convergence condition is met, the kernel ridge regression model can be evaluated and adjusted. The process of evaluation and adjustment includes cross-validation and adjusting the model parameters and hyperparameters.
[0132] In the embodiments of the present disclosure, when performing cross-validation on the kernel ridge regression model, the set of historical energy data is divided into multiple subsets. For example, when performing K-fold cross-validation, the set of historical energy data is divided into K subsets of similar sizes. Then, one subset is sequentially selected as the validation set, and the remaining subsets are used as the training set to train and validate the kernel ridge regression model. The performance metrics for each validation are calculated, such as the mean squared error or the mean absolute error. Finally, the average value of the K validation results is taken as the performance evaluation metric of the model.
[0133] In the embodiments of the present disclosure, adjusting the model parameters and hyperparameters includes adjusting the regularization parameter, the kernel function parameter, and other hyperparameters.
[0134] For the regularization parameter, methods such as grid search or random search can be used to try different regularization parameters within a certain range, observe the performance of the kernel ridge regression model on the validation set, and select the regularization parameter with the best performance.
[0135] For the kernel function parameter, if the Gaussian kernel function is used, the kernel parameter can also be adjusted by a similar method.
[0136] For other hyperparameters, according to the specific optimization algorithm, hyperparameters such as the learning rate and the number of iterations are adjusted to improve the performance and convergence speed of the model.
[0137] S406, the device control device fuses the approximate kernel function with the kernel ridge regression model to obtain an energy demand prediction model.
[0138] In the embodiment of the present disclosure, the original kernel function in the kernel ridge regression model can be replaced with an approximate kernel function, and the kernel ridge regression model containing the approximate kernel function is used as the energy demand prediction model. This fusion method is simple and direct, and does not require major changes to the algorithm structure of the kernel ridge regression.
[0139] In the embodiment of the present disclosure, the output of the approximate kernel function can be connected to the input of the kernel ridge regression model to obtain an energy demand prediction model. This fusion method can better control the process of variational stochastic feature mapping and kernel ridge regression, and optimize the two stages respectively.
[0140] S407, the device control device obtains the current energy data, and obtains the current energy demand information based on the current energy data and the energy demand prediction model.
[0141] In the embodiment of the present disclosure, the energy demand prediction model can perform feature selection and fusion on the current energy data.
[0142] Optionally, calculate the correlation coefficient between each feature of the current energy data and the energy consumption. Select the features with higher correlation as the key features. For example, for household energy data, the correlation between features such as the usage time of household appliances, indoor temperature, and light intensity and the electricity consumption can be calculated.
[0143] Optionally, use the feature importance evaluation method in machine learning algorithms, such as the feature importance score of random forest, and select the features with higher scores as the key features.
[0144] Optionally, according to the understanding of the energy consumption process, select the features directly related to the energy consumption. For example, for the energy consumption of an air conditioner, select the indoor temperature, outdoor temperature, set temperature, etc. as the key features.
[0145] After determining the key features from the current energy data, the energy demand prediction model concatenates the key features with the variational random features to obtain a fused feature vector. Further, different weights can be assigned to the key features and the variational random features, and then weighted summation is performed to obtain the fused features. Among them, the weights can be determined by an optimization algorithm to maximize the performance of the model. The energy demand prediction model can obtain the current energy demand information based on the fused feature vector.
[0146] S408, the device control device controls the operation of the corresponding home device based on the current energy demand information.
[0147] In some embodiments, the energy demand prediction model can be online learned. Specifically, an online learning algorithm, such as incremental kernel ridge regression or online stochastic gradient descent, is adopted to continuously update the model using newly collected data. When a new data point is received each time, the update amount of the model is calculated, and the model parameters are fine-tuned. This can enable the model to adapt to changes in the home energy usage situation.
[0148] In some embodiments, the energy demand prediction model can be periodically optimized. Specifically, the energy demand prediction model is comprehensively optimized regularly. For example, every once in a while (such as once a week, once a month), steps such as data preprocessing, feature selection, model training, and evaluation are re-performed to ensure the accuracy and adaptability of the model. Methods such as cross-validation can be used to evaluate the performance of the model, and the model parameters and hyperparameters are adjusted according to the evaluation results. Through the above core technical details, the effective application of the fusion of kernel ridge regression and variational random features in intelligent home energy monitoring and conservation can be realized, improving energy utilization efficiency and realizing intelligent energy management.
[0149] In the embodiments of the present disclosure, the user terminal can cooperate with the energy-saving strategy. The user terminal can provide an intuitive interface to display energy data, prediction results, and saving suggestions, and the user can set preferences. The user terminal can collect the user's satisfaction with the strategy and problem feedback to improve the algorithm and strategy.
[0150] Combined Figure 5 As shown, the embodiments of the present disclosure provide a device control device 500 based on energy demand. The device control device 500 includes a historical data acquisition module 501, a function model construction module 502, a prediction model acquisition module 503, an energy demand prediction module 504, and a device control module 505.
[0151] The historical data acquisition module 501 is configured to acquire historical energy data, where the historical energy data represents energy consumption data and energy consumption impact data.
[0152] The function model construction module 502 is configured to construct an approximate kernel function using historical energy data and construct a kernel ridge regression model using historical energy data.
[0153] The prediction model acquisition module 503 is configured to fuse the approximate kernel function and the kernel ridge regression model to obtain an energy demand prediction model.
[0154] The energy demand prediction module 504 is configured to obtain current energy data and obtain current energy demand information based on the current energy data and the energy demand prediction model.
[0155] The device control module 505 is configured to control the operation of corresponding home devices based on the current energy demand information.
[0156] The device control device 500 based on energy demand provided by the embodiments of the present disclosure uses energy usage data and environmental data in multiple dimensions as energy data, and constructs an approximate kernel function and a kernel ridge regression model that implement variational random features using the energy data. By fusing the approximate kernel function and the kernel ridge regression model, an energy demand prediction model that can accurately predict energy demand is obtained, so as to intelligently control the operation of home devices according to the energy demand, realize the monitoring and control of multi-dimensional energy types, ensure the efficient management and optimization of energy use, and achieve the purpose of energy conservation and emission reduction. The energy demand prediction model obtained based on the fusion of the approximate kernel function and the kernel ridge regression model can effectively process high-dimensional data and non-linear relationships, help improve the accuracy and calculation efficiency of energy demand prediction, and simplify the calculation complexity. Moreover, a large amount of labeled data is not required in the process of obtaining the energy demand prediction model, which significantly reduces the cost.
[0157] In some embodiments, the function model construction module 502 is configured to:
[0158] Evaluate each candidate kernel function type based on historical energy data, and determine the target kernel function type based on the evaluation results of each candidate kernel function type;
[0159] Optimize the pre-constructed random matrix and random function based on historical energy data;
[0160] Based on the target kernel function type, as well as the optimized random matrix and random function, construct an approximate kernel function that implements variational random features.
[0161] In some embodiments, the function model construction module 502 is configured to:
[0162] Determine the data characteristics of historical energy data under each kernel function type;
[0163] Verify each candidate kernel function type using historical energy data and obtain the evaluation index of each candidate kernel function type;
[0164] Based on the data characteristics of historical energy data and the evaluation indexes of each candidate kernel function type, a target kernel function type is determined from the candidate kernel function types.
[0165] In some embodiments, the function model construction module 502 is configured to:
[0166] Define a first objective function for the approximation error, and initialize the random feature parameters of the pre-constructed random matrix and random function;
[0167] Calculate the first gradient of the first objective function with respect to the random feature parameters based on the historical energy data, and adjust the random feature parameters based on the first gradient;
[0168] Determine the dimension of the low-dimensional random feature space jointly corresponding to the random matrix and the random function by means of cross-validation.
[0169] In some embodiments, it is characterized in that the function model construction module 502 is configured to:
[0170] Define a second objective function for the kernel ridge regression model, where the second objective function includes a squared error loss term and a regularization term;
[0171] Initialize the coefficients to be solved for the kernel ridge regression model;
[0172] Calculate the second gradient of the second objective function with respect to the kernel ridge regression model based on the historical energy data;
[0173] Adjust the coefficients according to the second gradient until a preset convergence condition is met.
[0174] In some embodiments, the prediction model acquisition module 503 is configured to: replace the original kernel function in the kernel ridge regression model with an approximation kernel function, and use the kernel ridge regression model including the approximation kernel function as the energy demand prediction model.
[0175] In some embodiments, the prediction model acquisition module 503 is configured to: connect the output of the approximation kernel function to the input of the kernel ridge regression model to obtain the energy demand prediction model.
[0176] Combine Figure 6As shown in the figure, an embodiment of the present disclosure provides another device control device 600 based on energy demand. The device control device 600 based on energy demand includes a processor 601 and a memory 602. Optionally, the device control device 600 based on energy demand may further include a communication interface 603 and a bus 604. Among them, the processor 601, the communication interface 603, and the memory 602 can communicate with each other through the bus 604. The communication interface 603 can be used for information transmission. The processor 601 can call the logical instructions in the memory 602 to execute the device control method based on energy demand in the above embodiment.
[0177] In addition, when the logical instructions in the above-mentioned memory 602 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium.
[0178] The memory 602, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as the program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 601 executes functional applications and data processing by running the program instructions / modules stored in the memory 602, that is, implements the device control method based on energy demand in the above embodiment.
[0179] The memory 602 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 602 may include a high-speed random access memory and may also include a non-volatile memory.
[0180] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, and the computer-executable instructions are set to execute the above-mentioned device control method based on energy demand.
[0181] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The foregoing storage medium may be a non-transitory storage medium, such as: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc, etc., which are various media that can store program codes.
[0182] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure, enabling those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, process, and other changes. Embodiments only represent possible variations. Unless explicitly required, individual components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terms used in this application are only for describing embodiments and do not limit the claims. As used in the description of embodiments and claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to also include the plural forms. Similarly, as used in this application, the term "and / or" refers to any and all possible combinations of one or more of the associated listed items. Additionally, when used in this application, the term "comprise" and its variants "comprises" and / or "comprising" etc. mean the presence of the stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups of these. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, or apparatus comprising the element. Herein, each embodiment may focus on the differences from other embodiments, and the same or similar parts among the embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method parts disclosed in the embodiments, the relevant parts may refer to the description of the method parts.
[0183] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner may depend on the specific application and design constraints of the technical solution. The skilled person may use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the embodiments of the present disclosure. The skilled person can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0184] In the embodiments disclosed in this document, the disclosed methods, products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units can be merely a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Additionally, the shown or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to implement this embodiment. Additionally, in the embodiments of this disclosure, the various functional units can be integrated in one processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0185] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to the embodiments of this disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the block can occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, which can depend on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks can also occur in a different order than that disclosed in the description. Sometimes, there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, which can depend on the functions involved. Each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A device control method based on energy demand, characterized in that: include: Acquire historical energy data, wherein the historical energy data represents energy consumption data and energy consumption impact data; Using historical energy data to construct an approximate kernel function, and using historical energy data to construct a kernel ridge regression model; The approximate kernel function is integrated with the kernel ridge regression model to obtain the energy demand prediction model; Obtain current energy data, and obtain current energy demand information based on the current energy data and energy demand prediction model; Control the operation of corresponding home appliances based on current energy demand information.
2. The device control method based on energy demand according to claim 1, characterized in that: The approximate kernel function is constructed using historical energy data, including: Evaluate each candidate kernel function type based on historical energy data, and determine a target kernel function type based on the evaluation results of each candidate kernel function type; Optimize pre-built random matrices and random functions based on historical energy data; Based on the target kernel function type, as well as the optimized random matrix and random function, an approximate kernel function that realizes variational random features is constructed.
3. The device control method based on energy demand according to claim 2, characterized in that: Based on the historical energy data, each candidate kernel function type is evaluated, and the target kernel function type is determined based on the evaluation results of each candidate kernel function type, including: Determine the data characteristics of historical energy data under each kernel function type; Use historical energy data to verify each candidate kernel function type and obtain evaluation indicators for each candidate kernel function type; Based on the data characteristics of historical energy data and the evaluation index of each candidate kernel function type, the target kernel function type is determined from the candidate kernel function types.
4. The device control method based on energy demand according to claim 2, characterized in that: Optimize pre-built random matrices and random functions based on historical energy data, including: Define the first objective function of the approximation error, initialize the random characteristic parameters of the pre-constructed random matrix and random function; Calculating a first gradient of a first objective function with respect to a random characteristic parameter based on historical energy data, and adjusting the random characteristic parameter based on the first gradient; The dimension of the low-dimensional random feature space corresponding to the random matrix and the random function is determined by cross-validation.
5. The device control method based on energy demand according to any one of claims 1 to 4, characterized in that: Use historical energy data to build a kernel ridge regression model, including: Defining a second objective function of the kernel ridge regression model, wherein the second objective function includes a squared error loss term and a regularization term; Initialize the coefficients of the kernel ridge regression model to be solved; Calculate a second gradient of a second objective function with respect to a kernel ridge regression model based on historical energy data; The coefficient is adjusted according to the second gradient until a preset convergence condition is met.
6. The device control method based on energy demand according to any one of claims 1 to 4, characterized in that: The approximate kernel function is integrated with the kernel ridge regression model to obtain an energy demand prediction model, including: using the approximate kernel function to replace the original kernel function in the kernel ridge regression model, and using the kernel ridge regression model containing the approximate kernel function as the energy demand prediction model.
7. The device control method based on energy demand according to any one of claims 1 to 4, characterized in that: The approximate kernel function is integrated with the kernel ridge regression model to obtain an energy demand prediction model, including: connecting the output of the approximate kernel function to the input of the kernel ridge regression model to obtain the energy demand prediction model.
8. An equipment control device based on energy demand, characterized in that: include: A historical data acquisition module is configured to acquire historical energy data, wherein the historical energy data represents energy consumption data and energy consumption impact data; a function model building module configured to build an approximate kernel function using historical energy data and to build a kernel ridge regression model using historical energy data; A prediction model acquisition module is configured to fuse the approximate kernel function with the kernel ridge regression model to obtain an energy demand prediction model; An energy demand prediction module is configured to obtain current energy data and obtain current energy demand information based on the current energy data and an energy demand prediction model; The device control module is configured to control the operation of corresponding household devices based on current energy demand information.
9. An energy demand-based equipment control device, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the device control method based on energy demand according to any one of claims 1 to 7 when running the program instructions.
10. A storage medium, characterized in that: The storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the device control method based on energy demand as described in any one of claims 1 to 7 is executed.