THE APPLICATION OF RESTFUL WEB SERVICE AND JSON FOR POULTRY FARM MONITORING SYSTEM

Partnership schema is widely applied in Indonesia poultry farm industry. In this schema, a poultry company cooperates with many breeder partners to raise their chicken. The company sends their field inspection staffs to monitor the growth of the chickens. Large number of breeders with manual process of report, handle, and monitor takes a significant amount of time and efforts. In addition, the data cannot be observed immediately by the company. A poultry farm monitoring system based on the Application Programming Interface (API) is proposed in this research. The system can be used by breeders, breeder partners and field inspection staffs to facilitate the process of reporting, handling and monitoring by the poultry company. The API technology is applied as a data center and a data provider. The combination of RESTful web service and JSON into the API enable the integration can be processed safely as well as simple and easy to use. The proposed system can be applied to complement or replace the existing manual processes on many poultry farms with partnership schema.


INTRODUCTION
Broiler chicken farm is a potential good business and can be applied in various areas in Indonesia.The broiler chicken industry plays an important role because it fulfills most of the protein need of Indonesian [1].The industries are commonly implemented as a partnership schema, in which the farm company has many breeder partners who are responsible for raising the broiler chicken.The partnership schema has several advantages compared to the independent schema, such as the supply of the production and market guarantee for the breeder partner [2,3].It will increase the competitiveness of broiler industry because it integrates the upstream and downstream chain of the business.In order to monitor the performance of the breeder partners, the company has field extension workers who regularly monitor and assist the development of the chicken.Field extension workers will go to each farmer regularly.It need large resources and time, especially when the breeder partners are distributed in large area.In addition, the chicken development is recorded manually therefore it is difficult for the company to analyze the data.This will take a lot of time and resources [4].
The wide range application of information technology brings the opportunity to implement those technologies on farm industry.The concept of smart farming has significant influence in raising productivity and reducing operational cost [5].There are various stages that can be integrated in the smart process, such as: management, feeding, quality assurance, environment control and performance [6].The fast growing of platformindependents lead the web-based application to provide collaboration among various stages [7].
The use of information technology can minimize the drawback of manual checking system which is applied widely in traditional broiler farms with partnership schema.In this research, a novel chicken growth monitoring system is proposed for broiler farm with partnership schema.The monitoring system is used to record the chicken growth based on its weight, amount of food and death rate.The system enables the breeder to report the chicken condition to the farm company directly.It implemented RESTful web service and JSON.The rest of the paper is as follow: section 2 describes various application of information technology in farm industry.Section 3 describes the proposed system.Section 4 discusses the propose system.Conclusion and future work directions are presented in section 5.

SMART FARMING SYSTEM
In the last decade, smart farm systems have been increase significantly.It aim is raising productivity by minimizing operational cost.Many researchers propose various automation models for smart farm system such as temperature control [8], light control [9], remote monitoring and analyzing [7].Poultry is a potential commodity compared to the livestock products due to its fast growth, high gain body weight, good feed conversion ratio and high quality meat.The broiler breeders mostly work partnership schema, where farmers will be facilitated in their production and selling, as well as guaranteed market.This partnership program is a government program to increase livestock production in order to enhance the growth of broiler farmers in Indonesia [3].
The use of information system to support poultry farm industry is not widely applied in Indonesia.Information system is collection of tools and human resources which is mutually incorporated, integrated and unified to collect and process data in order to produce useful information for the planning, execution, work, control and decision making in the organization [10].Information system can be assumed as a data processing container which get the data from the users and their processed products are also consumed by the users.
The rapid development of smart farming system increases the demand of collaboration among breeder partners and poultry industry.The collaboration can increase their competitiveness due to better information sharing in order to control the business.As the breeders separated in various locations and have differences background, it is challenging to bring them together to achieve convenience information exchange and communications.However, Internet provides a convenience way for communication among the breeder partners and the poultry industry.The emerging web-based technology enables to support the information exchange and communications.
Application Programming Interface (API) is a set of commands, functions, and protocols used by programmers to build software for a particular operating system [11].The API has standard rules for serving a request; therefore, there is no need to adjust the existing platform when additional platforms are added.Additional changes in the API will only change the data processing in the API within its server.Furthermore, the API security features enable users to edit its access permission for other developers.
Web service is software designed to provide communication and interaction of two or more applications with the nature of the program-to-program [12].Web service enable the application to be accessed and connected without the need to know the details of the program in depth with other applications even if the applications have different platforms, programming languages, and operating systems [13].The implementation of web services involve the web development services using XML (Extensible Markup Language) which can be used to manage data and to integrate applications in the enterprise information system [14].
Web service can be divided into two parts, Simple Object Access Protocol (SOAP) and Representational State Transfer (REST).REST architecture was introduced by Roy Thomas Fielding [15].It consists of Application Definition Language (WADL) which is used as a service contract that crawled through the code and substitute Web Service Definition Language (WSDL), HTTP Method OPTIONS, GET, HEAD, POST, PUT, DELETE, and TRACE, and Uniform Resource Identifier (URI).REST is simpler than SOAP as it uses a standard format (HTTP, HTML, XML, URI, MIME).When the data exchange process is carried out, the results of the web service execution is processed in XML or HTML format via the HTTP protocol [16].
Javascript Object Nation (JSON) is a lightweight data format that facilitates programmers to exchange data (shorter than the array).This format is easy to process by the machine for dis-assembly.JSON is a text format that is actually an independent language, but uses conventions that are familiar for programmers of the C programming language family, which includes the C/C++, C#, Java, JavaScript, Perl, Python, and many others.These make JSON is a good data exchanger format [17].
This research focuses on the implementation of web with API to interact with other resources.The use of web service RESTful JSON data type enables additional resources become easier.API also serves as a standard that manage the process of service and request of data.

THE PROPOSED SYSTEM
Scientific approach used in this research is an engineering approach, where the main emphasis is to create products [18].A common poultry farm industry practiced in Indonesia is partnership schema that consists of four actors: Poultry Company, breeders' partners, cage boy and poultry field inspection staff [15].[15] Figure 1 illustrates the structure of the typical poultry industry partnership schema in Indonesia.Cage boy is responsible directly to the chicken growth, starts from the preparation, seedlings, maintenance to harvesting.A breeders partner is a person who is administratively become the partner of the poultry company.His main responsibility is providing chicken cage and cage boy. a poultry field inspection staff is a person appointed to monitor and maintain the breeder partners and cage boy performance.The poultry company IS responsible for providing poultry food, medicine and marketing [17].

Figure 1.Typical poultry industry partnership schema in Indonesia
The functionality of the proposed system is described using use case diagram.The use case diagram is divided into two sections, the use case diagram for the data entrance section and use case diagram for the monitoring section.The first diagram focusing on the entering data functionality by the cage boy and breeder partners while the second diagram representing the monitoring functionality by the poultry company.There are three actors in the data entrance section, cage boy, breeder partners and poultry field inspection staff.A cage boy should login to the system in order to insert the required data.The cage boy can insert daily report of the chicken growth.The report consists of the number of chicken food in a day, the number of death chicken, and the chicken weight.He can edit his own profile as well as view the history of the chicken growth in a period.A breeder partners can monitor his cage boy.The breeder partner views the Feed Conversion Ratio (FCR) as well as the death rate of his chicken.The (FCR) reflects the performance of the cage boy.The field inspection staff can view the profile and performance of the cage boy and the breeder partners.The monitoring section is used by the poultry company to monitor the breeder partners.It manages the breeder partners' administration and monitors the performance of the breeder partners.It provides the information of FCR and death rate of each cage.In the proposed system, the cage boys and the breeder partners could input daily report of the chicken growth;number of chicken death, chicken weight and amount of food; as well as report of special conditions such as very high temperature and abnormal number of chicken death.Before entering the input data, they need to access the API to login.The system will provide two kind of message, successful and unsuccessful respond.If the users get an unsuccessful respond, they need to re-login; otherwise they can go to further process which is entering the daily report.A cage boy or a breeder partner can only report once a day.The field inspection staff could access the reports send by the cage boys.Therefore, they can monitor the chicken grow and provide fast respond to the report, especially report about unusual condition.The poultry company could manage its breeder partners as well as monitor the chicken grow.The company can see the feed conversion ratio, chicken death rate and amount of food.
In term of physical component, the proposed system consists of database server which is connected with API server and application server.The API server is used to connect with input mobile device used by the cage boys, breeder partners as well as field inspection staff.The application server is used to handle information system in the poultry company side.It manage the report and graphics derived from the database

4.RESULT AND DISCUSSION
The system consists of two sub-applications, the API and the information system.The API serves the data request and response while the information system used to show the reports and graphics.MySQL is used as the database management system for the propose applications.The application consist of six tables to store data of food stock, breeder partners, cage boys, field inspection staffs, report header and report detail.
The API is intended for the cage boy, breeder partner and field staff inspection.The API is built based on Restler and it implements RESTful web service with JSON as the data type of its return value.Token authentication is implemented to increase its security and limit the access to resources.The token is randomly generated every time users need to login.The return values of the token are encapsulated in the JSON.
In the proposed API, there are two methods, GET and POST.They are compatible for many web browser, framework and platform.GET is used to get a list of data from the request, while the POST method is used to enter data to the API.Table 1 show a list of commands contained in the API that request and response data The request and respond commands are implemented using GET methods with token, except for the login command.By storing the token value of the login unable the authentication is conducted only when the user login.The value of the token is unique and can be used to indicate credential user because no users will have the same value of token.Without the custom token authentication, the request to API will be rejected.The use of token parameter allow multiple requests to be processes with single login process In the information system part, the poultry company can manage its breeder partners and field inspection staff.This part uses Bootstrap as the framework of the user interface, Sammy.jr as the path routing control and library Mustache as the application template.

5.CONCLUSION
A chicken growth monitoring system based on RESTful web service dan JSON with API is proposed in this study.The monitoring system is customized for the poultry farm partnership schema, which is widely applied in Indonesia.The users of the proposed system are cage boy, breeder partners, field inspection staff and Poultry Company.RESTful web service andJSON are selected because it can be safely integrated through Internet.They are also easier to use and human readable.
The proposed system consist the API and the information system.The API serves the data request and response while the information system used to show the reports and graphics.The API can be used to serve, provide and process data from the cage boys, breeder partners and the field inspection staff.The information system is used by the poultry company to monitor the chicken growth.In addition, the information system can also be used to monitor the performance of its breeder partners and staff

Figure 2 .
Figure 2.Use Case Diagram for the data entrance

Figure 3 .
Figure 3.Use Case Diagram for the information system