The pervasive presence of smartphones has emerged as one of the key elements for sensing people contextual information. Their sensors and communication capabilities can be used to gather a huge amount of data. Such capabilities have made it possible to compose profiles of people by relating different parameters such as time and location. This paper contributes in this sense by providing the basis for the composition of temporal proximity patterns—when and whom people share their time with each other. For this purpose, the Bluetooth Low Energy (BLE) advertisement protocol was used. The contribution of this work departs from that of those who use BLE technology focused on measuring the intensity of the signals to, for example, determine distances. In this field, a huge amount of work has been already done with very interesting results. Instead, in this work, BLE is used to emit and sense the presence of people. A set of algorithms are then used inside the smartphones to analyse the data gathered and to detect proximity patterns between people. This scenario avoids the difficulties that appear in other works—like those focused on people positioning—derived from the lack of precision of the sensors and the differences between BLE chipsets. Tests to evaluate the consumption, precision, and reliability of using this technology, together with the proposed algorithms, confirmed the feasibility of the approach. In addition, the proposal has proved very useful for the automatic construction of social networks based on physical closeness of people.
The pervasive presence of smartphones, which include a wide range of sensors, has enabled the massive gathering of information from people. This information has been proved useful in many situations, as demonstrated by the interest of large corporations such as Google, Facebook, and Amazon in gathering as much information as possible from their users.
Similarly, the work presented in this paper is part of a research initiative of the authors about sensing contextual information from people. In previous works, the authors presented a model with which to build virtual profiles of people including their routines of movement and outdoor positioning [
The goal of the present work is to estimate whom users share their time with. This information is still missing in most approaches considering the development of virtual profiles of people, although it is of interest for social networks and other companies [
Dozens of datasets about people’s geopositioning and mobility are publicly available. They gather very different kinds of data, ranging from places of birth vs. places of residence or long-distance travelling to urban mobility, traffic events, cabs, running, or biking traces. Focusing on those more fine-grained, most of them contain information coming from GPS sensors (for instance, Geolife (Geolife.
In the literature, we can also find several approaches for detecting when two or more people are together [
Although some previous studies have used Bluetooth detection for inferring connections or relationships between people [
Nevertheless, in order to assess the feasibility of the proposed system, we have analysed its most relevant features. In particular, in this paper, we have evaluated the precision with which the proposed system assesses the proximity of other people, its reliability under different circumstances, and its consumption of the smartphone’s resources, especially the battery. Results show that the BLE capabilities of smartphones can be successfully used to gather information about the proximity between people.
Most of the previous related work was applied to the elderly care context [
The rest of this paper is organized as follows. After this introduction, Section
The main goal of gathering contextual information about a system’s users is for the system to take this context into account, to learn from it, and to proactively meet the users’ needs with as little intervention on their part as possible. These contextual data are used to infer more complex information and to create virtual profiles of the users [
Currently, there are different approaches to create these virtual profiles (see, for instance, [
For the goal of adapting systems to the preferences of their users, the closer to complete these profiles are the better [
Currently, the location of a smartphone can be estimated using its GPS sensor. However, GPS precision drastically decreases when the user is inside a building. Although other techniques, such as WiFi or 4G networks, could be used indoors, neither they have great precision so that they would have only limited use when a person should be located with accuracy [
Techniques for determining indoor positioning have improved greatly over the last few years [
However, while this approach is useful in controlled, instrumented environments, it cannot be used with any guarantee in more general situations in which beacons are unavailable or not properly maintained. Additionally, they only provide information about the individual position of users and not about who are they with.
To address this issue, in this paper, we present an extension to our Beacon Management System [
This is not the first time, however, that BLE devices have been used to gather contextual information. The next section will summarize the most relevant works.
Gathering user positioning information in different scenarios has been a topic of interest for researchers for a long time [
Performance analyses comparing different protocols have been made before. In [
The suitability of BLE for these types of scenarios is of course supported by many research works. In [
Similarly, in [
Another example of BLE usage can be found in [
Similarly, in [
Finally, the present authors previously proposed a Beacon Management System [
As can be seen, there is a wide range of related studies in the field, with some of them even using mobile devices as virtual beacons for indoor positioning and to measure the proximity between users. While similarly, in the present work, our focus is on two main issues that, as far as, the authors know, they are not covered in previous works. On the one hand, as will be shown in Section
The work presented in this paper was initially developed to be part of an elderly care system [
Although originally designed for the elders and their caregivers, our proposal can be applied to gather temporal proximity patterns of any kind of user, since such patterns can be of interest in many other context-awareness scenarios. Therefore, the BLE system to compute the proximity patterns is presented here independently of the system in which such information will be used.
The following sections describe the detailed architecture of the system, how the proximity data are gathered and stored, the data model used to describe proximity patterns, and the algorithms that actually identify those patterns.
Figure
Architecture of the BLE proximity pattern system.
Our proximity pattern application takes advantage of the existing nimBees implementation. However, it could be replaced by an alternative implementation.
The main component of the architecture is the Proximity Patterns smartphone application. This app converts users’ smartphones into both advertising and scanning devices as defined in the BLE protocol. Each smartphone will periodically emit an advertising packet, while it also listens for and scans packets from other BLE advertising devices. Thus, all the smartphones behave symmetrically and exchange information cooperating in a P2P architecture.
The Contextual Information component is responsible for capturing and recording the advertising packets received. It comprises two modules: the Accumulator and the Timeline. The Accumulator module scans the raw information included in the advertising packets, in particular, the identifier of the user sending the packet and an estimation of the distance to that user, derived from the strength of the received signal. The information gathered is stored in the Timeline component, which sequentially organizes the acquired information.
Figure
Graphical representation of the information stored in the Timeline component.
The Virtual Profile component is divided into two modules: the Analyser and the Proximity Patterns store. The Analyser is responsible for periodically analysing the information stored in the Timeline in order to identify temporal proximity patterns. It implements an algorithm which evaluates the BLE packets of information stored in the Timeline in order to identify sequences of packets corresponding to a given user’s smartphone. This is indicative of its proximity to the detecting smartphone. When these sequences are repeated at different times, they will eventually lead to the definition of a temporal proximity pattern. All the patterns identified in this way are stored in the Proximity Patterns module, following a data model that will be described in Section
With this architecture, each smartphone is able to compute the temporal proximity patterns of its owner. These patterns can be therefore provided as a service to third parties. For example, an elder’s smartphone composes and stores her proximity patterns, and her caregiver’s smartphone could request to be alerted when any of these patterns change. These operations are handled by the nimBees Message Manager component of the architecture.
The architecture detailed above gathers information from any BLE advertising device. This allows the detection of temporal proximity patterns, regardless of the time shared between users or, even, if the detections involve devices that have no relation with the user. These nonrelated devices can be filtered using the nimBees platform. In addition, in order to handle small and sporadic interactions, we define a flexible conceptual data model that facilitates the definition of proximity patterns but that can accommodate small contextual changes. Figure
Conceptual data model for the definition of proximity patterns.
A proximity pattern is defined as a time window in which a user shares her time with some specific companions. Its representation therefore consists of the start and end time of the pattern, the frequency with which the pattern is repeated (e.g., daily, on weekends, and sporadically), its weight (which indicates the expected probability that the pattern actually takes place at the times indicated by its frequency), and a number of companions corresponding to the set of people who are with the user when the pattern takes place. Each companion has their own weight, indicating the probability of that person participating in the pattern.
A proximity pattern is connected to other patterns by a set of transitions. This allows information to be stored about sequences in which the different patterns occur, composing a picture of the sequencing of all the people the user spends time with throughout the day. Moreover, it allows one to know with whom a person should be at a specific time and also to forecast which proximity patterns would occur.
Figure
Excerpt of a proximity pattern timeline example.
As indicated before, this pattern structure is managed by means of different data processing algorithms which will be briefly described in the next section.
The Analyser module of the smartphone application is responsible for identifying the phone owner’s temporal proximity patterns and their storage. A fine-grained description of the algorithms involved would require too much space. In [
This algorithm is executed once a day at a predetermined time, usually at night when the phone is plugged in for charging. It processes all the contextual information stored in the Timeline component of the architecture since the last time it was executed.
Let
In order to reduce the smartphone’s resource consumption, the distance between pairs of devices is measured by means of BLE technology. For this purpose, equation (
Let
Let us assume that the day being analysed corresponds to the time interval
In the first step, the algorithm analyses all the BLE advertising packets stored in the Timeline component. During this process, all the packets received from the same device are extracted and used to compute the proximity of that device to the user during the day being analysed. The result of this first step is a set of devices
The second step takes as input this information and splits it into fragments
Finally, the third step takes the fragments obtained in the previous step and compares them with all the proximity patterns
Again, in the comparison between proximity patterns, a given standard deviation is allowed to account for possible measurement errors. If a pattern
For a specific occurrence, if there is a difference for some companions but it is within the allowed deviation, the weight of those companions would be updated accordingly. The weight of an absent companion would be reduced to the point at which that companion would be removed from the pattern if their weights were below some threshold. Similarly, the weight of a companion not included in the pattern would be increased to the point where they would be added to the pattern when their weight rose above that threshold.
If no equal pattern is found for a timeline fragment, then a new pattern will be created in the application with its weight and the weight of all the involved companions set to zero. If this pattern is found again in the future, its weight would be updated.
The weights of patterns that are stored in the application but not performed by the user will be reduced in accordance with their frequency. If a detected pattern is no longer followed by the user, then it will be removed over time.
Preliminary results of the extended elderly care system show that temporal proximity patterns help to enrich the contextual information that the application gathers from its users, providing a new source of information about their habits. This information can be combined with that coming from the analysis of patterns of location and movement already inferred by the application. All this knowledge is applied to better assess whether the elder is in a safe situation or, contrarily, an alarm should be raised. Nevertheless, there should be additional validation of these results, with information on proximity patterns collected from a number of real users.
In the previous section, we described the proposed system for determining the user’s proximity patterns and how the data are registered and processed. None of this has any value, however, unless one can guarantee that the proximity data acquired are correct. In this section, we shall consider the feasibility of the system by evaluating the following aspects of the proposed solution:
To perform the experiments, we developed an application that transforms the smartphone on which it is run into a BLE advertising device at the same time as registering the reception of BLE advertising packets broadcasted by other devices. This application was designed in a similar way to the one used in our previous work to measure the resource consumption of a GPS sensor [
For the transmission of advertising packets, the most important parameters that can be configured with this library are
In the case of listening for BLE advertising packets, the most important parameters to configure are the
In order to be able to evaluate the above aspects, information on the advertisements sent and received and on the battery consumption during the execution of these operations is stored in a log file. Among other data, this file contains the number of packets received and their UUIDs, the distance detected to the transmitting device, and the battery consumption in microampere-hours (
For the sake of the validity of the experiment, it is also necessary to ensure that the smartphones involved are not subject to interference from external agents or OS routines. For this reason, all the operations are executed with the device at rest, with no other applications running at the same time, and they are encapsulated in an Android Service with an associated WakeLock [
Additionally, measuring the consumption pattern of an operation from a single execution does not always provide real data since there may be contamination from the consumption of the screen, the app’s interface, or other sensors of the smartphone. In order to get more accurate average measurements of the consumption, the test application was developed to execute each operation in a loop. In this way, we were able to launch an execution, put the device to rest, acquire a large set of measurements, and then halt the execution. In particular, each test was run for more than 20 minutes so that each emitting device transmitted, at least, 12 000 advertisements and each sensing device executed 10 000 packet scans.
All the experiments were carried out on a set of Motorola Moto E2 devices (Android OS 5.0.2). In addition, in order to evaluate the performance of BLE using different devices, the most important experiments were also replicated on the following smartphones: Honor 8, Honor 9, Moto G, Huawei P9, and LG G5. The experiments were performed with the screen off, no other application running, and the mobile at rest except for the outdoor experiment which was done with the device in motion. To allow the reproducibility of the experiments detailed here, the source code of the described application and the results obtained in each experiment are included as additional material to this paper.
Once all the experiments were carried out, a multivariate analysis was performed to statistically validate the obtained results.
Finally, the feasibility of the proposed algorithms was validated using students. A set of students carried a mobile device with the proposed application running and performed different routines accompanied by others. These experiments allowed us to first define the standard deviation thresholds to be used in the detection of proximity patterns and second evaluate the correctness of the algorithms in a more realistic environment.
The following sections describe in detail the experiments run and their results.
In order to determine the feasibility of using smartphones to estimate the proximity of other smartphones emitting BLE packets, we performed a set of experiments.
First, we measured the precision of the readings of distance with the devices separated by 1 meter. The objective was to analyse the results so as to be able to detect situations in which two people are next to each other.
Figure
BLE devices separated by 1 m. (a) With one transmitter. (b) With several transmitters.
The experiment also measured how the precision might be affected by interference from other emitting devices. Figure
Table
Average detected distance between BLE devices situated at 1 m.
Situation | Average detected distance (m) | Deviation ( |
---|---|---|
Without obstacles and one transmitter | 1.14 | 0.55 |
With a wall and one transmitter | 6.28 | 5.33 |
Without obstacles with three transmitters | 1.95 | 0.69 |
Without obstacles with five transmitters | 1.80 | 0.91 |
Similar experiments were performed with the devices 3 meters apart in order to analyse this technology’s ability to detect situations in which two people are in close proximity. Table
Average detected distance between BLE devices situated at 3 m.
Situation | Average detected distance (m) | Deviation ( |
---|---|---|
Without obstacles and one transmitter | 2.73 | 0.99 |
With a wall and one transmitter | 10.27 | 2.95 |
Different floor and one transmitter | 12.37 | 4.52 |
Without obstacles with three transmitters | 5.12 | 2.09 |
Without obstacles with five transmitters | 3.57 | 1.96 |
In order to evaluate situations in which two people are not in close proximity, similar experiments were performed with the devices distanced by 5 meters. These results are summarized in Table
Average detected distance between BLE devices situated at 5 m.
Situation | Average detected distance (m) | Deviation ( |
---|---|---|
Without obstacles and one transmitter | 6.44 | 2.96 |
With a wall and one transmitter | 31.73 | 9.36 |
Different floor and one transmitter | 21.81 | 6.23 |
Without obstacles with three transmitters | 5.26 | 1.50 |
Without obstacles with five transmitters | 16.13 | 8.53 |
The different experiments have been analysed to obtain information useful to detect proximity patterns. Figure
Average detected distance and deviation per test.
Finally, a completely different experiment was performed to complete the analysis. The proposed application is meant to detect the proximity patterns of users both when they are still and when they are moving. All the previously detailed experiments were performed with the devices still, so in this last, experiment our aim was to analyse the behaviour when the devices are being carried by users walking by the side of each other. In some environments, such as elder care, these accompaniments may be required for performing outdoor activities. This experiment also lasted 20 minutes and while the distance between devices was not fixed since it would change as the users walked together, at no point in the experiment was it greater than 3 meters.
In Figure
BLE devices in movement.
Average detected distance between devices in movement.
Situation | Average detected distance (m) | Deviation ( |
---|---|---|
Device A | 9.80 | 12.89 |
Device B | 11.45 | 11.36 |
However, it is interesting to note that most of the greatest deviations in the measured distances between devices are replicated in the two devices at the same time. Examples of this situation are clearly seen in Figure
As a conclusion of the experiments conducted, the results confirm the feasibility of using smartphones to detect proximity patterns. Although the results indicate that one cannot trust the precision of the measured distances when there are obstacles between the two devices, it still allows to determine the closest group of people in ordinary conditions. Moreover, the results show that it is possible to reduce the number of false-positive proximity patterns that are detected when a person is close to another but not really sharing their space because they are on different floors or have a wall between them.
To measure the reliability of using smartphones’ BLE capacities in order to communicate the device’s presence, we took into account all the communications that took place during the experiments previously described. Figure
Detections per second in the different tests.
Combining this information with the values of the Advertising Interval, Scan Window, and Scan Interval that were used in the experiments detailed above, one can obtain a clear image of the reliability of the communications in the different scenarios.
As can be seen in the figure, the reliability of the communications is unaffected by the presence of obstacles between the devices. However, the number of packets detected is seriously affected by the presence of other BLE transmitting devices. This must be taken into account to prevent false negatives when detecting proximity patterns in the presence of multiple emitting devices. This problem can be mitigated by choosing the appropriate values for the Advertising Interval, Scan Window, and Scan Interval.
From the experiments carried out in this work, and also taking into account the recommendations highlighted by other researchers (such as Montanari et al. [ The Transmission Power controls the distance to which the packets are broadcasted. Initially, this parameter can be configured to its maximum power, since its impacts on battery life are not critical. Nevertheless, if one only wants to detect the patterns of people that are in close proximity, it can be reduced in order to also decrease the number of collisions and of false negatives. The Advertising Time is dependent on the size of the data to be transmitted. Therefore, in order to reduce collisions and false negatives, this size should be as small as possible, decreasing the Advertising Time to the minimum. The Advertising Interval, which is the frequency at which the advertisement is sent, should be configured to 10 Hz or lower in order to decrease the number of collisions. The lower the frequency, the lower the number of packages sent and of collisions but also more difficult is for the receiver device to capture the advertisement. The Scan Window should be long enough to capture the advertisements. If the frequency of the Advertising Interval is low, then a longer Scan Windows may be required in order to detect the proximity among devices. Also, longer Scanning Windows provide better accuracy and higher reliability. Nevertheless, the scanning is a battery consuming operation, so it should be as short as possible in order to reduce the battery consumption. The frequency of the Scan Interval should be low in order to decrease the battery consumption. Nevertheless, this value depends on the Advertising Interval. Usually, it is recommended to have a Scan Window that assures the reception of the advertisements (because it is a little bit longer than one Advertising Interval) and Scan Interval with a low frequency in order to reduce the battery consumption.
For detecting temporal proximity patterns, the granularity of the detection does not have to be high, since it is not important to detect the exact second in which two people are no longer together. Therefore, the frequency of the Scan Interval can be even lower. Seamlessly, it is not crucial if some advertisements are lost, since the temporal proximity pattern can be detected. Although the defined configuration reduces the detections per second when there is a higher number of devices, that configuration is good enough to detect the temporal proximity patterns.
Table
Consumption per second of the operations for the reception and transmission of BLE packets.
Name | Frequency (Hz) | Battery | Deviation |
---|---|---|---|
Operating system | — | 2.45 | 2.02 |
Transmitting a packet | 10 | 1.32 | 2.47 |
Listening for a packet | 8.33 | 14.23 | 4.38 |
The first row of the table presents the average consumption of the operating system with the mobile device at rest. We calculated this value in order to eliminate the background consumption of the operating system from the consumption of the rest of the operations. For the devices used in the experiments, the average battery consumption was 2.45
The second row presents the average battery consumption of the devices when transmitting BLE advertising packets ten times per second. In this value, the consumption of the operating system has already been subtracted. As can be seen, this consumption is even lower than the OS idle consumption. This result was to be expected since one of the main benefits of BLE is precisely the low battery consumption, as demonstrated by most of the physical beacons available on the market which present battery lives of up to several years. Additionally, most of the consumption deviation in this operation is attributable to variations in the OS consumption.
Finally, the third row presents the average battery consumption of the devices when listening for BLE advertising packets at the frequency detailed in the description of the experiments. This consumption is an order of magnitude higher than the transmission case. This result was also expected since it coincides with previous studies in the literature [
To summarize, the battery consumption obtained in the experiments performed, both transmitting and receiving BLE advertising packets, is comparable with the results of similar studies [
As mentioned above, battery consumption is considered a determining factor for an application success. However, there are other resources whose excessive consumption could have a negative impact on the solution. According to [
In order to validate statistically the performance analysis described in the previous sections, a multivariate analysis was carried out using the following set of independent variables: the real distance between BLE devices (
Two dependent variables were considered: the relative root mean square error
Table
OLS regression results with
Model | Variable type | B | Std. error | Beta | Sig. | |
---|---|---|---|---|---|---|
1 (constant) | 0.669 | 0.206 | 3.247 | 0.001 | ||
Continuous | 0.729 | 0.065 | 0.165 | 11.148 | 0.000 | |
Continuous | 0.092 | 0.043 | 0.054 | 2.121 | 0.003 | |
Categorical | 7.536 | 0.154 | 0.594 | 49.068 | 0.000 | |
Categorical | 3.508 | 0.204 | 0.341 | 13.480 | 0.000 |
The independent variables hardly affect the BatteryConsumption, however, confirming the expected behaviour. Since the number of transmitted advertising packets and the Scan Intervals are independent of the environmental conditions, the battery consumption is always the same (within possible normal deviations). The detailed results of the multivariate analysis for the dependent variable
This statistical analysis not only validates the performance study of the system’s precision and battery consumption, but can also be used to improve the algorithm for the identification of temporal proximity patterns. The first step of the algorithm, in which the BLE advertising packets are analysed, can be updated to take into account the results of this statistical analysis. In particular, the algorithm can use this information to enrich the data model it generates by taking into account the statistical probability of the different situations in which a companion may be detected, e.g., without obstacles, on the other side of a wall, and on a different floor. We are also working on using the detected situation to modify at run-time the different beacon transmission and reception parameters in order to increase the accuracy. This enriched data model can then be used to better assess a user’s temporal proximity patterns and thus provide a more detailed virtual profile.
Once checked that BLE technology is reliable enough for the identification of temporal proximity patterns, we evaluated the feasibility of the algorithms defined in Section To evaluate the adequacy of the data model To establish the standard deviation thresholds to use in the algorithms To evaluate their correctness by determining the ratio of correct detection of temporal proximity patterns, their false-positive (FP) ratio, and their false-negative (FN) ratio
In the first phase of testing the algorithms, we decided to evaluate them with students simulating different accompaniment patterns. This first phase allowed us to establish and validate the thresholds used in the algorithms, in particular for the standard deviation in the measurements. The values selected were as follows: The maximum average distance ( The maximum difference between two consecutive distances ( The maximum difference between the timestamps of two distances ( The minimum timestamp interval for considering a pattern (
To perform the experiment, twelve students were selected. These students were organized into two groups of six people. In each group, one student was selected as user. The device of this user would be the one detecting the temporal proximity patterns to be analysed in the experiment. The other users were companions.
Before beginning the experiment, a workshop was conducted to explain the situations they had to reproduce. These situations were similar to the ones in the test previously shown (i.e., one user and one companion, one user and three companions, and one user and five companions). For evaluating each situation, different characteristics were reproduced: A distance between users and companions of 1, 3, and 5 meters Interruption between detections of 4 and 20 minutes Companions in the same room or in different rooms
Every test lasted 60 minutes. Throughout the experiment, students had to record on paper all the actions they performed. Special attention was paid to the times at which users and companions were together so that the identified patterns could be compared with the real life. The comparison of the information gathered by the system with the information manually recorded by the students was used to determine the correct detection of patterns and its FP and FN rates.
Tables
Patterns identified with one user and one companion.
Group | 1 meter | 3 meters | 5 meters | ||||||
---|---|---|---|---|---|---|---|---|---|
Id | FP | FN | Id | FP | FN | Id | FP | FN | |
1 | 3 | 0 | 0 | 2 | 0 | 1 | 2 | 0 | 1 |
2 | 3 | 0 | 0 | 3 | 0 | 0 | 2 | 0 | 1 |
Patterns identified with one user and three companions.
Group | 1 meter | 3 meters | 5 meters | ||||||
---|---|---|---|---|---|---|---|---|---|
Id | FP | FN | Id | FP | FN | Id | FP | FN | |
1 | 3 | 0 | 0 | 2 | 0 | 1 | 2 | 0 | 1 |
2 | 3 | 0 | 0 | 3 | 0 | 0 | 3 | 1 | 1 |
Patterns identified with one user and five companions.
Group | 1 meter | 3 meters | 5 meters | ||||||
---|---|---|---|---|---|---|---|---|---|
Id | FP | FN | Id | FP | FN | Id | FP | FN | |
1 | 3 | 0 | 0 | 3 | 1 | 1 | 0 | 0 | 3 |
2 | 2 | 0 | 1 | 4 | 1 | 0 | 0 | 0 | 3 |
In order to quantitatively validate the approach, we began by evaluating the pattern detection algorithms (FP and FN rates). As can be seen in Tables
In the analysis of these results, we identified that the main reason for detecting FP and FN was the identification of outlier values. That is, some measurements wrongly detected because of interference, problems during the transmission, etc. Most of the outliers were removed with the trimmed mean applied in equation (
No patterns were identified when the companions were in a different (but adjacent) room. The algorithms correctly discarded the received measurements because of the increase in the estimated distance and its standard deviation.
Each group also performed a test in motion. However, the smartphones of the student-users did not identify these patterns due to the high deviation of the obtained distances and the increase in the measurements. We are currently working on how to improve the contextual information used to detect these patterns.
Finally, the completeness of the data model was evaluated. To that end, we checked whether the patterns were correctly identified and described and whether any FP or FN was due to the data model. The result was a confirmation of its feasibility and of its expressiveness for defining proximity patterns. Nevertheless, as previously mentioned, in order to identify certain patterns (in particular when users are moving), some additional contextual information (e.g., GPS geopositioning) may be required.
Many software applications can benefit from having a specific behaviour depending on the preferences and the context of their users. This adaptation is achieved by using the contextual information that can be gathered from the users. The rise of BLE technology has provided a way to detect proximity between devices, information of which can be used to enrich users’ contextual information.
In this paper, we have proposed a system that uses BLE to determine temporal proximity patterns. The proposed solution takes advantage of the BLE capabilities of modern smartphones and transforms these devices into virtual beacons that constantly emit advertising packets. These packets are received by other smartphones and processed to compute the user’s proximity patterns. To assess the feasibility of the proposal, we performed a set of experiments with the system to measure its precision, its battery consumption, the reliability of the communications, and the accuracy of the algorithms for the identification of proximity patterns. As far as the authors know, there is no other work in the literature that detects this kind of proximity patterns between users without requiring additional infrastructure. As discussed in Section
Although the results showed that BLE is not accurate in the measurements of distance, it is precise enough to detect people’s proximity patterns, especially if the potential deviations are taken into account during pattern detection. In particular, the proximity detection algorithm does not depend on the accuracy of the measurements, as it only uses these measurements to rank other users by proximity, and once a companion has been detected and added to a proximity pattern, the distance is no longer relevant for the system.
It is also important to emphasize that the greatest inaccuracies obtained during the experiments were found when there were obstacles between the devices, as it is said in [
Regarding the reliability of the communications, the results showed that BLE is reliable enough to detect temporal proximity patterns between users. Even in the worst-case scenarios where other emitting devices caused interferences, the devices were still able to detect one another with sufficient frequency to compute the proximity patterns. In any case, the reliability can be improved by modifying the values of the application’s advertising interval, scan window, and scan interval. Such changes, however, would involve a trade-off with worsened battery consumption and would therefore need to be implemented with caution.
The battery consumption in the devices in no way reached alarming levels. Indeed, the results showed battery consumption to be lower than the levels of currently accepted social network applications and therefore should not affect user acceptance.
The algorithms for the identification of proximity patterns can identify most of the situations in which two people share their time together. False positives and false negatives mainly resulted from interferences preventing us to clearly detect whether there is an obstacle between the smartphones or not. Again, more contextual information would be required to identify these situations.
Finally, the results not only demonstrated the feasibility of the system but also served to fine-tune the thresholds and accepted deviations used in the proximity pattern detection algorithm. Appropriate calibration of these values allowed us to improve the algorithm with respect to the false-positive and false-negative rates in the pattern detection. By adjusting the accepted deviation when splitting the pattern timeline into fragments with the information obtained during the experiments, we reduced the number of false-positive patterns detected that were caused by measurement error. Similarly, by adjusting the thresholds used in the comparison of the stored patterns and timeline fragments with the results obtained in the experiments, we reduced the number of false negatives of pattern detections that were caused by measurement errors.
Now that we have verified the feasibility of using smartphones BLE capabilities to detect the temporal proximity patterns of their users, and we are preparing additional validation experiments. The objective of these new experiments is to obtain more precise information about the temporal proximity patterns of users in noncontrolled environments.
We are also currently working on an evolution of the PeaaS model. Our aim is to develop the capacity of smartphones to define and manage their owners’ virtual profiles, enabling new applications to be designed. In the present work, the focus was on improving the quality of the contextual information stored in the virtual profiles by adding temporal proximity patterns. For the future, we are working on a new concept termed Situational Context.
The Situational Context is a form of analysing the conditions that exist at a particular time and place in order to predict, at run-time, the expected behaviour of IoT systems [
The results presented in this work allow one to use BLE to compute users’ temporal proximity patterns. One can then use these patterns to enrich the contextual information stored in each user profile. The proposed solution can be applied in both indoor and outdoor situations without the need to deploy any kind of infrastructure in the areas where it will be used.
This is a small, but relevant step in our goal of bringing technology closer to nontechnical users. The richer the contextual information gathered from the user, the farther one can advance in seamlessly integrating IoT systems into the users’ daily lives.
The source code of the presented applications and the data produced by the performed experiments are included within the supplementary information files.
The authors declare that they have no conflicts of interest.
This work was supported by 4IE+ project (0499_4IE_PLUS_4_E) funded by the Interreg V-A Espańa-Portugal (POCTEP) 2014–2020 Program, by the Spanish Ministry of Science, Innovation and Universities (RTI2018-094591-B-I00 (MCIU/AEI/FEDER, UE) and PGC2018-094905-B-I00), by the Department of Economy and Infrastructure of the Government of Extremadura (GR18112, IB18030), and by the European Regional Development Fund Andalucía 2014–2020 (UMA18-FEDERJA-180).
BatteryConsumptionOLSregression.pdf contains the results of the multivariate analysis for the dependent variable BatteryConsumption, as mentioned in Section