LNCS 4278 - Compressing GPS Data on Mobile Devices - Springer Link

3 downloads 18463 Views 182KB Size Report
In context-aware mobile systems, data on past user behaviour or use of a ... J2ME – Java for mobile applications – is a common platform for building mobile.
Compressing GPS Data on Mobile Devices Ryan Lever, Annika Hinze, and George Buchanan University of Wales, Swansea [email protected] University of Waikato, New Zealand [email protected] University of Wales, Swansea [email protected]

Abstract. In context-aware mobile systems, data on past user behaviour or use of a device can give critical information. The scale of this data may be large, and it must be quickly searched and retrieved. Compression is a powerful tool for both storing and indexing data. For text documents powerful algorithms using structured storage achieve high compression and rapid search and retrieval. Byte-stream techniques provide higher compression, but lack indexation and have slow retrieval. Location is a common form of context frequently used in research prototypes of tourist guide systems, location-aware searching and adaptive hypermedia. In this paper, we present an exploration of record-based compression of Global Positioning System (GPS) data that reveals significant technical limitations on what can be achieved on mobile devices, and a discussion of the benefits of different compression techniques on GPS data. Keywords: Compression, GPS, Context-aware.

1

Introduction

Contextual data can take many forms. In this paper, we focus on GPS location data, but many of the lessons we demonstrate here will be pertinent to other structured location data. GPS data is commonly presented in simple NMEA sentences [2] which contain information such as latitude, longitude and altitude. A GPS device can output sentences many times a minute, and therefore a substantial volume of data can aggregate within a single day. Given that a device may be stationary for periods of time, or moving within a very limited distance, it seems natural to exploit this redundancy and trim the data to reduce the total data size required. However, there are both consequences and complications to a simple implementation to this approach: first, it is not clear, given GPS data alone, when localised movement may be significant and require storage; second, the well-reported variability of recorded location complicates the determination of a ‘static’ location; third, improved precision can be achieved by over-sampling the entire GPS trace, which is clearly compromised by premature loss of data. R. Meersman, Z. Tari, P. Herrero et al. (Eds.): OTM Workshops 2006, LNCS 4278, pp. 1944–1947, 2006. c Springer-Verlag Berlin Heidelberg 2006 

Compressing GPS Data on Mobile Devices

2 2.1

1945

Design Constraints Mobile Hardware

Mobile devices have relatively consistent configurations – sharing the same processors, similar memory configurations and storage options. One key factor for our design is that most processors have no floating point (FP) hardware. This is due to the significant price and power consumption differentials between those CPUs with and without FPUs. To provide some level of floatingpoint capacity, processor manufacturers, e.g. ARM, provide FP libraries, e.g. the ARM-FPE (Floating Point Emulator). Though efficient, such libraries naturally cannot compete with purpose-built hardware. 2.2

Programming Environments

J2ME – Java for mobile applications – is a common platform for building mobile applications. The common CLDC v.1.0 configuration doest not support FP due to the hardware limitations just discussed. The later and rarer CLDC v.1.1 has (usually library-based) FP support. Software–based solutions suffer the same inherent limitations as the ARM-FPE above. A common alternative platform is the use of either C or C++. C–based environments are usually platform-specific, and can provide close fidelity to the hardware capabilities. However, given the general lack of FPUs, the same reservations apply to C as for J2ME. GPS access libraries are available for both J2ME and C/C++. These only provide access to GPS data but do not support processing of GPS data. 2.3

GPS Limitations

It is well-known that GPS has a limited window of accuracy and variable coverage [1]. Given the variability of atmospheric and electromagnetic conditions and signal reception, the observed GPS for a stationary person will fluctuate. This can be turned to our advantage. If GPS were accurate to the nearest metre – which it is not – longitudinal positions would need a range of -1x10e7m to +1x10e7m, or approx. 25 bits. This is a much smaller range than the IEEE floating point standard. Representing the degree, minutes, and four-decimal figure sub-minute data supported by most GPS receivers would require 9 bits (for 360 degrees), 6 bits (for 60 minutes) and 14 bits (to contain 10,000 decimal values) – or 29 bits. Both formats fit well within the 32 bits of most mobile CPUs. We therefore created a bespoke GPS library.

3

Compression

Compression of text is well documented, and the upper bounds of achievable compression are well understood [5,3]. What is not widely recognised is the benefit of compression in terms of performance, particularly on devices with

1946

R. Lever, A. Hinze, and G. Buchanan

slow input/output. To minimise retrieval time, compression schemes must allow the random access of individual texts [5]. Therefore, the compressed documents have, in fact, a record-like structure. Where record-based retrieval is needed, a similar approach can naturally be adopted, exploiting the known performance advantages found in the compression of plain text. 3.1

Distinguishing Movement from Error

Given that the first GPS location in a sequence is at a starting site, A, the first challenge is to distinguish small-scale actual movement (e.g. on foot) from random variations in the detected position. A naive approach would discard new data that falls within the error distance of the last GPS location. However, the greater the actual initial error, the more likely that a subsequent reading from the same point may be erroneously taken to be a movement from A. A better approach is to maintain a rolling average when the rate of movement is small. This method, however, has in turn its problems as slow movement may not be observed when the rate of movement over the sample is less than the GPS margin of error. It is worth remembering that GPS data may be received in short time durations, meaning that several samples may reflect only a couple seconds of time duration. Therefore, the final method is to aggregate an initial location over several GPS NMEA sentences, and if the deviation between readings is within the known maximum error bounds, the location is fixed and subsequent readings checked against the computed average of the initial readings. Until the rolling average moves outside the initial site, the location is taken to be stationary. Intervening measures may be discarded. This leaves us with, for a “stationary” position, an averaged location (which may improve accuracy) and a duration figure as well, to distinguish between a momentary fix on the move and an enduring location fix at a stationary point. A final factor is highly spurious readings - where there is a temporary but large displacement in the recorded GPS location. Such abberations would result in an apparent movement given the simple approach above. However, we further exploit our buffering of several readings, and a detected movement is only confirmed when successive readings, rather than a single reading, suggest it. 3.2

Rapid Movement

When a device is moving rapidly across the earth, the data on any given point is momentary and fleeting. To achieve compression, we need different approaches than for stationary positions – particularly, we need to use interpolation to discern smooth paths that can be found in the GPS data which can be readily compressed into vectors. Where movement is rapidly changing direction, this may be of limited use, particularly when the GPS sample rate is low. Conversely, when the movement is relatively smooth (e.g. a car on a motorway) and as the sample rate rises, the opportunity for compression increases.

Compressing GPS Data on Mobile Devices

4

1947

Indexation

As the GPS stream is compressed, an index is built over the longitude and latitude data. Limited by the onboard processing power of mobile devices, retrieval is of items within a minimum/maximum latitude and longitude. Supplementary indexes are created to identify the beginning and end of stationary periods.

5

Implementation

Much of our work has been the creation of an efficient library for processing GPS latitude and longitude data. Our GPS–compression library has been built upon this, providing a complete implementation for stationary sequences and a simple implementation of the interpolation scheme for periods of movement. We have tested the implementation on Nokia mobile phones and HP iPaq PDA devices running IBM’s J2ME environment. There was a marked reduction in the space taken to store GPS sequences on the on-device permanent (Flash) storage of between 20% (high movement) to 50% (low movement). Storing a compressed GPS sequence is also quicker. Our results are broadly comparable to MG’s compression of textual and numeric data [5].

6

Discussion and Conclusion

Our primary focus was to obtaini a method for compression of GPS data. We wish to refine the interpolation techniques, and extend the indexation to cover directional movement.. Further work will incorporate the system into a broader network service context – e.g. incorporation into peer-to-peer networks [4]. Compression certainly can create compact and high-performance storage for GPS data. However, due to a lack of FPUs, achieving this on mobile devices is problematic. Given the much higher energy consumption, cost and size of FPUs, these units are unlikely to be added to the CPUs of mobile devices in the near future. Therefore, for compression specifically, and a whole range of mobile applications, we must learn to harness a selective use of slow (relative to ’on-board’) network communication to reduce the demand for FP operations.

References 1. A. Crabtree, S. Benford, T. Rodden, C. Greenhalgh, M. Flintham, R. Anastasi, A. Drozd, M. Adams, J. Row-Farr, N. Tandavanitj, and A. Steed. Orchestrating a mixed reality game ’on the ground’. In Proc. of ACM CHI, pages 391–398, 2004. 2. National Marine Electronics Association. NMEA 0183 Standard For Interfacing Marine Electronic Devices, 3.01 edition, 2002. 3. D. Salomon. A guide to data compression methods. Springer-Verlag, 2002. 4. M. Scholl and A. V. Marie Thilliez. Location-based mobile querying in peer-to-peer networks. Lecture Notes in Computer Science, 3762:166–175, 2005. 5. I. H. Witten, A. Moffat, and T. C. Bell. Managing gigabytes (2nd ed.): compressing and indexing documents and images. Morgan Kaufmann, San Francisco, 1999.