A User Space Device Energy Consumption Prediction Method Based on Random Forest Algorithm

By using a random forest-based energy consumption prediction method and employing multiple regression tree models and data preprocessing techniques, this method addresses the challenges of existing technologies in handling complex building environments and the influence of multiple factors. It achieves more accurate and flexible energy consumption prediction and supports personalized energy consumption management.

CN120508924BActive Publication Date: 2025-12-02SOUTH CHINA AGRICULTURAL UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510441747.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-12-02
Estimated Expiration
2045-04-09

AI Technical Summary

Technical Problem

Existing technologies are ill-equipped to handle complex and dynamic building environments and cannot fully account for the various factors that affect the energy consumption of user space equipment, such as weather, building design, materials and resident behavior.

Method used

An energy consumption prediction method based on the random forest algorithm is adopted. By collecting user data, training and test sets are created. A random forest model composed of multiple regression trees is used to predict device usage and calculate energy consumption, combined with users' environmental preferences, device usage habits and dwell time. Bayesian optimization and Gini coefficient are applied to optimize model parameters, and data preprocessing and feature selection are performed.

Benefits of technology

It improves the accuracy and stability of energy consumption prediction, can adapt to changes in different users, equipment and environments, reduces the risk of overfitting, provides personalized energy consumption management strategies and accurate energy consumption data, and supports space managers in formulating effective energy consumption management strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508924B_ABST
    Figure CN120508924B_ABST
Patent Text Reader

Abstract

This invention discloses a user space device energy consumption prediction method based on the random forest algorithm. By collecting and integrating multi-dimensional data, it comprehensively reflects user behavior and energy consumption characteristics. Using this data, a random forest model is trained to capture complex relationships and subtle changes in user behavior, thereby improving prediction accuracy. Compared with traditional models, random forest performs better when handling nonlinear and high-dimensional data, and can more accurately predict users' choices and device usage in public spaces, thus accurately calculating energy consumption. It consists of multiple regression trees, trained based on different feature components, and uses ensemble learning methods to improve the model's generalization ability, adapting to new data, different scenarios, and changes in user, device, and environmental conditions. At the same time, random selection of features and samples reduces bias, improves minority class prediction accuracy, reduces the risk of overfitting, and ensures stable model performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of user space equipment energy consumption prediction technology, and in particular to a user space equipment energy consumption prediction method based on the random forest algorithm. Background Technology

[0002] Current methods for predicting energy consumption of user space equipment mostly rely on historical data and physical models. While these methods perform well in specific scenarios, they often struggle to cope with complex and dynamic building environments. For example, the accuracy of traditional regression models and statistical methods may be significantly reduced when data quality is insufficient or environmental changes are drastic. Furthermore, the variability of energy consumption of user space equipment is not only affected by weather conditions but is also closely related to factors such as building design, materials, equipment configuration, and resident behavior. This makes it difficult for traditional methods to fully consider all influencing factors. Summary of the Invention

[0003] In view of this, the present invention proposes a user space equipment energy consumption prediction method based on the random forest algorithm, which can effectively solve the shortcomings of existing technologies in dealing with complex and dynamic building environments and in comprehensively considering all influencing factors.

[0004] The technical solution of this invention is implemented as follows:

[0005] A method for predicting energy consumption of user space devices based on the random forest algorithm, specifically including:

[0006] Collect user data and create training and testing sets. The user data includes users' environmental preferences, device usage habits, time spent in public spaces, and the types and frequency of devices selected.

[0007] A random forest model is trained by extracting feature components from the training set. The random forest model consists of multiple regression trees, each of which is trained based on different feature components.

[0008] The test set data is input into the trained random forest model to predict users' space choices and device usage in public spaces;

[0009] Based on the prediction results and combined with the time characteristics of users, calculate the energy consumption generated by each user when using terminal devices in public spaces.

[0010] The energy consumption data of individual users is aggregated into the total energy consumption of the space, and the average daily energy consumption of terminal devices generated by each user in each space is calculated.

[0011] As a further alternative to the user space device energy consumption prediction method based on the random forest algorithm, the bagging algorithm is used to extract feature components from the training set. The specific formula of the bagging algorithm is as follows:

[0012] ;

[0013] in, It is the first b The number of features in each training subset It refers to the number of features in the original training set, i.e., the number of features selected by each tree when extracting features. 1 feature column.

[0014] As a further alternative to the user space device energy consumption prediction method based on the random forest algorithm, the optimal splitting attribute of each regression tree is determined based on the Gini coefficient during the training of each regression tree, specifically:

[0015] Calculate the impurity measure of the current dataset based on the Gini coefficient formula;

[0016] For each feature and all its possible values, calculate the measure of impurity of the split dataset if that feature and its values ​​are used as the split point;

[0017] Calculate the gain of the Gini index based on the Gini coefficient of the current dataset and the Gini coefficient of the split dataset;

[0018] Among all features, the feature with the largest Gini index gain is selected as the optimal splitting feature;

[0019] Based on the selected optimal splitting feature, the current node is split into multiple child nodes.

[0020] As a further optional solution to the user space device energy consumption prediction method based on the random forest algorithm, the parameters of the random forest model are optimized using Bayesian methods during the training process, specifically as follows:

[0021] Initialize a parameter space for Bayesian optimization, which includes the range of values ​​for all adjustable parameters of the random forest model;

[0022] Calculate the covariance between different points in the parameter space based on the kernel function;

[0023] Based on Gaussian process regression, the covariance between different points is used to construct the predictive distribution of the random forest model performance;

[0024] The marginal likelihood of the predicted distribution is calculated based on the marginal likelihood formula;

[0025] Based on the calculated marginal likelihood, obtain the parameter combination that maximizes the marginal likelihood;

[0026] Use the expected improvement criteria to select the next combination of parameters to evaluate;

[0027] Repeat the above steps until the preset optimization standard or the preset number of iterations is reached.

[0028] As a further optional solution to the user space device energy consumption prediction method based on the random forest algorithm, the specific formula for calculating the average daily terminal device energy consumption per user in each space is as follows:

[0029] ;

[0030] in, This represents the average daily energy consumption of terminal devices per user in each space. This represents the sum of the predicted power consumption of the devices the user would use in that space. This indicates the duration of a user's stay in that space. This indicates the number of times the user spends in that space per day. N This indicates the number of users.

[0031] As a further optional solution to the user space device energy consumption prediction method based on the random forest algorithm, after collecting user data and before creating training and test sets, a data preprocessing step is also included, which includes data cleaning, standardization, and data augmentation.

[0032] As a further optional solution to the user space device energy consumption prediction method based on the random forest algorithm, the method further includes:

[0033] The predicted average user energy consumption for each space is imported into the BIM model. Based on the number of users occupancy monitored daily, the daily energy consumption of terminal equipment generated in each space in the building and the daily energy consumption of terminal equipment in the entire building are predicted. An energy consumption heat map is generated through BIM visualization.

[0034] A user space device energy consumption prediction system based on the random forest algorithm includes:

[0035] The data collection and preprocessing module is used to collect user data, which includes at least the user's environmental preferences, device usage habits, time spent in public spaces, and the types and frequency of devices selected and used. Training and test sets are created based on the user data.

[0036] The random forest model training module is used to extract feature components based on the data in the training set for training the random forest model. The random forest model consists of multiple regression trees, and each regression tree is trained independently based on different feature components.

[0037] The prediction module is used to input data from the test set into a pre-trained random forest model to predict users' space choices and device usage in public spaces.

[0038] The energy consumption calculation module is used to calculate the energy consumption of each user when using terminal devices in public spaces, based on the output of the prediction module and the user's time characteristics.

[0039] The energy consumption aggregation and analysis module is used to aggregate the energy consumption data of a single user into the total energy consumption of the corresponding space, and further calculate the average daily energy consumption of terminal devices generated by each user in each space.

[0040] A computing device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described user space device energy consumption prediction methods based on the random forest algorithm.

[0041] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-described user space device energy consumption prediction methods based on the random forest algorithm.

[0042] The beneficial effects of this invention are as follows: By collecting and integrating multi-dimensional data such as users' environmental preferences, device usage habits, time spent in public spaces, and the types and frequency of selected devices, this solution can more comprehensively reflect users' actual behavior and energy consumption characteristics. Using this data to train a random forest model can capture complex relationships and subtle changes in the data, thereby improving the accuracy of predictions. Compared with traditional linear regression or simple machine learning models, the random forest model performs better when dealing with nonlinear and high-dimensional data, and can more accurately predict users' space choices and device usage in public spaces, thus calculating energy consumption more precisely. The random forest model consists of multiple regression trees, each trained based on different feature components. This ensemble learning method effectively improves the model's generalization ability. Even when facing new data or different scenarios, the model can maintain stable predictive performance, reducing the risk of overfitting and adapting to changes in different users, devices, and environmental conditions. At the same time, since the model is an ensemble model composed of multiple regression trees, each tree randomly selects features and data samples during training, which helps reduce the model's bias towards the majority class and improve the prediction accuracy of the minority class. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart illustrating a user space device energy consumption prediction method based on the random forest algorithm of the present invention.

[0045] Figure 2 This is a schematic diagram of the composition of a user space device energy consumption prediction system based on the random forest algorithm according to the present invention;

[0046] Figure 3 This is a schematic diagram of the composition of a computing device according to the present invention. Detailed Implementation

[0047] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] refer to Figures 1 to 3 A method for predicting energy consumption of user space devices based on the random forest algorithm, comprising:

[0049] Collect user data and create training and testing sets. The user data includes users' environmental preferences, device usage habits, time spent in public spaces, and the types and frequency of devices selected.

[0050] A random forest model is trained by extracting feature components from the training set. The random forest model consists of multiple regression trees, each of which is trained based on different feature components.

[0051] The test set data is input into the trained random forest model to predict users' space choices and device usage in public spaces;

[0052] Based on the prediction results and combined with the time characteristics of users, calculate the energy consumption generated by each user when using terminal devices in public spaces.

[0053] The energy consumption data of individual users is aggregated into the total energy consumption of the space, and the average daily energy consumption of terminal devices generated by each user in each space is calculated.

[0054] In this embodiment, by collecting and integrating multi-dimensional data such as users' environmental preferences, device usage habits, time spent in public spaces, and the types and frequency of selected devices, this solution can more comprehensively reflect users' actual behavior and energy consumption characteristics. Using this data to train a random forest model can capture complex relationships and subtle changes in the data, thereby improving prediction accuracy. Compared to traditional linear regression or simple machine learning models, the random forest model performs better when handling nonlinear, high-dimensional data, and can more accurately predict users' space choices and device usage in public spaces, thus calculating energy consumption more precisely. The random forest model consists of multiple regression trees, each trained based on different feature components. This ensemble learning method effectively improves the model's generalization ability. Even when facing new data or different scenarios, the model can maintain stable prediction performance, reducing the risk of overfitting and adapting to changes in different users, devices, and environmental conditions. Furthermore, since the model is an ensemble model composed of multiple regression trees, each tree randomly selects features and data samples during training, which helps reduce the model's bias towards the majority class and improves the prediction accuracy of the minority class.

[0055] Preferably, the bagging algorithm is used to extract feature components from the training set. The specific formula for the bagging algorithm is as follows:

[0056] ;

[0057] in, It is the feature number of the b-th training subset. It refers to the number of features in the original training set, i.e., the number of features selected by each tree when extracting features. 1 feature column.

[0058] In this embodiment, by selecting Training with a subset of features significantly reduces the number of features while maintaining model performance. This feature selection strategy not only improves training efficiency and reduces model complexity but also helps avoid overfitting, making the model more concise while maintaining high performance. Utilizing the bagging algorithm, this approach constructs multiple models based on different training subsets and averages their predictions. This method enhances model diversity and robustness, effectively improving generalization ability, and demonstrating good predictive performance even with unseen data. Reducing the number of features means less data processing is required when training each tree, saving computational resources. This is particularly important for handling large-scale datasets, significantly improving training speed, reducing computational costs, and making the model more efficient in practical applications. By integrating multiple weak learners to build a strong learner, the bagging algorithm improves model stability and accuracy. Selecting different feature subsets for each tree during training helps reduce the impact of single features on the model, making it more robust to data noise and outliers.

[0059] Preferably, during the training of each regression tree, the optimal splitting attribute of each regression tree is determined based on the Gini coefficient, specifically as follows:

[0060] Calculate the impurity measure of the current dataset based on the Gini coefficient formula;

[0061] For each feature and all its possible values, calculate the measure of impurity of the split dataset if that feature and its values ​​are used as the split point;

[0062] Calculate the gain of the Gini index based on the Gini coefficient of the current dataset and the Gini coefficient of the split dataset;

[0063] Among all features, the feature with the largest Gini index gain is selected as the optimal splitting feature;

[0064] Based on the selected optimal splitting feature, the current node is split into multiple child nodes.

[0065] In this embodiment, by calculating the Gini index gain for each feature and all its possible values, the scheme provides a clear and quantifiable criterion for selecting the optimal splitting feature. This helps ensure that tree growth is based on the actual influence of data features, rather than subjective judgment. Using the Gini coefficient as a splitting criterion aims to build the model by reducing the impurity of the dataset, which helps improve the model's generalization ability because it tends to select features that minimize prediction errors for splitting. Calculating the Gini index gain for each feature and all its possible values ​​can be a computationally intensive task, especially when the dataset is large or the feature dimension is high. However, this calculation is performed independently at each node of the tree, and once the tree is built, these calculations are no longer needed.

[0066] It should be noted that, firstly, the Gini coefficient (Gini(D)) of the current dataset D needs to be calculated. This reflects the impurity of the dataset. The smaller the Gini coefficient, the lower the impurity of the dataset, meaning that the samples in the dataset are more likely to belong to the same category. Next, for each feature A and all its possible values, the Gini coefficient (Gini(D|A)) of the dataset D after splitting is calculated if this feature and its values ​​are used as the split point. This involves calculating the Gini coefficient (Gini(Di)) for each subset Di and performing a weighted average based on the number of samples in subset Di |Di|. The gain of the Gini index is calculated, which is the Gini coefficient (Gini(D)) before splitting minus the weighted average Gini coefficient (Gini(D|A)) after splitting. The larger the gain, the better the feature is at reducing the impurity of the dataset. The specific calculation formula is as follows:

[0067] ;

[0068] in It is a category i proportion, y It is the total number of categories;

[0069] ;

[0070] in, Gini(D) The sample set before partitioning D The Gini index, Each subset after partitioning The Gini index, It is a subset The number of samples, It is a sample set D Total number of samples k It is a feature A The number of possible values.

[0071] Preferably, during the training process, the random forest model uses Bayesian optimization of its parameters, specifically:

[0072] Initialize a parameter space for Bayesian optimization, which includes the range of values ​​for all adjustable parameters of the random forest model;

[0073] Calculate the covariance between different points in the parameter space based on the kernel function;

[0074] Based on Gaussian process regression, the covariance between different points is used to construct the predictive distribution of the random forest model performance;

[0075] The marginal likelihood of the predicted distribution is calculated based on the marginal likelihood formula;

[0076] Based on the calculated marginal likelihood, obtain the parameter combination that maximizes the marginal likelihood;

[0077] Use the expected improvement criteria to select the next combination of parameters to evaluate;

[0078] Repeat the above steps until the preset optimization standard or the preset number of iterations is reached.

[0079] In this embodiment, Bayesian optimization automatically searches for the optimal parameter combination through iteration, eliminating the need for manual trial and error and significantly reducing the time cost of parameter tuning. It intelligently utilizes information from the previous sampling point, constructing a predictive distribution through Gaussian process regression to guide subsequent parameter searches, thus improving search efficiency. Bayesian optimization aims to find the global optimum, rather than a local optimum. By continuously iterating and updating the predictive distribution, it can effectively search the entire parameter space, thereby finding the parameter combination that optimizes the performance of the random forest model. When initializing the parameter space, Bayesian optimization allows users to specify the value range of all adjustable parameters of the random forest model, ensuring broad coverage of the parameter space and increasing the likelihood of finding a better parameter combination.

[0080] It should be noted that the iterative optimization method continuously adjusts the model parameters to achieve optimal prediction accuracy. In each optimization, the impact of the new parameter configuration on the prediction results is evaluated, and the model parameters are updated based on the optimization results to maximize prediction accuracy. The relevant formulas are as follows:

[0081] Matérn 5 / 2 kernel function: ;

[0082] in, x The input hyperparameters are the number of spanning trees and the maximum depth of the trees. To and x Another input point for comparison, k(x, x') It is an input point x and x' Covariance between d=|x-x'|, It is the Euclidean distance between the input points. It is the output variance that controls the overall amplitude of the function value. l It is a length scale parameter, which is automatically selected based on the data;

[0083] Gaussian process regression: ;

[0084] in, This is a mean function, which is set to a zero mean function here;

[0085] Calculate the marginal likelihood: ;

[0086] in, Indicates input data X and hyperparameters The probability distribution of accuracy for spatial or device type predictions. It is input X hour The mean function, assuming it is 0, It is set as the precision of the target optimization value. The kernel matrix, This is the variance of the noise, set to 1, used to model observation noise. I It is the identity matrix;

[0087] Maximize the likelihood margin: ;

[0088] in, To maximize the value of the parameter, It is the accuracy value output by the model. X It is the input feature dataset;

[0089] Desired improvements: ;

[0090] in, For the current combination of hyperparameters, In hyperparameters The objective function value is below. For the best accuracy observed so far, E This represents the expected value.

[0091] Preferably, the formula for calculating the average daily terminal device energy consumption per user in each space is as follows:

[0092] ;

[0093] in, This represents the average daily energy consumption of terminal devices per user in each space. This represents the sum of the predicted power consumption of the devices the user would use in that space. This indicates the duration of a user's stay in that space. This indicates the number of times the user spends in that space per day. N This indicates the number of users.

[0094] In this embodiment, relevant user data is collected, including but not limited to the user's dwell time in different spaces, the types of devices used, and their power consumption. Based on this data, the devices that the user will use in a specific space and their power consumption are predicted. For each user, based on the prediction results and the user's dwell time in the space, the total energy consumption generated by the user's terminal devices in that space is calculated. The energy consumption data of all users are aggregated into the total energy consumption of the space, and the average daily terminal device energy consumption generated by each user in each space is calculated. By accurately predicting the user's device usage and power consumption in a specific space, this technical solution can provide more accurate energy consumption data. This helps space managers better understand energy consumption, formulate effective energy management strategies, and reduce energy costs. This solution considers different user behavior patterns and device usage habits, thus providing personalized energy consumption prediction and calculation results. This makes the solution more flexible and adaptable to the needs of different users, different spaces, and different time periods.

[0095] Preferably, after collecting user data and before creating training and test sets, a data preprocessing step is included, which includes data cleaning, standardization, and data augmentation.

[0096] In this embodiment, the user data is preprocessed, including data cleaning, standardization, and data augmentation, to remove invalid data and outliers and ensure the balance of the dataset. The data augmentation process includes oversampling or undersampling of the label data with imbalanced distribution to ensure that the model is not affected by the imbalanced data during training.

[0097] Preferably, the method further includes:

[0098] The predicted average user energy consumption for each space is imported into the BIM model. Based on the number of users occupancy monitored daily, the daily energy consumption of terminal equipment generated in each space in the building and the daily energy consumption of terminal equipment in the entire building are predicted. An energy consumption heat map is generated through BIM visualization.

[0099] In this embodiment, by combining the predicted average user energy consumption with the BIM model, this technical solution enables refined prediction and management of energy consumption for each space. This helps space managers to more accurately understand the energy consumption of each space, thereby formulating more targeted energy management strategies. Daily monitoring of user occupancy and prediction of daily terminal equipment energy consumption for each space allows energy management to reflect the actual situation in real time. This provides space managers with a basis for dynamically adjusting energy management strategies and helps to respond promptly to abnormal energy consumption situations. Generating energy consumption heat maps through BIM visualization presents energy consumption data in an intuitive and easy-to-understand way. This helps space managers to more intuitively understand the energy consumption distribution of each space in the building, making it easier to identify abnormal energy consumption areas and potential energy-saving opportunities. Combining the BIM model and energy consumption heat maps, space managers can gain a more comprehensive understanding of the building's energy consumption, providing strong decision support for formulating energy efficiency optimization strategies, helping to reduce the overall energy consumption of the building and improve energy efficiency.

[0100] A user space device energy consumption prediction system based on the random forest algorithm includes:

[0101] The data collection and preprocessing module is used to collect user data, which includes at least the user's environmental preferences, device usage habits, time spent in public spaces, and the types and frequency of devices selected and used. Training and test sets are created based on the user data.

[0102] The random forest model training module is used to extract feature components based on the data in the training set for training the random forest model. The random forest model consists of multiple regression trees, and each regression tree is trained independently based on different feature components.

[0103] The prediction module is used to input data from the test set into a pre-trained random forest model to predict users' space choices and device usage in public spaces.

[0104] The energy consumption calculation module is used to calculate the energy consumption of each user when using terminal devices in public spaces, based on the output of the prediction module and the user's time characteristics.

[0105] The energy consumption aggregation and analysis module is used to aggregate the energy consumption data of a single user into the total energy consumption of the corresponding space, and further calculate the average daily energy consumption of terminal devices generated by each user in each space.

[0106] A computing device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described user space device energy consumption prediction methods based on the random forest algorithm.

[0107] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-described user space device energy consumption prediction methods based on the random forest algorithm.

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

Claims

1. A method for predicting energy consumption of user space devices based on the random forest algorithm, characterized in that, Specifically, it includes: Collect user data and create training and testing sets. The user data includes users' environmental preferences, device usage habits, time spent in public spaces, and the types and frequency of devices selected. A random forest model is trained by extracting feature components from the training set. The random forest model consists of multiple regression trees, each of which is trained based on different feature components. The test set data is input into the trained random forest model to predict users' space choices and device usage in public spaces; Based on the prediction results and combined with the time characteristics of users, calculate the energy consumption generated by each user when using terminal devices in public spaces. The energy consumption data of individual users is aggregated into the total energy consumption of the space, and the average daily terminal device energy consumption generated by each user in each space is calculated. The specific formula for calculating the average daily terminal device energy consumption per user in each space is as follows: ; in, This represents the average daily energy consumption of terminal devices per user in each space. This represents the sum of the predicted power consumption of the devices the user would use in that space. This indicates the duration of a user's stay in that space. This indicates the number of times the user spends in that space per day. N This indicates the number of users.

2. The user space device energy consumption prediction method based on random forest algorithm according to claim 1, characterized in that, The bagging algorithm is used to extract feature components from the training set. The specific formula for the bagging algorithm is as follows: ; in, It is the first b The number of features in each training subset It refers to the number of features in the original training set, i.e., the number of features selected by each tree when extracting features. 1 feature column.

3. The user space device energy consumption prediction method based on the random forest algorithm according to claim 2, characterized in that, During the training of each regression tree, the optimal splitting attribute for each regression tree is determined based on the Gini coefficient, specifically: Calculate the impurity measure of the current dataset based on the Gini coefficient formula; For each feature and all its possible values, calculate the measure of impurity of the split dataset if that feature and its values ​​are used as the split point; Calculate the gain of the Gini index based on the Gini coefficient of the current dataset and the Gini coefficient of the split dataset; Among all features, the feature with the largest Gini index gain is selected as the optimal splitting feature; Based on the selected optimal splitting feature, the current node is split into multiple child nodes.

4. The user space device energy consumption prediction method based on the random forest algorithm according to claim 3, characterized in that, During the training process, the random forest model employs Bayesian optimization of its parameters, specifically as follows: Initialize a parameter space for Bayesian optimization, which includes the range of values ​​for all adjustable parameters of the random forest model; Calculate the covariance between different points in the parameter space based on the kernel function; Based on Gaussian process regression, the covariance between different points is used to construct the predictive distribution of the random forest model performance; The marginal likelihood of the predicted distribution is calculated based on the marginal likelihood formula; Based on the calculated marginal likelihood, obtain the parameter combination that maximizes the marginal likelihood; Use the expected improvement criteria to select the next combination of parameters to evaluate; Repeat the above steps until the preset optimization standard or the preset number of iterations is reached.

5. The user space device energy consumption prediction method based on the random forest algorithm according to claim 4, characterized in that, After collecting user data and before creating training and test sets, a data preprocessing step is included, which includes data cleaning, standardization, and data augmentation.

6. The user space device energy consumption prediction method based on the random forest algorithm according to claim 5, characterized in that, The method further includes: The predicted average user energy consumption for each space is imported into the BIM model. Based on the number of users occupancy monitored daily, the daily energy consumption of terminal equipment generated in each space in the building and the daily energy consumption of terminal equipment in the entire building are predicted. An energy consumption heat map is generated through BIM visualization.

7. A user space device energy consumption prediction system based on the random forest algorithm, characterized in that, include: The data collection and preprocessing module is used to collect user data, which includes at least the user's environmental preferences, device usage habits, time spent in public spaces, and the types and frequency of devices selected and used. Training and test sets are created based on the user data. The random forest model training module is used to extract feature components based on the data in the training set for training the random forest model. The random forest model consists of multiple regression trees, and each regression tree is trained independently based on different feature components. The prediction module is used to input data from the test set into a pre-trained random forest model to predict users' space choices and device usage in public spaces. The energy consumption calculation module is used to calculate the energy consumption of each user when using terminal devices in public spaces, based on the output of the prediction module and the user's time characteristics. The energy consumption aggregation and analysis module is used to aggregate the energy consumption data of a single user into the total energy consumption of the corresponding space, and further calculate the average daily terminal device energy consumption of each user in each space. The specific formula for calculating the average daily terminal device energy consumption per user in each space is as follows: ; in, This represents the average daily energy consumption of terminal devices per user in each space. This represents the sum of the predicted power consumption of the devices the user would use in that space. This indicates the duration of a user's stay in that space. This indicates the number of times the user spends in that space per day. N This indicates the number of users.

8. A computing device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the user space device energy consumption prediction method based on the random forest algorithm according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the user space device energy consumption prediction method based on the random forest algorithm as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Prediction method and system for vehicle energy consumption analysis

    CN110705774A

  • Commercial building energy consumption prediction optimization method and system

    CN113282122A