Research and Application on Protected Vegetables Early Warning and Control of Mobile Client System

. Experimental vegetable production is greatly influenced by many environmental factors. There is urgent need to supervise its air temperature and humidity, soil temperature and humidity in the facilities information such as real-time monitoring, and timely early warning and control, in case of irreparable damage. This paper adopts the IOT technology to design and develop mobile client system which is used to make warnings and protect vegetables in order to realize real-time monitoring in the process of vegetable production in the aspects of timely warning of environmental information and control


Introduction
In protected vegetables production,when the light is few,light intensity weak,day and night temperature differ, relative humidity of air is high and air flow is not good(slow speed),or soil temperature and humidity is too high or too low, they have an effect on the normal growth and development of vegetable crops.At present, in the regulation and control of greenhouse, there are man-made management which means poor regulatory capacity,awful management, bad proportion of the input-output to cause final low economic rewards.If we want to get the normal condition for growth and development of protected vegetables, it is necessary to regulate environmental factor timely and scientifically which may possibly affect the growth of vegetables in the greenhouse to meet the need for the development of vegetable.
Internet of thing has a perception as its premise to realize fully interconnected networks between man and man,man and material or substances [1][2][3][4].Agricultural internet of thing makes use of the sensor to obtain environmental date through a variety of instruments to monitor real-time display or control the parameters which are involved in to ensure a great harvest in the aspects of the crops,livestock and poultry.At presence, foreign counterparts have widely adopted sensor of agricultural things of internet in the seeding,production,transportaion and storage,etc.Moreover, they have accomplished the successful monitoring in the aspects of packaging and irrigation and Chinese scholars have made initial achievement at home [5][6][7][8][9][10].
When we set up the system to monitor vegetable for early warning and control, most of people could not keep the computer next all the time which often caused the huge damage.However, mobile phones are often carried with you every second.The problem is solved by the establishment of a monitoring and control system based on the mobile client's facilities effectively.

System framework
The system makes use of c/s model to achieve the service mode of multi-clients sharing data.Taking advantage of WCF,receiving and storing,sending data can be realized.The main framework of the system [11][12][13][14][15][16] is shown in Figure1.

2.2.1Storage for remote data
In the system, the data transmission of the sensor is not regular.It may send a message to the server at any time.If the server acts as a connection to the remote and meanwhile needs to do a lot of I/O storage, the process will has a greater impact on database performance so as to influence the functional performance of the system.Therefore, this system tries to establish a specific database server which can alleviate slow performance effects caused by I/O storage.

Server balanced loading
Considering the future promotion of the system, if the data acquisition and equipment control were done in thousands of greenhouses, a steep pressure phenomenon may bring the slow response of the server, denial of server or system crashes and other issues.In order to prevent the occurrence of the problems, this system uses the NAT load balancing method, which means an external IP address is mapped into a plurality of internal IP addresses for each connection to convert every connection requirement to an address of an internal server dynamically,and meanwhile the external connection request is introduced to the server which is converted to the address to achieve the purpose of loading balancing.

WCF server
Windows communication foundation(WCF) is developed by Microsoft company as application interfaces of a set of data communication.WCF communication mode mainly has three kinds of simple request reply: simple request-reply mode;no replay model and double-replies mode(that is data communication happening between clients and server sensors who can send the message to the clients at the same time.)thissystem presents the last model to realize the data communication between client terminals and servers, between transmission terminals and severs and between control equipment and servers.

Automatic detection of server
This gateway system with a remote hardware client and the sensor is used in TCP/IP protocol.This is a long chain with each communication at least maintained by a connection.They are not the system resources to be saved.whenthe client is using a proxy,even if the client communication with the server channel breaks, the servers can not capture the information so that the client has been out of connection with the server while the server still helps client to maintain this communication,which caused the huge waste of resources.Therefore,the system uses the heartbeat program that is server sends a data package to every communication client from time to time.If packets fail, it will continuously try to send three times.If they all failed then the system will recover resources greatly to improve utilization rate of resource.

System control process
The sensor transmits the data to the control center through the LTE gateway and after that,control center after processing sent the warning data to the mobile phone user.Mobile phone user get early warning data and send control information to the control center.The control center will convert control information into commands to send to the LTE node in order to achieve the equipment control.

Data communication protocol
Data communication is important for the communication between the two parties in the network.Actual line in the internet needs to realize the communication with a hardware device or the server and the clients terminals to ensure the smooth running of the whole system.There are two kinds of main data communication format in this paper, a kind of is the data collected by the sensor, the collected data is sent to the server; another is the control data, the server receives from mobile client's instructions, and instructions are sent to the need to control the device.The data communication protocol is shown in table 1.

Early warning
When the various aspects of environment for growing crop changed over a given threshold value(the threshold's set up shown in Figure3) the system will automatically alarm and notify the user in the form of sound and vibration to show temperature and humidity greater than warning value data information and hence prompt the user to grasp the real-time to control the environment of the greenhouse condition and control the corresponding equipment to protect crops in better environment.

Device control
When the environmental information exceeds the threshold, the system can manually realize the straight control to the equipment (pump roller shutter) to achieve the timely control of the environment.As shown in figure 4 of the device control interface:

Conclusions
The paper adopts Web Services technique to explain the service of data collection,storage, early warning, controlled and provide the interface for clients and date communication; it mainly makes use of the IOT technology through the wireless network to achieve the communication between hardware and hardware for smooth data communication ; also, it applies language and database to achieve facilities and vegetables and remote control of the mobile phone client software.Thus this paper solves the time and space limit of data acquisition and control.After testing, if the sensor sends a data every ten minutes,environmental data can be received within zero point one seconds.When the phone after sending a control command, equipment can work within zero point one.
The system has been running for nearly a year in Jilin Province, and it has played an effective role in regulating the quality and yield of greenhouse crops.