{"title": "Optimising Synchronisation Times for Mobile Devices", "book": "Advances in Neural Information Processing Systems", "page_first": 1401, "page_last": 1408, "abstract": "", "full_text": "Optimising Synchronisation Times for \n\nMobile Devices \n\nNeil D. Lawrence \n\nDepartment of Computer Science, \nRegent Court, 211 Portobello Road, \n\nSheffield, Sl 4DP, U.K. \nneil~dcs.shef . ac.uk \n\nAntony 1. T. Rowstron Christopher M . Bishop Michael J. Taylor \n\nMicrosoft Research \n\n7 J. J. Thomson A venue \n\nCambridge, CB3 OFB, U.K. \n\n{antr,cmbishop,mitaylor}~microsoft.com \n\nAbstract \n\nWith the increasing number of users of mobile computing devices \n(e.g. personal digital assistants) and the advent of third generation \nmobile phones, wireless communications are becoming increasingly \nimportant. Many applications rely on the device maintaining a \nreplica of a data-structure which is stored on a server, for exam(cid:173)\nple news databases, calendars and e-mail. ill this paper we explore \nthe question of the optimal strategy for synchronising such replicas. \nWe utilise probabilistic models to represent how the data-structures \nevolve and to model user behaviour. We then formulate objective \nfunctions which can be minimised with respect to the synchronisa(cid:173)\ntion timings. We demonstrate, using two real world data-sets, that \na user can obtain more up-to-date information using our approach. \n\n1 \n\nIntroduction \n\nAs the available bandwidth for wireless devices increases, new challenges are pre(cid:173)\nsented in the utilisation of such bandwidth. Given that always up connections are \ngenerally considered infeasible an important area of research in mobile devices is \nthe development of intelligent strategies for communicating between mobile devices \nand servers. ill this paper we consider the scenario where we are interested in main(cid:173)\ntaining, on a personal digital assistant (PDA) with wireless access, an up-to-date \nreplica of some, perhaps disparate, data-structures which are evolving in time. The \nobjective is to make sure our replica is not 'stale'. We will consider a limited number \nof connections or synchronisations. Each synchronisation involves a reconciliation \nbetween the replica on the mobile device and the data-structures of interest on the \nserver. Later in the paper we shall examine two typical examples of such an applica(cid:173)\ntion,an internet news database and a user's e-mail messages. Currently the typical \nstrategy! for performing such reconciliations is to synchronise every M minutes, \n\nlSee, for example, AvantGo http://vvv. avantgo. com. \n\n\fwhere M is a constant, we will call this strategy the uniformly-spaced strategy. We \nwill make the timings of the synchronisations adaptable by developing a cost func(cid:173)\ntion that can be optimised with respect to the timings, thereby improving system \nperformance. \n\n2 Cost Function \n\nWe wish to minimise the staleness of the replica, where we define staleness as the \ntime between an update of a portion of the data-structure on the server and the time \nof the synchronisation of that update with the PDA. For simplicity we shall assume \nthat each time the PDA synchronises all the outstanding updates are transferred. \nThus, after synchronisation the replica on the mobile device is consistent with the \nmaster copy on the server. Therefore, if skis the time of the kth synchronisation \nin a day, and updates to the data-structure occur at times Uj then the average \nstaleness of the updates transferred during synchronisation Sk will be \n\n(1) \n\nAs well as staleness, we may be interested in optimising other criteria. For example, \nmobile phone companies may seek to equalise demand across the network by intro(cid:173)\nducing time varying costs for the synchronisations, c(t). Additionally one could \nargue that there is little point in keeping the replica fresh during periods when the \nuser is unlikely to check his PDA, for example when he or she is sleeping. We might \ntherefore want to minimise the time between the user's examination of the PDA \nand the last synchronisation. If the user looks at the PDA at times ai then we can \nexpress this as \n\n(2) \n\nGiven the timings Uj and ai, the call cost schedule c(t) and K synchronisations, the \ntotal cost function may now be written \n\nK \n\nC = L (-aFk + fJSk + C(Sk)) ' \n\nk=l \n\n(3) \n\nwhere a and fJ are constants with units of ~~~:y which express the relative impor(cid:173)\ntance of the separate parts of the cost function. Unfortunately, of course, whilst \nwe are likely to have knowledge of the call cost schedule, c(t), we won't know the \ntrue timings {Uj} and {ai} and the cost function will be a priori incomputable. If, \nthough, we have historic data2 relating to these times, we can seek to make progress \nby modelling these timings probabilistically. Then, rather than minimising the ac(cid:173)\ntual cost function, we can look to minimise the expectation of the cost function \nunder these probabilistic models. \n\n3 Expected Cost \n\nThere are several different possibilities for our modelling strategy. A sensible as(cid:173)\nsumption is that there is independence between different parts of the data-structure \n(i.e. e-mail and business news can be modelled separately), however, there may \nbe dependencies between update times which occur within the same part. The \n\n2When modelling user ru:cess times, if historic data is not available, models could also \n\nbe constructed by querying the user about their likely ru:tivities. \n\n\fperiodicity of the data may be something we can take advantage of, but any non(cid:173)\nstationarity in the data may cause problems. There are various model classes we \ncould consider; for this work however, we restrict ourselves to stationary models, \nand ones in which updates arrive independently and in a periodic fashion . . \nLet us take T to be the largest period of oscillation in the data arrivals, for a \nparticular portion of a data-structure. We model this portion with a probability \ndistribution, Pu(t). Naturally more than one update may occur in that interval, \ntherefore our probability distribution really specifies a distribution over time given \none that one update (or user access) has occurred. To fully specify the model we \nalso are required to store the expected number of updates, Ju , (or accesses, Ja ) that \noccur in that interval. \nThe expected value of Sk may now be written, \n\n(4) \n\nwhere Op(:v) is an expectation under the distribution p(x), Au(t) = JuPu(t) can be \nviewed as the rate at which updates are occurring and So = SK - T. \nWe can model the user access times, ai, in a similar manner, which leads us to the \nk +l Aa(t)(t - sk)dt, where Aa(t) = \nJaPa(t) The overall expected cost, which we will utilise as our objective function, \nmay therefore be written \n\nexpected value of the freshness, (Fk)Pa(t) = J:k\n\nK \n\n(C) = L (Sk)p\" - (Fk)Pa + C(Sk)) . \n\nk=l \n\n(5) \n\n3.1 Probabilistic Models. \n\nWe now have an objective function which is a function of the variables we wish to \noptimise, the synchronisation times, but whilst we have mentioned some character(cid:173)\nistics of the models Pu(t) and Pa(t) we have not yet fully specified their form. \nWe have decreed that the models should be periodic and that they may consider \neach datum to occur independently. In effect we are modelling data which is mapped \nto a circle. Various options are available for handling such models; for this work, \nwe constrain our investigations to kernel density estimates (KDE). \nIn order to maintain periodicity, we must select a basis function for our KDE which \nrepresents a distribution on a circle, one simple way of achieving this aim is to wrap \na distribution that is defined along a line to the circle (Mardia, 1972). A traditional \ndensity which represents a distribution on the line, p(t), may be wrapped around \na circle of circumference T to give us a distribution defined on the circle, p( 0), \nwhere 0 = t mod T. This means a basis function with its centre at T - 8, that will \ntypically have probability mass when u > T, wraps around to maintain a continuous \ndensity at T. The wrapped Gaussian distribution3 that we make use of takes the \nform \n\n(6) \n\nThe final kernel density estimate thus consists of mapping the data points tn -t On \n\n3In practice we must approximate the wrapped distribution by restricting the number \n\nof terms in the sum. \n\n\f\"-' \n~60 \n\n.\u00a7 \n~40 \n\"-' \n.S \n1)520 \n~ \nOJ \nH \nCo> \nOJ \n\"\"0 \n~ \n-20 \n\nThu Fri Sat Sun \n\nThu Fri Sat Sun \n\nFigure 1: Left: part of the KDE developed for the business category together with a \npiecewise constant approximation. Middle: the same portion of the KDE for the FA Car(cid:173)\nling Premiership data. Right: percent decrease in staleness vs number of synchronisations \nper day for e-mail data. \n\nand obtaining a distribution \n\n1 N \n\np(()) = N L W N(()I()n, (}\"2), \n\nn=l \n\n(7) \n\nwhere N is the number of data-points and the width parameters, (}\", can be set \nthrough cross validation. Models of this type may be made use of for both Pu(t) \nand Pa(t) . \n\n3.2 \n\nIncorporating Prior Knowledge. \n\nThe underlying component frequencies of the data will clearly be more complex than \nsimply a weekly or daily basis. Ideally we should be looking to incorporate as much \nof our prior knowledge about these component frequencies as possible. IT we were \nmodelling financial market's news, for example, we would expect weekdays to have \nsimilar characteristics to each other, but differing characteristics from the weekend. \nFor this work, we considered four different scenarios of this type. For the first \nscenario, we took T = 1 day and placed no other constraints on the model. For the \nsecond we considered the longest period to be one week, T = 1 week, and placed no \nfurther constraints on the model. For the remaining two though we also considered \nT to be one week, but we implemented further assumptions about the nature of the \ndata. Firstly we split the data into weekdays and weekends. We then modelled these \ntwo categories separately, making sure that we maintained a continuous function \nfor the whole week by wrapping basis functions between weekdays and weekends. \nSecondly we split the datainto weekdays, Saturdays and Sundays, modelling each \ncategory separately and again wrapping basis functions across the days. \n\n3.3 Model Selection. \n\nTo select the basis function widths, and to determine which periodicity assumption \nbest matched the data, we \u00b7 utilised ten fold cross validation. For each different \nperiodicity we used cross validation to first select the basis function width. We \nthen compared the average likelihood across the ten validation sets, selecting the \nperiodicity with the highest associated value. \n\n4 Optimising the Synchronisation Times \n\nGiven that our user model, Pa(t), and our data model, Pu(t) will be a KDE based \non wrapped Gaussians, we should be in a position to compute the required integrals \n\n\fX \n\n4 \n\nX \n\nX \n\n)I( \n\n+ \n\nX ~ \n\n!I \n\nC/J \nt{360 \n>=1 \nQ) \n\n]40 \nC/J \n.S \nS520 \n~ \nQ) \n!-< \nU \nQ) \n\"0 \n~ \n-20 \n\n'\" \nt{360 \n>=1 \nQ) \n=1 \n.$20 \n....., \n~ \nC/J \n.S \n\nQ) \nC/J \n~ \n~20 \nu \nQ) \n\"0 \n~40 \n\n-60 \n\n+ + \n\n+ \n\n! i \nI~! \n\n24 \n\nX \n\nX \n\nxx \nX \n\nj \n\nX \n\n~ \n\n12 \n\nX \nxx \nX \n\nX X \n\nX \n\nxXx \n\nin (5) and evaluate our objective function and derivatives thereof. \nFirst though, we must give some attention to the target application for the algo(cid:173)\nrithm. A known disadvantage of the standard kernel density estimate is the high \nstorage requirements of the end model. The model requires that N floating point \nnumbers must be stored, where N is the quantity of training data. Secondly, inte(cid:173)\ngrating across the cost function results in an objective function which is dependent \non a large number of evaluations of the cumulative Gaussian distribution. Given \nthat we envisage that such optimisations could be occurring within a PDA or mobile \nphone, it would seem prudent to seek a simpler approach to the required minimi(cid:173)\nsation. \nAn alternative approach that we explored is to approximate the given distributions \nwith a functional form which is more amenable to the integration. For example, a \npiecewise constant approximation to the KDE simplifies the integral considerably. \nIt leads to a piecewise constant approximation for Aa(t) and Au(t). Integration \nover which simply leads to a piecewise linear function which may be computed in a \nstraightforward manner. Gradients may also be computed. We chose to reduce the \noptimisation to a series of one-dimensional line minimisations. This can be achieved \nin the following manner. First, note that the objective function, as a function of a \nparticular synchronisation time Sk, may be written: \n\nIn other words, each synchronisation is only dependent on that of its neighbours. We \nmay therefore perform the optimisation by visiting each synchronisation time, Sk, in \na random order and optimising its position between its neighbours, which involves a \none dimensional line minimisation of (8). This process, which is guaranteed to find \na (local) minimum in our objective function, may be repeated until convergence. \n\n(8) \n\n\f5 Results \n\nIn this section we mainly explore the effectiveness of modelling the data-structures \nof interest. We will briefly touch upon the utility of modelling the cost evolution \nand user accesses in Section 5.2 but we leave a more detailed exploration of this \narea to later works. \n\n5.1 Modelling Data Structures \n\n12 \n\n00 \n\nx \n\nx \n\nx \n\nx \n\nx \n\n60 \n\n40 \n\n20 \n\n~XX ~ \n\n-20 X X Xx \nx x \n\nTo determine the effectiveness of our approach, we utilised two different sources of \ndata: a news web-site and e-mail on a mail server. \nThe news database data-set was collected from the BBC \nNews web site4 . This site maintains a database of arti(cid:173)\ncles which are categorised according to subject, for ex(cid:173)\nample, UK News, Business News, Motorsport etc .. We \nhad six months of data from February to July 2000 for \n24 categories of the database. \nWe modelled the data by decomposing it into the dif(cid:173)\nferent categories and modelling each separately. This \nallowed us to explore the periodicity of each category in(cid:173)\ndependently. This is a sensible approach given that the \nnature of the data varies considerably across the cate(cid:173)\ngories. . Two extreme examples are Business news and \nFA Carling Premiership news5 , Figure 1. Business news \npredominantly arrives during the week whereas FA Car(cid:173)\nling Premiership news arrives typically just after soccer \ngames finish on a Saturday. Business news was best \nmodelled on a Weekday/Weekend basis, and FA Car(cid:173)\nling Premiership news was best modelled on a Week(cid:173)\nday /Saturday /Sunday basis. To evaluate the feasibility \nof our approach, we selected three consecutive months \nof data. The inference step consisted of constructing our \nmodels on data from the first two months. To restrict \nour investigations to the nature of the data evolution \nonly, user access frequency was taken to be uniform and \ncost of connection was considered to be constant. For \nthe decision step we considered 1 to 24 synchronisations \na day. The synchronisation times were optimised for \neach category separately, they were initialised with a \nuniformly-spaced strategy, optimisation of the timings \nthen proceeded as described in Section 4. The stale(cid:173)\nness associated with these timings was then computed \nfor the third month. This value was compared with the \nstaleness resulting from the uniformly-spaced strategy \ncontaining the same number of synchronisations6 . The \npercentage decrease in staleness is shown in figures 2 \nand 3 in the form of box-plots. \nGenerally an improvement in performance is observed, \nhowever, we note that in Figure 3 the performance for several categories is extremely \n\nFigure 3: May/June \nbased models tested on \nJuly. \nthe \nFA Carling Premiership \nStream. \n\n+ )( \n+ x x \nx \nx \n\ng}40 ~,(\u00a2<: ~ \n\u00a7 \n~x x \n++ \\xx \n'\"@ \nt260 \n.S \n\n.,\u00ab \n\nx \n\n+ \n+ \n+ + \n+ \n\n+ \n\n+ + + \n+ \n\n+ signifies \n\n+ \n\n+ \n+ \n\n-120 \n\n-140 \n\n-160 \n\n-180 \n\n-200 \n\n+ \n\n+ \n\n4http://news.bbc.co.uk. \n5The FA Carling Premiership is England's premier division soccer. \n6The uniformly-spaced strategy's staleness varies with the timing of the first of the K \nsynchronisations. This figure was therefore an average of the staleness from all possible \nstarting points taken at five minute intervals. \n\n\fIn particular the FA Carling Premiership stream in Figure 3. The poor \npoor. \nperformance is caused by the soccer season ending in May. As a result relatively \nfew articles are written in July, most of them concerning player transfer speculation, \nand the timing of those articles is very different from those in May. In other words \nthe data evolves in a non-stationary manner which we have not modelled. The other \npoor performers are also sports related categories exhibiting non-stationarities. \nThe e-mail data-set was collected by examining the logs of e-mail arrival times for \n9 researchers from Microsoft's Cambridge research lab. This data was collected for \nJanuary and February 2001. We utilised the January data to build the probabilis(cid:173)\ntic models and the February data to evaluate the average reduction in staleness. \nFigure 1 shows the results obtained. \nIn practice, a user is more likely to be interested in a combination of different cate(cid:173)\ngories of data. Perhaps several different streams of news and his e-mail. Therefore, \nto recreate a more realistic situation where a user has a combination of interests, \nwe also collected e-mail arrivals for three users from February, March and April \n2000. We randomly generated user profiles by sampling, without replacement, five \ncategories from the available twenty-seven, rejecting samples where more than one \ne-mail stream was selected. We then modelled the users' interests by constructing \nan unweighted mixture of the five categories and proceeded to optimise the synchro(cid:173)\nnisation times based on this model. This was performed one hundred times. The \naverage staleness for the different numbers of synchronisations per day is shown in \nFigure 4. \nNote that the performance for the combined categories is worse than it is for each \nindividually. This is to be expected as the entropy of the combined model will always \nbe greater than that of its constituents, we therefore have less information about \narrival times, and as a result there are less gains to be made over the uniformly(cid:173)\nspaced strategy7. \n\n5.2 Affect of Cost and User Model \n\nIn the previous sections we focussed on modelling the evolution of the databases. \nHere we now briefly turn our attention to the other portions of the system, user \nbehaviour and connection cost. For this preliminary study, it proved difficult to \nobtain high quality data representing user access times. We therefore artificially \ngenerated a model which represents a user who accesses there device frequently \nat breakfast, lunchtime and during the evening, and rarely at night. Figure 4 \nsimply shows the user model, Pa(t), along with the result of optimising the cost \nfunction for uniform data arrivals and fixed cost under this user model. Note how \nsynchronisation times are suggested just before high periods of user activity are \nabout to occur. Also in Figure 4 is the effect of a varying cost, c(t), under uniform \nPa(t) and Pa(t). \nCurrently most mobile internet access providers appear to be charging a flat fee for \ncall costs (typically in the U.K. about 15 cents per minute). However, when demand \non their systems rise they may wish to incorporate a varying cost to flatten peak \ndemands. This cost could be an actual cost for the user, or alternatively a 'shadow \nprice' specified by service provider for controlling demand (Kelly, 2000). We give a \nsimple example of such a call cost in Figure 4. For this we considered user access \nand data update rates to be constant. Note how the times move away from periods \nof high cost. \n\n7The uniformly-spaced strategy can be shown to be optimal when the entropy of the \n\nunderlying distribution is maximised (a uniform distribution across the interval). \n\n\f0.3 \n\n0.25 \n\n0.2 \n\n0.15 \n\n0.1 \n\n0.05 \n\n1200 \n\n....., \n~ 900 \nU \n:::::::: 600 \n\n'\" \n\nU \n\n300 \n\n0 \n00:00 \n\n08:00 \n\n00:00 \n\n08:00 \n\n16:00 \n\n00:00 \n\nX \n\n\"-' gj 60 \n>=1 \nCl) \n7Lo \n\"-' \n.S \n~20 \n'\" Cl) \n.... \nU \nCl) \n\"'0 \n~ X \n\n-20 \n\nFigure 4: Left: change in synchronisation times for variable user access rates. x shows \nthe initialisation points, + the end points. Middle: change in synchronisation times for a \nvariable cost. Right: performance improvements for the combination of news and e-mail. \n6 Discussion \n\nThe optimisation strategy we suggest could be sensitive to local minima, we did \nnot try a range of different initialisations to explore this phenomena. However, by \ninitialising with the uniformly-spaced strategy we ensured that we increased the \nobjective function relative to the standard strategy. The month of July showed how \na non-stationarity in the data structure can dramatically affect our performance. \nWe are currently exploring on-line Bayesian models which we hope will track such \nnon-stationarities. \n\nThe system we have explored in this work assumed that the data replicated on the \nmobile device was only modified on the server. A more general problem is that of \nmutable replicas where the data may be modified on the server or the client. Typical \napplications of such technology include mobile databases, where sales personnel \nmodify portions of the database whilst on the road, and a calendar application on \na PDA, where the user adds appointments on the PDA. \n\nFinally there are many other applications of this type of technology beyond mobile \ndevices. Web crawlers need to estimate when pages are modified to maintain a \nrepresentative cache (eho and Garcia-Molina, 2000). Proxy servers could also \nbe made to intelligent maintain their caches of web-pages up-to-date (Willis and \nMikhailov, 1999; Wolman et al., 1999) . \n\nReferences \n\nCho, J. and H. Garcia-Molina (2000). Synchronizing a database to improve freshness. \nIn Proceedings 2000 ACM International Conference on Management of Data (SIG(cid:173)\nMOD). \n\nKelly, F. P. (2000). Models for a self-managed internet. Philosophical Transactions of \n\nthe Royal Society A358, 2335-2348. \n\nMardia, K. V. (1972). Statistics of Directional Data. London: Academic Press. \nRowstron, A. 1. T., N. D. Lawrence, and C. M. Bishop (2001). Probabilistic modelling of \nreplica divergence. In Proceedings of the 8th Workshop on Hot Topics in Operating \nSystems HOTOS (VIII). \n\nWillis, C. E. and M. Mikhailov (1999). Towards a better understanding of web resources \nand server responses for improved caching. In Proceedings of the 8th International \nWorld Wide Web Conference, pp. 153-165. \n\nWolman, A., G. M. Voelker, N. Sharma, N. Cardwell, A. Karlin, and H. M. Levy \n(1999). On the scale and performance of co-operative web proxy caching. In 17th \nACM Symposium Operating System Principles (SOSP'99), pp. 16-3l. \n\nYu, H. and A. Vahdat (2000). Design and evaluation of a continuous consistency model \n\nfor replicated services. In 4th Symposium on Operating System Design and Imple(cid:173)\nmentation (OSDI). \n\n\f", "award": [], "sourceid": 2012, "authors": [{"given_name": "Neil", "family_name": "Lawrence", "institution": null}, {"given_name": "Antony", "family_name": "Rowstron", "institution": null}, {"given_name": "Christopher", "family_name": "Bishop", "institution": null}, {"given_name": "Michael", "family_name": "Taylor", "institution": null}]}