Design and Implementation of Cloud Platform for Vegetable Planting Field Operation Management

: Aiming at the problems of simple, extensive, inefficient and high consumption of traditional agricultural production management in China, this paper takes the field management of vegetable industry as the starting point, and adopts intelligent, flat and interactive field production and management micro services by building a mobile "Internet+small programs". The system is based on microservice technology, which solves the problems of PaaS platform in dealing with high logic complexity of business system and low system performance, realizes application splitting and decoupling, and improves the ability of agile development and rapid deployment; For the needs of agricultural production materials and tasks, production status management, etc., production materials, tasks and labor assignments, work time limits, task prompts, etc. can be realized. Through hierarchical authorization, enterprise administrators, warehouse keepers, and workers can view relevant basic information and data online at any time, accurately understand the distribution of field management resources, and make field management traceable and refined.


Introduction
In large vegetable bases, due to the large number of workers, many types of work, and many workload calculation rules, traditional field management mainly depends on experience, and the warehouse management and production management of agricultural materials and tools are extensive, which makes it difficult to achieve refined management. With the rapid development of Internet information technology, its application has involved all aspects of life. At present, the state strongly supports the development of agriculture through science and technology, and the construction of information platforms for the production, sales and management of agricultural products is of great significance for optimizing the allocation of agricultural resources and improving the market competitiveness of agricultural products.
Smart agriculture is a new agricultural production mode based on big data and artificial intelligence, which is mainly driven by intelligent machinery. It uses intelligent machinery to achieve seed management, harvesting and other aspects of agricultural and livestock products, achieve maximum returns with minimum investment, and achieve higher output and environmental protection requirements. At this stage, the main application of smart agriculture is focused on intelligent management and computing breeding such as visual remote diagnosis, remote control and disaster early warning of agriculture [1][2][3]. Gao Wei [4] analyzed the problems in the development of smart agriculture in China, and proposed countermeasures to promote the development of smart agriculture in China. It is necessary to increase the training of agricultural talents and the application of Internet technology. On the basis of fully analyzing the significance and objectives of the construction of the agricultural big data information collection platform, Li Tingting et al. [5] put forward the construction idea and overall framework of the agricultural big data information collection platform, described the information collection methods and content methods of the platform, designed the core functions of the system, and tried to promote the construction of the agricultural related information resource system by building the agricultural big data information collection platform. On the basis of years of experience and thinking in the agricultural and rural government information work in Guangdong Province, Wu Huilin et al. [6] designed the application service platform of agricultural and rural big data in Guangdong Province by taking the business application and data resource integration construction of Guangdong Provincial Department of Agriculture and Rural Affairs as the object and using modern information technologies such as big data, so as to achieve the goal of integrating relevant data inside and outside Guangdong Provincial Department of Agriculture and Rural Affairs, and build the agricultural and rural big data resource system in Guangdong Province, Eliminate data sharing barriers and improve data service efficiency. Liu Qinchao et al. [7] designed the cloud platform of Yan'an modern agricultural Internet of Things, realizing the precision, intelligence, scientific and practical management of greenhouse vegetables.
It can be seen that the combination of mobile Internet, Internet of Things, big data and other technologies with agricultural production and management has gradually become an important trend in the development of agricultural industry, and its application prospects are very promising [8][9].

System platform architecture and technology
For the framework design of microservices for vegetable industry field production management, this paper is based on the technology of microservices (lightweight SOA Service Oriented Architecture) to solve the problems of PaaS platform dealing with high logic complexity of business system, low system performance, and great difficulty in development and maintenance, to achieve application splitting and decoupling, and to improve the ability of agile development and rapid deployment. The platform framework is shown in Figure 1 below.

System platform architecture
(1) The communication between microservices adopts HTTP (s) protocol for communication. Based on the Web development interface RESTful API, it returns the highly readable JSON data format to achieve complete decoupling.
(2) The independent database, cache, message queue and cluster of each microservice can avoid the failure of one service affecting the normal operation of the whole cloud.
(3) The client (PC, mobile phone, tablet) requests are processed by the API Gateway, which is completely transparent, supports clustering, and avoids the occurrence of performance bottleneck.
In order to meet the needs of users in different roles, achieve the best user experience, and facilitate the application and promotion of the system, the system provides two microservice solutions: desktop application and mobile application (WeChat applet). The system structure is shown in Figure 2 below.

Key Technologies of the system
The Key technologies used in the system development are as follows: (1) The application of https security communication protocol and OAuth2.0 security authentication can maximize the protection of user data security. Each information system accesses the platform in the form of service through its own RESTful Web Service interface. At the same time, each information system extracts and encapsulates the data to be exchanged and shared into services and registers them in the service registry of the platform. Users and platforms authorize users through OAuth2.0. After the business system directly authorizes, information exchange and sharing can be carried out to ensure the safe access of data, To prevent information disclosure and malicious access, and reduce the coupling between systems.
(2) Zookeeper is used as the service registry to realize the registration and monitoring of services and achieve high availability, high concurrency and high performance of the system. As a distributed service framework, Zookeeper is mainly used to solve the consistency problem of application systems in distributed clusters. By providing data storage based on a directory node tree similar to the file system, Zookeeper maintains and monitors the status changes of the stored data., Thus, data based cluster management can be achieved. In some processes, if multiple threads need to operate on the same common variable at the same time, data synchronization needs to be guaranteed by locking to prevent thread safety problems that may occur when multiple threads operate on the variable at the same time. In this system, the system uses the concept of microservice to split services for separate deployment, and the application is clustered, so data consistency is difficult to be guaranteed. Therefore, the system effectively guarantees data security by designing a Zookeeper distributed lock based on the mainstream, which is mainly realized by the temporary order of Zookeeper nodes. Each instance will sleep temporarily after creating a node, Then compare the temporary node created by the instance with the smallest node obtained to obtain the distributed lock. The Zookeeper client communicates with the background server through a long TCP connection. Each time the Zookeeper distributed lock is acquired, a ZKClient instance object needs to be created. After the distributed lock is acquired, close the ZKClient. The distributed lock scheme based on Zookeeper has high stability. If the lock cannot be obtained, just register a listener. There is no need to actively try to obtain the lock, and the performance overhead is small and stable.
(3) The Platform of this project use Redis high speed cache to improve the storage and access capability of massive data. With the continuous use of the system, a large amount of data is continuously added to the database. Due to the performance limitations of the database itself, if you directly connect the database to operate the data in the database, you cannot support high concurrency read and write operations. Data caching technology effectively solves this problem. At the database level, the structure of the database is optimized and designed. Redis is used as the database cache. As a memory cache database, Redis has unique advantages in processing huge amounts of data. It has good performance and read-write capabilities, which can greatly improve the storage and access capabilities of massive data; Set clustering schemes such as master-slave replication and read-write separation for the MYSQL database to effectively guarantee the security of database data and ensure the continuous stability of database services (4) The cloud computing platform developed based on the J2EE technical framework realizes the interconnection with WeChat small programs by authorizing open APIs, and ensures the high availability and reusability of the system.Based on SaaS mode, users can apply the system through registration and configuration, which is easy to use and promote.Accordingly, The harvesting and weighing APP suitable for vegetable industry was developed. Through weighing, the harvesting data of agricultural products, such as geographical location stamp and time stamp, were automatically obtained. The concurrent problem of uploading weighing data from multiple terminals at the same time and writing data in batches was solved, and the accuracy and reliability of the data were improved.

Platform Functions and Implementation
The purpose of developing the vegetable industry production management cloud platform is to improve production efficiency, reduce production and operation costs, and directly solve the practical difficulties of production management for agricultural enterprises. Through the implementation of the cloud platform, we can also collect big data on production management of agricultural enterprises. For example, we can accurately calculate the field production time of crops in specific plots in the fruit and vegetable base, including weeding, spraying drugs, sowing, fertilization, water spraying, etc. These accurate production data provide strong data support for further research on basic data on improving vegetable quality and other issues.

The basic functions of the field production management platform
The basic functions of the field production management platform definition are: (1) Basic Definitions: including: type of work (including labor cost), furniture, agricultural materials, etc. Different types of work set different working hour standards, and specific classifications and definitions of furniture and agricultural materials.
(2) Assignment of work tasks: the supervisor shall designate staff to complete a certain field work, such as weeding, spraying medicine, sowing, fertilizing and spraying water.
(3) Employment management: select the person in charge of the work, time, place, quantity or time, completion, completion confirmation and other functions. Carry out overall management on the employment to improve the efficiency of management. For example, the specific employment is assigned to the corresponding person in charge, and the work is managed and supervised by a specially assigned person.
(4) Salary Settlement: generate salary settlement documents by time period according to user data. In order to reduce the burden on the staff, and at the same time to improve the wage efficiency and avoid bad behavior of cheating, the wage settlement adopts electronic calculation and distribution list record.
(5) Agricultural material inventory: through agricultural material inventory management, complete the inventory status management of agricultural materials. This function greatly reduces the burden of the original management staff. The agricultural materials inventory management system is used to register and manage the agricultural materials entered, so as to know the inventory situation in time, and then timely handle or supplement the corresponding agricultural materials.
The above functions have been put into production. Due to the limited space, the sowing and harvesting functions are selected for display and analysis.

Graphical interface of the platform
(1) Graphical interface of sowing and harvesting function in the platform, as shown in Figure 3. (2) Detailed information interface of harvesting. By selecting a piece of land, you can enter the detailed collection interface of the land to display the date of collection, vegetable type, yield, settlement, etc., as shown in Figure 4 below.It can be seen in the figure that on April 26, 2020, the vegetable variety collected was the Chinese flowering cabbage, the harvest yield was 145.5 kg, the settlement was 142 yuan, and the vegetable bonus was 99.4 yuan. At the same time, the total output, settlement and total vegetable awards of all vegetable varieties in the area can be summarized.

Conclusions
Based on the technology of micro service (lightweight SOA Service Oriented Architecture), this paper solves the problems of PaaS platform in dealing with high logic complexity of business system, low system performance, and great difficulty in development and maintenance, realizes application splitting and decoupling, improves the production efficiency of vegetable agricultural enterprises, reduces the cost of agricultural production, and promotes the upgrading and development of agricultural industry. The characteristics and innovations of this paper are: Through desktop applications and small programs, dynamic decision-making schemes and intelligent real-time monitoring can be realized. In practice, it can be handled at any time according to user needs.