I. INTRODUCTION
Nowadays, China's agricultural production is still dominated by traditional production methods. The traditional production method will waste a lot of manpower and material resources, which is not conducive to the development and progress of China's agricultural industry, and its production method does not conform to the current development concept of sustainable development. With the rapid development of society and technology, smart agriculture will definitely be the main direction of agriculture in the future. Technology such as modern industrial control technology and wireless communication will also be gradually widely used in it.
The intelligence of smart agriculture is mainly reflected in the technical intelligence applied in the agricultural production process. The current stage of smart agriculture is an advanced stage of agricultural activities based on the information and communication technology platform. In a sense, it is an inevitable product of the information age. It is generally believed that the main content of “smart agriculture” is to integrate advanced computer technology, information communication technology, embedded technology, etc. in agriculture to make agriculture more flexible, efficient and intelligent. Let the existing resources of agriculture be used reasonably and increase agricultural output. To increase the competitiveness of Chinese agricultural products in the market.
Smart greenhouse is a specific realization of smart agriculture. Smart greenhouses use sensor networks to apply modern technology to agricultural production, and achieve high-quality and high-yield goals by adjusting the temperature and humidity in the greenhouse. As the main application technology of smart greenhouse, wireless sensor network can not only realize the functions of data collection, processing and transmission, but also can achieve the ability of strong networking ability and long transmission distance. A wireless sensor network (WSN) is composed of a large number of cheap miniature sensor nodes. These miniature sensor nodes are connected with each other through wireless communication technology to form a multi-hop self-organizing network system, and send the information to the management node after gathering [1-3]. Because the number of nodes is large, the deployment range is wide, and the environment in the deployment area is complex, it is unrealistic to supplement the node energy by artificial means [4]. Therefore, reducing the energy the nodes consume and prolonging the working cycle of the network has become a key issue in the current research.
With the continuous improvement of energy harvesting technology, sensor nodes such as solar illumination, thermal temperature difference, and mechanical vibration can supplement electricity from the environment themselves, thus possessing the characteristics of self-supply. This wireless sensor network with energy self-supply nodes can solve the problem of limited survival time in traditional sensor networks [5]. However, due to the influence of environmental energy itself by many factors, the energy supply of self-powered nodes is unstable. How to make nodes effectively save energy and prolong the life of the network is an urgent problem to be solved in the current wireless sensor network. Rational clustering is one of the alternatives [6].
In order to balance the energy consumption of wireless sensor networks and prolong the network life, a variety of clustering algorithms [7-10] and network clustering algorithms for energy self-sufficient nodes have emerged [11-14]. The cluster refers to a group of these nodes within the wireless sensor network that are organized to communicate more efficiently. The network is divided into clusters to optimize data transmission and reduce energy consumption. Each cluster has a head node, which is selected based on certain criteria. The LEACH (represent as Low Energy Adaptive Clustering Hierarchy) protocol [10] is one of the earliest classical clustering algorithms. The basic idea is to select the cluster head circularly by calculating the probability, and distribute the energy burden of the whole network to all the sensors in the network. On the node, the network consumption is further reduced, and the purpose of prolonging the working life of the network is achieved. However, in the LEACH algorithm, selecting nodes with low residual energy or nodes which are very far from the base station as cluster head nodes will cause those cluster head nodes to die prematurely, resulting in a “fault” in the network.
In order to realize the intelligent collection and monitoring of greenhouse temperature and humidity, this paper combines wireless communication technology, computer network technology and single chip technology to build a long-distance and low-power wireless sensor network. At the same time, in view of the challenge that network energy consumption is very critical, this paper improves the algorithm of literature [6]. based on the LEACH clustering algorithm. The designed algorithm not only considers the average energy of the network in each round of operation, but also includes the distance from the node to the base station, the effective round of network operation and the energy remaining of the node after each round of operation. The improved method fully considers the situation that the node that has been the cluster head can be repeatedly selected as the head node, and maximizes the utilization of the nodes.
II. RELATED WORK
As a clustering algorithm, the fixed clustering algorithm can greatly reduce the clustering overhead and balance the size of each cluster [15]. Literature [16] proposed a fixed cluster area routing algorithm. The algorithm improves system performance by improving the particle swarm optimization (PSO) algorithm. PSO is a computational method that optimizes a problem by iteratively trying to improve a candidate solution with regard to a given measure of quality. It simulates the social behavior of birds within a flock or fish schooling, where each particle adjusts its position based on its own experience and the successful experiences of other particles, aiming to find the best solution [17]. The algorithm comprehensively considers the distance between the cluster and the sink node, the distance between the nodes in the cluster, the remaining energy and other factors. Literature [18] proposes a multi-hop routing protocol with fixed clustering and energy balancing. Clustering is based on the genetic simulated annealing algorithm. Literature [19] proposes a fixed-area clustering routing algorithm for heterogeneous networks, which comprehensively considers the remaining energy of nodes and the distribution of nodes in fixed partitions of the grid to elect cluster heads. In [20], a grid-based clustering routing algorithm is proposed. This method sets an energy threshold, and when the number of neighbor nodes whose energy is lower than the threshold exceeds a certain number, a new cluster head is generated through a unique cluster head election method.
Literature [21] proposed an adaptive clustering routing algorithm based on solar energy supply node energy. According to the characteristics of sunlight, the algorithm divides the energy states of nodes in the network into three categories. Nodes in different energy states set different thresholds to choose the cluster head, calculate the optimal communication distance between clusters, and transmit data to the sink node through multiple hops. In literature [22], factors such as the distance from the cluster head to the node, the degree of the node, and the remaining energy of the node are used as weights, and the entire network is divided into clusters of different sizes. Then, the cluster head node will construct the optimal transmission path according to the distance and remaining energy, and transmit the data to the base station and the single hop in the cluster through inter-cluster multi-hop. Although the above algorithm optimizes the data transmission path, traversing the network will consume the energy. Literature [23] proposed a new improved algorithm on this basis, and alleviated the problem of unbalanced node load in this area by selecting transmission nodes in the “hot spot area". In the non-"hot zone", the cluster head will be selected according to the remaining energy of the node, and the remaining nodes after the cluster head is selected will join the cluster closest to it. The improved algorithm re-elects cluster heads after each round, which reduces energy waste.
In literature [24], the Wireless sensor networks non-Uniform Clustering Hierarchy (WUCH) algorithm is proposed, which uses the distance from the node to the base station and the residual energy of the node as performance indicators. It divides the network into clusters of different scales, elects dual-cluster head nodes from the larger-scale clusters, and the primary and secondary cluster heads share different tasks, so as to alleviate the excessive energy consumption of the cluster head nodes. In [25], a cluster head selection algorithm using double-layer fuzzy control is proposed. The performance parameters such as the energy of the node, the number of adjacent nodes, and the distance from the base station are used as the input of the membership function to obtain the optimal node of the selected cluster head in the network, thus ensuring the energy balance among the cluster head nodes.
III. SYSTEM DESIGN
The intelligent greenhouse monitoring system is mainly composed of a wireless sensor network slave system, a wireless sensor network host system, and an Internet of Things (IoT) monitoring and management subsystem.
The wireless sensor network slave system is responsible for the collection of environmental data such as temperature and humidity in the greenhouse, as well as communication with the wireless sensor network host. The host system is responsible for monitoring and managing the sensor network subsystem, collecting the environmental information in the greenhouse collected by each slave, and transmitting it to the host computer and the cloud platform to issue monitoring instructions, and summarize data to the host computer and server. The IoT monitoring and management subsystem is composed of the computer and the IoT cloud platform. The computer communicates with the host system of the WSN through the serial port, and controls the wireless sensor network host system to receive the greenhouse information collected by each slave subsystem, and will receive the information. information reporting. The host system of WSN is connected to the IoT cloud platform through Wi-Fi to display the current environmental information in the greenhouse collected by multiple slave subsystems, and support real-time query of the monitored greenhouse information through the Internet and mobile terminals.
The intelligent greenhouse monitoring system includes a host subsystem and multiple wireless sensor network slave subsystems. The host subsystem mainly includes a low-power main control processor, a wireless transceiver module, a Wi-Fi module and an interface module that communicates with the host computer. The slave subsystem mainly includes a low-power main control processor, a wireless transceiver module, a display module and an environmental data acquisition module.
The hardware part of the sensor network slave subsystem mainly includes the temperature and humidity sensor AM2301 module, S14463 wireless module, USB serial port module and low-power LCDl602 display module. The main control chip has rich interfaces, simple operation and low power consumption mode. The temperature and humidity sensor uses AM2301, and the single bus protocol is used for communication between AM2301 and the main control chip, which responds quickly to the environment and occupies less resources. The wireless module selects the S14463 chip, and uses the SPI protocol to communicate with the main control chip. The working frequency of the wireless module is 433 MHz, and its ability to circumvent obstacles and anti-interference is stronger than that of ZigBee, which is suitable for long-distance communication. In addition, the S14463 also has a low-power mode, which can reduce the power consumption of the entire system to a certain extent.
For the hardware structure of the host subsystem, the power supply module uses a 5 V adapter to supply power, the microprocessor uses MSP430F149 as the main control chip, and the wireless module also uses the S14463 chip to communicate with each slave subsystem. The host subsystem uses the Wi-Fi module to upload data to the cloud server.
The IoT monitoring and management subsystem includes the host computer and the IoT server. The local host computer stores the received greenhouse environment information into the local database through the serial port, and calls the system function to process the information in the database, so that the user can view the changes of the greenhouse environment parameters. Curve and monitor real-time greenhouse information. At the same time, a historical data query function is also designed to support the query of historical information in the greenhouse.
The function of the cloud platform is to implement the remote management of the information in the greenhouse, and the host will report the collected greenhouse environmental data to the IoT cloud platform for data processing. Once the data processing is completed, users can remotely manage the conditional information of the greenhouse through the mobile phone APP, WeChat, or Web.
IV. LOW-POWER WIRELESS SENSOR NETWORK ALGORITHMS
This paper adopts the energy model used in [26]. The energy consumption of the sender sending L-bit data is shown in equation (1):
In the equation, Eelec represents the energy consumption of the transmitting circuit. is the threshold for dividing the spatial model. d represents the distance, which refers to the length between the sending node and the receiving node in this paper. εfs or εamp depends on d0. If d is less than d0, use εfs; otherwise, use εamp.
The energy consumption of nodes receiving L-bit messages is shown in equation (2).
The head node needs to process the data sent by other nodes in the network. This part of the energy consumption also needs to be paid attention to. The energy consumption equation of this part is shown in equation (3).
In the equation: Eda is the energy consumption of unit data message aggregation.
The operation process of the LEACH is carried out in “rounds". Each round of operation includes the following stages: the initialization stage of the network and the steady transmission stage of node data in the cluster. In the first stage, each node chooses a random number between [0,1] to determine whether the node can turn into the head node of the current round of transmission. If the difference between this value and the already determined T(n) is less than a threshold, the node can be selected as a cluster head node. Meanwhile, the newly appointed cluster head node will send out a broadcast to the other nodes, informing them of its new role as the head node. Based on the information provided by the head node, the other nodes will then make a decision to affiliate with a node within the cluster. Once the cluster is complete, the system will start the node data transfer phase. At this stage, common nodes transmit data using Time Division Multiple Access (TDMA) protocol, cluster head node will process messages from other nodes and send them to BS. This process is repeated each round. Among them, in the cluster head formation stage, the expression of the network threshold T (n) [27] is shown in equation (4):
Aiming at the deficiency of LEACH algorithm, this paper makes the existing algorithm based on LEACH better. The improved algorithm is divided into two stages like the LEACH algorithm.
In the cluster formation stage, the average energy of nodes in the entire system is first considered. The calculation equation of the average energy is shown in equation (5).
In the equation: Eto represents the sum of the energy of all nodes in the entire network.
In the selection of cluster head nodes, the improved algorithm optimizes the selection method of cluster head nodes, and the remaining energy of each node in each round of operation is added to the selection function of cluster head nodes. The improved equation is shown in equation (6).
In the equation: nalive is the surviving number of nodes in the network system operation, Ere is the energy remaining size of each node in the network operation, and Ebe is the initial original energy of each node in the network.
The original algorithm uses the weighting idea to make the nodes generate weights based on node energy and density to optimize the selection of cluster head nodes. The weight equation is shown in equation (7).
where Eres is the residual energy of the node in the network, E0 is the initial energy of the node, nneb is the number of neighbor nodes of the node, Ncul is the number of members in the cluster head node, and γ1 and γ2 are the weight influence factors.
The improved threshold equation according to the above weight equation is shown in equation (8)
Optimizing the weight values in the original algorithm does not take node distance into account. According to the existing algorithm, after a node is selected as the cluster head node, as long as its energy remaining is still greater than the average energy remaining in the current network system, it can still be selected as the head node again. This is not good for energy optimization. The main problem with these is that no node distances are considered. Therefore, it is necessary to consider the remaining energy of the node after each round of operation, the number of network operation rounds, and the distance from the node to the base station. The improved threshold equation is shown in equation (9).
In the equation: Er−re (i) is the total remaining energy after each round of operation, rre is the number of remaining rounds, where rre = r − rnow. rnow is the number of rounds currently running, dmax, dmin, dto−BS are the maximum and minimum distance values from each node to the sink node, and the size of the node in the current round to the sink node respectively. The more remaining energy and the closer the distance to the sink node, the more likely to be selected as the cluster head node.
The cluster head node assigns specific time division multiple access (TDMA) time slots to each common node within the cluster for data transmission. This arrangement prevents data collisions by ensuring that only one node transmits data at any given time. It also enables non-cluster head nodes to remain in a dormant state, conserving energy by not sending data until their designated TDMA time slot arrives. With this setup, the network's energy consumption is minimized. Once this process of allocating time slots and setting up the cluster is finished, the network transitions from the clustering phase to the data transfer phase.
In the data transmission stage, for the cluster head node, there will be energy loss in these aspects. The first is the energy loss when the cluster head node receives data transmitted by other nodes. Since other nodes in the cluster are constantly sending data to the cluster head node, the cluster head node will also generate energy loss when receiving. Secondly, it is the energy loss generated when the cluster head node aggregates the data. The cluster head node needs to aggregate the data sent by the nodes in the cluster and the data generated by itself, and then transmit it to the outside. This part will generate the third part of data loss, that is, the loss when sending data to the sink node. The entire energy loss equation is shown in equation (10).
The energy loss of common nodes in each cluster is shown in equation (11).
Then the total energy consumption of the network is shown in equation (12).
in literature [28] is adopted. Let , the equation for calculating the optimal number of cluster heads k can be shown in equation (13):
V. EXPERIMENTAL EVALUATION
The designed algorithm aims to improve the energy consumption of the wireless sensor network, thereby prolonging the service life of the network. This paper uses simulation software to evaluate the performance of this algorithm. The designed algorithm is compared with the existing research. There are three methods involved in the comparison in this paper, namely Modified LEACH [29], SEDT-LEACH [30] and EMPB-LEACH [31]. In the experiment designed in this paper, the network consists of 140 nodes, which are randomly distributed in the area to be tested of 100 m×100 m, and the Sink node is located in the center of the area to be tested. The percentage of cluster heads is defined as 0.05.
In this Section, comparing our method with the other three methods to visually highlight the performance of the designed method. The details of the experimental results can be seen in Fig. 1 and Fig. 2. First, this paper evaluates the relationship between the number of surviving nodes and the communication time (number of rounds) in the whole wireless sensor network when running four different algorithms. The experimental results are given in Fig. 1, where the vertical axis represents the evaluation index, that is, the number of surviving nodes in the entire network. The horizontal axis represents the communication time in the wireless sensor network, taking the number of communication rounds as the unit. From the experimental results, among the four comparison algorithms, the node death rate of the designed algorithm is obviously lower than that of the other three algorithms. In addition, the node death time of our method is later than the other three compared methods. This phenomenon shows that the designed algorithm can prolong the service life of the entire network and achieve the purpose of improving the energy consumption of a single node. For a single node, lower energy consumption means that the node can live longer and thus die later. Specifically, when the number of rounds of communication in the entire network reaches 1,000, the number of surviving nodes in the algorithm presented in this paper has a relatively steep decline curve, indicating that the nodes in the network have entered a stage of rapid death. When the number of communication rounds reaches 1,500, the communication frequency of the whole network decreases due to the obvious reduction of the total number of communication nodes. At this time, the descending curve of the number of surviving nodes tends to be flat. Among the other three comparison methods, Modified LEACH outperforms the other two methods. As the number of communication rounds increases, the number of surviving nodes decreases uniformly. Among all the algorithms participating in the comparison, the number of surviving nodes of the EMPB-LEACH algorithm decreases the fastest.
Fig. 2 shows the situation that all four algorithm node data messages are sent to the sink node. Among them, the x axis means the number of communication rounds, while the y axis is the total amount of data gathered on the network, and the unit is 104 bit. Consistent with the previous results, the designed algorithm has the best performance. Since the network duty cycle of our work is longer than that of the other three compared algorithms, the total data volume of the method in this paper will not increase after more than 1,900 rounds of communication. Compared with these three methods, the data transfer volume is increased by about 2.0 times, 3.7 times and 5.8 times. Among all the methods, the EMPB-LEACH algorithm transmits the least number of data packets to the sink node.
This is because the algorithm designed in this paper optimizes the selection process of cluster head nodes. Specifically, the selection of the cluster head node not only needs to take into account the distance from a single node to the sink node, but also needs to pay attention to whether a node has a chance to be selected as a cluster again after being selected once. The original algorithm ignores this consideration, and when the remaining energy of the cluster head node is higher than the average energy in the management domain, it may be selected as the cluster head again. Afterwards, the node utilization is maximized by increasing the size of the packets received by the sink node. To sum up, the algorithm proposed in this paper is significantly better than other methods in prolonging the network lifetime and improving network throughput.
VI. CONCLUSION
The application of advanced embedded sensing and communication technologies in agriculture has strongly promoted the development of smart agriculture. One of the biggest challenges is to manage the energy consumption of wireless sensor networks, so that communication nodes can save energy and prolong the life of the entire network. This paper proposes an intelligent greenhouse monitoring system based on low-power wireless sensor network technology, which integrates the IoT technology and intelligent wireless sensor networks. Considering the deficiency of the traditional LEACH optimization algorithm, an improved LEACH algorithm is proposed based on the random selection of the cluster head node and the unreasonable membership of the member nodes in the initialization stage of the LEACH clustering algorithm. The results of the evaluations show that the improved algorithm has obvious performance advantages.