Intelligent Prediction of Refrigerant Amounts Based on Internet of Things

In a refrigeration unit, the amount of refrigerant has a substantial influence on the entire refrigeration system. To predict the amount of refrigerant in refrigerators with the best performance, this study used refrigerator data collected in real time via the Internet of (ings, which were screened to include only the effective parameters related to the compressor and refrigeration properties (based on their practical significance and the research background) and cleaned by applying longitudinal dimensionality reduction and transverse dimensionality reduction.(en, on the basis of an idealizedmodel for refrigerator data, a model of the relationships between refrigerant amount (the dependent variable) and temperature variation, refrigerator compartment temperature, freezer temperature, and other relevant parameters (independent variables) was established. A refrigeration model based on a neural network was then established for predicting the amount of refrigerant and was used to predict five unknown amounts of refrigerant from data sets. BP neural network and RBF neural network models were used to compare the prediction results and analyze the loss functions. From the results, it was concluded that the unknown amount of refrigerant was most likely to be 32.5 g. It is of great practical significance for refrigerator production and maintenance to study the prediction of the amount of refrigerant remaining in a refrigerator.


Introduction
Against the backdrop of the highly developed state of network technology and the ongoing development of sensor acquisition technology and communication technology, a new type of relationship between objects emerges. In this environment, all objects related to the Internet are connected through radio frequency identification devices (RFIDs) [1], image recognition technology [2], wireless data communication, and other information-sensing technologies, thereby forming a network with certain intelligent identification and intelligent management functions [3], called the Internet of things (IoT). With the rapid development of smart home appliances [4], digital computer technology, information network technology, and sensing technology can be applied to household appliances [5,6], enabling smart home appliances to generate "thought," acquire perceptual abilities, and perform information network functions [7]. As smart home appliances in the family continuously exchange information with the outside world, they can help people optimize their lifestyles and use household appliances more conveniently. e combination of IoT with refrigerators to produce the smart refrigerator is an inevitable result of the development of IoT technology and a direct reflection of people's pursuit of higher quality and a more convenient life [8]. In contrast with the traditional ordinary refrigerator, the smart refrigerator can remind users of foods stored in the refrigerator in a timely way, collect data relevant to the refrigerator's operation to issue early warnings and to prompt maintenance, and help people use it more easily [9,10], changing people's living habits to a certain extent and increasing convenience in people's lives [11]. Figure 1 shows a diagram of the structure of a smart home appliance system.
In refrigeration appliances, the cooling effect is affected by many factors. As a fully closed refrigeration system, it is limited by many factors, and compactness of the physical structure is a strict design requirement [12]. Under the condition of close coordination of key components such as the evaporator, capillary [13], condenser, and compressor, the amount of refrigerant has a substantial influence on the entire refrigeration system [14]. With too much or too little refrigerant, the refrigerant cannot be freely converted [15], the internal pressure will be unbalanced, efficiency of the system will be reduced, and energy consumption will increase, resulting in poor refrigeration [16,17]. erefore, it is highly important to precisely control the amount of refrigerant, and this necessitates accurate analysis of the system data [18,19].
It is the responsibility of refrigerator manufacturers to maintain the quality of refrigerators, addressing issues such as the normal loss of refrigerant, leakage problems, insufficient or excessive filling in later stages, and the question of how much refrigerant should be added when it is clear that the amount is insufficient. If the problem would affect actual use, prompt maintenance can significantly improve the user experience. However, as frequent on-site inspection is not very feasible, it is important to collect and analyze refrigerator data in real time through the Internet of ings, calculate the amount of refrigerant remaining, and prompt users or manufacturers when it falls to a preset threshold so that they can perform advance maintenance.
is study investigated the effect of changes in refrigerant amount on selected parameters such as the refrigerator compartment temperature, variations in temperature, freezing temperatures, and refrigerator frost temperature and established a model of the relationships between refrigerant amount and these parameters, in which the refrigerant amount is the dependent variable and the relevant acquisition parameter is an independent variable. en, the refrigerant amount was predicted in an experiment by studying the effect of changes in relevant parameters.

Refrigerator Characteristics
rough the real-time collection of existing refrigerator data through the Internet of ings, it is feasible to estimate the amount of refrigerant remaining in the refrigerator and to add a proper amount of refrigerant, which is important for the production and maintenance of the refrigerator. As the refrigerator structure, operating mechanism, and data acquisition environment have an impact on the collected data, it is necessary to provide a basic description of the type of refrigerator investigated in this study.

Physical Structure and Function.
Different physical structures of refrigerators produce different types of data and affect the temperature changes within each chamber. Table 1 shows the main physical structure of the refrigerator.

Control Panel
2.2.1. Principle. By adjusting the digital resistance of the analog sensor, various working states of the refrigerator's computer board can be activated, thereby simulating the process of using the refrigerator. roughout the experiment, the R-on of the refrigerator compartment was 7 degrees, the R-off was 3 degrees, the change in the temperature of the variable-temperature compartment was 0 degrees (the "keeping fresh" mode), the startup point was 1 degree, the shutdown point was − 1 degree; the temperature of the freezing compartment was the same as that of the refrigerator compartment, F-on was − 16 degrees, and F-off was − 19 degrees. In order to ensure triggering, the corresponding temperature point was 1 degree lower than the OFF point and 1 degree higher than the ON point.
By default, the refrigerator runs with a load when a profile is formulated.   temperature will rise. After a period of time, if the refrigerator sensor reaches the start point, the refrigerator fan starts working, and the air door opens. If the freezer sensor reaches the start point, the compressor starts working, the refrigerator fan starts working, and the air door opens. If the refrigerator sensor reaches the freezer shutdown point and the refrigerator sensor does not reach the start point, the compressor stops working. (iii) Moisturizing: when the refrigeration compartment is uncooled and the refrigerator defrost sensor detects that the temperature is less than − 3 degrees, the moisturizing function is triggered. When the refrigerator defrost sensor detects that the temperature is greater than 3 degrees, moisturizing ends. (iv) Opening and closing the door: opening and closing the door simulates the temperature change caused by cold storage and the opening and closing of the freezer. e trigger mechanism is the same as that in the moisturizing mode. (v) Defrosting: after booting, the compressor works for 8 h, triggering defrosting, and the defrosting heating element starts to work. During this time, the compressor does not operate, and the temperatures rise. When the defrost sensor reaches a specified temperature, defrosting stops. Defrost recovery mode is entered and cooling starts. (vi) Stopped mode: after working for a period of time, the power supply of the computer board is switched off, simulating a loss of power to the user.

Data Acquisition.
ere were seven refrigerators: BX001, BX002, BX004, BX005, BX006, BX007, and BX009. Each refrigerator was statically injected with a certain amount of refrigerant at a certain time, for example, the BX001 refrigerator was injected with 35 g of refrigerant on January 24, 2018; 35 g on January 25, 2018; and 42.5 g on March 6, 2018. Each file name included the refrigerator ID, the number of grams of refrigerant, and the data collection document number.
By setting up each sensor and collecting data from each one and from the refrigerator computer board, we obtained discrete data for the following parameters at various time points: refrigerator compartment temperature, temperature variation, freezer compartment temperature, freezing temperature, refrigerator defrosting temperature, freezer defrosting temperature, ambient temperature, humidity,

Data Screening.
We established an idealized model of refrigerator data. We assumed that the refrigerator was in a normal state during operation, the refrigerant amount remained stable after addition, and the external environment was stable.
We show an analysis of the data collected by each sensor, ignoring the effects of built-in lighting and UV module sterilization on temperature. Parameters such as network speed and the rate of discarding are considered to be independent of the model establishment, and the data on the status of the refrigerator solenoid valve and the working status of the ozone module have little influence on the experiment. erefore, we selected only the first 11 data items for processing: those from the refrigerator compartment temperature to the compressor outlet temperature.
In the refrigerator cooling mode, because the refrigerator is intercooled, the refrigeration principle for each compartment is divided into two types. In the first type, a particular compartment sensor reaches the start point, triggering the compressor to start working; meanwhile, the fan starts working, the damper opens, and the fan blows cold air into the compartment for heat exchange, and refrigeration is achieved. In the second type, the sensor itself cannot trigger the compressor; only the heat exchange between the fan and other chambers can serve to achieve cooling. Since refrigerant is only added to the compressor, and our purpose is to study the changes in various parameters when the refrigerant amount changes; we only study the parameter changes under the first refrigeration principle.
During heat preservation, moisturizing, tempering of each compartment, and shutdown of the refrigerator, the compressor stops working, and the temperature of each chamber rises. At this time, any changes in the data have nothing to do with the compressor or the refrigerant. erefore, we believe that any data changes at this time do not reflect the refrigerant. Naturally, in the door-opening phase, although the compressor continues to work, the decisive factor affecting each chamber is the ambient temperature.
e data at this time are also considered irrelevant.
us, we only select the first refrigeration principle-that is, the data on each chamber through the fan directly exchange heat with the compressor, the nonswitching door stage, and the refrigeration phase of the refrigerator compressor-as the effective data for the next step.

Data Processing.
e raw data were preprocessed as shown in Figure 2.
After data preprocessing, which reduces the data dimensionality, the data parameters finally selected are shown in Table 2. e next step was to scan the database to process the data parameters for repeat values (see Figure 3).
ere are multiple lines of data every second, and the basic data remain constant. In order to reduce data redundancy, the mode value for each parameter in a given second was selected as the parameter value for that second, which reduces the data vertically. e data as finally processed are shown in Figure 4. To visualize the data after processing, box plots were drawn from the data ( Figure 5), enabling the approximate correlation of the data and general trends to be observed. From the figure, it can be seen that the distributions of data under different amounts of refrigerant are similar. It can also be seen that there is a strong correlation between the refrigerator defrosting temperature and the refrigerator evaporator outlet temperature and between the freezer defrosting temperature and the refrigerator evaporator outlet temperature. Ambient temperature and humidity also have a strong correlation, so the data can be further reduced in dimensionality by removing the three parameters refrigerator evaporator outlet temperature, freezer evaporator outlet temperature, and humidity. rough data visualization, it was found that the parameters of the 45 g_0806 data set were "abnormal"; the data were distributed around 25°C. By a comparison with the box plots of the previous data, these data were deemed abnormal (see Figure 6). In order to improve the accuracy of the model results, the data of this part of the abnormality were eliminated during the postoperation. e data anomaly may have been due to operational errors during data collection.
Given the data characteristics and the purpose of the modeling, analysis can be performed from three perspectives: the changes in various parameters after different amounts of refrigerant are placed, the relationship between multiple sets of data collected on the same day but at different times, and the effect of different amounts of refrigerant on different machines. Because of the influence of the quantity of data, for example, one given machine can have data for at most three different amounts of refrigerant (according to the description that the refrigerant is injected 4 Complexity only once a day), one machine has at most four sets of data for different times of the day, and different machines do not have the same refrigeration. e amounts of the refrigerant are contrasted. erefore, the factors influencing different machines and the changes in parameters at different times of the same day were not considered; instead, only the changes in parameters between different amounts of refrigerant were extracted for study.

Establishment and Solution of BP Neural Network Model
According to Kolmogorov's theorem, a three-layer BP neural network with a single hidden layer is sufficient to perform arbitrarily complex function mapping. erefore, a three-layer BP neural network with a hidden layer was adopted.       Table 3. Figure 7 shows the structure of the BP neural network model.     Table 4. e number of neurons in the hidden layer is set as variable n and is calculated according to the following empirical formula:

Neural Network Model for Predicting Refrigerant Amount.
where a ∈ [1,10]. e number of hidden layer neurons was selected as n ∈ [6,15], and after repeated verification, we let n � 12. e tansig transfer function was used from the input layer to hidden layer, and the purelin transfer function was used from the hidden layer to output layer. e training algorithm adopts a nonlinear damped least-squares optimization algorithm with the trainlm function. Regarding training error, the maximum number of cycles was 100, and the error between network training results and training samples could be controlled within 1 × 10 − 6 , so the accuracy requirement was considered to be reached. e learning coefficient was 0.05.

Loss Function.
Using 80% of the labeled data as the training set and 20% as the test set, a simple neural network model was selected for training to obtain the loss curve of the model (Figure 8). According to the figure, the minimum loss function value of the model training can reach below 0.045. Table. Table 5 shows the prediction result details for five XXg data sets.

Visualization of Prediction
Results. Five files with unknown refrigerant amounts were preprocessed, the XX data set for an unknown refrigerant amount was predicted by the model generated by training, and the prediction results were processed visually. en, pie charts were drawn to intuitively display the distributions of different categories ( Figure 9). As      can be seen from the figure, based on the qualitative data for five unknown refrigerant amounts, categories 1 and 3 account for the largest proportion; that is, the corresponding refrigerant may range from 30 g to 37.5 g.

Analysis of Results.
ere are two explanations for the above results.

Refrigerant Amount Varies Discretely according to the
Label Given. For each data set, according to the prediction results, the predicted refrigerant amount having the highest percentage was selected as the optimal refrigerant amount for that data set. Table 6 shows the optimal amounts for the above five groups of refrigerants.

Future Model Modifications.
e temperature variation rule for the original data is segmented cooling. After data cleaning, a breakpoint occurs in the second cooling after each temperature rise. erefore, the most appropriate data processing method should be applied to the section cooling data as a whole.
ere has been no internal correlation analysis of data parameters and no specific analysis of the internal correlations of parameters, and the model could also be modified in this regard.

Summary.
is section has introduced the BP neural network, defined the symbols, categorized the refrigerant amounts, and then applied the BP neural network to training data, training the generated model to predict the unknown refrigerant amount of XXg data, set refrigerant amount data set, and drawn the following conclusion: e value for the unknown amounts of refrigerants was most likely to be 32.5 g.
Next, in order to verify the BP results, an RBF radial basis neural network will be used to make predictions, and the results will be compared.

Establishment of RBF Model and Analysis of Loss Function
According to RBF theory, before implementing the algorithm, the center of the basis function should first be determined, as it can directly affect the time and space used for network training. Second, from the hidden layer to the output layer, the weight w and the bias value b are involved, and these cannot be determined in advance. To address the above problems, the following solutions are proposed for implementation at the beginning of the algorithm: (1) Determination of the location of the center of the basis function: for a data set with a small quantity of data, when the spatiotemporal complexity (time complexity and space complexity) is not limited, take random points to determine the center of the basis function. For a data set with a large quantity of data, having higher precision requirements and certain requirements on space-time complexity, apply the clustering algorithm to obtain the center of the initial basis function for testing, such as the K-means RBF neural network [20]. (2) Determination of weight and bias values from the hidden layer to output layer of neural network: refer to the BP neural network for reverse error propagation, and update ω and b iteratively.
e flow chart and implementation design of this algorithm when used for nonlinear function fitting are shown in Figure 10. It can be seen from the figure that when the algorithm is applied to nonlinear neural network fitting, it can be divided into three steps: parameter initialization, network training, and network testing.

Implementation of Algorithm.
e RBF neural network for nonlinear fitting is defined as an RBF class. First, the neurons and the numbers of input layers, hidden layers, and output layers are initialized according to the sample data, and the weights and basis function centers are randomly assigned.
en, the forward propagation process is constructed, the Gaussian function is selected in the hidden layer, and weight w is trained by back propagation according to the data. Finally, the test data are brought into the network to obtain the predicted value. Some parameters of the established RBF network are shown in Table 7.

Loss Function Analysis.
e loss function adopts the mean square error and runs the RBF neural network. When the number of iterations was set to 500, it was found that the loss function rapidly converges to 8.72 (Figure 11). is indicates that the training of the RBF radial basis neural network is not as good as that of the BP neural network for this problem and the parameter values used. e parameters were adjusted several times, but the results were similar. erefore, we believe that the RBF model does not successfully extract ΔT (temperature variation), the change in temperature over time.

Summary.
In order to formulate a basis for comparison with the prediction results obtained by the BP neural network, this section used the RBF radial basis neural network to conduct code design and loss function analysis on the nonlinear fitting problem. e RBF neural network characteristically has the best unique approximation, a quickly converging learning process, good classification capability, multidimensional nonlinear mapping capability, good 10 Complexity generalizability, parallel information processing capability, and a simple and convenient learning algorithm. However, the network still has the disadvantage of uncertain parameters, and a training process for adjusting parameters is required for different data sets. In this practical application, the RBF neural network was not as effective as the BP neural network for feature extraction of numerical changes. erefore, the BP neural network is to be preferred when encountering a similar problem.

Conclusions
Different amounts of refrigerant will produce different temperature change data. After data cleaning and pretreatment, a model was established and trained to obtain a model that can predict refrigerant amount according to changes in temperature. Using this model, the relation between refrigerant amount and relevant parameters (temperature variation, cold storage temperature, etc.) can be established, in which the amount of refrigerant is the dependent variable, and the relevant collection parameters are independent variables. e amount of refrigerant can be predicted by studying the changes in relevant parameters through experiments. In this experiment, it was found that the unknown amount of refrigerant was most likely 32.5 g.
In practical production and in life, this model can be used to predict the amount of refrigerant in refrigerators with the best performance and to test and properly maintain refrigerators that have been sold or whose refrigerant needs replenishing.

Data Availability
e raw data were preprocessed as shown in Figure 2.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.