Original papers
Rules engine and complex event processor in the context of internet of things for precision agriculture

https://doi.org/10.1016/j.compag.2018.09.013Get rights and content

Highlights

  • RECEP is used to process events in the context of IoT and Precision Agriculture.

  • The main components are: Rules Engine (RE) and Complex Event Processor (CEP).

  • RE allows configure dynamic rules conditioning input data from different sources.

  • RE control actions on actuators and notifications for end users or applications.

  • CEP detects patterns of simple events to take automatic decisions.

  • Case of use of RECEP: intelligent irrigation of an experimental banana plot.

  • CEP analyzes big data at high speeds using minimal computational resources.

Abstract

The Internet of Things (IoT) applications monitor large data flows and events in real time, some raw data is captured from devices located in wireless sensor networks (WSN) and used to make control decisions about actuators. This can be a major problem when the devices grow in number as well as the data that is captured. In this paper, we propose an architecture called “RECEP” for the dynamic processing of events generated in the context of IoT and Precision Agriculture (PA); it is made up of two components: Rules Engine (RE) and Complex Event Processor (CEP). RE allows you to configure dynamic rules conditioning input data from different sources and planning control actions on actuators, alerts, and notifications for end users or applications. The CEP component fuses the input data at the rate at which they arrive, with the rules established in the RE and it performs a prescriptive analysis that consists not only in predicting or detecting patterns of events, but in making automatic decisions. RECEP was implemented in a virtual machine with a 1.9 GHz CPU and 6 GB RAM, then it was integrated into an intelligent irrigation system of an experimental banana plot located in Machala-Ecuador. A WSN simulator was also used to generate sensor data in large quantities, the CEP was evaluated with several test cases, and results show that it consumes computational resources with a growth trend, represented by a logarithmic regression model (r-squared > 0.9); that is, the more events are processed, there is a minimum consumption of resources. It was tested for fifteen days; around 25 thousand events/s were processed. Our RECEP can be implemented in low-cost infrastructure typical of small and large banana producers.

Introduction

Today, the Internet of Things (IoT) is having great success in many areas, allowing computers to see, hear and detect parameters of the world (Qin et al., 2016). The number of connected devices is increasing, and according to CISCO, it is projected about 50 billion objects connected by 2020 (Evans, 2011). Morgan Stanley; however, forecasts that by the end of 2020, around 75 million objects will be connected (Rose et al., 2015). On the other hand, Huawei (2015) projects that there will be 100 billion of IoT devices installed, connected, and autonomously managed by 2025.

IoT is based on a system of interconnecting heterogeneous devices to the Internet; these devices have a unique identity, physical attributes, virtual personality, and use intelligent communication interfaces to transfer data to the network without human interaction (Vermesan and Friess, 2015). The devices constitute Sensor Networks and Wireless Actuators (WSN or WSAN) and at the same time, they are connected through a Gateway to a larger technological infrastructure such as a data center or cloud computing which is responsible for the storage, processing, analysis, and other data management processes. IoT has several fields of application such as Healthcare, Logistics; Manufacturing, Smart Home; Smart Cities, Precision Agriculture (PA); among others. In the case of PA, it consists of crop integration or farm management that combines information technology with rational agricultural industries and tries to provide quantities and types of supplies based on the real needs of a crop (Far and Rezaei-Moghaddam, 2017). In the context of IoT, raw data obtained from sensors and transmitted to a Cloud Computing is abundant, reaching high speeds in real time or near real-time; consequently, the task of monitoring and controlling WSN devices becomes complex and almost impossible to carry out by humans. It is for this reason that the need for a Complex Event Processor (CEP) appeared.

There are several CEP tools for IoT. For example Google offers its Real Time Stream Processing for IOT tool (Google Cloud Platform, 2017) that deals with probabilistic events that are stored and processed by machine learning techniques to predict patterns. There is also WSO2 (WSO2, 2017), consisting of the CEP and BRS components; the CEP component identifies significant events and patterns of multiple data sources, analyzes their impact and generates real-time alerts; while BRS manages business rules. Companies like Microsoft, IBM, AWS, Oracle and others, also offer similar tools. In the scientific community there are several proposals such as: An intrusion detection systems (IDS) architecture based on the mechanism of event processing in IoT environments for real-time data computing (Jun and Chi, 2014). Bruns et al. (2015) show how CEP can be used as the key technology for intelligent M2M systems. Another example is a rule engine for smart buildings that guarantees real-time response and quick match between events and rules (Sun et al., 2015). Zhou et al. (2017) raised the following: Knowledge-infused and consistent CEP over real-time and persistent streams; a semantic CEP model (x-CEP) is introduced to query across real-time and persistent streams applied to case studies from Smart Grid. Akbar et al. (2017) worked an architecture which exploits historical data using machine learning for prediction in conjunction with CEP for Complex IoT Data Streams. Gökalp et al. (2018) proposed a visual programming framework for distributed Internet of Things centric complex event processing to users who have limited or no experience in these technologies.

After reviewing related works and software tools according to the topic discussed, although there are several options of RE and CEP for IOT, they are partial solutions still which are complex to develop, integrate and deployment; it requires a specialist in IoT and PA to take it to the actual applications. In addition, some of these tools are expensive and inaccessible to farmers in a developing country such as Ecuador. Another difficulty is the demands to process large data-events in IoT, the existing options require high-performance hardware or monthly payments for cloud service; or simply, they don't adjust to the needs of Precision Agriculture and Internet of Things applications. In the context of PA-IoT, the work proposed by Kamilaris et al. (2017), it is a semantic framework for IoT, based on smart farming applications, which support reasoning over various heterogeneous sensor data streams in real-time and it can integrate multiple cross-domain data streams. This work focuses only on rule design and detection of event patterns, but does not integrate prescriptive analysis, i.e. it does not make decisions.

This work proposes a kind of architecture for the automatic management of structured decisions generated in Precision Agriculture applications that use telemetry technologies and control of systems based on Internet of Things. For example the following: irrigation systems in crops, fertigation or plant nutrition; disease or pest control, animal monitoring; agricultural robots, machinery, greenhouses, etc. This architecture has been called “RECEP” because it integrates two Rules Engine components (RE) and Complex Event Processor (CEP); the contributions made are described in greater detail below:

  • A.

    The design of the RECEP architecture in order to facilitate user tasks that manage, monitor and control the processes of systems based on IoT as a multi-tenant SaaS service model. For example, software as a service for agricultural enterprises is organized in one or more plots. The implementation of RECEP intends to automate the complexity of raw data processing in WSN and manage the dynamism of the structured decisions to be generated. The architecture consists of two components: (1) RE that manages event models, decision rules models, configuration of control actions, alerts and notifications that are sent to applications or users; and (2) CEP is conceived to work as a service in the background performing tasks in parallel and in real time; its function is to process incoming events, and complete rules with data flows (from WSN, internal databases, external data such as web services), evaluate real-time rules and make decisions involving output events.

  • B.

    The proposed architecture has been verified in two ways: (1) Trough a use case focused on the monitoring and control of an irrigation system of a banana plot located on an experimental farm belonging to the Technical University of Machala (UTMACH) in Ecuador. RECEP was designed, built and integrated as a subsystem in the IoTMach platform that is an IoT platform created by the AutoMathTIC research group of UTMACH. And (2) by running functionality and performance tests considering the use of computational resources, carried out with raw data taken from the experimental banana farm and also generated by a simulator to evaluate large data flows at high speeds.

This paper is organized in the following aspects: related work, proposed RECEP architecture and its components; use case of the architecture in a monitoring and irrigation control system for a banana plot, evaluation and presentation of results, discussion and conclusions.

Section snippets

Internet of Things and Precision Agriculture

Precision Agriculture (PA) combines diverse Information and Communication Technologies (ICTs) for process and data management in an agricultural production system, allowing it to increase efficiency and productivity, applying a scientific approach during all phases of the production cycle of plants and animals. Data that can be collected or generated with ICTs (Bendre et al., 2015, Wolfert et al., 2017) can be obtained from: field (physical-chemical soil characteristics, topography,

The proposed architecture for the management of a Rules Engine and Complex Event Processor in the context of Internet of Things for Precision Agriculture (RECEP)

There are several reasons that justify the decision to propose this new architecture called RECEP. The purpose of this architecture to respond to the challenge of processing large data flows (throughput events/s) that arrive at high speed in real time or almost in real time from several WSN. The use case for which the architecture was focused is for precision agriculture applications and the Internet of things. Another challenge addressed is the use of minimal computational resources (CPU and

Description of operation of the RECEP architecture-based subsystem

The GDF component

For this case, message interchange format based on subprotocol Lightweight Protocol for Sensor - Json (LP4S-J) was used between the IoT Gateway and the CEP as shown in Fig. 3. A data flow (raw data) sent by a IoT device and transmitted through a gateway to the CEP, is identified by “package_id”, “MAC” is the physical address of the device that sends the data flow, “interface” is the pin where a sensor (in) or actuator (out) is connected; the interfaces are of various types:

Experiments

This section describes the first case study to which the proposed RECEP architecture has been applied. This case was implemented as a subsystem of the IoTMach platform that was created for the field of Precision Agriculture, specifically for banana cultivation in Ecuador. Although tested on one experimental banana field, it is designed to grow and support multiple companies in the Ecuadorian banana sector.

Conclusions

The Internet of Things is a technology that is making incursions in many fields and the agricultural field is no exception. IoT applied in Precision Agriculture, allows the optimization of resources and the increase of agricultural production. However, more and more wireless sensor networks that integrate many IoT devices with a variety of sensors and actuators are connecting, producing an increase in the transmission of large volumes of data flow and in real time; thus, the need to automate

Acknowledgments

This research received funding from the Universidad Técnica de Machala - Ecuador, through the AutoMathTIC research group. This work was also supported by the Universidade da Coruña, Spain, through an interinstitutional agreement.

References (56)

  • Y. Wang et al.

    A proactive complex event processing method for large-scale transportation internet of things

    Int. J. Distrib. Sens. Netw.

    (2014)
  • Y. Wang et al.

    Predictive complex event processing based on evolving Bayesian networks

    Pattern Recognit. Lett.

    (2018)
  • S. Wolfert et al.

    Big data in smart farming – a review

    Agric. Syst.

    (2017)
  • Q. Zhou et al.

    Knowledge-infused and consistent Complex Event Processing over real-time and persistent streams

    Futur. Gener. Comput. Syst.

    (2017)
  • A. Akbar et al.

    Context-aware stream processing for distributed IoT applications

  • A. Akbar et al.

    Predictive analytics for complex IoT data streams

    IEEE Int. Things J.

    (2017)
  • V. Akila et al.

    Complex event processing over uncertain events: Techniques, challenges, and future directions

  • Amazon, 2018. Amazon Kinesis Data Streams [WWW Document]. URL <https://aws.amazon.com/kinesis/data-streams/> (accessed...
  • Amazon, 2018. Rules for AWS IoT - AWS IoT [WWW Document]. URL...
  • Apache Flink, 2017. Scalable Stream and Batch Data Processing [WWW Document]. URL <https://flink.apache.org/> (accessed...
  • Apache S. F., 2017. Apache Kafka. A distributed streaming plataform [WWW Document]. URL <https://kafka.apache.org/>...
  • M.R. Bendre et al.

    Big data in precision agriculture : weather forecasting for future farming

  • J. Boubeta

    Model-Driven Development of Domain-Specific Interfaces for Complex Event Processing in Service-Oriented Architectures

    (2014)
  • G. Cugola et al.

    Introducing uncertainty in complex event processing: model, implementation, and validation

    Computing

    (2014)
  • M. Dayarathna et al.

    Recent advancements in event processing

    ACM Comput. Surv.

    (2018)
  • T. Ding et al.

    A semantic preserving CEP based approach for business data processing

  • Eclipse Mosquitto, 2018. Eclipse Mosquitto [WWW Document]. URL <https://mosquitto.org/> (accessed...
  • Evans, D., 2011. The Internet of Things – How the Next Evolution of the Internet is Changing Everything [WWW Document]....
  • Cited by (41)

    • Towards a control-as-a-service architecture for smart environments

      2021, Simulation Modelling Practice and Theory
      Citation Excerpt :

      Most of them have their language [23]. Some approaches use more friendly rules mechanisms for the use of non-expert users [10]. Communicating directly with the RE, the CEP can define complex events over simple events – i.e., raw data.

    View all citing articles on Scopus
    View full text