Abstract

In the traditional case, the uncertainty of the ambient temperature measured by the experiential distributed sensor is considered. In this paper, a model based on the moving least square method in the fusion algorithm is proposed to study the optimal monitoring point of the sensor in the greenhouse and determine the most suitable installation position of the sensor in the greenhouse to improve the control effect of the temperature control device of the system. MATLAB simulation software is used to simulate each working condition of the greenhouse. Temperature data measured at 15 locations in the greenhouse were used to evaluate all possible combinations of monitoring locations and to estimate the optimal location for indoor temperature sensors. Compared with the traditional method, the error is reduced to 0.373, and the data are more accurate.

1. Introduction

At present, China has implemented greenhouse energy-saving planting projects and intelligent technology is applied to the modern greenhouse control system. Proper control of temperature, humidity, and carbon dioxide concentration in greenhouse can effectively improve the growth speed, quality, and yield of crops [1]. All biochemical reactions of crops in the whole growth cycle require appropriate temperature. Compared with other environmental factors, temperature is a decisive factor for crop growth and development. Therefore, the study is of great importance to the high efficiency, energy saving, and high yield under the premise of greenhouse temperature analysis.

During the temperature data measurement in a greenhouse, a limited number of sensors are usually installed to improve the overall cost performance. In general, sensor locations are determined by experience. However, according to the empirical distribution measurement results, the correct representation of the whole temperature environment in the greenhouse is uncertain. Therefore, it is necessary to select the best installation location for a limited number of sensors to accurately monitor the internal temperature of larger greenhouses.

Currently, the studies on the optimal sensor placement are mainly to measure the stability of the internal detection system in a specific environment and to determine the optimal sensor location in different measurement environments. The new technology based on truck GPS trajectory optimization deployment strategy in the California highway has been investigated: one is to establish a flow measurement based on the intercepting model flow weighting factor with emphasis on different body position and another is to set up the truck and choose different relative position recognition model to determine the best position of identification of heavy truck movement [2].

A unified TWLS framework was proposed for the joint location estimation of multiple disconnected sources and sensors based on a more general measurement model, which can be applied to many different localization scenarios [3]. A sensor network design strategy for monitoring nonlinear dynamic chemical processes using UKF was proposed to approximate the true mean and covariance of a nonlinearly transformed random variable, till the third order was correctly performed with a low computational workload [4]. A four-stage program for a practical solution was developed to predict seismic displacement responses on all building floors using accelerometer measurements in optimized sensor positions. A recursive neural network based on multiscale attention was proposed [5]. Based on the response mode analysis, the position optimization scheme of monitoring sensor for a deep-water drilling riser was proposed to predict the optimal position according to the principle of maximum response acceleration amplitude by selecting main excitation modes and considering the tilt angle of riser [6]. Wang Xiaoping et al. established a two standard model for the optimal sensor placement, by which gas concentration could reach the given value and the maximum in the shortest time [7]. Bowen et al. selected the position and number of measuring points of a scramjet combustion chamber with a genetic algorithm and obtained the best sensor position and number by using the global optimal search and large-scale parallel computing capability of the genetic algorithm [8]. A probabilistic scheme for sensor monitoring in a discrete nonlinear state space was proposed to estimate the probability density function of the state and the measurement noise covariance, which is considered as a random variable. With the variable decibel Bayesian method, a quantitative index characterizing the measurement quality and satisfactory state estimation was obtained [9].

However, the existing studies in sensor placement method enhances unceasingly perfectness, but the precision control is largely limited by the accuracy of the model and the complexity of measurement environment conditions. Due to the crop growth models, greenhouse temperature, forecast model, and so on, there is a certain distance from the actual production requirement of greenhouse.

Based on the crop growth model and performance index function, the Pontryagin’s maximum principle (PMP) was used to calculate the optimal set value of greenhouse daytime temperature at different temperature and light levels [10]. The computer optimization system of greenhouse heating control target based on energy consumption prediction model was established [11], which can optimize and calculate the greenhouse temperature setting points during the day and night. A SVM prediction model for the photosynthetic rate was established to realize the increase of CO2 application on demand [12]. All possible combinations of monitoring positions were evaluated in [13] and the best sensor position was selected by many sensors. Two methods were used for the optimization: sensor placement based on error and sensor placement based on entropy. By the former method, the sensor locations can be selected where the monitoring data are close to the reference value, i.e., the average data of all measured positions. By the latter method, sensor locations that are subject to poor environmental control due to external weather conditions can be selected.

In view of the disadvantages of reference setting as the average value and the demand objectives of crop growth characteristics, energy consumption, economic benefit, etc., the simulation temperature of indoor environment was calculated by the moving least square (MLS) method, which was proposed systematically by P. Lancaster and K. Salkauskas in the early 1980s [14]. The MLS has two major improvements [15]: (1) it is more convenient to establish the fitting functions instead of the traditional polynomials or other functions and (2) it introduces the concept of compact support, i.e., the value y at point x is regarded as only affected by nodes in the subdomain near point x, which is called the support domain of point x, while nodes outside the support domain have no influence on the value of x. In the process of fitting, different basis functions can be used to obtain different precision, and the same weight function can be used to change the smoothness of the fitting curve.

The mobile least squares method is developed based on the traditional least squares method with the high numerical accuracy for good mathematical theory support. This is also unmatched by other meshless methods, such as smooth particle method, unit decomposition method, reconstructed kernel particle method, and radial basis function method [16].

Therefore, by the moving least square method, the present study aims to investigate the best monitoring point of the sensor in the greenhouse, determine the most suitable installation position of the sensor in the greenhouse, and improve the control effect of the system temperature control device and the temperature environment quality in the greenhouse.

2. Materials and Methods

2.1. Multisensor Distribution Model Based on Data Fusion

Multisensor data fusion refers to the fusion of data collected by different knowledge sources and sensors to achieve a better understanding of observed phenomena. The moving least square method selected in this paper belongs to data layer fusion, as shown in Figure 1. First, the observation data of all sensors are fused, and then feature vectors are taken from the fused data for judgment and recognition. Data layer fusion does not have the problem of data loss, and the result is the most accurate, but it has a high requirement on system communication bandwidth [17].

2.2. Moving Least Squares
2.2.1. Establishment of Fitting Function

In the local region of a fitting function selected, the fitting function is [1823]:

In formula (1), , is called the basis function vector, which is a complete polynomial of order , and is the number of terms of the basis function. is the undetermined coefficient of the fitting function, which is compared with the traditional least square method. , the undetermined coefficient is the spatial coordinate function of .

Consider the weighted discrete normal form of residuals below:

In formula (2), is the number of nodes in the solution region, is the fitting function, is the node value at , and is the weight function of the node . In order to determine the coefficient , formula J should take a minimum value, so the partial derivative of its coefficient should be calculated as follows:

Substitute the following equations into formula (3)

By substituting the formula into f(x), the moving least square function is obtained as follows:where is called the form function and k represents the order of the basis function.

2.2.2. Weight Function

Weight function plays an important role in moving least square method. The weight function in the moving least squares method should be compactly supported, that is, the weight function is not equal to zero in a subdomain of , but is zero outside this subdomain, which is called the support domain of the weight function (that is, the influence region of ). Generally, the circle is chosen as the supporting domain of the weight function (see Figure 2), and its radius is denoted as . Due to the compact support of the weight function, only these data points contained in the influence region have an effect on the value of point .

The selection process of the influence radius is as follows:(1)First, the overall characteristic line is obtained through linear fitting;(2)Cycle each discrete point x again:(2.1)Determine the support domain size of discrete point x;(2.2)Determine the key nodes contained in the support domain of point x:(2.2.1)Translate the overall feature line to point x;(2.2.2)Calculate the distance between all nodes in x support domain and the overall feature line;(2.2.3)Select several nodes closest to the overall feature line as key nodes and eliminate other nodes in the support domain;(3)End the cycle of discrete points and use the moving least square method for curve fitting.

The weight function, , should be nonnegative and decreasing monotonically as increases. The weight function should also have some smoothness because the fitting function inherits the continuity of the weight function. The commonly used weight function is spline function, , then cubic spline weight function is shown in formula (10):

Figure 3 shows the cubic spline function curve, where the independent variables are the values of , and the dependent variables are the values of the mapped spline function. The influence region should contain enough nodes to make in (5) invertible.

Verified in the literature [15], in using the moving least-square method of curve fitting, the right to choose seven times spline function fitting curve effect is the best, but the large amount of calculation, and according to the example of this chapter, choose three to five times spline weight function was proposed to fit, take the high number of elected five or six times spline weight function. The fitting result is not as good as choosing cubic and quartic spline weight function. In general curve fitting, we can get better fitting results by using cubic spline weight function.

The derivation of the square matrix invertibility condition of the weight function is as follows: Suppose there is a node in the support domain of point , and the total number of nodes is . is the node. Due to , when node is in the support domain of , there is , otherwise there is , so there is a permutation matrix , which makes , so there is .

Moreover, the first behavior of the matrix :

Write , as the matrix formed by the last lines of , then

Because is positive definite, so .

If and only if the column vector is linearly independent, is linearly independent with respect to this node , , so is invertible if and only if our basis vector is linearly independent with respect to these nodes. In this way, when is a two-dimensional linear basis, the column vectors of are linearly independent if and only if there are at least three non-collinear points in the support domain. When is a two-dimensional quadratic basis, the column vectors of are linearly independent if and only if there are at least six points in the support domain, and these points are not on any one of the conics.

2.2.3. Optimal Sensor Position Model

The method based on moving least squares is used to select sensor locations that best represent the overall greenhouse environment. In addition, statistical indicators such as root mean square error (RMSE) and mean absolute percentage error (MAPE) are calculated to verify the accuracy of the measured data at the location selected by the moving least squares method.

is a measure of the difference between a composite trend and a reference trend. is a measure of predictive accuracy as a percentage of errors. Therefore, MAPE is used to assess the accuracy of the composite trend relative to the reference trend.

The comparison between RMSE and standard deviation is needed: Standard deviation is used to measure the dispersion degree of a set of numbers, while root mean square error is used to measure the deviation between the observed value and the true value. Their research objects and purposes are different, but the calculation process is similar. MAPE is expressed as a percentage, independent of proportion and can be used to compare predictions of different proportions.

Using these two statistics, the difference between the reference trend and the combined trend based on the number of sensors installed can be assessed. and are calculated using equations, and detailed calculations are shown in formulas (10) and (11).

Here, is expressed in , is expressed in percentage , is the total amount of data, is the value of the reference trend at a particular time, and is the combined value of the trend at a particular time.

Compared with the traditional error method, the method based on the lower basis function is adopted to obtain the shape function with higher continuity and compatibility by selecting appropriate weight function, and the numerical error after fitting is smaller. Substitute formulas (10) and (11) into A(x) and B(x) to obtain formulas (12) and (13).

3. Results and Discussion

3.1. Descriptive Analysis of Environmental Data

The internal environment of the experimental greenhouse was monitored, and temperature sensors were installed at 15 positions in the greenhouse [24], SHT 71, Sensirion, a Switzerland sensor, error range ±0.1 °C, as shown in Figure 4. The measured data were obtained by experimental temperature collection in summer (May-June), and the broken line graph of temperature data relative to position coordinates was drawn, as shown in Figure 5. After excluding missing data and rough error, the data were substituted into the moving least square model for verification experiment. Specific data are shown in Table 1.

In order to verify the effectiveness of the moving least square method, this paper selects different weight functions for comparison simulation under the condition of using the same bar function and quadratic basis respectively. Suppose that during the simulation, the range of influence area is 0.3 m, and samples are taken every 10 minutes. Under the same conditions, three different weight functions are simulated and compared, and the simulation results are output as simulated temperature curves. The results are shown in Figure 6, which is a simulated data graph by the moving least square method. Figure 7 is the actual measurement data connection diagram. The error function is analyzed, and the results are shown in Figure 8 and Table 2. The ordinate of Figures 6 and 7 is temperature in °C.

As can be seen from Figure 8, when the system model is established and the weight function characteristics are known, the moving least squares method has a good curve fitting accuracy and memory stability. However, when the weight function changes, its error characteristics will change. It can be seen from Figure 7 that the weight function with higher order has better fitting effect. When the system adopts the moving least square method, the error data of T11 and T13 are excluded due to the fact that there are also sensors in the vent. During the whole simulation process, according to the analysis and calculation of the error and combined with the data in Table 2, the optimal sensor can be located at the T10 sensor with the error closest to the fitting value, namely, the central sensor.

3.2. Validation of Experimental Data

In order to further verify the practicability of the proposed algorithm and consider the feasibility of the experiment, root mean square error (RMSE) and mean absolute percentage error (MEAN absolute percentage error) of statistical indicators are used for experimental verification. The results are shown in Table 3 and Figure 9.

As shown in Table 3, the error variation trend of the data of statistical indicators and is basically the same as that of the moving least squares method, that is, the position prediction model based on the moving least squares method is verified. At the same time, it can be seen from the temperature simulation surface shown in Figure 9 that the temperature measurement error of the sensor in the center of the greenhouse is consistent with the trend of the simulation error [25, 26].

4. Conclusion

In this paper, a simulation system based on the moving least square method is proposed, which overcomes the divergence problem of traditional error analysis under different weight functions. Based on the moving least square method, the optimal sensor position algorithm selects the corresponding weight function by judging the statistical index. When the error appears divergence, the corresponding position can be eliminated in time to avoid mismeasurement. The shortcoming of the algorithm is that the error stability of the moving least square method needs to be further improved when the weight function of low order is adopted. Therefore, in this paper, the moving least square method is used to study the best monitoring point of the sensor in the greenhouse, and determine the most suitable installation position of the sensor in the greenhouse, and improve the control effect of the system temperature control device and the temperature environment quality in the greenhouse.

An adaptive control model can be added to improve the control accuracy of greenhouse parameters. In order to further reduce static errors, a genetic factor proposed in [27] is used to summarize the historical errors, thus effectively improving the system stability. We can take advantage of the adaptive control system for the later research of the estimation error [28] and minimize the cost function of the fixed time by adaptive control scheme, in order to shorten the time of the system state to reach sliding mode surface [29] and the use of the finite time adaptive algorithm based on parameter estimation error [30], make more accurate measurement scheme, etc. In order to improve the stability of temperature measurement system, the Lyapunov stability theoretical analysis method proposed by [31] can be used.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This research was funded by the following projects: the Key Research and Development Project in Shandong Province (2019GGX101008) and College Students Innovation and Entrepreneurship Training Program (X202110424179).