User Tools

Site Tools


research:rfid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
research:rfid [2010/07/27 16:18]
kpinte
research:rfid [2011/09/12 18:50] (current)
kpinte
Line 1: Line 1:
-====== Software Abstractions for the Development of Mobile RFID-enabled Applications ======+====== Distributed Object-Oriented Programming with RFID Technology ======
 //Representing RFID-tagged physical objects as **mutable software objects**//. //Representing RFID-tagged physical objects as **mutable software objects**//.
  
-=== RFID-enabled Library ===+[[http://soft.vub.ac.be/soft/members/kevinpinte|Kevin Pinte]] and [[http://soft.vub.ac.be/~alombide|Andoni Lombide Carreton]]
  
-=== Requirements ===+<note> 
 +This page is under construction, some sections are not yet completed. Please refer to the [[:research:rfid#further_reading|futher reading]] section for a full text. 
 +</note>
  
-=== Software Abstractions ===+==== RFID-enabled Library ==== 
 +The RFID-enabled library is a //mobile RFID-enabled application (MoREnA)// and illustrates the kind of application we target. The application runs on a mobile device, such as a smartphone and shows the books that are in the vicinity of the user and allows certain operations to be performed on them. Users can attach a small review message to a book, rate a book or associate keywords with the book, etc. This data is all stored on the book directly, using RFID tag(s). The application lets the user also filter the books based on rating or comparison with a keyword profile describing the user's preferences. For example, the user could just swipe his smartphone over a shelf of books and discover which books on the shelf are must-read books!
  
-== +== Towards naturally expressing RFID applications == 
 + 
 +Developing such mobile RFID-enabled applications with traditional software abstractions is a daunting task given the extreme volatility of connections to RFID tags. Simple repositioning of the mobile (reader) device, interference, etc. cause such applications to be very prone to failures. Currently the programmer is left to deal with these issues manually. 
 + 
 +We even go one step further, by representing RFID-tagged objects as full-blown software objects. State-of-the-art RFID applications merely use RFID tags as digital barcodes and remain oblivious to the enormous potential of RFID technology in ubiquitous computing scenarios. For example, they do not use the writable memory on RFID tags to store contextual information. 
 + 
 +Using the abstractions we present further on this page, programming RFID applications becomes more natural as application logic can be directly expressed in terms of the presence or absence of software objects representing physical items. Building on the [[research:papers|ambient oriented programming model]] of [[http://code.google.com/p/ambienttalk|AmbientTalk]] we provide integrated support for fault-tolerant connections and asynchronous communication with RFID tags. 
 + 
 +In short, we consider RFID tags as the bridge between the physical and digital world. They effectively store digital stand-ins for real world items. 
 + 
 +== Demo == 
 + 
 +The movies below show a small prototype showing discovery of books on a shelf and a user adding a comment to a book. 
 + 
 +<html> 
 +<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/LGiF1OlhC6o&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/LGiF1OlhC6o&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> 
 +</html> 
 + 
 +<html> 
 +<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/WS36nhugGh4&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WS36nhugGh4&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> 
 +</html> 
 + 
 +==== Requirements ==== 
 +To align physical objects tagged with writable RFID tags as true mutable software objects we model these objects as proxy objects acting as stand-ins for physical objects. For this model to be applicable to mobile RFID-enabled applications, it must adhere to the following requirements: 
 + 
 +  - **Addressing physical objects** RFID communication is based on broadcasting a signal. However, to be able to associate a software object with one particular physical object, it is necessary to address a single designated physical object. Object identities of digital objects should always correspond to object identities of physical objects. 
 +  - **Storing application-specific data on RFID tags** Since mobile RFID- enabled applications do not rely on a backend database, the data on the RFID tags should be self-contained and stored on the writable memory of the tags. 
 +  - **Reactivity to appearing and disappearing objects** It is necessary to observe the connection, reconnection and disconnection of RFID tags to keep the proxy objects synchronized with their physical counterparts. Differentiating between connection and reconnection is important to preserve the identity of the proxy object. Furthermore, it should be possible to react upon these events from within the application. 
 +  - **Asynchronous communication** To hide latency and keep applications responsive, communication with proxy objects representing physical objects should happen asynchronously. Blocking communication will freeze the application as soon as one physical object is unreachable. 
 +  - **Fault-tolerant communication** Treating communication failures as the rule instead of the exception allows applications to deal with temporary unavailability of the physical objects and makes them resilient to failures. For example, read/write operations frequently fail due hardware phenomena. 
 + 
 +==== Software Abstractions ==== 
 + 
 +Here we will illustrate our model by presenting small code snippets that, in the end, will bring us to the RFID-enabled library application  above. We will not go in full detail, we merely want to give a look and feel of RFID programming in our model. Please refer to the [[:research:rfid#further_reading|further reading]] section for extensive documentation. 
 + 
 +== RFID tags as mutable proxy objects == 
 + 
 +Physical objects are represented using a digital counterpart. This is done by simply defining an object with appropriate methods and slots. The code example shows the definition of a book object in AmbientTalk. 
 + 
 +<code> 
 +deftype Book; 
 + 
 +def aBook := object: { 
 +  def ISBN := 123; 
 +  def title := "My Book";  
 +  def reviews := Vector.new(); 
 + 
 +  def setTitle(newTitle)@Mutator {  
 +    title := newTitle; 
 +  }; 
 + 
 +  def addReview(review)@Mutator {  
 +    reviews.add(review); 
 +  };  
 +} taggedAs: Book; 
 +</code> 
 + 
 +In this example a book contains an ISBN, a title and a set of review messages. There are two methods that allow to change the title and to add a review. By annotating the message with //Mutator// the programmer specifies when the software object is to be synchronized with the RFID tag. 
 + 
 +Discovering books that are tagged with such an object happens by installing a discovery handler. To react upon disconnection or reconnection of a book, similar handlers are used: 
 + 
 +<code> 
 +whenever: Book discovered: { |book|  
 +  whenever: book disconnected: { // react on disappearance }; 
 +  whenever: book reconnected: {  // react on reappearance }; 
 +}; 
 +</code> 
 + 
 +The example above uses //whenever:discovered:// to install a block of code that will be executed every time a book is discovered in the vicinity of the user. The variable //book// is a remote reference to the book object on the tag. Within this block, two more blocks are installed that are executed when the book disappears or reappears in range of the user. We will later use these blocks to show or hide books in a list in the GUI. 
 + 
 +The [[at:tutorial:actors#ambienttalk_actors_and_far_references|remote reference]] to a book can be used to asynchronously access its slots or methods. The snippet below shows a call to a method that retrieves the title of a book: 
 +<code> 
 +when: book<-getTitle() becomes: { |title|  
 +  system.println(title) 
 +};  
 +system.println("here first!"); 
 +</code> 
 +This method invocation is [[at:tutorial:actors#asynchronous_message_sending|asynchronous]], this means that the sending of the message immediately returns with a [[:at:tutorial:actors#futures|future]]. On this future we can install a block of code that is executed when the return value is ready. For the code above, first "here first!" will be printed, only afterwards the title of the book. 
 + 
 +In case the book is not available at the time of the message send, no exception is raised but the message is simply buffered. When the book reappears in range the message is delivered and will be processed. The programmer can control the amount of time a message is buffered. For example, if the book does not respond within 10 seconds, the programmer might no longer be interested in the result. The code below exemplifies how this can be achieved by annotating the message send with a //Due// annotation. 
 + 
 +<code> 
 +def myReview := "not suitable for beginners";  
 +when: book<-addReview(myReview)@Due(10.seconds) becomes: { |ack| 
 +  // message processed successfully  
 +} catch: TimeoutException using: { |e|  
 +  // message timed out  
 +}; 
 +</code> 
 + 
 +If the message send does not yield a result within 10 seconds, the catch block will be executed. 
 + 
 +== Ambient References == 
 + 
 +RFID tags very frequently appear in groups of the same kind of item. For example, the set of books, or in a supermarket a set of jars of jam, etc. Thanks to [[:research:ambientrefs|ambient references]] it is easily possible to address a set of items of the same type. Furthermore, we can specify a number of constraints the set of items has to satisfy: 
 + 
 +<code> 
 +def books := ambient: Book; 
 +def computerScienceBooks := ambient: Book where: { |b|  
 +  b.category == "Computer Science"; 
 +}; 
 +</code> 
 + 
 +On the first line, we have an ambient reference //books// that designates the set of all books that are detected. Note that this set changes dynamically when the user moves about and books become available or unavailable. 
 + 
 +The last three lines define //computerScienceBooks//,  an ambient reference to the set of books that belong to the "Computer Science" category. This second ambient reference is a subset of the //books// ambient reference. 
 + 
 +<code> 
 +def shelfFuture := computerScienceBooks<-getShelf()@Any;  
 +when: shelfFuture becomes: { |shelf| 
 +  system.println("The book should be on shelf: " + shelf);  
 +}; 
 + 
 +computerScienceBooks<-setShelf("5D")@Sustain; 
 +</code>
  
 == Multiway References == == Multiway References ==
 +
 +{{:research:typesoftags.png?400|:research:typesoftags.png}}
 +
 +
 +== Sample Application ==
 +
 +<code>
 +def books := ambient: Book;
 +whenEach: books<-getBookInfo()@Sustain becomes: { |infoAndRef|
 +  GUI.addBookInfoAndReferenceToList(infoAndRef);
 +}; 
 +whenever: Book discovered: { |book|
 +  whenever: book disconnected: { GUI.removeBookFromList(book) }; };
 +</code>
 +
 +<code>
 +def addReviewToBook(book, text) { 
 +  when: book<-addReview(text)@Due(5.seconds) becomes: { |ack|
 +    showOkDialog("Review added succesfully!"); 
 +  } catch: TimeoutException using: {|exc|
 +    showWarningDialog("Failed to add review!"); 
 +  };
 +};
 +</code>
 +
 +==== Conclusions ====
 +
 +By implementing an example mobile RFID-enabled application using our model of aligning physical objects with mutable proxy objects we have observed that the requirements that we set forward for programming mobile RFID-enabled applications are met in the following ways:
 +  - **Addressing physical objects** The implementation of the application shows that mobile RFID-enabled applications can be written in an object-oriented fashion, where application-level proxy objects uniquely represent physical objects in one’s physical environment.
 +  - **Storing application-specific data on RFID tags** The data needed to con- struct these proxy objects is stored on the RFID tags themselves.
 +  - **Reactivity to appearing and disappearing objects** Application logic is ex- pressed in terms of reactions to changes in the physical environment by relying on a number of expressive abstractions that are integrated into a communicating event loops framework.
 +  - **Asynchronous communication** Interacting with physical objects is achieved by using the message passing metaphor on the proxy objects, by means of asynchronous message passing and asynchronous signaling of return values.
 +  - **Fault-tolerant communication** Communication failures are considered the rule rather than the exception. Failures that must be considered permanent are detected and raise the appropriate exceptions.
  
  
  
-=== Further Reading === +==== Further Reading ==== 
-  * Distributed Object-Oriented Programming with RFID Technology. Andoni Lombide Carreton, Kevin Pinte, Wolfgang De Meuter. In Lecture Notes in Computer Science, vol. 6115, Eliassen F, Kapitza R (eds.), 2010; 56–69. [{{:research:mobile_rfid.pdf|download}}((The original publication is available at [[http://www.springerlink.com|www.springerlink.com]].))].+  * Distributed Object-Oriented Programming with RFID Technology. Andoni Lombide Carreton, Kevin Pinte, Wolfgang De Meuter. In Lecture Notes in Computer Science, vol. 6115, Eliassen F, Kapitza R (eds.), 2010; 56–69. [{{:research:mobile_rfid.pdf|download}}((The original publication is available at [[http://www.springerlink.com/content/517t6667573653m2|www.springerlink.com]].))].
          
research/rfid.1280240304.txt.gz · Last modified: 2010/07/27 16:20 (external edit)