<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/blogs/shared/nolsol.xsl"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>

<title>
BBC Internet Blog
 - 
Mark Longstaff-Tyrrell
</title>
<link>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/</link>
<description>Staff from the BBC&apos;s online and technology teams talk about BBC Online, BBC iPlayer, and the BBC&apos;s digital and mobile services. The blog is reactively moderated. Posts are normally closed for comment after three months. Your host is Eliza Kessler. </description>
<language>en</language>
<copyright>Copyright 2012</copyright>
<lastBuildDate>Wed, 20 Jan 2010 16:45:00 +0000</lastBuildDate>
<generator>http://www.sixapart.com/movabletype/?v=4.33-en</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 


<item>
	<title>A brief technical overview of the BBC personalised mobile homepage</title>
	<description><![CDATA[<p>Most people I know are never more than a few feet away from their mobiles. They provide access to email, text and internet, including social networking sites. They're fashion accessories. They're becoming increasingly personal pieces of equipment and in the same way that junk mail landing on your doormat feels intrusive, so it is with mobile websites cluttering up your screen with unwanted content. </p>
<p>When it was <a href="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2009/04/new_mobile_homepage_launched.html">released in April last year</a>, the <a href="https://bbcbreakingnews.pages.dev/mobile/index.html">BBC personalised mobile homepage</a> aimed to address this by allowing many aspects of the page to be personalised.</p>
<p>This post aims to explain some of the technologies we've developed to generate personalised mobile pages that we hope provide you with the best experience, regardless of the make and model of your device.</p>
<h3>Rendering pages for different devices</h3>
<p>The appearance of the mobile homepage changes depending on the device you use to view it. If you browse the mobile homepage using a touchscreen device such as an Android or iPhone, you'll be presented with larger text and images to make it easier to navigate with your finger.</p>
<p>Non-touchscreen phones that use a trackball or buttons to navigate will present a more compact page. In addition, links to mobile iPlayer and other multimedia content is selectively displayed based on the phone capabilities and whether it's connecting over WiFi or 3G. </p>
<p>In order to do this, the page content is defined using a device-independent XML representation. Each tag in the device-independent XML is then translated into a fragment of XHTML appropriate to the capabilities of the client handset. These XHTML fragments make up a library of common components, such as links, headings and list items. This approach means that the look of the site is maintained throughout and also that the entire design can be updated by simply changing the templates.</p>
<p>Here's an example. The following XML describes the Radio &amp; Music topic: </p>
<p><font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">header</font> <font color="#2040a0">editable=</font><font color="#008000">"true"</font> <font color="#2040a0">text=</font><font color="#008000">"Radio &amp;amp; Music"</font> <font color="#2040a0">url=</font><font color="#008000">"/mobile/radio/"</font><font color="#2040a0">/</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>
<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">now_on_air</font> <font color="#2040a0">title=</font><font color="#008000">"NOW ON AIR"</font><font color="#2040a0">/</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>

<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">list</font> <font color="#2040a0">style=</font><font color="#008000">"plainList"</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>
<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">channel_list-item</font> <font color="#2040a0">channel_url=</font><font color="#008000">"/mobile/radio/radio1/index2.shtml?region=london"</font>
<font color="#2040a0">channel_name=</font><font color="#008000">"Radio 1"</font> <font color="#2040a0">brand_url=</font><font color="#008000">"b00pjl2g"</font> <font color="#2040a0">brand_name=</font><font color="#008000">"Greg James"</font><font color="#2040a0">/</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>

<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">/list</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>
<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">list</font> <font color="#2040a0">style=</font><font color="#008000">"boldList"</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>
<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">list-item</font> <font color="#2040a0">text=</font><font color="#008000">"More stations and schedules"</font> <font color="#2040a0">url=</font><font color="#008000">"/mobile /customise/11"</font><font color="#2040a0">/</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>
<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">/list</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>

<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">list</font> <font color="#2040a0">style=</font><font color="#008000">"audioList"</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>
<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">list-item</font> <font color="#2040a0">demi=</font><font color="#008000">"15"</font> <font color="#2040a0">text=</font><font color="#008000">"Podcasts"</font> <font color="#2040a0">url=</font><font color="#008000">"/mobile/radio/podcasts/index.shtml"</font><font color="#2040a0">/</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>

<font color="#2040a0"><strong><font color="#4444ff"><strong>&lt;</strong></font><font color="#2040a0">/list</font><font color="#4444ff"><strong>&gt;</strong></font></strong></font>
<p></p>
<p>The XML above renders like this on an iPhone: </p>
<p>
<div class="blq-clearfix">
<span style="DISPLAY: inline" class="mt-enclosure mt-enclosure-image"><img style="MARGIN: 0px 20px 20px 0px; FLOAT: left" class="mt-image-left" alt="iphone.png" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/img/iphone.png" width="288" height="171" /></span></div>
<p></p>
<p>And like this on a Nokia 6331: </p>
<p>
<div class="blq-clearfix">
<span style="DISPLAY: inline" class="mt-enclosure mt-enclosure-image"><img style="MARGIN: 0px 20px 20px 0px; FLOAT: left" class="mt-image-left" alt="nokia.png" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/img/nokia.png" width="261" height="112" /></span></div>
<p></p>
<p>On the 6331 version the text and image sizes are reduced to account for the smaller screen and the podcast link is hidden.</p>
<p>Here's a simplified diagram of the flow during a mobile page request: </p>
<p>
<div class="blq-clearfix">
<span style="DISPLAY: inline" class="mt-enclosure mt-enclosure-image"><img style="MARGIN: 0px 20px 20px 0px; FLOAT: left" class="mt-image-left" alt="diagram.png" src="https://bbcbreakingnews.pages.dev/blogs/bbcinternet/img/diagram.png" width="266" height="289" /></span></div>
<p></p>
<h3>Page personalisation</h3>
<p>Successfully navigating over 60 regional news areas, 17 sports categories, 181 football teams, 18 news topics, 9 radio stations and 6 TV channels on a mobile device requires some organisation. To this end many of the topics on the mobile home page can be personalised to show only the information you're interested in. When you personalise your page the personalisation settings are stored in a cookie on your device. Due to the number of personalisation combinations available a cookie format had to be designed to store these settings efficiently to reduce the storage space consumed on the device, while being flexible enough to allow future development.</p>
<p>In the end we settled on the format shown below: </p><code><pre>11_3_8_4___G9_10__CD11__CK12_14_15_16_

</pre></code>
<p>Each of these fragments represents a topic on the homepage and its personalisation settings. The position of the fragment in the cookie determines the order in which the topics appear in the page. </p>
<p>Topics that can be personalised contain extra information in their fragment that represents the personalisation state of the topic. For example, the fragment '10__CD' describes the 'Television' topic and can be split into three fields: '10', '__' and 'CD'. The '10' is the topic ID, the next two characters are used to store the TV region as a 2 digit base 42 (b42) number and the rest of the fragment stores the selected TV channels. In this case the channels are 'CD' which correspond to BBC1 and BBC2. Adding BBC3 to the page changes the fragment to '10__CDF'. Both the channels and the order in which they will appear in the topic are stored. The formats of the other topics vary depending on the information to be stored and are outlined briefly below. We don't use vowels in the configuration cookies to avoid spelling unfortunate four letter words. With this many combinations they're bound to occur.</p>
<p>The topic IDs and their personalisation encodings are as follows:</p><p>
<br>1   Promo	- none
<br>3   News - 2 character b42 region + n character feed list
<br>4   Weather - 3 character b42 region + 1 character b42 display format 
<br>8   Sport - 2 character b42 region + n character feed list
<br>9   Entertainment - none
<br>10  Television - 2 character b42 region + n character feed list
<br>11  Radio &amp; Music - 	2 character b42 region + n character feed list
<br>12  iPlayer - none
<br>14  Featured Sites - none
<br>15  Search - none
<br>16  MyClub - 4 character club ID + 2 character b42 display format</p>


<p>The characters used for the base 42 encoding are: </p><p>'_CDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz'.
</p>
<p>If you're so inclined, you can play about with the configuration format to see how it works. Paste the following URL into your desktop browser, edit the configuration and see what happens. </p>
<p><a href="https://bbcbreakingnews.pages.dev/mobile/ps/11_3_DfCV8__GW4__DG9_10_DGD11__HM12_14_15_16__C___/?bookmark">https://bbcbreakingnews.pages.dev/mobile/ps/11_3_DfCV8__GW4__DG9_10_DGD11__HM12_14_15_16__C___/?bookmark</a> </p>
<p>You'll notice that you can't remove the promo or search topic. These are now permanently part of the page but still appear in the personalisation settings. They'll be removed in the future. </p>
<p>
<h3>Scaling personalised applications</h3>The system described so far has all the functionality required, but in order to cope with the high load demanded caching must be used to reduce the load on the servers. 'Caching' is the process of storing in memory a piece of data that takes time to be rendered or downloaded so that next time you need it you can simply look it up. 
<p></p>
<p>Non-personalised pages are relatively simple to cache as each user sees the same page. But personalised pages, where each user has a personal view on to a page, requires a little more thought; a user in Manchester doesn't want to see the weather for a user in Birmingham. </p>
<p>The problem we have is that the number of combinations of personalised pages is huge. The order of topics in the page alone gives us over 300,000 combinations. So what we've done is to cache the individual page topics separately, rather than the complete pages. When a client request is received for a particular topic order, the topics are simply retrieved from the cache in that order and concatenated to form the complete page. This immediately reduces the potential amount of data to be cached by a few orders of magnitude, but there's still the problem of the topic content. </p>
<p>For example the news component has over a million combinations and that's before all the regional news feeds have been factored in. We can't cache them all. Luckily there are a couple of things on our side:</p>
<p>
<ol>
<li><strong>Not all personalisation combinations are equally represented: </strong>It turns out that nearly 70% of all requests are for the same couple of dozen personalisation combinations. The last 30% is still a large number, but the majority of the load can be effectively managed by caching.</li>
<li><strong>We don't want to cache the components forever:</strong> Many topics contain dynamic data such as news stories that need to be updated periodically. Caching components for just a few seconds is enough to considerably reduce the number of requests per second while not filling up the server cache. Perhaps in the future we could exploit the observation in point 1 and employ a more intelligent caching system where the more popular configurations are cached for longer.</li></ol>
<p></p>
<p></p>
<h3>Conclusion</h3>
<p>The mobile homepage is still under constant development and there are many aspects of the system that can be improved. Mobile development is still a relatively new discipline and presents its own unique problems. But it's by building novel systems that we develop the techniques to solve them, some of which may find uses beyond their original application.</p>
<p>I hope this has provided an insight into some of the work that we do here at BBC Mobile. With ever more powerful devices becoming available it's a very exciting field to be working in at the moment. I hope we can help to make it an exciting experience for you too.</p><em>Mark Longstaff-Tyrrell is a software engineer on the BBC mobile platform.</em>]]></description>
         <dc:creator>Mark Longstaff-Tyrrell 
Mark Longstaff-Tyrrell
</dc:creator>
	<link>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2010/01/a_brief_technical_overview_of.html</link>
	<guid>https://bbcbreakingnews.pages.dev/blogs/bbcinternet/2010/01/a_brief_technical_overview_of.html</guid>
	<category>mobile</category>
	<pubDate>Wed, 20 Jan 2010 16:45:00 +0000</pubDate>
</item>


</channel>
</rss>

 
