Tracking Trip Changes with Event Triggering

The Internet of Things (IoT) is poised to deliver connected automation for monitoring, optimization, and control of processes and systems in sectors such as the automotive, healthcare and security. In this way, the IoT promises to make better use of the available resources, enable real-time interaction, and support innovative applications. Under this regime, the present work details an event-triggering technique (ETT) for efficient and effective tracking of road vehicles in the realm of intelligent transportation systems. The technique assumes that both the local and remote host follow a predetermined mobility model to approximate the actual vehicle location. Upon detection of deviation from this model, the local host triggers an update event to resynchronize the remote host. Within the proposed ETT, both the mobility model, as well as the detection thresholds are calculated solely based on sensory data, making the whole system both scalable and robust to dynamic changes. Experimental results demonstrate the many-fold improvements in efficiency of the proposed solution compared to traditional periodic tracking. These improvements are also validated in practice through an implementation on an operating bus route service.


I. INTRODUCTION
Undoubtedly, a far greater number of IoT devices will exist in the near future as compared to personal devices [1].The obvious reason is that there are far more "things" that could benefit from Internet connectivity than the total world population.These benefits could vary from simple monitoring, to optimization and advance control [2].Additionally, the substantial drop in capital, operational, and recycling expenditure associated with IoT technologies has opened up development opportunities in many market sectors.However, the sheer volume of interconnected devices makes system management and supervision a very challenging task.It also exacerbates processing, storage, and communication inefficiencies associated with current implementations.This is why efficient automation is becoming a critical feature for the sustainable development of future IoT solutions.
This work describes a novel event-triggering technique for efficient automation of process/system monitoring.The proposed ETT assumes the existence of a local host (i.e., an embedded IoT device) and a remote host (i.e., a server or a cloud service) that monitor a particular process/system.Instead of continuously or even periodically exchanging information, the local host informs its remote counterpart only of changes (i.e., an event) that occurs in the process/system.To achieve this, both the local and remote host use a predetermined behavior model that approximates the process/system evolution.
Both parties assume that the model is followed whenever the deviation is within certain bounds.A change is detected by the local host when the actual change violates these bounds and only then information is passed to the remote host.This type of event-triggering ensures that minimal information is processed, stored, and communicated when the underlying process/system exhibits predictable behavior patterns; on the other hand, its performance falls back to that of continuous monitoring when the system is completely unpredictable.Fortunately, a plethora of real-world processes and systems follow diurnal, highly predictable patterns that can be capitalized to raise operational efficiency [3].
One such application scenario considered in this work is that of public transport.More specifically, the efficient automation problem is investigated for tracking public buses.Noticeably, buses need to maintain strict schedules along deterministic routes and thus their mobility patterns are highly predictable.Under these circumstances, a mobility model could be used to approximate the bus movement along its service route.This mobility model determines future bus locations whenever there is no unanticipated change.Unanticipated changes trigger event interrupts that are handled either locally, remotely, or jointly from both entities.It should be emphasized here that the proposed scheme greatly differs from current periodic tracking schemes already implemented in practice; an example being the Dublin bus fleet consisting of 1000 vehicles that report location information every 20 seconds [4].As shown in the sequel, the proposed ETT has the potential to greatly reduce the processing and communication overhead associated with these applications.
The mobility model and the event detection algorithm are the two most decisive components for the operation of event triggering.They are also the most cumbersome components to implement due to several model design considerations, model calibration procedures, and a number of event detection approaches [5], [6].Hence, to alleviate complexity and automate development, this work investigates data-driven solutions for both these components.Doing so ensures that both the model and the detection algorithm can easily adapt to dynamic mobility patterns in order to maintain efficiency and accuracy.Overall, the contributions of this work are the following: • A mobility model (consisting of travel times) is developed and a time-deviation event detection analysis is conducted purely based on GPS location readings.• The event detection analysis couples the tracking accuracy to the volume of event-triggering interrupts in order to study their trade-off.• Demonstrates both experimentally and in practice the superior performance of the devised ETT solution compared to the current state-of-the-art periodic tracking solutions.
Towards that direction, Section II first elaborates on related work and demonstrates the novelty of the proposed solution.Section III then develops the two aforementioned components of the ETT, while Section IV includes experimental results on the performance of the proposed ETT solution.Section V includes implementation details and actual performance results of the proposed solution which was tested on a public bus service in Nicosia, Cyprus.Finally, concluding remarks are provided in Section VI.

II. RELATED WORK
The majority of related work in the literature deals with issues faced when the available technology is being used to set up vehicle tracking systems, [7]- [11].The Global Positioning System (GPS) is predominantly used for both location and timing information, while radio frequency identification (i.e., RFID technology such as Near Field Communication) is sometimes employed to improve on the location accuracy offered by GPS.Cellular connectivity (most frequently 2 nd generation GSM networks) is used to communicate GPS traces to control centers, the users, or third parties, with radio frequency satellite links and WiFi mesh solutions being proposed for auxiliary connectivity.Traditionally, custom layouts have been employed to integrate all these technologies together, however recent efforts have focused on open-source platforms such as the Arduino and Android ecosystems that are both economical and for which there exists a large and active community of software developers.
Provided that such a tracking system is in place, the primary concern is on how to obtain arrival time estimates accurately and efficiently.The classical approach followed by most city operators involves surveys using samples, and calibration of the outcomes using sensory data.However, the approach is neither accurate (due to infrequent surveying) nor efficient (due to resource-intensive responses) [12].Hence, numerous data-driven solutions have been proposed to compensate for these shortfalls and automate the entire process, [13]- [20].Obviously, real-time solutions are the simplest, and most straightforward, to implement.However, they impose significant overheads [4] and require considerable infrastructure set-up [21].The alternative approach is to use historical data to estimate the arrival times by clustering, extrapolation, regression, Kalman filtering, and machine learning techniques.The majority of the aforementioned works use GPS traces for this purpose due to the increased availability of this type of data.Of course, other forms of road data including induction loop measurements (as in [22]) have also been used in the past.
However, the current literature decouples the travel-time prediction problem from the vehicle tracking problem in most of the cases.As a result, the efficiency aspect of tracking is overlooked altogether.The issue has first been identified in [20] where the tradeoff between accuracy and efficiency has been investigated.The work presented in this paper takes a more systematic approach to deal with this issue and in the process of doing so develops a new and complementary approach to vehicle tracking based on event triggering.As with most state-of-the-art solutions, historical GPS traces are used to build a generic mobility model of the travel patterns.Subsequently, a new framework is developed that uses this model to build probabilistic bounds on the travel time along the different segments of the traveling route.Tracking entities use the model to approximate the bus movement, while buses use the bounds to trigger time-deviation interrupts to resynchronize the tracking entities in real-time.Importantly, this innovative approach ensures that both high accuracy and high efficiency are achieved at all times.

III. EVENT TRIGGERING TECHNIQUE (ETT)
In this section, the proposed data-driven ETT is developed.Without loss of generality, a single service route is considered with a set of B = {1, . . ., B} bus stops along its path.It is assumed that the locations of the bus stops for a specific route are given and the requirement is to monitor the bus schedule.Let t n ij be the traveling time observed at the n th time a bus travels on the particular route between bus stops i → j, j > i, {i, j} ∈ B. In practice, these measurements are obtained from GPS traces.Noticeably, the travel time between bus stops i → j is the time elapsed between a GPS fix received close to bus stop i to that received close to bus stop j.
With these measurements, a mobility model can be developed to produce estimates of the actual vehicle movement along any part of the route.In turn, this model can be used to approximate the vehicle movement under normal conditions and only trigger event interrupts using an event-detection algorithm when the model is violated.

A. Mobility Model
With a total of N measurements made, a simple mobility model S = {S 12 , S 13 , . . ., S ij , S (N −1)N }, {i, j} ∈ B could suffice as the collection of the latest M traveling times observed for each segment of the path, i.e., a time window of measurements expressed as follows, t n ij ∈ S ij , n = {N − M + 1, . . ., N − 1, N}.These measurements can be further used to calculate statistical values and probabilistic bounds on the traveling times across any arbitrary section of the route as discussed in the sequel.

B. Time Deviation Detection
Given mobility model S, describing the traveling times observed between each segment of the path, then probabilistic travel-time bounds can be calculated.Clearly, event interrupts are triggered whenever the measured traveling time falls outside these bounds.Loose bounds may fail to accurately track the bus movement while tight bounds may create an unnecessarily high number of interrupts.In a nutshell, these bounds determine the quality of experience perceived and thus appropriate bounds must be found that can maintain both accuracy and resource efficiency.
Let τ ij be the mean travel time in segment i → j.Then, the travel-time bounds are defined as follows: Definition 1.The upper and lower travel-time bounds are given by τ ij + α and τ ij − α respectively, where α is the threshold value.
A time-deviation event is then defined as follows: Definition 2. A time-deviation occurs whenever the measured travel time in segment i → j violates the travel-time bounds.
Let K be the target number of deviation events triggered on a single run for a particular route.In this work, K is left as a design parameter that can be adjusted to particular needs.Then, the number of distinct combination of events that can possibly occur is given by the binomial coefficients, expressed as Consider the 1 st combination of events (i.e., c = 1).C 11 indicates that a time-deviation event is triggered at the 3 rd segment of the route while the next event is triggered at the C 12 = 6 th segment, and so on.Hence, no interrupt occurs at either the 4 th or the 5 th road segment.This is to say that after an event interrupt was triggered at the 3 rd segment, the time deviation that accumulated on the subsequent two segments was within the set bounds while the measured deviation on the 6 th segment violated those bounds and another interrupt was triggered.Noticeably, with every event interrupt, the estimated vehicle movement is reset to its true value.In this way, the probability of an arbitrary pair of consecutive events occurring can be expressed as follows: P (i, j) = P (i, i+1)× P (i, i+2)×. ..×P (i, j−1)×(1− P (i, j)) (1) where P (i, j) expresses the probability of no event detection when traversing segment i → j.Formally, this probability is defined as follows: Strictly speaking, border conditions in C should also be taken into account.The leftmost border deals with the probabilities from the start of the route up to the 1 st event.Similar to (1), these probabilities can be expressed as follows: The practical interpretation of this border condition is that there is always an event trigger at the start of every roundtrip journey to initiate the monitoring process.This can be a real event trigger or a virtual indication that is set by a predetermined schedule (e.g.bus timetable).
The rightmost border deals with the probabilities for all route segments just after the last event trigger to the end of the route.These probabilities can be expressed as follows: P (j, |B|) = P (j, j + 1) × P (j, j + 2) × . . .× P (j, |B|) (4) Then, the probability of all possible combination of events is expressed as follows: where P (C ck , C ck+1 ) is defined in equation ( 1) and the last two terms are defined by equations ( 3) and ( 4), respectively.Clearly, the total probability expressed in equation ( 5) should be equal to 1 since it includes all possible combinations of events that could occur for a target of K interrupts.Moreover, the only unknown parameter in this expression is threshold α of the bound in equation ( 2).As such, the bisection method [23] can be used to solve (5) as described by the steps of Algorithm 1 below.
The method assumes that the solution lies within a definite interval (a l , a u ).The method iteratively computes the center point (i.e., a = 0.5 * (a u +a l )) of this interval, calculates a new value of the function, tests feasibility, and updates either the lower or the upper end of the interval based on the one which satisfies feasibility.The procedure continues until a favorable precision is reached with respect to the threshold, i.e., a u − a l > .

Algorithm 1 Bisection Method
Ensure: a l = 0, a u = A 1: while (a u − a l ) > do end if 9: end while Overall, the proposed solution relies only on a set of travel time measurements to build a mobility model of the vehicle movement.Given this model, it computes probability bounds on the tolerable time-deviation for K out-of-bound events to be triggered in each trip.The bisection method, that is used to calculate these bounds, terminates when a favorable precision is reached.With regards to the complexity of this solution, there are a total of |B|(|B|−1) 2 computations for the mobility model in each trip.Furthermore, at every update of the bounds using the proposed solution, there are C combinations that are considered in (5), which exponentially increase with K. Finally, the bisection method converges linearly with a total of log 2 ( 0 ) iterations carried out, where 0 is the initial interval at the start of the iterative procedure.

IV. EXPERIMENTAL RESULTS
To test the proposed solution, real traces have been used from public buses operated by the Transportation Organization of Nicosia District (OSEL), in Cyprus.For this work, approximately 500, 000 traces are considered that are collected at intervals of 15 seconds from 3 buses operating service route 150 (that is operated only on weekdays).The route is illustrated in Figure 1, together with the designated bus stops, and the index of each road segment between these bus stops.
From those traces a total of M = 1000 measurements were used to build the mobility model for route 150.It should be noted here that in addition to the timestamp, information with regards to the originating bus id (of every trace collected) was also recorded.In this way, mobility models could be build for individual buses at different days and times.However, the analysis showed that such a breakdown provides no substantial benefits (at least for the particular service route) unlike other case studies that demonstrate the alternative, and thus a unified mobility model is used for all times and for all buses operating on the particular route.Doing so also simplifies implementation since a single model can be used for all times and days that the route is operated (as noted above the route is operated only on weekdays where traffic variability does not differ substantially).
Figures 2, 3, and 4 plot the travel time histograms and the corresponding road segments of the measurements made for three distinct cases.In each case, a particular bus stop is selected and the traveling times to subsequent bus stops are shown.For instance, the plots in Figure 2          travel times for road segments starting from the first bus stop on the route.Plot 2a shows the travel times to a nearby bus stop, plot 2b shows the histogram to a bus stop further down the route, and plot 2c shows the histogram to a bus stop towards the end of the route.Similarly, Figures 3 and 4 present successive pairs of bus stops.Looking into the results, it is clear that the spread of travel times closely resembles the Poisson distribution.As expected, not only is the mean travel time increasing with larger road segments but so is the spread of those measurements.Nevertheless, these histograms are well defined and describe precisely the mobility of the buses along the particular route.
As elaborated in Section III-B, to calculate probability bounds on these measurements, the bisection method is employed to solve Eq. ( 5).To do so, a precision = 1 sec is used that is both realistic and highly accurate for this application.The bisection method was implemented in Matlab and was used to calculate probability bounds using 80% of the collected samples.The remaining 20% was used as a test set to validate the methodology.The results of this exercise are demonstrated in Figure 5.
More specifically, Figure 5a presents the bounds achieved when the target number of event interrupts, K, varies from 1 to 6.As shown in the figure, the bound becomes significantly smaller even for a small number of K values.Indicatively, for K = 4 interrupts, a bound of less than a minute is achieved.This is to say that on average the proposed ETT will trigger a mere 4 deviation detection events along the entire bus trip.At any other time, the bus movement can be adequately approximated by the mobility model within the achieved 1 minute bound.During all this time (the total trip time for service route 150 is about 50 minutes), there is no need for communication between the local and the remote host and there is no need for any additional computation to be performed for the monitoring process.In that respect, the proposed ETT provides a 12× gain as compared to a periodic scheme that updates the vehicle state every minute (since 50 interrupts will be needed by the periodic scheme as compared to only 4 for the proposed ETT technique).Figure 5b plots the results obtained when the testing samples are used (i.e., 20% of the collected samples) to create the triggering events for target threshold bounds.In the box plots, the central mark is the median, the edges of the box are the 25th and 75th percentile, the whiskers (i.e., the lines above and below the box) extend to those points not considered outliers (i.e., whiskers extend to cover approximately 99% of the values, assuming points are normally distributed), and all outliers are plotted individually.As expected, the total number of events drops dramatically for wider bounds.More importantly though, it is evident from the comparison of the two plots in Fig. 5 that the volume of triggered events is within the computed bounds.

V. IMPLEMENTATION RESULTS
The proposed ETT solution has been implemented as an application for Android devices and has been used for testing on route 150 of OSEL's fleet.A function was written to: a) acquire GPS signals for location information at intervals of 15sec, b) calculate the travel time between successive pairs of bus stops, and c) check for bound violations.The mobility model derived from the collected traces (as discussed in the previous section) was used to set a threshold value of α = 60sec for a target of K = 4 interrupts.A second function was used to collect and log event interrupts.The application was installed on 3 mobile devices which were subsequently placed onboard the buses operating the particular route.
Figure 6 presents the results for a total of 100 trips conducted by buses on route 150.As shown in the figure, the proposed solution successfully maintains the target volume of interrupts for more that 90% of the trips conducted while for the rest of the cases, analysis of the collected traces has shown that those interrupts occurred due to delays experienced at the start of the trips.Interestingly, the cumulative distribution curve of Fig. 6 has a sharp start indicating that many of the trips trigger only very few interrupts.For instance, more than 40% of the cases trigger less than 1 event while 70% of the trips only trigger less than 2 out-of-bound events.In that respect, this implementation demonstrates in practice the great potentials of the proposed ETT solution in building more efficient tracking applications by minimizing processing and communication overhead (since only out-of-bound event interrupts need to be handled) while maintaining good tracking accuracy using the predetermined mobility model.

VI. CONCLUSIONS
In this work, a data-driven event-triggering technique has been developed for vehicle tracking.Both the mobility model and the event detection algorithms have been designed so as to greatly automate the tracking process while maintaining low complexity.The ETT has been purposefully designed to achieve the best tradeoff between accuracy and efficiency and that has been demonstrated by experimental results using real mobility traces.Compared to traditional periodic tracking, the proposed solution achieves a many-fold improvement in efficiency while maintaining high accuracy.This result has also been validated by an actual implementation of the ETT solution on public buses serving OSEL route 150 in Nicosia, Cyprus.
A sensitivity analysis on the proposed solution for different mobility conditions is planned as future work, together with additional experiments with other service routes.Already, we are in the process of collecting mobility data from all other service routes operated by OSEL to extract mobility models that will be used to experiment further with ETT.The approach will also be tested with other means of transportation including taxis and private cars, both of which experience some degree of diurnal patterns.
where C is a matrix whose rows consist of all possible combinations of the |B| route segments taken K at a time.Hence, matrix entry C ck determines the k th route segment where an event occurs (k = 1, . . ., K), in the c th possible combination of events (c = 1, . . ., C with C = |B|!(|B|−1)!K! ).An example of this matrix is shown below, illustrating the case of |B| = 40 and K = 5.

Fig. 2 .
Fig. 2. Distribution of travel times from the first bus stop to subsequent bus stops along the route.

Fig. 3 .
Fig. 3. Distribution of travel times beginning midway in the route to subsequent bus stops.

Fig. 4 .
Fig. 4. Distribution of travel times for road segments towards the end of the route.

Fig. 5 .
Fig. 5. a) Travel time bounds for varying number of target event interrupts, and b) experimental performance with a test sample.
depict the