chapter 18 location aware applicationscsce.uark.edu/~cwt/courses/2014-01--csce-4543--sw... ·...
TRANSCRIPT
SOFTWARE ARCHITECTURES
Chapter 18 – Location Aware Applications
Ben Gooding
1. Summary
This chapter will cover the many forms of location aware applications, the challenges associated
with these applications as well as their architecture. The majority of location aware applications
are utilized by mobile devices. There are some location aware applications for desktop
computers, such as find local singles in Fayetteville ads, however that is not the focus of this
chapter. There are four main types of location aware applications that will be discussed and they
are: proximity based applications, indoor localization, traditional localization (GPS &
triangulation), and human mobility prediction.
2. Introduction
Location aware applications are a class of computer based applications that use location data to
control the application’s functionality. These types of applications have a wide range of uses and
are continually growing in popularity. This popularity growth has been caused by the steady
increase in the number of mobile devices in the hands of potential users.
Location aware applications have grown from just being simple services to growing into
complex and ever evolving applications [8].
This is not necessarily a new concept that came around with the invention of the mobile phone.
Computers have been using the IP Address of a person searching to determine the user’s rough
geographic location. Posters that list location information for a local concert and a person
relaying information to another can be considered a location aware system.
So what exactly is a location aware application? This can be defined as
“…information services accessible with mobile devices through the mobile network and utilizing
the ability to make use of the location of the mobile device [3]”
We can further define this by making note of what questions an location aware application will
answer [3]:
“Where am I?”
“What is nearby?” or
“How can I go to?”
To fully understand how a location aware application works we will look at the five components
that go into their development [3]:
Mobile Devices – This is the tool that a user will use to gain access to the application.
Without the mobile device there is not location aware application. These can consist
of a GPS navigation unit, Smartphone, tablet or even smart watches.
Communication Network – In some fashion the mobile device needs to contact either
the application server or the positioning component. This is the network form being
used to transmit data.
SOFTWARE ARCHITECTURES
Positioning component – This is the component that will be utilized to determine the
user’s position. This may consist of the GPS adaptor, a WLAN, cellular towers or
even sound waves. The user may also manually specify their location.
Service and Application Provider – The service provider is responsible for providing
a number of different services to the user and is responsible for processing the service
request. This can consist of route calculation, search results, nearby friends, etc.
Data and Content Provider – If the service provider does not control all of the
information than some requests will go to the data provider. This can be a mapping
company or the Yellow Pages.
3. GPS & Cellular Localization
3.1 Introduction
GPS and cellular localization can be used to identify the location for many of the applications
that will be discussed within this paper. However, both are deserving of their own section as they
are such an important piece of the location aware application ecosystem. Within this section the
topics of how GPS works, what cellular triangulation is, the challenges associated with these
methods, as well as a brief overview of GPS navigation applications.
3.2 How does GPS Work?
GPS stands for Global Positioning System. It is interesting to think that in 2001 GPS navigation
units first began to hit the shelves. These very expensive devices unlocked a whole new world of
possibilities. When GPS first hit consumer shelves people wanted to know how a device that can
provide your location with an accuracy of about 10m would not have a service fee. Over time, as
the price and popularity of this grew the curiosity associated with GPS began to dissipate. It was
something that was just there and did its job. So how exactly does it work?
To begin with we need to understand that the GPS network we all use is owned and operated by
the United States government, mainly the Department of Defense. The DoD doesn’t call the GPS
system just GPS, it goes by the name Navstar. Other countries or groups of countries have their
own systems similar to GPS. For example, the European Union version of GPS is known as
Galileo, named after the famous astronomer. Since Navstar is operated by the DoD it is clear that
the original purpose was for military use. Military use of Navstar will provide accuracy of
10mm! In 1983 the DoD decided to open the use of Navstar up to civilians, however the
accuracy was only up to about 100m for them. This accuracy was degraded so that the focus
could be for military use; however in 2000 this was eliminated. This may explain why there was
an explosion of GPS navigation units in 2001.
SOFTWARE ARCHITECTURES
Figure 1: GPS Satellite Network [5]
Navstar consists of a network of satellites orbiting the Earth. Each of these satellites transmits is
location and the current time as of transmission. All the satellites will transmit this information at
the exact same instant. A GPS receiver (phone, navigation unit, etc.) will receive this
information. Since each satellite is at varying locations their signals will reach the receiver at a
different moment in time. The receiver then calculates its position based on the time delays
between the receptions of data sent from the satellites. When a receiver has received the signal
from at least four different satellites it is capable of mapping its location in 3D [5].
Figure 2: GPS Sending Signals to a Receiver [5]
3.3 Cellular Triangulation
Triangulation is the method of using the location of other things to locate a specific item.
Cellular triangulation can only be performed if the location of the cellular tower is known. This
SOFTWARE ARCHITECTURES
information is not made public which makes it very difficult to accurately perform triangulation.
There are techniques such as wardriving to determine the rough location of a cellular tower.
In order to properly perform triangulation a least three signals are required. With the known
location of a cellular tower and strength of signal a rough distance from that tower can be gained.
Repeat this for the remaining two towers that are providing a signal. Using a map or algorithm
on the phone the rough location can be achieved. For example, we have distances of 50m from
tower 1, 200m from tower 2, and 150m from tower 3. By drawing circles on a map with the
given distance from each tower the location is then achieved. The user location will be roughly
near the intersection of all three circles. Theoretically, the more towers available for use the more
precise the user’s location should be.
Figure 3: Triangulation of Earthquake Origin [12]
3.4 Challenges
There are very few challenges remaining in regards to traditional localization. The most
overwhelming issues involve efficiently using the GPS device to optimize battery use. GPS is a
battery drainer and inefficient applications can drain the battery quicker than a user would like.
The other issue involves lack of signal for these methods. Being inside can obscure the strength
and ability to accurately determine a user’s location. Cellular signal strength is at sometimes
completely unavailable or extremely weak. There may also be a lack of cellular towers in the
area to accurately determine a user location.
3.5 GPS Navigation
If a GPS Navigation unit is to be useful it is extremely important that the maps are kept up to
date. Each year roughly 5 percent of roads change. This can mean the addition of stoplights, new
roads, speed limit changes, etc. Each of these things can affect the suggested route by a GPS
unit. A road that was once a two street and is now a one way, since the last update, can cause an
erroneous route to be provided by the GPS navigation unit. This is why there may be navigation
differences between two mapping technologies. GPS satellites do not provide a navigation unit
with the direction required to reach the destination. This information is provided by the software
using the GPS coordinates of both your current location and those of where you wish to go [6].
A modified version of routing algorithms such as A* are used to calculate the route to a given
destination. Unfortunately the majority of mapping companies do not release this information.
The purpose of this is to keep their technology private in hopes of having the best algorithm to
SOFTWARE ARCHITECTURES
provide the fastest, shortest or any other given type of route. The routing algorithms are
considered propriety information and can provide a competitive advantage.
These algorithms will take into account time of day, average speed, number of stops along the
route, etc. Combining all of this information an estimated best route can be provided. Certain
navigation companies such as Waze will learn as more people use their application. The more
people driving down roads a better estimate of average speed and variations based on the time of
day can be obtained [10]. There is always room for improvement when it comes to mapping
technologies. Companies are constantly working to perfect their algorithms.
4. Proximity Based Location Aware Applications
4.1 Introduction
A proximity based application will answer the following question:
What or who is near me?
One of the original versions of a proximity based application was the Yellow Pages. The Yellow
Pages would be distributed to different areas and list businesses that are located in that specific
area. Yellow Pages are the Yelp without reviews.
Figure 4: Finding a business in the Yellow Pages [11]
There are a vast number of different proximity based applications. Although there is a diverse
and large number of proximity based applications many of them fall into the following categories
[3]:
Travel and tourist guides
Mobile yellow pages
Shopping guides
Buddy finder
Date finder
Road tolling
Location sensitive billing
Advertising
SOFTWARE ARCHITECTURES
4.2 Architecture
The general architecture of a proximity based application works in the following way.
1. A user loads the application
2. The application will signal the device to activate the GPS adaptor if it is not currently
running.
3. The adaptor will capture the user’s location
4. The application will then send the user’s location and/or other relevant information to the
application server.
5. The application server will then process this information.
6. The server will return the queried data or relevant information to the user.
Figure 5: General Architecture for Proximity Based Applications
SOFTWARE ARCHITECTURES
4.3 Challenges
The main challenge with the creation of these types of applications
deals with privacy. An application maker will be dealing with
information about either the specific location, or rough location of
users throughout time. If this information is gained it can be used
to learn the identity of a user, who may want to remain anonymous.
For example, in Tinder, you can see mutual friends between
yourself, and the user you are being matched with. Using this
information one can go on Facebook and learn the real identity of
the person in question.
4.4 Yelp
Yelp, in my opinion is the modern day and updated version of the
Yellow Pages. Yelp was founded in 2004 with the idea of helping
others find great local businesses. In this regard Yelp has truly
succeeded. Yelpers, people who use Yelp, have contributed over 53
million reviews and over 120 million unique visitors used Yelp in
the Fourth Quarter of 2013. Any business can create a Yelp
account to help reach customers or to correct information about
their business. Yelp is not an ad-free experience. A local business can purchase an advertisement
inside of Yelp. However, these ads are labeled as such.
The key behind Yelp’s success can be linked to the ability to review local businesses and their
automated software that recommends the most helpful and reliable reviews first [1]. Yelp works
by gaining a user’s GPS location through the phone’s built in adapter. With this information in
hand a list of local businesses and categories is provided for the user to browse and find the
company in their area they are interested in.
4.5 Tinder
Tinder is a proximity based “dating” application. Tinder works by
using OAUTH to allow a user to create an account with their Facebook
information. The user’s Facebook pictures, age and about me section
are pulled into the application. A user will then modify his/her
description to display what they want about themselves. The will also
choose from pictures currently attached to their Facebook profile or on
their phone to display to other users. After completing their profile the
user can set their options.
From the figure to the left, one has the ability to set which gender they
are interested, the age range they are interested in and then the distance
from their current position. To determine the user’s current position the
phone’s built in GPS adapter is used. The application will get the
user’s position and then using an algorithm, most likely Euclidean
distance, they find other users within the specified range that meet the
specific requirements previously set by the user.
Figure 6: Nearby Fayetteville, AR
Figure 7: Tinder Options
SOFTWARE ARCHITECTURES
Once a user has been found that meets the requirement that user’s profile is loaded. The screen
displays the found user’s profile image, an x button, an ‘i’ button and a heart button. Pressing
each of these buttons will perform a different functionality. Pressing the x or swiping left will
produce Figure 8 as well as bringing up the next qualified user.
Figure 9: Results of Dislike Figure 10: Results of Liking
\If you are interested in finding out more about the person meeting your requirements you can
click on their picture or the ‘i’ button. This will bring up the full user profile allowing you to see
more pictures and read their description. If you find the user attractive you can swipe to the right
or press the heart button. This produces Figure 9. If it turns out the person that was found
attractive also finds the user attractive Tinder will alert both users. This will then provide the
users a chance to communicate with each other.
Where things go from there is truly up to the users. Tinder is a rather simple proximity
application that has brought a spun to the dating world. Rather than worrying about matching
algorithms it allows users to set specific requirements and use looks or a witty description in
their profile to grab someone’s attention.
5. Indoor Localization
5.1 Introduction
Indoor localization is still very much in its infancy. The most accurate form of indoor
localization is very expensive. It requires placing specialized hardware in specific locations.
These are then used to calculate a person’s approximate location. Using specialized hardware is a
fairly accurate method for determining location. However, due to the cost people have begun to
turn towards using Wireless Signals to determine a user’s location. To examine these techniques
Figure 8: Tinder Conversation
SOFTWARE ARCHITECTURES
and how they are being developed one research paper will be analyzed. Others have come up
with rather interesting techniques which will be explored in the section over SurroundSense.
5.2 Wi-Fi Localization Using RSSI Fingerprinting [9]
There are two main methods for determining the user’s location based on the Received Signal
Strength Indicator (RSSI). The first method involves triangulation. The goal of triangulation is to
map RSSI as a function of distance. If this method is to be used than a steep linear
characterization curve will be used. A function will be used to describe the curve, and from this
information determine the approximate (x,y) location. This method is much simpler than
fingerprinting; however it is not as accurate. The second method of locating a user is through
fingerprinting. Fingerprinting creates a radio map of a given area based on RSSI data from
several access points and generates a probability distribution of RSSI values for a given (x,y)
location. Real-time RSSI values are then compared to these fingerprints to determine the user’s
location.
The authors of the paper “Wi-Fi Localization Using RSSI Fingerprinting” focus on using
Fingerprinting to track children inside of a playground. To do this they created a floor plan of the
playground and created fingerprints in 10 foot increments in both x and y directions.
Figure 11: Fingerprint Flow Chart [9]
To gather the RSSI values from each of the fingerprints a fingerprint gathering utility was used.
When using this utility the data owner (person performing the fingerprinting) will enter the
current (x, y) coordinate as well as web URLs to status pages for the given routers nearby.
However, if a data owner doesn’t know all of the routers in the area this can be an inefficient
method. The WiFi Manager functionality built into the Android OS can help ease this process if
an application to perform this specific function is created.
SOFTWARE ARCHITECTURES
With this information a fingerprint map is created. Along with this, a parser is used to build the
RSSI probability distribution for each reference point.
Two prediction methods can be used to determine the application user’s location. The first
method is to use the Nearest Neighbor. The nearest neighbor simply calculates the Euclidean
distance between the real-time readings and those that have been stored at the fingerprint. The
minimum Euclidean distance is the nearest neighbor and the likely (x, y) location.
√∑(𝑅𝑖 − 𝐹𝑃𝑖)2𝑛
𝑖=1
R represents the real-time RSSI values. FP represents the fingerprint RSSI value.
The second option for prediction location is to use a Markov model. Using a Markov to predict
the location consists of two steps. The first step is to perform the prediction and the second step
is correct the prediction. The prediction model calculates the probability that a user will be given
at a certain location given a previous location and time the user was there. The correction step
calculates the probability that a user is at a given location given the RSS values at a given time.
Upon testing their methodology using Nearest Neighbor was more accurate due to the ability to
look at all fingerprints at any given time. When the Nearest Neighbor predicted an incorrect
location it was almost always immediately fixed. However, when the Markov predicts an
incorrect location it is extremely difficult to predict an additional correct location. Based on the
table below it is clear that both have a fairly low mean error rate.
Figure 12: Error Distance Measured in Feet [9]
5.3 SurroundSense [2]
When analyzing the definition it covers a broad range. Location can stand for the current
coordinates of a user or a logical location, such as Qdoba. Within the realm of computer science
there have been very few attempts at recognizing logical location. With the lack of skill in
recognizing logical many people assume
that physical location can be used to
determine logical location. However, that
is not the case. As mentioned earlier GPS
has an accuracy of roughly 10m and WiFi
localization can have an error of up to 30+
meters. If a user is standing next to a wall
dividing two stores, the physical location
may not be enough to determine which
store the user is actually inside. Figure 13: Logical Location cannot be Determined with GPS [2]
SOFTWARE ARCHITECTURES
On top of this, WiFi may not be available in developing regions. Besides the lack of precise
accuracy within WiFi localization this lack of WiFi is also an issue. However, mobile phones are
becoming more popular in these regions.
SurroundSense aims to solve this issue by combining the effect of ambient sound, light, color,
and motion an accurate logical location can be provided. This can also be described as using a
comparison of the overall ambience of a given location to determine its logical identity. Think
about the ambient sound of different stores or logical locations near you. The sound inside of a
piano bar is very different from that of a nightclub or bookstore. The piano and people singing
along can be used to help identify a piano bar. The thumping of bass or people yelling could be
used to identify a nightclub. An overall quiet ambience with few people talking could be used to
identify a bookstore. However, on their own these are
not enough to correctly identify the exact logical
location. Combine this with the thematic colors inside
of the location, how the floor looks and even the
lighting a picture will begin to form as to the exact
location. Add on to this the type of motion being
performed by a user and the WiFi signals nearby an
even more precise picture can be painted.
The overall architecture of SurroundSense will be explained along with how the system was
created; however it would take too many pages to explain all of the details behind their
methodology.
Figure 15: SurroundSense Architecture [2]
The first portion of determining the logical location is to use sensors built into the phone to
gather data. The sensors used include the WiFi adaptor, camera, microphone, GSM antenna and
the accelerometer. Upon collecting this information the accelerometer, WiFi, microphone and
camera data is sent to the “Fingerprinting Factory.” This is where all of the key attributes from
each sensor will be extrapolated and used to determine the precise logical location. In order to
prevent the comparison of all Fingerprints to the sensed data the GSM location, which has an
accuracy of roughly 150m, is sent to the Candidate Selection component. This component will
Figure 14: Ambience of various locations [2]
SOFTWARE ARCHITECTURES
take the location and transmit it to the Geographic database. The geographic database stores a list
of logical location. The database will then return the list of locations within the 150m radius to
the Candidate Selection Component. This component will then send the list of locations to the
Fingerprint database. The Fingerprint database will then compare the list provided by the
candidate selection component to the data it has stored. If any of the locations match they will be
sent to the matching component. The Fingerprint Factory will send its processed information to
the matching component as well. The matching component will then compare the fingerprints
provided to the sensed and processed data. The results will then be ranked based on probability
of being the correct location. The top ranked location will then be output as the logical location.
Fingerprints need to be created for SurroundSense to work properly. To do this the authors of [2]
gather sensor data from various locations under various settings. The end result was that 85% of
the time the correct location was output. There is still much work to be done in improving the
accuracy.
6. Human Mobility Prediction
6.1 Introduction
Academic research has long focused on solving the problem of human mobility prediction.
Human mobility prediction is the ability to predict the next location a user will visit at a set time.
This can be applied to a vast array of application types. Human mobility can be used to better
understand human behavior, migration patterns, the evolution of epidemics and the spread of
disease [7]. As discussed earlier, location aware applications are growing in popular and with
this growth an increased interest in human mobility prediction has come to focus.
6.2 Challenges
It is currently extremely difficult to get accurate predictions for human mobility. This will be
discussed in sections 6.3 and 6.4.
6.3 Mining User Mobility Features for Next Place Prediction in Location-Based Services [7]
Foursquare is a proximity based mobile application that allows a user to “check-in” at a nearby
location. By checking in at a location the user has provided the exact time and coordinates of the
location being visited. This information can be extremely helpful in predicting human mobility.
By mining the publicly available Foursquare check-ins that have been tweeted a data set of check
in information can be completed. The challenge of this is to be able to predict the exact next
location a user will go out of the thousands of options available.
In order to create a prediction for a user there must be a set of prediction features that can be
analyzed. These include:
User Mobility
o Historical visits
o Categorical Preference – the types of locations the specific user prefers to visit
(ex/ mostly checks in at bars would lead to a preference for bars)
o Social Filtering – this considers the user and his set of friends
Global Mobility
o Popularity – determined by the total number of check ins
SOFTWARE ARCHITECTURES
o Geographic Distance – Distance from the user
o Rank Distance – describes the relative density between the user and all other
places
o Activity Transitions – Assuming that the succession of human activities is not
random, but more logical. For example a user is more likely to go to the
grocery store after work and not from work to work again.
o Place Transitions – used to predict consecutive transitions of users across
venues
Temporal
o Category Hour
o Category Day
o Place Day
o Place Hour
With this information mobility prediction can be tested for each of these categories. However, it
is not an accurate measurement. By combining all of these features, meaning that one feature
alone is not enough to identify a location; a better picture can be made. The authors of [7] used
an M5 tree and linear regression to test their methods.
The end results of their experiments were M5 Trees performing at a minimum of 50% accuracy
in regards to predicting the next location. Considering the myriad of location possibilities and an
incomplete dataset the work is a wonderful step forward towards human mobility prediction.
6.4 Contextual Conditional Models for Smartphone-based Human Mobility Prediction [4]
This paper uses a generalized predictive framework to predict human mobility. There are two
fundamental questions that must be answered: what is the next place the user will visit and how
long with the user stay at his current location?
In order to satisfy these two questions the authors test conditional probability and an ensemble
method to predict the next location and current duration. The authors also consider that the user
is in an always online setting. This means that with each visit the prediction model is updated.
Over time this model will become more accurate for the user.
There are 8 context variables used:
1. Location – ID of the current place
2. Hour – hour of the day
3. DOW – day of the week (from Monday to Sunday)
4. WE – workday/weekend indicator
5. FREQ – frequency of visits to the current place. It is broken into 5 possible values
based on the number of visits.
6. DUR – the average visit duration of the current place
7. BT – the number of nearby BT devices during the first 10 minutes of the visit
8. PC – binary value which indicates if the user makes a call or sends an SMS during the
first 10 minutes of the visit
Conditional probability models are then created from this information as well as combining them
all in an ensemble method.
SOFTWARE ARCHITECTURES
`
Figure 16: Results for predicting next location [4]
Based on the above results it is clear that their ensemble method is more accurate than using
plain conditional probability. It is also nice to note that the accuracy of the ensemble method is
great than the accuracy achieved in Section 6.3.
Figure 17: Results for predicting duration stay [4]
Human behavior in regards to length of stay at a location is overwhelmingly similar. The authors
compared personalized accuracy to a generalized method with similar results. In the end the
main contributors to an accurate duration stay was just the current hour and location.
Unfortunately based on the table above there is still a lot of work to be down on predicting stays
between 1-8 hours.
Based on their work the authors believe they could improve the accuracy with a larger dataset.
7. Future of Location Aware Applications
The future of Location Aware Applications is vast. Some people are working on GPS navigation
systems that utilize the most fuel efficient routes rather than the fastest or shortest routes. Others
are working on utilizing cameras in conjunction with GPS positioning to determine if the user is
truly in the correct location.
The sky is truly the limit for location aware applications.
8. References
[1] About Us: Yelp. http://www.yelp.com/about (accessed April 16, 2014).
[2] Azizyan, Martin, Ionut Constandache, and Romit Roy Choudhury. "SurroundSense: Mobile
Phone Localization via Ambience Fingerprinting." MobiCom. Beijing: ACM, 2009. 261-272.
[3] Edwards, Alistair, Moritz Neun, and Stefan Steiniger. "Foundations of Location Based
Services." 2006.
[4] Gatica-Perez, Daniel, and Trinh Minh Tri Do. "Contextual Conditional Models for
Smartphone-based Human Mobility Prediction." UbiCom. Pittsburgh: ACM, 2012. 163-172.
SOFTWARE ARCHITECTURES
[5] Griffin, Darren. How does the Global Positioning System work? June 26, 2011.
http://www.pocketgpsworld.com/howgpsworks.php (accessed April 16, 2014).
[6] How does GPS Mapping Software Work? http://www.mio.com/technology-gps-mapping-
work.htm (accessed April 16, 2014).
[7] Lathia, Neal, Cecilia Mascolo, Anastasios Noulas, and Salvatore Scellato. "Mining User
Mobility Features for Next Place Prediction in Location-based Services." International
Conference on Data Mining. IEEE, 2012. 1038-1043.
[8] Location-based Service: Wikipedia. http://en.wikipedia.org/wiki/Location_based_service
(accessed April 16, 2014).
[9] Navarro, Eduardo, Benjamin Peuker, and Michael Quan. Wi-Fi Localization Using RSSI
Fingerprinting. San Luis Obispo: California Polytechnic State University, 2010.
[10] Routing Server: Waze Wiki. https://wiki.waze.com/wiki/Routing_server (accessed April 16,
2014).
[11] Stewart, Mike. State of the Yellow Pages Industry. http://www.smbseo.com/state-of-the-
yellow-pages-industry (accessed April 16, 2014).
[12] What is Triangulation? http://www.qrg.northwestern.edu/projects/vss/docs/Navigation/1-
what-is-triangulation.html (accessed April 16, 2014).