Figure 3: Directed service graph.
To construct a directed SG, we create links
between the DSNs and SINs. When a device is
discovered by CP, our system checks the service
interface's data type and semantics of the added
device. If the DSN's data type and semantics are the
same with the service input interface's data type and
semantics, then a link is directed from DSN to SIN.
Otherwise, if the DSN's data type and semantic are
the same with the service output interface's data type
and semantics, then a link is directed from SIN to
DSN. Each time when a device is discovered by CP,
our system would make links between DSN and SIN
automatically. Fig. 3 represents the directed SG.
2.4 Execution Path Exploration
We use Virtual Application Probing (VAP) to find a
composite service path in the directed SG. To
implement this scheme, we place each visited node
into a linked list and record its preceding node with
index information. Then we use VAP to find a
shortest execution path (EP) in SG. Step 0: Check
virtual device description. CP reads the virtual
device's description to know the virtual service's
input and output interfaces' data types and semantics.
Step 1: Put the DSN which represents the virtual
service's input interface into linked list. Step 2: Put
SINs whose input interface is the DSN from step 1
into linked list. Record their indexes as the number
of the preceding nodes in the linked list. Step 3: Put
the DSN which represents the output interface of the
SIN from step 2 into list. And record the index as the
number of the predecessor nodes in the linked list.
Step 4: If we find DSN of the virtual service's
output interface, stop searching and export the EP
according to their indexes. Otherwise, repeat Step 2
and 3 until there are no nodes left in linked list.
2.5 Virtual Service Provision
Once all EPs of virtual device are explored, the
virtual device with the EPs will be created and CP
would invoke the services which was required in the
EP sequentially. Here we describe two types of
flows: control flow and data flow. Control flow is
used to trigger the required service in EP. If we
invoke the virtual service, the CP would invoke the
primitive services automatically with the control
flow. And data is exchanged between services
without going through the CP.
3 SYSTEM IMPLEMENTATION
Our device model is refined from CyberLink for
Java (CyberLink 2004), which is a development
package for UPnP developers. We append some
classes and methods to implement our DSC system.
y ControlPoint Class
: Method DeviceAdded()
checks whether a service can be composed with
other service by interface matching. If the added
service’s interface exactly matches another service’s
interface then we connect the two service nodes in
SG. If a device is leaving the UPnP network, method
DeviceRemoved() removes the links between the
service nodes.
y SemanticType Class
: This class is used to
describe the data structures of SG. DSN represent
the interfaces of a service. And SIN records the
service information including device name and
service name. With the aid of semantics, we use
“interface matching” approach to find out what
service’s output can be fed to the next service’s
input. Then we use VAP to find a virtual service in
the directed SG.
y LinkedList Class
: The LinkedList class is used
to find EP of virtual device. We implement a linked
list to record the SG nodes in EP. Extra index
information is used to record the preceding node’s
number in the linked list.
y VirtualDevice Class
: In the beginning of VAP
process, CP will check the virtual device’s
descriptions. If the virtual service can be composed
from the primitive services, we create an instance of
virtual device with the EP and user can invoke the
virtual device from CP. Unlike the real device, the
virtual service/device is not implemented beforehand.
The virtual device can receive a composite EP found
by VAP. The virtual service is a composite service
composed from the primitive services. Once the
virtual service is invoked, CP would sequentially
invoke the primitive services involved in EP.
DYNAMIC SERVICE COMPOSITION FOR VIRTUAL UPnP DEVICE CREATION IN HOME NETWORK
ENVIRONMENT
351