Main Page/Resources/CEP

From Atenea

Jump to: navigation, search



Complex Event Processing (CEP) is a method for tracking and analyzing streams of information about events that happen in a system, and deriving conclusions from them. CEP permits defining complex events based on the events produced by the incoming sources, to identify complex meaningful circumstances and to respond to them as quickly as possible. Such event types and patterns are defined using Event Processing Languages (EPLs). However, as the complexity of CEP programs grows, they become difficult to understand and to prove correct.

This website provides the implementation code for the three CEP-based case studies described in our paper entitled "Formalizing Complex Event Processing Systems in Maude", which proposes a formal framework for the specification of CEP applications, using rewriting logic and Maude, to allow developers to formally analyze and prove properties of their CEP programs. Maude permits modeling, simulation, analysis and semantic validation of CEP programs.

Case Studies

Accident Monitoring

Let us assume a fleet of motorbikes equipped with sensors that produce real-time information about their state, including the pressure of their two tyres, their location and speed, and whether the driver on the seat or not. We are interested in monitoring them, being able to detect in real time flat tyres, vehicle crashes or accidents. In particular, we are interested in the following derived events:

  • BlowOutTire: The pressure of one of the tires of a moving motorbike goes down from more than 2.0 BAR to less than 1.2 BAR in less than 5 seconds.
  • Crash: The speed of a motorbike goes from more than 50 km/h to 0 km/h in less than 3 seconds.
  • DriverLeftSeat: The seat sensor detects that the motorbike driver has left the seat.
  • Accident: A moving motorbike suffers a blow out of one of its tires, then a Crash event is detected, and the driver is thrown out, everything within less than 3 seconds.
  • AccidentsReport: A derived event with the number of Accidents per day and location.
  • DangerousLocation: This event is raised every time 100 events of type Crash are detected in a given location.

Temperature Monitoring

This case study simulates a simplistic temperature monitoring system at a Nuclear Plant [1]. Using the temperature measurements produced every second by the Plant sensors as the simple events, the CEP application defines and processes the following three types of events:

  • Monitor: computes the average temperature every 10 seconds
  • Warning: warns if 2 consecutive temperatures above a certain threshold (400ºC) are detected
  • Critical: alerts of any sudden, rising escalating temperature spike whereby there are 4 consecutive events, with the first one above 100ºC, each subsequent one greater than the previous, and the last one being 1.5 times greater than the first.

Air Quality Monitoring

This is an example of real CEP application that automatically controls air quality in real time across the Andalusian region (33,694 sq. miles, 8.4 million people). It uses the existing Andalusian regional government's sensor network composed of 61 sensor stations spread all over the region. Each station measures every 10 minutes six air pollutants including, e.g., Carbon Monoxide, Ozone, Nitrogen Dioxide and Sulfur Dioxide. The air quality is measured using the index proposed by the U.S. Environmental Protection Agency (EPA), which defines windows of 1, 8 or 24 hours to analyze the simple events depending on the specific air pollutant, and expresses the results in a 6-grade scale, from Good to Hazardous [2].

The CEP application is defined in terms of 43 rules. The information about each pollutant measurement is aggregated by one rule, and other six rules determine the grade of the air quality for this pollutant. This makes seven rules for every pollutant, and therefore we need 42 rules to analyze six pollutants. A final rule AirQualityLevel calculates the global air quality level by computing the maximum of the grades obtained for each pollutant.



[1] Milne, A. Complex Event Processing Made Easy (using Esper), Last accessed: June 2017.

[2] Mintz, D. Technical Assistance Document for the Reporting of Daily Air Quality - the Air Quality Index (AQI). Technical Report EPA-454/B-16-002, U.S. Environmental Protection Agency, 2016.

Personal tools