Air conditioner energy consumption data supervision method and system based on big data
By using a big data-based method for monitoring air conditioning energy consumption and employing machine learning algorithms to build an energy consumption prediction model, real-time detection and early warning signals are generated. This solves the problems of inaccurate energy consumption prediction and low management efficiency in traditional methods, and achieves efficient energy consumption management of central air conditioning systems.
Patent Information
- Application Number
- CN202411457510.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-10-18
AI Technical Summary
Existing methods for monitoring air conditioning energy consumption data rely on traditional energy consumption monitoring systems and manual inspections, which cannot accurately predict future energy consumption trends of central air conditioning systems and are difficult to detect short-term energy consumption anomalies, resulting in low efficiency in energy consumption management.
The big data-based method for monitoring air conditioning energy consumption collects and analyzes historical operating data of central air conditioning systems, uses machine learning algorithms to build an energy consumption prediction model, and combines environmental parameters, changes in pedestrian traffic, and equipment status to detect energy consumption anomalies in real time and generate early warning signals.
It enables real-time monitoring of central air conditioning systems, quickly and accurately detects energy consumption anomalies, improves energy management efficiency, and reduces manual workload.
Smart Images

Figure CN119374210B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of air conditioner maintenance, in particular to an air conditioner energy consumption data supervision method and system based on big data. BACKGROUND
[0002] In large public buildings such as shopping malls, central air conditioning systems as important energy-consuming equipment, its energy consumption supervision for the realization of energy saving and emission reduction, reduce operating costs is of great significance.
[0003] In the existing field of air conditioner energy consumption data supervision, it usually relies on traditional energy consumption monitoring system and manual inspection method. The traditional energy consumption monitoring system can only provide basic energy consumption data, and lacks comprehensive consideration of environmental parameters, changes in passenger flow, equipment state and other multi-dimensional factors, which leads to the inability to accurately predict the future energy consumption trend of central air conditioner, and also cannot timely find energy consumption abnormal points. Manual inspection method is inefficient and cannot realize real-time supervision of a large number of central air conditioning systems. At the same time, due to the subjectivity and discontinuity of manual inspection, it is difficult to find short-term and sudden energy consumption anomalies, resulting in poor energy consumption management effect. Therefore, we propose an air conditioner energy consumption data supervision method and system based on big data. SUMMARY
[0004] The purpose of the present application is to provide an air conditioner energy consumption data supervision method and system based on big data to solve the problems raised in the background.
[0005] To achieve the above purpose, the present application provides the following technical scheme: an air conditioner energy consumption data supervision method based on big data, the method comprising:
[0006] S1: Collecting historical operation data of central air conditioning control system, including energy consumption data, operation settings, production parameters of each central air conditioner, and environmental parameters and passenger flow records during operation;
[0007] S2: Constructing features for the data collected in step S1 to form a feature data set;
[0008] S3: Using machine learning algorithm, respectively constructing energy consumption prediction model for each central air conditioner, the energy consumption prediction model is based on feature data set, and comprehensively considers environmental parameters, changes in passenger flow, equipment state and time factors, and predicts the energy consumption trend of central air conditioner in a period of time in the future;
[0009] S4: Obtaining production parameters and operation settings of each central air conditioner at present, and current environmental parameters and passenger flow data;
[0010] S5: Inputting the obtained data into the energy consumption prediction model, and receiving the energy consumption prediction trend data output by the model;
[0011] S6: Collect real-time energy consumption data of each central air conditioner from the central air conditioning control system, and clean the collected raw data to remove outliers;
[0012] S7: Draw the real-time energy consumption data collected in step S6 and the predicted energy consumption data output by the model in step S5 into curves changing with time respectively, timestamp align the two curve data, judge whether each point on the curve exists abnormality according to the preset algorithm, and mark it as an abnormal point if it exists;
[0013] S8: Generate an early warning signal according to the discovered abnormal point and the early warning rule, and further send the early warning signal to the air conditioner management personnel.
[0014] Preferably, the feature data set comprises:
[0015] Time window features, including average energy consumption, maximum energy consumption and minimum energy consumption in the past preset time period;
[0016] People flow related features, including the ratio of current people flow to average people flow in the past preset time period, the change rate of people flow and the identification of peak period people flow;
[0017] Environmental parameter features, including indoor and outdoor temperature difference, humidity change rate and identification of whether in extreme weather conditions;
[0018] Device state features, including device running time, time since last maintenance of the device and identification of whether the device is in maintenance state;
[0019] Time related features, including identification of which day of the week, which day of the year or which month, and holiday;
[0020] Statistical features, including distribution characteristics of energy consumption data and rolling statistics of energy consumption data;
[0021] Change rate features, including the change rate of energy consumption.
[0022] Preferably, a long short-term memory network (LSTM) algorithm is used to construct an energy consumption prediction model, and the specific steps include:
[0023] S301: Use the feature data set as input, and divide the feature data set into a training set and a test set;
[0024] S302: Build an LSTM network structure, set the number of network layers, the number of hidden layer units and the activation function hyperparameters;
[0025] S303: Train the LSTM model using the training set, and optimize the model parameters by the back propagation algorithm and the gradient descent method;
[0026] S304: Evaluate the trained LSTM model using the test set to verify the prediction performance of the model;
[0027] S305: Adjust the hyperparameters of the LSTM model according to the evaluation results until a satisfactory prediction accuracy is achieved.
[0028] S306: Train and save the corresponding LSTM energy consumption prediction model for each central air conditioner.
[0029] Preferably, the network structure of the LSTM model is as follows:
[0030] Input layer: receives the feature data set as input, which includes time window features, passenger flow related features, environmental parameter features, device state features, time related features, statistical features and change rate features;
[0031] Network layer: contains two hidden layers, each containing 128 and 64 hidden units, respectively. Each hidden unit updates and transmits information through the forget gate, input gate and output gate, and uses the ReLU activation function to perform nonlinear transformation on the output of the hidden unit.
[0032] Output layer: the output layer receives the output of the last hidden layer and maps the output of the LSTM network to the energy consumption prediction value through a fully connected layer.
[0033] Preferably, the LSTM model is iteratively trained using the training set data. In each iteration, a batch of input data is fed into the LSTM model, the values of the input layer and the output layer are calculated, the memory cells and the hidden states are updated, and finally the predicted output sequence is obtained. During the training process, the model performance is evaluated periodically using the validation set, and the learning rate is adjusted or the training is stopped in advance to prevent overfitting as needed.
[0034] Preferably, the mean squared error (MSE) algorithm is used to evaluate the performance of the energy consumption prediction model, and the specific algorithm is as follows:
[0035]
[0036] where n is the number of data points, Y pred,i is the predicted energy consumption value of the model, and Y actual,i is the actual measured energy consumption value. The prediction accuracy of the model is evaluated according to the MSE value, and the smaller the MSE value, the higher the prediction accuracy of the model.
[0037] Preferably, the way to clean the original data in step S6 includes: setting a reasonable numerical range for each type of data, traversing the original data, marking the values outside the set range as outliers, and removing the data marked as outliers from the original data.
[0038] Preferably, the algorithm for marking abnormal points includes:
[0039] The algorithm based on the difference threshold: set a fixed energy consumption difference threshold, when the difference between the real-time energy consumption data and the predicted energy consumption data exceeds the threshold, mark it as an abnormal point, the calculation formula is: if |R-P|>T, mark it as an abnormal point, where R represents the real-time energy consumption data, P represents the predicted energy consumption data, and T represents the set energy consumption difference threshold;
[0040] The algorithm based on the percentage of difference: set a percentage threshold of energy consumption difference to predicted value, when the difference between the real-time energy consumption data and the predicted energy consumption data accounts for more than the threshold percentage of the predicted value, mark it as an abnormal point, the calculation formula is: if |(R-P) / P|>PT, mark it as an abnormal point, where R represents the real-time energy consumption data, P represents the predicted energy consumption data, and PT represents the set percentage threshold of energy consumption difference to predicted value;
[0041] The algorithm based on moving average: calculate the average value of energy consumption difference in a time window, when the difference between the real-time energy consumption data and the predicted energy consumption data exceeds a certain multiple of the average value, mark it as an abnormal point, the calculation formula is: if |R-P|>M×AVG, mark it as an abnormal point, where R represents the real-time energy consumption data, P represents the predicted energy consumption data, M represents the set multiple, and AVG represents the average value of energy consumption difference in the time window;
[0042] The algorithm based on trend change: analyze the trend of real-time energy consumption data and predicted energy consumption data, when the trend of real-time data deviates significantly from the trend of predicted data, mark it as an abnormal point, the trend change is realized by calculating the slope of the two curves, the slope difference formula is: if |Slope(R)-Slope(P)|>ST, mark it as an abnormal point, where Slope(R) represents the slope of real-time energy consumption data, Slope(P) represents the slope of predicted energy consumption data, and ST represents the set slope difference threshold.
[0043] Preferably, the warning signal contains the specific timestamp of the abnormal point, the corresponding real-time energy consumption value, the predicted energy consumption value, the abnormal type identification and the number and location information of the related central air conditioner.
[0044] Preferably, a central air conditioning energy consumption data monitoring system based on big data, the system includes:
[0045] Data collection module, responsible for collecting the historical operation data of central air conditioning control system, including the energy consumption data, operation setting, production parameter of each central air conditioner, and the environmental parameter and passenger flow record during operation;
[0046] Feature construction module, which constructs features for the collected data to form a feature data set for subsequent modeling;
[0047] a model construction module, which utilizes a machine learning algorithm to construct an energy consumption prediction model for each central air conditioner, the model being based on a feature data set and comprehensively considering environmental parameters, changes in human flow, equipment states and time factors to predict the energy consumption trend of the central air conditioner in a future period of time;
[0048] a real-time data acquisition module, which is responsible for acquiring the production parameters and operation settings of each central air conditioner, as well as the current environmental parameters and human flow data;
[0049] an energy consumption prediction module, which inputs the real-time data into the energy consumption prediction model and receives the energy consumption prediction trend data output by the model;
[0050] a data cleaning module, which collects real-time energy consumption data of each central air conditioner from the central air conditioner control system and cleans the collected raw data to remove outliers;
[0051] an anomaly detection module, which plots the cleaned real-time energy consumption data and the predicted energy consumption data into curves varying with time, aligns the time stamps of the two curve data, and judges whether each point on the curve is abnormal according to a preset algorithm, and marks the point as an abnormal point if it is abnormal;
[0052] a warning signal generation and sending module, which generates a warning signal according to the discovered abnormal point and a preset warning rule, and sends the warning signal to a designated air conditioner manager.
[0053] Compared with the prior art, the present application has the following advantages:
[0054] By acquiring the production parameters, operation settings, environmental parameters and human flow data of the central air conditioner in real time and inputting them into the energy consumption prediction model, energy consumption abnormal points can be discovered in a timely manner. Compared with the manual inspection method, the present method can more quickly and accurately discover short-term and sudden energy consumption abnormalities, so that measures can be taken in a timely manner for processing. The present method realizes real-time supervision of a large number of central air conditioner systems, significantly improving the efficiency of energy consumption management. At the same time, by automatically generating a warning signal and sending it to the air conditioner manager, the process of energy consumption management is further simplified, and the manual burden is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0055] Fig. 1 a flowchart of the steps of the air conditioner energy consumption data supervision method based on big data according to the present application;
[0056] Fig. 2 a flowchart of the construction and training of the energy consumption prediction model;
[0057] Fig. 3 a structural diagram of the air conditioner energy consumption data supervision system based on big data according to the present application. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work are within the protection scope of the present application.
[0059] Please refer to Figs. 1-3 The present application provides a technical solution: an air conditioner energy consumption data supervision method based on big data. The steps of the method include:
[0060] Data collection phase (S1): First, collect historical operation data from the central air conditioning control system comprehensively, including but not limited to energy consumption data, operation setting parameters, production parameters of each central air conditioner, and environmental parameters (such as temperature, humidity) and passenger flow records during operation.
[0061] Feature construction phase (S2): The collected raw data is constructed into a feature data set through feature engineering technology, and features valuable for energy consumption prediction are extracted from the raw data.
[0062] Model construction phase (S3): Use machine learning algorithms to build an energy consumption prediction model for each central air conditioner. The energy consumption prediction model is based on the feature data set, and considers environmental parameters, passenger flow changes, equipment status, and time factors (such as season, workday / non-workday). Through training and learning the historical energy consumption pattern of the central air conditioner, the future energy consumption trend can be predicted.
[0063] Real-time data acquisition phase (S4): Real-time acquisition of production parameters and operation settings of each central air conditioner, and recording of current environmental parameters and passenger flow data as part of the model input to ensure the accuracy of the prediction.
[0064] Energy consumption prediction phase (S5): Input the data obtained in step S4 into the corresponding energy consumption prediction model, and the model outputs the energy consumption prediction trend data for a future period of time, providing a benchmark for subsequent anomaly detection.
[0065] Real-time energy consumption data acquisition and processing phase (S6): Real-time acquisition of energy consumption data of each central air conditioner from the central air conditioning control system, and cleaning of these raw data to remove abnormal values caused by sensor failure and other reasons, ensuring the reliability of the data.
[0066] Abnormality detection phase (S7): Real-time energy consumption data and model-predicted energy consumption data are plotted as time-varying curves, respectively, and time-stamped alignment is performed on the two curves. Through pre-set algorithms (such as threshold-based detection, time series analysis, etc.), it is determined whether each point on the curve is abnormal. If an abnormality is detected, it is marked as an abnormal point.
[0067] Early warning signal generation and sending phase (S8): According to the detected abnormal points and pre-set early warning rules, early warning signals are generated, which contain information such as the type, location, severity of the abnormality. Subsequently, these early warning signals are sent to air conditioning managers in a timely manner, so that they can take prompt measures to handle potential energy consumption problems or equipment failures, thereby achieving effective energy consumption management and cost control.
[0068] In order to effectively monitor the energy consumption of central air conditioning systems and timely discover and handle abnormal points, the early warning signals contain specific information of the abnormal points, so that relevant personnel can quickly locate the problem and take appropriate measures. The following is a detailed description of the content of the early warning signal and specific implementation methods:
[0069] The early warning signal mainly contains the following parts: the specific timestamp of the abnormal point, the corresponding real-time energy consumption value, the predicted energy consumption value, the abnormal type identification, and the number and location information of the relevant central air conditioning.
[0070] Specific timestamp of abnormal point: This refers to the exact time when the abnormal point occurs, usually represented in the form of year, month, day, hour, minute, and second. It helps relevant personnel understand the time background of the abnormal occurrence, thereby better analyzing the reasons for the abnormality.
[0071] Corresponding real-time energy consumption value: This refers to the actual energy consumption value of the central air conditioning system at the time of the abnormal point. By comparing the real-time energy consumption value with the predicted energy consumption value, the nature and possible reasons of the abnormal point can be further analyzed.
[0072] Predicted energy consumption value: This refers to the predicted energy consumption value at the time of the abnormal point according to the energy consumption prediction model. It provides a reference benchmark for comparing with the real-time energy consumption value to determine whether the energy consumption is abnormal.
[0073] Abnormal type identification: This is the identification of the classification of the abnormal point, such as "difference threshold abnormality", "difference percentage abnormality", "moving average abnormality", or "trend change abnormality", etc. It helps relevant personnel quickly understand the type and possible reasons of the abnormal point, so as to take more targeted handling measures.
[0074] Number and location information of the relevant central air conditioning: This refers to the number and location information of the central air conditioning system where the abnormal point occurs, such as floor, room number, etc. It helps relevant personnel quickly locate the specific equipment and location where the problem occurs, so as to carry out further inspection and handling.
[0075] In actual implementation, when the energy consumption monitoring system detects an abnormal point, it will automatically generate a warning signal and include the above information. For example, assume that on May 1, 2023 at 2:30 pm, the central air conditioning system numbered 001 is located in the first floor lobby, and its real-time energy consumption value is 150 KW·h, while the predicted energy consumption value is 100 KW·h. At this time, the energy consumption monitoring system judges this point as a "difference threshold abnormality" and automatically generates a warning signal containing the following information: "abnormal time: 2023-05-01 14:30; real-time energy consumption value: 150 KW·h; predicted energy consumption value: 100 KW·h; abnormal type: difference threshold abnormality; device number: 001; device location: first floor lobby". After receiving the warning signal, relevant personnel can quickly locate the problem and take appropriate measures to handle it.
[0076] The present application will be further described below in conjunction with Examples 1 to 3:
[0077] Example 1:
[0078] The feature data set covers information in multiple dimensions to ensure the comprehensiveness and accuracy of the energy consumption prediction model. Specifically, it includes the following types of features:
[0079] ① Time window features:
[0080] Average energy consumption in the past preset time period: reflects the stable level of energy consumption in a period of time.
[0081] Maximum and minimum energy consumption in the past preset time period: reveals the fluctuation range of energy consumption.
[0082] Assuming the preset time period is the past week, the average energy consumption in the past week can be calculated by adding the energy consumption data of each day in the week and dividing by 7. Similarly, the maximum and minimum energy consumption in the past week can be determined by finding the maximum and minimum values of the energy consumption data in the week.
[0083] ② Human flow related features:
[0084] Ratio of current human flow to average human flow in the past preset time period: reflects the relative change in human flow.
[0085] Change rate of human flow: reflects the dynamic change trend of human flow.
[0086] Identification of peak period human flow: used to mark the peak period of human flow so that the model can consider its impact on energy consumption.
[0087] The ratio of current traffic volume to average traffic volume of the past week can be calculated by dividing the current traffic data by the average of the same time period's traffic volume for each day in the past week. The rate of change of traffic volume can be calculated by finding the difference between the current time period's traffic volume and the previous time period's traffic volume, then dividing by the previous time period's traffic volume. The identification of peak hours can be done by setting a threshold, and when the traffic volume exceeds this threshold, it is marked as a peak hour.
[0088] ③ Environmental parameter features:
[0089] Indoor-outdoor temperature difference: Reflects the difference between indoor and outdoor environments, which has a significant impact on energy consumption.
[0090] Rate of change of humidity: Reflects the change of humidity over time, which has a certain impact on energy consumption.
[0091] Identification of whether it is in extreme weather conditions: Used to mark extreme weather conditions so that the model can consider its special impact on energy consumption.
[0092] The indoor-outdoor temperature difference can be calculated by subtracting the outdoor temperature data from the indoor temperature data. The rate of change of humidity can be calculated by finding the difference between the current time period's humidity and the previous time period's humidity, then dividing by the previous time period's humidity. The identification of whether it is in extreme weather conditions can be done by obtaining meteorological data, and when parameters such as temperature, humidity or wind speed exceed the preset extreme weather threshold, it is marked as extreme weather.
[0093] ④ Device status features:
[0094] Device running time: Reflects the cumulative running time of the device, which has an indicative effect on energy consumption and device maintenance.
[0095] Time since last device maintenance: Reflects the history of device maintenance, which is helpful for predicting device efficiency and energy consumption.
[0096] Identification of whether the device is in maintenance: Used to mark whether the device is being maintained so that the model can consider its impact on energy consumption.
[0097] Device running time can be obtained by recording the time when the device starts running and calculating the difference from the current time. Time since last device maintenance can be obtained by recording the time of the last maintenance of the device and calculating the difference from the current time. Identification of whether the device is in maintenance can be done by setting a maintenance status flag, which is set to true when the device is being maintained.
[0098] ⑤ Time-related features:
[0099] Day of the week: Reflects the difference between weekdays and weekends within a week, which has an impact on energy consumption patterns.
[0100] Day of the year or month: Reflects seasonal and monthly changes, which have a significant impact on energy consumption.
[0101] Holiday identification: Used to mark holidays so that the model can consider their special impact on energy consumption.
[0102] ⑥Statistical features:
[0103] Distribution characteristics of energy consumption data: Describe the overall distribution of energy consumption data, which helps the model capture energy consumption patterns.
[0104] Rolling statistics of energy consumption data: Such as rolling mean, rolling standard deviation, etc., reflect the dynamic change characteristics of energy consumption data.
[0105] The distribution characteristics of energy consumption data can be described by calculating the mean, median, mode, variance, etc. of the energy consumption data. The rolling statistics of energy consumption data can be obtained by calculating the average value, standard deviation, etc. of the energy consumption data in the past period (such as the past hour).
[0106] ⑦Change rate features:
[0107] Change rate of energy consumption: Reflects the dynamic change of energy consumption over time, which is important for predicting future energy consumption trends. The change rate of energy consumption can be obtained by calculating the difference between the current time period and the previous time period of energy consumption, and then dividing the energy consumption of the previous time period.
[0108] Example 2:
[0109] Build an energy consumption prediction model based on a long short-term memory network (LSTM), the specific steps include:
[0110] First, the implementation steps include:
[0111] S301: Prepare the feature dataset and divide it into training set and test set. The feature dataset covers multiple dimensions of information, including time window features, people flow related features, environmental parameter features, device state features, time related features, statistical features and change rate features, to ensure the comprehensiveness and accuracy of the energy consumption prediction model.
[0112] S302: Build the LSTM network structure. The network structure includes an input layer, two hidden layers and an output layer. The input layer receives the feature dataset as input. The two hidden layers contain 128 and 64 hidden units respectively, and each hidden unit updates and transmits information through the forget gate, input gate and output gate. The output of the hidden unit is nonlinearly transformed by using the ReLU activation function to enhance the expression ability of the model. The output layer receives the output of the last hidden layer and maps the output of the LSTM network to the energy consumption prediction value through a fully connected layer.
[0113] S303: Train the LSTM model using the training set. Optimize the model parameters through the backpropagation algorithm and gradient descent method to enable the model to accurately predict energy consumption. During the training process, periodically evaluate the model performance using the validation set to ensure the model's generalization ability.
[0114] S304: Evaluate the trained LSTM model using the test set. Verify the model's prediction performance by comparing the predicted values with the actual energy consumption values. The evaluation index uses the mean square error (MSE), and the algorithm formula is:
[0115]
[0116] where n is the number of data points, T pred,i is the energy consumption value predicted by the model, Y actual,i is the actual measured energy consumption value; evaluate the prediction accuracy of the model according to the MSE value, the smaller the MSE value, the higher the prediction accuracy of the model.
[0117] S305: Adjust the hyperparameters of the LSTM model according to the evaluation results. Hyperparameters include network layers, hidden layer units, learning rate, etc. By adjusting the hyperparameters, the prediction accuracy and generalization ability of the model can be further improved.
[0118] S306: Train and save the corresponding LSTM energy consumption prediction model for each central air conditioner. Since the operating characteristics and environmental factors of each central air conditioner may differ, training the model separately can better adapt to the energy consumption prediction needs of different devices.
[0119] In the network structure of the LSTM model, the input layer is responsible for receiving the feature data set as input and passing the data to the hidden layer. The hidden layer is the core part of the LSTM network, which contains two hidden layers responsible for processing different levels of feature information. Each hidden unit updates and transmits information through the forget gate, input gate, and output gate, capturing the long-term dependence of time series data. The ReLU activation function is used to perform nonlinear transformation on the output of the hidden unit, enhancing the model's expression ability. The output layer is responsible for mapping the output of the LSTM network to the energy consumption prediction value, achieving this mapping relationship through a fully connected layer.
[0120] During the training process, the LSTM model is iteratively trained using the training set data. In each iteration, a batch of input data is fed into the LSTM model, and the memory cells and hidden states are updated by calculating the values of the input layer and output layer, ultimately obtaining the predicted output sequence. Through the backpropagation algorithm and gradient descent method, the model parameters are optimized to gradually approach the true energy consumption data. At the same time, the model performance is evaluated periodically using the validation set to ensure its generalization ability. If necessary, adjust the learning rate or stop training early to prevent overfitting.
[0121] Below is a code example for building and training an energy consumption prediction model using Python as the programming language:
[0122] import numpy as np
[0123] import pandas as pd
[0124] from keras.models import Sequential
[0125] from keras.layers import LSTM, Dense, ReLU
[0126] from sklearn.model_selection import train_test_split
[0127] from sklearn.preprocessing import StandardScaler
[0128] # DataFrame 'df' containing all features, and the 'target' column is the predicted energy consumption value
[0129] # Create a sample dataset
[0130] np.random.seed(0)
[0131] dates = pd.date_range('20230101', periods=100)
[0132] df = pd.DataFrame(np.random.randn(100, 7), index=dates, columns=['feature1', 'feature2', 'feature3', 'feature4',
[0133] 'feature5','feature6','feature7'])
[0134] df['target'] = df.sum(axis = 1) + np.random.randn(100) * 0.5 # Assumed energy consumption value
[0135] # Divide into training set and test set
[0136] X_train,X_test,y_train,y_test=train_test_split(features,targets,test_size=0.2,random_state=42)
[0137] #Build LSTM model
[0138] model=Sequential()
[0139] model.add(LSTM(128,return_sequences=True,input_shape=(1,X_train.shape[2])))
[0140] model.add(ReLU())
[0141] model.add(LSTM(64))
[0142] model.add(ReLU())
[0143] model.add(Dense(1))#output layer, 1 neuron corresponds to the energy consumption prediction value
[0144] # Compile the model
[0145] model.compile(optimizer='adam',loss='mean_squared_error')
[0146] #Train model
[0147] model.fit(X_train,y_train,epochs=50,batch_size=32,validation_split=0.1)
[0148] #Evaluate the model
[0149] mse=model.evaluate(X_test,y_test,verbose=0)
[0150] print(f'Test Mean Squared Error:{mse}')
[0151] # Save the model
[0152] model.save('lstm_energy_prediction_model.h5')
[0153] The above code is an example of using Python programming language and Keras deep learning library to build and train an energy consumption prediction model. Here is a detailed description of the code:
[0154] ① Import necessary libraries:
[0155] numpy and pandas are used for data processing.
[0156] keras.models.Sequential is used to build a sequential model.
[0157] keras.layers.LSTM, keras.layers.Dense, keras.layers.ReLU are used to build layers of LSTM network.
[0158] sklearn.model_selection.train_test_split is used to split the training set and test set.
[0159] sklearn.preprocessing.StandardScaler is used for feature standardization.
[0160] ② Create a sample dataset: use numpy to generate a DataFrame containing random numbers, simulate 7 features and a target energy consumption value. Use the date_range function of pandas to generate a date index.
[0161] ③ Split the training set and test set: use the train_test_split function to divide the dataset into training set and test set, the test set size is 20%.
[0162] ④ Build the LSTM model: use the Sequential model to sequentially stack each layer.
[0163] Add two LSTM layers, the first contains 128 hidden units and returns the sequence; the second contains 64 hidden units.
[0164] Add ReLU activation function after each LSTM layer for nonlinear transformation.
[0165] Add a Dense layer as the output layer, containing one neuron to predict the energy consumption value.
[0166] ⑤Compile the model: Use the adam optimizer and mean_squared_error loss function to compile the model.
[0167] ⑥Train the model: Use the fit function to train the model, specifying the training set, test set, number of iterations (epochs), batch size, and validation set proportion.
[0168] ⑦Evaluate the model: Use the evaluate function to evaluate the model's performance on the test set, outputting the mean squared error (MSE).
[0169] ⑧Save the model: Use the save function to save the trained model to disk for future use.
[0170] Example 3:
[0171] In order to visually compare real-time energy consumption data and model-predicted energy consumption data, and use them for anomaly point detection, the present invention draws real-time energy consumption data and model-predicted energy consumption data as curves changing over time, and aligns the timestamps of the two curves. The following is a detailed description and specific implementation of this method:
[0172] Obtain real-time energy consumption data from the energy consumption monitoring system or related data sources, which usually contain timestamps and corresponding energy consumption values. At the same time, use the trained energy consumption prediction model to input the corresponding timestamps or time features to obtain the model-predicted energy consumption data.
[0173] In order to draw curves changing over time, it is necessary to ensure that real-time energy consumption data and model-predicted energy consumption data are one-to-one corresponding in time. Therefore, timestamp alignment is a necessary step. Timestamp alignment can be achieved through the following steps:
[0174] Determine the time range of the two data curves, i.e. the start time and the end time.
[0175] According to the needs, select an appropriate time interval as the sampling interval of the curve. For example, you can choose every minute, every hour, or every day as the sampling interval.
[0176] For real-time energy consumption data, extract the energy consumption value corresponding to the timestamp according to the sampling interval. If a timestamp does not have a corresponding energy consumption value, interpolation can be performed to ensure that each timestamp has a corresponding energy consumption value.
[0177] For the model-predicted energy consumption data, the predicted energy consumption values corresponding to the timestamps are also extracted according to the sampling interval. If there is no predicted value corresponding to a timestamp, interpolation or extrapolation can be used to obtain the predicted energy consumption value for that timestamp.
[0178] The real-time energy consumption data curve and the model-predicted energy consumption data curve are plotted in the coordinate system with timestamps as the horizontal coordinates and energy consumption values as the vertical coordinates.
[0179] The horizontal coordinates (timestamps) of the two curves are ensured to be completely aligned for subsequent comparison and analysis.
[0180] For example, assume that an hourly sampling interval is chosen and a 24-hour time range is determined. For the real-time energy consumption data, the hourly energy consumption values are extracted from the energy consumption monitoring system and necessary interpolation processing is performed. For the model-predicted energy consumption data, the hourly timestamps are input into the prediction model to obtain the corresponding predicted energy consumption values, and necessary interpolation or extrapolation processing is performed. Then, the real-time energy consumption data curve and the model-predicted energy consumption data curve are plotted in the coordinate system with timestamps as the horizontal coordinates and energy consumption values as the vertical coordinates, and the horizontal coordinates of the two curves are ensured to be completely aligned.
[0181] By plotting the curves and aligning the timestamps of the real-time energy consumption data and the model-predicted energy consumption data, the change trends and difference levels of the two curves can be visually compared. This helps to further analyze the abnormal points of the energy consumption data and take corresponding measures for optimization and adjustment.
[0182] The present application provides a variety of algorithms for marking abnormal points, aiming to effectively identify and mark abnormal points in energy consumption data. The following is a detailed description of each algorithm and specific implementation:
[0183] Algorithm based on difference threshold:
[0184] This algorithm identifies abnormal points by setting a fixed energy consumption difference threshold T. In specific implementation, first, the real-time energy consumption data R and the predicted energy consumption data P are obtained, and then the difference |R-P| between them is calculated. If the difference is greater than the preset threshold T, the corresponding real-time energy consumption data point is marked as an abnormal point.
[0185] For example, assume T = 10, if the real-time energy consumption data R = 100 at a certain time and the predicted energy consumption data P = 95, then |R-P| = 5, which is less than T, so the point is not marked as an abnormal point; if R = 110 and P = 95 at another time, then |R-P| = 15, which is greater than T, so the point is marked as an abnormal point.
[0186] Algorithm based on difference percentage:
[0187] The algorithm identifies abnormal points by setting a percentage threshold PT of the energy consumption difference to the predicted value. In implementation, the percentage of the difference between the real-time energy consumption data R and the predicted energy consumption data P to P is calculated, i.e. |(R-P) / P|. If the percentage is greater than the preset threshold PT, the corresponding real-time energy consumption data point is marked as an abnormal point.
[0188] For example, if PT = 0.1 (i.e. 10%), R = 100 and P = 90 at a certain time, then |(R-P) / P| = |(100-90) / 90| ≈ 0.11, which is greater than PT, so the point is marked as an abnormal point.
[0189] The algorithm based on moving average:
[0190] The algorithm identifies abnormal points by calculating the average value AVG of the energy consumption difference in a time window and setting a multiple M. In implementation, the average value AVG of all energy consumption differences (R-P) in the time window is first calculated, and then it is determined whether the difference |R-P| between the real-time energy consumption data and the predicted energy consumption data is greater than M times of AVG. If yes, the point is marked as an abnormal point.
[0191] For example, if the time window is the past 5 minutes and M = 2, the energy consumption differences in the window are -2, 3, -1, 4 and 2, then AVG = (((-2+3-1+4+2) / 5) = 1. If R = 100 and P = 97 at the current time, then |R-P| = 3, which is greater than 2 times of AVG (i.e. 2), so the point is marked as an abnormal point.
[0192] The algorithm based on trend change:
[0193] The algorithm identifies abnormal points by analyzing the change trend of the real-time energy consumption data and the predicted energy consumption data. In implementation, the slopes Slope(R) and Slope(P) of the real-time energy consumption data curve and the predicted energy consumption data curve are first calculated, and then it is determined whether the difference |Slope(R)-Slope(P)| between the two is greater than the preset slope difference threshold ST. If yes, the point is marked as an abnormal point.
[0194] For example, if ST = 0.5, the slopes Slope(R) = 2 and Slope(P) = 1 are calculated by linear regression in a certain period, then |Slope(R)-Slope(P)| = 1, which is greater than ST, so the real-time energy consumption data points in the period are marked as abnormal points.
[0195] A big data-based air conditioner energy consumption data monitoring system, the system comprising:
[0196] Data Collection Module: This module is responsible for collecting historical operation data from the central air conditioning control system. These data include energy consumption data, operation settings, production parameters, and environmental parameters and passenger flow records during operation. Through the data interface with the central air conditioning control system, the data collection module can regularly or in real time obtain these data and store them in the system database for subsequent analysis and processing.
[0197] Feature Construction Module: After collecting the original data, the feature construction module will preprocess and construct features. This module will extract features that affect energy consumption prediction, such as environmental parameter trends, passenger flow fluctuations, and equipment operating conditions, and integrate these features into a feature dataset. The formation of the feature dataset provides the necessary data basis for subsequent modeling.
[0198] Model Construction Module: Using machine learning algorithms, the model construction module will build energy consumption prediction models for each central air conditioner. These models are trained based on the feature dataset, taking into account environmental parameters, passenger flow changes, equipment status, and time factors to predict the energy consumption trend of the central air conditioner in the future. By continuously optimizing model parameters and algorithm selection, the accuracy and reliability of energy consumption prediction can be improved.
[0199] Real-time Data Acquisition Module: This module is responsible for acquiring the production parameters and operation settings of each central air conditioner, as well as the current environmental parameters and passenger flow data. Real-time data acquisition is achieved through the real-time data interface with the central air conditioning control system, ensuring the timeliness and accuracy of the data.
[0200] Energy Consumption Prediction Module: The energy consumption prediction module inputs real-time data into the energy consumption prediction model and receives the energy consumption prediction trend data output by the model. These prediction data can be used to compare with real-time energy consumption data to timely detect energy consumption anomalies.
[0201] Data Cleaning Module: The data cleaning module collects real-time energy consumption data of each central air conditioner from the central air conditioning control system and cleans the collected raw data. The cleaning process includes removing outliers and filling missing values to ensure the accuracy and integrity of the data.
[0202] Anomaly Detection Module: The anomaly detection module plots the cleaned real-time energy consumption data and predicted energy consumption data as time-varying curves, respectively, and aligns the time stamps of the two curves. The module determines whether each point on the curve is abnormal according to the pre-set algorithm, and marks it as an abnormal point if it is. The specific choice of anomaly detection algorithm depends on the characteristics of the data and the requirements of anomaly detection.
[0203] The pre-warning signal generating and sending module generates a pre-warning signal according to a pre-set pre-warning rule when the anomaly detecting module finds an anomaly point. The pre-warning signal contains specific information of the anomaly point, such as a time stamp, a real-time energy consumption value, a predicted energy consumption value, an anomaly type identifier, and relevant central air conditioner number and location information. The pre-warning signal is sent to designated air conditioner management personnel through a communication interface of the system so that they can take timely measures to handle the anomaly.
[0204] It should be noted that the relational terms herein such as first and second and the like are used solely to distinguish one from another entity or action without necessarily requiring or implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0205] While the embodiments of the application have been illustrated and described, it will be understood by those skilled in the art that various changes, modifications, substitutions, and alterations can be made therein without departing from the spirit and scope of the application, which is defined by the following claims and their equivalents.
Claims
1. A big data-based air conditioner energy consumption data supervision method, characterized in that, The method comprises: S1: collecting historical operation data of the central air conditioning control system, including energy consumption data, operation settings, production parameters of each central air conditioner, and environmental parameters and passenger flow records during operation; S2: constructing features on the data collected in step S1 to form a feature data set; S3: using a machine learning algorithm, an energy consumption prediction model is constructed for each central air conditioner, which is based on the feature data set and considers environmental parameters, passenger flow changes, equipment status and time factors to predict the energy consumption trend of the central air conditioner in the future; S4: obtaining the production parameters and operation settings of each central air conditioner, and the current environmental parameters and passenger flow data; S5: inputting the obtained data into the energy consumption prediction model and receiving the energy consumption prediction trend data output by the model; S6: collecting real-time energy consumption data of each central air conditioner from the central air conditioning control system, and cleaning the collected raw data to remove outliers; S7: drawing the real-time energy consumption data collected in step S6 and the predicted energy consumption data output by the model in step S5 into curves changing with time, aligning the time stamps of the two curve data, and determining whether each point on the curve is abnormal according to a preset algorithm, and marking it as an abnormal point if it is; S8: generating an early warning signal according to the discovered abnormal points and early warning rules, and further sending the early warning signal to air conditioner managers; The feature data set comprises: Time window features, including average energy consumption, maximum energy consumption and minimum energy consumption in the past preset time period; Passenger flow related features, including the ratio of current passenger flow to average passenger flow in the past preset time period, the change rate of passenger flow and the identification of peak period passenger flow; Environmental parameter features, including indoor and outdoor temperature difference, humidity change rate and identification of whether in extreme weather conditions; Device status features, including device running time, time since last device maintenance and identification of whether the device is in maintenance state; Time related features, including identification of which day of the week, which day of the year or which month, and holiday; Statistical features, including energy consumption data distribution features and rolling statistics of energy consumption data; Change rate features, including energy consumption change rate. 2.The big data-based air conditioner energy consumption data supervision method of claim 1, wherein, The energy consumption prediction model is constructed using the long short-term memory network (LSTM) algorithm, and the specific steps comprise: S301: using the feature data set as input, dividing the feature data set into training set and test set; S302: constructing an LSTM network structure, setting network layer number, hidden layer unit number and activation function hyperparameters; S303: training the LSTM model using the training set, and optimizing the model parameters by back propagation algorithm and gradient descent method; S304: evaluating the trained LSTM model using the test set to verify the prediction performance of the model; S305: adjusting the hyperparameters of the LSTM model according to the evaluation results until the prediction accuracy is satisfactory; S306: training and saving the corresponding LSTM energy consumption prediction model for each central air conditioner. 3.The big data-based air conditioner energy consumption data supervision method of claim 2, wherein, The network structure of the LSTM model is: The input layer receives a feature dataset as input, which includes time window features, crowd-related features, environmental parameter features, device state features, time-related features, statistical features, and change rate features. The network layer includes two hidden layers, each containing 128 and 64 hidden units, respectively. Each hidden unit updates and transmits information through a forget gate, an input gate, and an output gate. The output of the hidden unit is nonlinearly transformed using a ReLU activation function. The output layer receives the output of the last hidden layer and maps the output of the LSTM network to the energy consumption prediction value through a fully connected layer. 4.The big data-based air conditioner energy consumption data supervision method of claim 3, wherein: The LSTM model is iteratively trained using the training set data. In each iteration, a batch of input data is fed into the LSTM model. The values of the input layer and the output layer are calculated, and the memory cells and hidden states are updated. Finally, the predicted output sequence is obtained. During the training process, the model performance is evaluated periodically using the validation set. The learning rate is adjusted as needed, or the training is stopped early to prevent overfitting. 5.The big data-based air conditioner energy consumption data supervision method of claim 4, wherein, The mean squared error (MSE) algorithm is used to evaluate the performance of the energy consumption prediction model. The specific algorithm is as follows: , wherein n is the number of data points, is the energy consumption value predicted by the model, is the actually measured energy consumption value; the prediction accuracy of the model is evaluated according to the MSE value, the smaller the MSE value, the higher the prediction accuracy of the model. 6.The big data-based air conditioner energy consumption data supervision method of claim 1, wherein, In step S6, the original data is cleaned by setting a reasonable numerical range for each type of data, iterating through the original data, and marking and removing data outside the set range as outliers. 7.The big data-based air conditioner energy consumption data supervision method of claim 1, wherein, The algorithm for marking outliers includes: Difference threshold-based algorithm: Set a fixed energy consumption difference threshold. If the difference between the real-time energy consumption data and the predicted energy consumption data exceeds the threshold, mark it as an outlier. The formula is: If |R - P| > T, then mark it as an outlier, where R represents real-time energy consumption data, P represents predicted energy consumption data, and T represents the set energy consumption difference threshold. Difference percentage-based algorithm: Set a percentage threshold for the energy consumption difference relative to the predicted value. If the difference between the real-time energy consumption data and the predicted energy consumption data exceeds the threshold, mark it as an outlier. The formula is: If |(R - P) / P| > PT, then mark it as an outlier, where R represents real-time energy consumption data, P represents predicted energy consumption data, and PT represents the set energy consumption difference percentage threshold. Sliding average-based algorithm: Calculate the average energy consumption difference within a time window. If the difference between the real-time energy consumption data and the predicted energy consumption data exceeds a certain multiple of the average value, mark it as an outlier. The formula is: If |R - P| > M × AVG, then mark it as an outlier, where R represents real-time energy consumption data, P represents predicted energy consumption data, M represents the set multiple, and AVG represents the average energy consumption difference within the time window. The trend change-based algorithm: analyze the change trend of real-time energy consumption data and predicted energy consumption data, and mark an abnormal point when the trend of real-time data deviates significantly from the trend of predicted data. The trend change is realized by calculating the slope of the two curves. The formula of the slope difference is: if |Slope(R) - Slove(P)| > ST, then mark it as an abnormal point, wherein, Slope(R) represents the slope of real-time energy consumption data, Slove(P) represents the slope of predicted energy consumption data, and ST represents the set slope difference threshold. 8.The big data-based air conditioner energy consumption data supervision method of claim 1, wherein: The early warning signal contains the specific timestamp of the abnormal point, the corresponding real-time energy consumption value, the predicted energy consumption value, the abnormal type identification, and the number and location information of the related central air conditioner. 9.A big data-based air conditioner energy consumption data supervision system, characterized by, The system comprises: a data collection module responsible for collecting historical operation data of the central air conditioner control system, including energy consumption data, operation settings, production parameters of each central air conditioner, and environmental parameters and passenger flow records during operation; a feature construction module for feature construction of the collected data to form a feature data set for subsequent modeling; a model construction module for constructing an energy consumption prediction model for each central air conditioner using a machine learning algorithm. The model is based on the feature data set and considers environmental parameters, passenger flow changes, equipment status, and time factors to predict the energy consumption trend of the central air conditioner in the future; a real-time data acquisition module responsible for acquiring the production parameters and operation settings of each central air conditioner, as well as the current environmental parameters and passenger flow data; an energy consumption prediction module for inputting real-time data into the energy consumption prediction model and receiving the energy consumption prediction trend data output by the model; a data cleaning module for collecting real-time energy consumption data of each central air conditioner from the central air conditioner control system and cleaning the collected raw data to remove outliers; an anomaly detection module for plotting the cleaned real-time energy consumption data and predicted energy consumption data into curves changing over time, aligning the timestamps of the two curve data, and determining whether each point on the curve is abnormal according to the preset algorithm. If it is, mark it as an abnormal point; an early warning signal generation and sending module for generating an early warning signal according to the discovered abnormal point and the preset early warning rule, and sending the early warning signal to the designated air conditioner management personnel; The feature data set comprises: time window features, including average energy consumption, maximum energy consumption, and minimum energy consumption in the past preset time period; passenger flow-related features, including the ratio of current passenger flow to average passenger flow in the past preset time period, the change rate of passenger flow, and the identification of peak period passenger flow; environmental parameter features, including indoor and outdoor temperature difference, humidity change rate, and identification of whether in extreme weather conditions; equipment status features, including equipment running time, time since last equipment maintenance, and identification of whether the equipment is in maintenance state; time-related features, including identification of which day of the week, which day of the year, or which month, and holidays; statistical features, including energy consumption data distribution characteristics and rolling statistics of energy consumption data; change rate features, including energy consumption change rate.
Citation Information
Patent Citations
Air conditioner energy consumption prediction method based on long-short term memory recurrent neural network (LSTM-RNN)
CN109959122A
General water-cooling central air conditioner energy consumption prediction method based on long-short-term memory recurrent neural network
CN109961177A