Keywords

1 Introduction

In this ever changing world, the amount of data has been overwhelming and rapidly increased in the past few decades. The more data we have, the more difficult to collect, store, manage and utilize them. The newly emerged challenge is to select among the vastly abandon amount of data the least but most appropriate in the need of users of an information system. Personalized data is a concept to wisely select such information and present to the user.

The Department of Agriculture Extension of Thailand (DOAE) has very large databases and would like to utilize them to Thai farmers. Over several decades DOAE have been collecting data about farming in Thailand over various issues, including the farmers, farms, crops, harvest, costs and incomes. There are several systems using these databases for different purposes. However, it is yet to streamline the existing data into useful information to farmers. More importantly, the information should be personalized to fit with individual, and possibly unique, need for each farmers. In addition to DOAE’s databases, useful data from outside sources should also be collected and fed to interested farmers, individually. Such sources include various pages from Facebook, web pages and external database systems.

This work is driven by the passion of applying advanced research techniques in multiagent systems to real world usage, personalizing DOAE data to fit with individual needs of farmers. Having personalized data, farmers can make better decision then achieve higher yields and net profit. With regards to this passion, DOAE has developed a Personalized Data system, which will select and forward to farmers useful information that they really need. The system is composed of multiple subsystems, equipped with artificial intelligence technologies, accessible from various platforms. Among these system, the Suggestion Subsystem is meant to be very useful to farmers. This system deploy intelligent agents to collect the need of users, analyze for comprehensive need, then feed the appropriate data to the farmers. This system is among, if not, the first application(s) in Thailand that is equipped with such advanced techniques. The system is being used in Thailand, starting from certain areas and to be promoted and extended to farmers across the country. This article is focused on the News Feed, a feature of the system that delivering useful information of interests to farmers.

The paper is structured as following. We review related works in both push notification and agriculture domain. We discuss about the architecture, internal and external data sources of the system. We then present the multiagent system used for feeding news to farmers. This is followed by experimental results. Lastly, we conclude the paper.

2 Review

Delivering useful information to users is widely known as push notification [8]. In our context, we are to notify farmers with analyzed information of their interests. Artificial intelligence (AI)has been widely adopted as a smart tool to analyze complex problems in real world applications in recent years. An AI system that works on its own and reacts accordingly to the ever changing environment is defined by Russell et al. [6] as an intelligent agent. In complex systems, intelligent agents work together to accomplish the task of the system. Such systems are known as multiagent systems [7] (MAS). We found that there are not many multiagent systems be used for push notification, particularly, in agriculture domain. Given the complex and unique architecture, we need a simple but robust, yet, flexible, system to deliver information to farmers. Below, we shall review related works in both push notification and using AI in agriculture.

Guthula et al. [1] model a specific troubled agricultural sub-system in India as a Multi-Agent System and use it as a tool to analyze the impact of policies. Some policy options are examine to get an understanding of changes that may happen once such policies are implemented. The recommendations are delivered to only policy makers. Zaryouli et al. [2] develop an analytic system to provide to farmers reports about crop growth decisions by increasing yields and profitability of production for the farmer, to establish a predictive analysis on the impact of climatic change on red fruits. Perez-ponz et al.  [3] propose a multiagent system to help business make decisions in the purchase of sustainable agricultural products. The system helps choose a supplier for agricultural future market price forecast. Chevalier et al.  [4] investigates the use of a multi agent system for combining quadrotor and tracked robots in watering crops. The system is able to maintain the formation of the ground vehicles and provide a good tracking of the ground vehicles by the quadrotor. Gonzalez et al.  [5] use Intelligent multi-agent system for water reduction in automotive irrigation processes. The use of these intelligent technologies in rural areas provides a considerable saving of resources and improves the efficiency and effectiveness of agricultural production systems. Although these work use multiagent systems in agriculture, they differ significantly from our work.

Push Notification is about delivering requested and demanded information to recipients automatically and efficiently. In the following we shall explore related works. Okoshi et al. [9] use adaptive notification to break bottleneck of limited resources of users in Japan. They found that the click rate increases by 60%. Baruah et al. [10] evaluate a utility-based framework (gain vs pain) of push notification systems using Pareto optimality. It is found that the framework accommodate more user models and can work with information-seeking modalities. Wohllebe et al. [8] develop hypotheses on the effect of title, button and image on user interaction with push notifications. It is found that the use of a title seems to have a positive effect on interaction rates. Wheatley et al.  [11] explore news organizations’ use of alerts, considering whether they attempt to integrate with existing mobile-user behavior patterns or seek to be a disruptive element, garnering attention when audiences are not typically using devices. It is found that news organizations use the mobile channel for attracting and maintaining users’ attention, with varying interpretations of temporal customizability. Kodali et al.  [12] proposes a solution to monitor weather parameters, push them to cloud and notify their deviations to farmers. Saokaew et al.  [13] prototype a portable, small, smart, and off-grid photovoltaic system to provide an alternative electrical supply for a smart agricultural greenhouse. It is found that using internet of things with an MPPT charger controller enhances the prototype of smart farming as an alternative and green electrical resource. Ali et al.  [18] deploy A multi-agent coordination and control system to control multiple interacting agricultural vehicles involved in the crop harvesting process. It is found that multi-agent system allows concurrent planning and execution of the process, aiming to increase efficiency of the vehicles and improve cooperation between them.

Kim et al. [14] study the development of basic UX design element for Push Message in mobile commerce service by visual expression. It is found that users are divided into a four-dimensional structure and is able to change according to product, location and customer. Fraser et al. [15] use a number of benchmarks to evaluate process of push notification. They also propose models for users and adapted personalization. Bunch et al. [16] monitor complex chemical processes and flexibly using multiagent paradigm to notify the off-nominal conditions to key plant personnel in chemical industry. A Multi-perspective Analysis of Social Context and Personal Factors in Office Settings for the Design of an Effective Mobile Notification System. Seyma et al. [17] investigate the effects of social context, personal and mobile phone usage using multi-level model. They found that mobile application usage is associated to the responsiveness and work engagement/challenge levels of knowledge workers. They found that it takes 45 min to switch between applications and 5 min to response. Although there are various applications of push notification, none of them is similar to our work that collects data from internal and external sources, analyze the data and deliver to farmers.

Fig. 1.
figure 1

The overview architecture of the system.

3 Architecture, Internal and External Data Sources

Figure 1 depicts the architecture of this system. The system is composed of internal and external data sources, and four types of agents, residing in application servers and a mobile application. The system is used by farmers and DOAE officers. Millions of farmers in Thailand are categorized, according to their ability to access the information in the system, into seven layers, namely, individual, village, sub-district, district, province, region and country. Officers are be categorized into 4 levels, according to their roles and responsibilities, namely, district, province, region and country. Normally, officers in district level can configure accessibility for farmers in district, sub-district, village and individual levels. Below we shall discuss in details about data sources, auxiliary data sources, DOAE officers and farmers.

Internal data sources are seven major databases, including Farmer Registration (DB1), Digitized Farm Land (DB2), Current Crop (DB3), Disaster Victims(DB4), Large Farm (DB5), Efficiency Enhancement Centre (DB6) and Participating Farmer (DB7). DB1 is the largest one, composed of records of approximately 20 millions farmers in Thailand. The important data stored are details about farmers and their family members, farm lands, and crops. Altogether, millions of pieces of land comprising 24.16 millions hectares (238769 km\(^2\)) of agricultural farms. Major crops include rice, dry crops, fruits, vegetables and others. For each season, the data about lands, owners and crops are updated. DB2 is a very large set of complex information to help visualize lands in DB1. In addition, the data also suggest other useful data, such as water sources, both natural and artificial, elevation, etc. DB3 keeps track of current situation with respect to target plants within each season. DB4 maintains data about natural disaster on farm lands, including victim farmers, suffering farms and areas, etc. DB5 stores data about Thai government’s large farm project, which encourages Thai farmers to cooperate in order to help reduce costs and increase negotiation power. DB6 contains data about training projects that help introduce new technologies and knowledge to farmers. DB7 keeps track of government’s special projects, designed to support farmers, and participating farmers.

The external data sources are public groups in Facebook, Talad Thai (one of the largest market places of agricultural crops in Thailand), and other sources including government and private organizations. In Facebook, public groups typically specifies their common interests as keywords in the groups’ pages. These groups can be growers of organic vegetables, popular fruits, decoration plants, etc. There could be a few, tens or even hundreds thousands of members from all over the country. The members of these groups generally share information, knowledge, experience, etc., about which plants to choose, how to grow, how to take care, where to sell, etc., among themselves. Unfortunately, the access is limited only to members of the groups. It is inconvenient or unlikely for farmers to spend a lot of time to manually scan groups in Facebook for what is interesting for them. Since Thai government wants Thai farmers to try to optimally change crops for better prices, DOAE wants this system to help find interesting crops for farmers. Farmers specify their interests in this system through their mobile phones. The system scans related groups in Facebook and push notification back to farmers. Another source is Talad Thai, one of the largest market places in Thailand. Located just in the north of Bangkok, Talad Thai is a very large centre, where hundreds of tons of crops are collected from and distributed to locations all over the country. Based on this physical characteristic, Talad Thai also maintains a large crop pricing database, which is used as an outside data sources for the Personalized Data project. In the future, data from outside sources, such as weather forecast, irrigation data, can also be supplied to the system via application program interface (API) call between sources and this system.

Data from both internal and external sources are collected by collective agent based on requests of interests posted by farmers, and orders of demand posted by officers from all over the country. Farmers insert their interest in the system and wait for the analyzed information. DOAE personnel can also demand for analyzed data and forward the information to farmers later on. DOAE has nearly nine-hundreds offices located in all districts over Thailand. They simply use their desktop computer to submit the demanded information, which they can forward to farmers located in their respective locations.

In the next section, we shall discuss about our multiagent system.

4 Informative Multiagent-Based Personalized Data System

The main body of this system is a multiagent system, resides in server applications and mobile application. These agents are collective agent, analytic agent, disperse agent, and farmer agents. Instead of using other multiagent system, we did our best to follow the principle of multiagent systems. and make it as light and pragmatic, with regard to modern technologies (such as React Native), as possible. It turns out that we created this multiagent system from scratch. We shall discuss in details about these agents below.

4.1 Components of Agents

There are four types of agents in this system: collective agent, analytic agent, dispense and farmer agents. The first three agents, referred to as server agents, are a set of software residing on server systems in DOAE. Farmer agents are a small piece of software residing on farmers mobile phone.

Server agents are generally composed of Java classes, server shell script and SQL scripts. Both farmers and DOAE personnel interact with the system by specifying their interest via web-based or mobile applications. The interest will be stored in database. Server agents can be configured to work periodically or instantly. For the former, a set of shell scripts will be executed as cron jobs to control back end processes of server agents. Java classes are work horses for server agents. They are responsible for retrieving data from both internal and external sources, compute as needed, coordinate with external libraries for analytical computing, prepare data for visualization, etc.

Fig. 2.
figure 2

Delivering data to farmers via collective, disperse and farmer agents.

4.2 Collective Agent

This is the most important part of the system. The first part is to retrieve data from 7 databases, including crops, land, training, etc. These data represent what individual farmers do and are interested. Collective agent then analyze for direct keywords. The output is then sent over to analytic agent for detailed keywords. The detailed keywords are then sent back to collective agent, which use them to search for related issue available on Facebook, Talad Thai, or other sources. It is composed of a number of Java classes, React native files, and shell scripts distributed on various platforms working together as a single unit.

4.3 Analytic Agent

Analytic agent uses primary keywords from collective agent then further analyzes using its knowledge base for detailed keywords. At this first phase, one of the knowledge bases that can be used is OAM (Ontology Application Management), an ontology library developed particularly for Thai. Other tools can definitely be used. The architecture is designed to be scalable so that new technologies or more advanced algorithms can installed and work seamlessly with existing component in the future. The detailed keywords are then sent back to collective agent.

4.4 Dispense Agent

Disperse agent collects useful links for individual farmers from collective agent. The agent consults with configured data inserted by officer and sent over to DB9 (the database of the Personalized Data system). Note that the configuration is designed so that target farmers will always receive the information they are interested or intended.

4.5 Farmer Agent

This agent is a module resides on a mobile application, used by agent. The application is developed by React Native and is usable on both Android and iPhone, the two most popular smart phone platforms in Thailand. Farmers can configure how often the agent should accessed database and collect in information individually available to farmers. This is due to the fact that accessing database costs farmers some amount of money according to their package contracted to mobile phone service providers.

4.6 Scalable Design

The system is designed as a scalable framework for further extension and enhancement in the future. Better technology can be placed in the system as a module for each agent. For example, analytic agent may be equipped with more efficient ontology for generating related key words.

4.7 Algorithm for Collecting Data

The architecture used in this system is designed to serve with real hierarchical structure of DOAE personnel in Thailand. The architecture allows for an officer at any level, from the top level down to the bottom, of the hierarchy to distribute messages through the structure to farmers. This can be complex and time consuming for distributing messages in many cases. To help avoid delays in delivering messages, the algorithms involved in all processes must be very simple. The most-likely time-consuming process is collecting data from outside sources. We present this algorithm below.

figure a

The algorithm begins with reading configuration files to collect directive data for executing its tasks. The list of external sources is collected. The algorithm then goes through each of the data source \(source_i\). The \(source_i\) is connected and the request is sent. The algorithm awaits for the returned data which is stored \(DB_9\). The algorithm then goes to sleep as per specified in the configuration file. The other agents perform their tasks similarly to collective agents.

5 Results

Since this system is to collect useful and interested data from various sources and deliver the data to farmers through multiple layers of agents, it is important that in the worst case scenario the system performs reasonably well. With regards to this, there can be two bottleneck that hinder the performance of the system: i) collecting data from databases and outside sources by collective agent, and ii) distributing data from the blackboard to farmers at all levels. Since the architecture allows agents to sleep, wake up, and execute their tasks as per suggested in the configuration files, we therefore take into account only the time the agents take to execute the tasks after waking up and before going to sleep. Since the architecture is composed of layers of agents and farmers, and agents go to sleep after executing their tasks, the delays can simply take place when i)agents go to sleep, ii) agents collect data from external sources, iii) agents distribute data through layers. For the first case, we set up the sleep time as minimal as required. The more often the agents wake up, the higher power the system consume. For the second and the third cases, we need to carry out experiments to show what delays can happen.

5.1 Collecting Delay Time

Taking in to account the large number for farmers, there could be a lot of request posted to the system. We assume a farmer posts a request to the system. One way to cope with this is to scale the number of collective agents up. We would like to examine what will happen if we scale the number of agents up. Here, we simulate scaling number of agents from 1 to 10. The delays can mainly take place while i) connecting with the source because of the network, ii collecting data from the external sources (which might have their own database and network system), and iii transmitting data back to our system.

Fig. 3.
figure 3

Delay time for collecting data.

When scaling up, we keep the accumulated delay time for collecting and depositing data of all agents. As shown in Fig. 3, the delay time increases when the number of farmers increases. In general, the average delay time of different agents for all number of farmers are about the same, although we do not present the data here because of limited space. In general, having more agents should be able to help perform tasks faster. However, this may not result in decreasing delay time because increasing the number of agents consumes more resources and may take more time to execute and complete their tasks.

5.2 Distributing Delay Time

To examine the performance of distributing messages to farmers, we set up a similar scenario. We assume there are 1 distribute agent for 1,000 to 10,000 farmers over 1 to 7 layers. Note that the message from a higher level will be collected by its adjacent lower level agents. We consider that the sleep time form all agents are minimal and are interested in over all delay times for distributing messages from higher levels to the lowest levels.

Fig. 4.
figure 4

Delay time for distributing data.

When scaling up, we keep the accumulated delay time for collecting and depositing data of all agents. As shown in Fig. 4, the trend of the delay times are generally consistent when the number of agents increase. Here, we present the accumulated time of all cases for sake of detailed data. Although the detailed times of 5, 6 and 7 levels looks a little decreasing, the average data do not change significantly.

As we have already discussed in previous sections, the system is quite unique, with regards to DOAE’s hierarchical structure. The designed architecture provides many advantages. It allows for delivering information through complex structure. It is flexible that the providers of information can be from many levels. The delivery time is reasonable that it can reach farmers relatively quickly.

5.3 Final Results

In the end, all analyzed information will be pushed to notify farmers all over Thailand. All together, there are around 50 atomic menus in the application. As shown in Fig. 5, we excerpt only five screen shots to show in this paper due to limited space.

The screen shot in a) shows the information about a single farmland and respective crops being planted on the farmland. A farmer can have many farmlands. The screen shot in b) shows a list of farmer’s farmlands. The Thai government encourages farmers to form coalitions to increase bargaining power and reduce costs. The screen shot in c) shows information about the coalition farmers and interactions with DOAE’s personnel. The screen shot in d) shows the analytic information on a farmland, retrieved from the system. Farmers often request help and support from DOAE personnel. The screen shot in e) shows the progress of their requests.

Fig. 5.
figure 5

Five screen shots excerpted from farmer’s mobile application.

6 Conclusion

This paper presents the architecture and important details about the A Multiagent-based Informative Personalized Data System developed and deployed in the Department of Agriculture Extension of Thailand. The system uses internal data sources and receive data from farmers about their interests and necessary data for their crops. There are four types of agents used, collective agent for retrieving data from both internal and external sources, analytic agent for generating related key words, dispense agent, with coordination with officers, for configuring the distribution of data, and farmer agent on mobile phone. In general, the system performs consistently well when the number of farmers increases. The system works well and serving Thai farmers for their well-being.