Machine room environment monitoring method based on time sequence model and storage medium
By using a neural network prediction method based on time series models, the problems of accuracy and automated temperature control in computer room temperature monitoring were solved, achieving efficient environmental stability management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA PETROLEUM & CHEMICAL CORP
- Filing Date
- 2024-11-19
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, computer room environmental temperature monitoring methods have low sensitivity and poor accuracy, resulting in insufficient environmental stability and affecting the normal operation of hardware equipment.
A time series model-based approach is adopted, utilizing a neural network model based on the Transformer architecture. By preprocessing and training historical data, future temperature changes are predicted, and model parameters are dynamically updated. Combined with a dynamic environmental system, automated temperature control is achieved.
It achieves high-precision prediction and automated temperature control of the computer room environment, reducing manual intervention and improving environmental stability and equipment operating efficiency.
Smart Images

Figure CN122064552A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of temperature monitoring, specifically to a method and storage medium for monitoring computer room environment based on a time series model. Background Technology
[0002] With the rapid development of information technology, computers are playing an increasingly important role in various industries. In the field of oil exploration, not only is it necessary to store massive amounts of specialized data, but the requirements of production software on hardware equipment are also gradually increasing, and the stability requirements of computer room environments are becoming more stringent. Existing methods for manually adjusting the computer room environment have problems such as low sensitivity and poor accuracy, which seriously affect the stability of the computer room environment, especially the temperature environment. Summary of the Invention
[0003] The purpose of this invention is to solve the problems existing in the prior art and, in view of the shortcomings of the prior art, to invent a method that can predict temperature changes in the future period based on the collected historical temperature data inside and outside the computer room and schedule temperature control equipment accordingly.
[0004] This invention is achieved through the following technical solution:
[0005] In a first aspect, the present invention provides a method for monitoring the environment of a computer room based on a time series model, the method comprising:
[0006] Step 1: Preprocess historical data to construct a dataset;
[0007] Step 2: Select the model architecture and hyperparameters, and train the model;
[0008] Step 3: Predict the ambient temperature of the computer room and perform visual trend analysis;
[0009] Step 4: Control the temperature control equipment in the computer room according to the predicted ambient temperature.
[0010] Furthermore, step 1 includes:
[0011] Step 11: Convert the historical data into ndarray structure data;
[0012] Step 12: Perform clustering and hierarchical processing on the ndarray structured data to construct the dataset.
[0013] Furthermore, step 11 includes: exporting historical data from the InfluxDB time-series database as a CSV file; and calling the Python library functions csv.reader() and np.array() to convert the data in the CSV file into ndarry format data.
[0014] Furthermore, the clustering and grading process in step 12 involves data processing using a Python automated data processing script, including: performing precision downsampling on all data; estimating and filling missing values in the dataset using the KNN algorithm based on the similarity of dates and crowding levels; and assigning exponentially decreasing weights using exponential smoothing to smooth the data.
[0015] Furthermore, step 2 includes:
[0016] Step 21: Select the model architecture and hyperparameters, and train the neural network model; the model architecture is an improved Transformer model, which only uses the encoder module and comprehensively extracts the time series representation and the correlation between variables through a multi-head self-attention mechanism;
[0017] Step 22: Dynamically update the neural network model by recording the newly collected real temperature data every 15 minutes as a label for the predicted value at that time point based on 96 sample points collected in the previous 24 hours, and construct a new dataset. The neural network model is then fitted and optimized based on the new dataset.
[0018] Furthermore, step 21 includes:
[0019] Using an improved Transformer model, the input data is tokenized according to the set rules;
[0020] The training results are passed through the neural network layer by layer, using weight values and the GELU activation function, and finally output.
[0021] The model training evaluation metrics, root mean square error and mean absolute percentage error, are obtained by predicting the results and labels during the forward propagation process. The model weights are then adjusted to evaluate the performance of the neural network model.
[0022] Furthermore, the formula for calculating the model training evaluation index is as follows:
[0023] Formula for calculating root mean square error:
[0024] Mean absolute percentage error:
[0025] Furthermore, step 2 also includes setting an early_stopping mechanism during model training, so that training is stopped early when the evaluation value loss fails to converge three times in a row.
[0026] Furthermore, step 3 includes:
[0027] Step 31: Update the dataset every 15 minutes to predict the temperature values for the next 96 time points, i.e., the next 24 hours.
[0028] Step 32: Feed the predicted value of the most recent time point and the newly collected real value back into the model for prediction, and save the prediction results;
[0029] Step 33: After performing inverse normalization on the prediction results, the results are sent to the dynamic environment system for visualization analysis and subsequent use.
[0030] A second aspect of this invention provides a computer-readable storage medium storing at least one computer-executable program, which, when executed by the computer, causes the computer to perform the steps of the time-series model-based data center environment monitoring method.
[0031] Compared with the prior art, the beneficial effects of this invention are:
[0032] This invention presents an automated, highly accurate method for predicting computer room temperature based on historical values, meeting business requirements. A software interface has also been developed to enhance practicality and efficiency. Furthermore, this invention provides a remote air conditioning scheduling function, sending information to the scheduling equipment in advance based on predicted values to set the temperature control equipment parameters for the corresponding future time period. This avoids the real-time reliance on manual processing in traditional monitoring methods and the potential damage to equipment due to delayed responses. The implementation of this invention aims to address the problems of intelligent computer room construction, high equipment sensitivity to indoor temperature and humidity, heavy reliance on manual control and scheduling, and low efficiency in utilizing historical monitoring data. It demonstrates practical applicability in real-world applications. Attached Figure Description
[0033] Appendix Figure 1 A schematic diagram of the overall process of this invention.
[0034] Appendix Figure 2 A flowchart illustrating the data acquisition and processing method used in this invention.
[0035] Appendix Figure 3 The overall structure diagram of the time series model in this invention. Detailed Implementation
[0036] The present invention will now be described in detail with reference to specific embodiments and accompanying drawings.
[0037] This invention primarily leverages the unique advantage of the self-attention mechanism of the Transformer architecture's neural network model in capturing long-term dependencies in time-series data. It uses previously collected data from the data center, such as data from various nodes and outdoor temperature and humidity, to construct a dataset for training a dedicated model. The model continuously adjusts its parameters using newly collected data as ground truth values and provides an interface to the monitoring system to visualize the predicted values. Key components include preprocessing the raw data using Python, calling the PyTorch framework, training dedicated parameters using a modified iTransformer architecture, updating the dataset with newly collected data for parameter tuning, and visualizing the prediction results through an interface compatible with the existing environmental monitoring system of the data center.
[0038] like Figure 1 The diagram shown is an overall scheme diagram of an embodiment of the present invention. The entire method mainly includes four steps: data acquisition, model training, temperature prediction, and equipment scheduling.
[0039] Data acquisition: This mainly involves preprocessing and transforming a large amount of historical data before modeling, including clustering, hierarchical classification, and normalization.
[0040] Specifically, the raw historical data stored in the InfluxDB time-series database in Point format is exported as a CSV file on the server side. Then, converters are written to transform the data into an ndarray structure. The data that meets the requirements is then extracted and processed with missing value imputation, precision downsampling, clustering, etc., to generate preprocessed data in a standardized format.
[0041] Model training: This mainly involves the selection and setting of multiple hyperparameters, and the use of gradient descent error analysis to build a neural network model of the iTransformer architecture on historical data training set.
[0042] For the aforementioned preprocessed data, the training set and test set for building the model are divided according to the set hyperparameters such as input sequence length, label length, prediction length, and frequency. Then, the dataset is fed into the modified iTransformer model for training, and the model parameters are adjusted according to the set loss function to improve the training effect.
[0043] Temperature prediction involves forecasting temperature changes over a future period based on an established model. Real-world data for that predicted period is collected again and fed into the model for parameter calibration. The prediction result is then inversely normalized before being transmitted to the temperature control equipment. After saving and integrating the model built on historical data, new real-world data is continuously collected over time and fed into the model along with the predicted values to achieve dynamic model updates.
[0044] Equipment scheduling: This includes evaluating and using predicted values, linking predicted values with temperature control equipment, and setting them in advance to reduce manual labor and improve processing efficiency.
[0045] Example 1:
[0046] Step 1: Preprocess historical data to construct datasets for the corresponding time points.
[0047] like Figure 2 The diagram shown is a flowchart illustrating the data collection and processing method.
[0048] Step 1.1, Storage Format Conversion: Export historical data recorded over the past two years, sampled at 15-minute intervals, from the InfluxDB time-series database as a CSV file. Use Python library functions such as csv.reader() and np.array() to convert the data in the CSV file into the easily processed ndarry format for storage.
[0049] Step 1.2, Clustering and Grading, Constructing the Dataset: The clustering and grading is performed using a Python automated data processing script. The first step is to downsample all data to reduce computational load. The second step is to impute missing values, specifically using a missing value handling method combining time series analysis and machine learning algorithms. By considering the similarity of dates and crowding levels, the KNN algorithm is used to estimate and impute missing values in the dataset. The third step is to use exponential smoothing to assign exponentially decreasing weights, smoothing the data and helping to identify trends and seasonal patterns.
[0050] Other relevant variables besides the temperature at the sampling point, such as the daily maximum and minimum room temperature, humidity, equipment power, and usage frequency, are matched with the sampling interval and then converted into a set of tensors for deep learning using torch. The training set and test set are divided in an 8:2 ratio for model training.
[0051] Example 2:
[0052] Step 2: Select the model architecture and hyperparameters, and train the neural network model.
[0053] like Figure 3 The diagram shown is the overall structure of the time series model used in this invention. This invention improves upon the Transformer model: based on the special characteristics of time series prediction tasks, in order for the encoder to provide a powerful representation of the input data, only the encoder module is used, and the time series representation and the correlation between variables are fully extracted through a multi-head self-attention mechanism.
[0054] Step 2.1, Train the neural network model: Adjust the model parameters according to the set loss function to improve the training effect, train the model using the dataset, and save the output.
[0055] Specifically, the neural network model based on the Transformer architecture is configured for training in a GPU environment. The neural network model uses a three-layer Transformer structure: an embedding layer, n encoder layers, and a projection layer.
[0056] The embedding layer is used to tokenize the data. Its input dimension d_model is a hyperparameter that can be adjusted according to specific needs. It is generally set to 128. Each variable is fed into the embedding layer as X (number of variables, sequence step size) for tokenization.
[0057] The encoder layer introduces a self-attention module to comprehensively extract time series representations, employing an eight-head scaling dot product attention mechanism to calculate softmax scores to reveal correlations between variables. Furthermore, layer normalization is used for univariate processing instead of traditional multivariate fusion, which reduces discrepancies caused by inconsistent measurements by individually normalizing the feature representation of each variable to a normal distribution, thus mitigating differences in measurement units.
[0058] The projection layer is used to project the output labels onto the desired sequence length to generate the final prediction.
[0059] Using the BPTT gradient calculation algorithm with temporal forward and backward propagation, RMSE and MAPE are used as evaluation criteria to judge the performance of the trained model. Once the confidence value is reached, training is stopped and the model parameters are saved.
[0060] The specific training process is as follows:
[0061] Using a neural network model based on the Transformer architecture, the input data is tokenized according to predefined rules. These rules include: determining the number of specific variables, setting the variable time steps (usually 96), and setting the prediction time steps.
[0062] The training results are passed layer by layer through the neural network, and finally output after passing through the weight values and the GELU activation function. Furthermore, the predicted values of forward propagation during training are compared with the true label values to calculate the loss. The calculation results are used for backpropagation to calculate the gradient and then the weights are adjusted to minimize the loss.
[0063] The model training evaluation metrics used are root mean square error (MSE) and mean absolute percentage error (MAPE).
[0064] The formula for calculating the root mean square error is:
[0065] The formula for calculating the mean absolute percentage error is:
[0066] The evaluation metric values are derived from the forward propagation prediction results and the true label values during the training process, and are used to adjust the model weights to minimize the loss and evaluate the model performance.
[0067] Furthermore, this invention sets up an early_stopping mechanism during the training process, which stops training early when the loss, i.e., the evaluation value, fails to converge three times consecutively.
[0068] Once trained, the model stores its network structure and optimized parameters on a server for prediction purposes.
[0069] Step 2.2, Dynamic Update of Neural Network Model: Record the newly collected real temperature data value every 15 minutes as a label for the predicted value at that time point based on 96 sample points collected in the previous 24 hours. Construct a new dataset by using the concat() function to append the predicted value to the original dataset and then feed it back into the model for prediction and result accuracy verification, so as to realize the dynamic update of the model by fitting and optimizing it according to the new dataset.
[0070] Example 3:
[0071] Step 3: Predict the temperature and perform visual trend analysis.
[0072] Specifically, the steps for predicting temperature include:
[0073] Step 3.1: Update the dataset every 15 minutes and predict the temperature values for the next 96 time points, i.e., the next 24 hours. Specifically: set the time interval to 15 minutes, the total prediction period to the next 24 hours, and the prediction length to a hyperparameter. These parameters are set in the script. In this invention, 96 (24 hours) is selected to achieve the good training effect verified by experiments.
[0074] Step 3.2: Feed the predicted value of the most recent time point and the newly collected true value back into the model for prediction, and save the prediction results. Specifically, due to the use of a sliding window strategy, the prediction of the first time point is entirely based on historical true data, while the prediction process of subsequent points uses a new dataset of historical data plus predicted values. Therefore, the prediction accuracy of the first point is the highest, and only the prediction result of the first time point is stored.
[0075] Step 3.3 involves inverse normalizing the prediction results from the first time point and then sending them into the environmental system for visualization analysis and subsequent use. The inverse normalization process involves mapping the normalized data to the same interval during preprocessing; therefore, the normalized data needs to be mapped back to its original scale for subsequent visualization and prediction. The calculation method is the inverse normalization formula. The visualization analysis specifically involves: calling the environmental system's time-series database interface to obtain historical data for model training; calling the environmental system's visualization analysis module interface to transmit the predicted values; and simultaneously updating the predicted values to the database for storage.
[0076] Example 4:
[0077] Step 4: Control the temperature control equipment based on the predicted ambient temperature of the computer room.
[0078] Specifically, the predicted temperature is read and displayed using the Python built-in library Matplotlib. A corresponding processing logic module is written and integrated into the existing environmental control software. Based on the difference between the predicted temperature and the current setpoint of the cooling system (i.e., temperature control equipment) in the computer room, it is determined whether the future temperature is within a tolerable range. If it exceeds the setpoint, the cooling system is adjusted, including adjusting the cooling capacity and supply air temperature, to bring it to the ideal range. When a request to view historical data is initiated, the server transmits the stored data to the terminal as a byte stream and plots the trend, forming a predicted trend graph. This is a mature existing technology and will not be elaborated further here.
[0079] The above technical solution is only one embodiment of the present invention. For those skilled in the art, based on the principles disclosed in the present invention, it is easy to make various types of improvements or modifications, and not limited to the technical solutions described in the specific embodiments of the present invention. Therefore, the foregoing description is only a preferred option and is not restrictive.
Claims
1. A method for monitoring the computer room environment based on a time series model, characterized in that: The method includes: Step 1: Preprocess historical data to construct a dataset; Step 2: Select the model architecture and hyperparameters, and train the model; Step 3: Predict the ambient temperature of the computer room and perform visual trend analysis; Step 4: Control the temperature control equipment in the computer room according to the predicted ambient temperature.
2. The data center environment monitoring method based on a time series model according to claim 1, characterized in that: Step 1 includes: Step 11: Convert the historical data into ndarray structure data; Step 12: Perform clustering and hierarchical processing on the ndarray structured data to construct the dataset.
3. The data center environment monitoring method based on a time series model according to claim 2, characterized in that: Step 11 includes: exporting historical data from the InfluxDB time-series database as a CSV file; and calling the Python library functions csv.reader() and np.array() to convert the data in the CSV file into NdArry format data.
4. The data center environment monitoring method based on a time series model according to claim 2, characterized in that: The clustering and grading process in step 12 involves data processing using a Python automated data processing script, including: precision downsampling of all data; estimating and filling missing values in the dataset using the KNN algorithm based on the similarity of dates and crowding levels; and smoothing the data by assigning exponentially decreasing weights using exponential smoothing.
5. The data center environment monitoring method based on a time series model according to claim 1, characterized in that: Step 2 includes: Step 21: Select the model architecture and hyperparameters, and train the neural network model; the model architecture is an improved Transformer model, which only uses the encoder module and comprehensively extracts the time series representation and the correlation between variables through a multi-head self-attention mechanism; Step 22: Dynamically update the neural network model by recording the newly collected real temperature data every 15 minutes as a label for the predicted value at that time point based on 96 sample points collected in the previous 24 hours, and construct a new dataset. The neural network model is then fitted and optimized based on the new dataset.
6. The data center environment monitoring method based on a time series model according to claim 5, characterized in that: Step 21 includes: Using an improved Transformer model, the input data is tokenized according to the set rules; The training results are passed through the neural network layer by layer, using weight values and the GELU activation function, and finally output. The model training evaluation metrics, root mean square error and mean absolute percentage error, are obtained by predicting the results and labels during the forward propagation process. The model weights are then adjusted to evaluate the performance of the neural network model.
7. The data center environment monitoring method based on a time series model according to claim 6, characterized in that: The formula for calculating the model training evaluation index is as follows: Formula for calculating root mean square error: Mean absolute percentage error:
8. The data center environment monitoring method based on a time series model according to claim 1, characterized in that: Step 2 further includes setting an early_stopping mechanism during model training, which stops training early when the evaluation value loss fails to converge three times consecutively.
9. The data center environment monitoring method based on a time series model according to claim 1, characterized in that: Step 3 includes: Step 31: Update the dataset every 15 minutes to predict the temperature values for the next 96 time points, i.e., the next 24 hours. Step 32: Feed the predicted value of the most recent time point and the newly collected real value back into the model for prediction, and save the prediction results; Step 33: After performing inverse normalization on the prediction results, the results are sent to the dynamic environment system for visualization analysis and subsequent use.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer-executable program, which, when executed by the computer, causes the computer to perform the steps of the data center environment monitoring method based on a time series model as described in any one of claims 1-9.