Plug-n-Play Smart Sensor Network With Dynamic Web Service IEEE TRANSACTIONS ON INSTRUMENTATION AND...

44
Plug-n-Play Smart Sensor Network With Dynamic Web Service IEEE TRANSACTIONS ON INSTRUMENTATI ON AND MEASUREMENT, VOL. 57, NO. 1 0, OCTOBER 2008 Fabrizio Ciancetta, Student Member, IEEE, Biagio D’Apic e, Student Member, IEEE, Daniele Gallo, Member, IEEE, and Carmine Landi, Memb er, IEEE 學學69721041 學學 學學學 學學學學97.12.16

Transcript of Plug-n-Play Smart Sensor Network With Dynamic Web Service IEEE TRANSACTIONS ON INSTRUMENTATION AND...

Plug-n-Play Smart Sensor NetworkWith Dynamic Web Service

IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 57, NO. 10,

OCTOBER 2008

Fabrizio Ciancetta, Student Member, IEEE, Biagio D’Apice, Student Member, IEEE,

Daniele Gallo, Member, IEEE, and Carmine Landi, Member, IEEE

學號: 69721041 學生:朱振伸

報告日期: 97.12.16

1. INTRODUCTION 2. Web Services 3. Dynamic Services 4. Distributed Architecture 5. FI Implementation 6. Developed System

INTRODUCTION

IN different technological and information fields, continuous measurements are needed to monitor the system evolution and to take proper controlling actions.

By adopting smart web sensors, the client can read the state of a particular physical phenomenon with a browser or with an application developed to receive information from the web server.

With the Java approach, the manufacturer does not give protocol information to the final users, rendering it difficult or impossible to exchange information between a server and a client.

the long time required to access information, the impossibility to access a single data sent from the smart web

sensor, to perform further data manipulation, to correlate two measures supplied on-line by two

different systems are possible examples

every sensor defines its IP address and communicates its qualification to a master of the network

優點: 1) faster and easier access to measured data; 2) integration of a large complex web sensor netw

ork; 3) realization of flexible custom applications; 4) service reprocessing.

II . Web Services

A web service provides an infrastructure to exchange structured data in distributed environments.

In the past, clients accessed these services using tightly coupled distributed computing protocols

The web supports universal communication using loosely coupled connections.

II . Web Services

Web protocols are completely vendor, platform , and language independent

Web services support web-based access, easy integration and service reusability

SOAP provides an infrastructure for exchanging structured data in a distributed environment

II . Web Services

A. Web Services Description Language (WSDL)

A universal description, discovery, and integration “repository” is a directory of the available web services and their WSDL documents.

II . Web Services

B. PHP Web Services PHP is a widely used general-purpose scripting language,

which is well suited for Internet-based system development and is embedded into HTML.

PHP 有以下幾種有用的功能:1) object-oriented programming capabilities;2) SOAP and XML-RPC classes, each able to support webservice transactions;3) XML support, as well as several PHP extensions to expandXML functionality;4) CURL extension, allowing communication via variousprotocols such as the hypertext transport protocol (HTTP),HTTP secure, FTP, Telnet, and lightweight directory accessprotocol.

II . Web Services

B. PHP Web Services NuSOAP, which is a collection of PHP classes, all

ows users to send and receive SOAP messages over HTTP.

Web developers, regardless of the Web server platform available and/or permission restrictions,are able to use NuSOAP to create web services by including this class in the directory structure of their PHP-enabled Web server.

III. DYNAMIC SERVICES

The main web service limitation is the impossibility to give dynamic services.

It is very important to develop a methodology to create a network in which smart web sensors (network nodes) can be plugged without external configuration.

III. DYNAMIC SERVICES

Every sensor sets an IP address and communicates its ability to the network master, which has two functions:

1) the master of the entire network 2) a gateway.

III. DYNAMIC SERVICES

A. IP Acquisition In a plug-n-play sensor network, IP address

acquisition has an important role. Every new active element in the sensor network

asks the DHCP server which IP address it can use.

this approach is the impossibility of the DHCP server to detect a new service’s node

III. DYNAMIC SERVICES

Every new element has a default IP address (X.Y.Z.1), and the network server has a static IP address (X.Y.Z.2).

When a new element enters the sensor network, it executes two tasks: 1) detects if there is no transmission on the

network; 2) sends a request to the server, which replies

with the first free IP address.

III. DYNAMIC SERVICES

B. IP Table Routing and Service Table Upgrading

Themain advantage of our solution is the possibility to merge more services to implement another new service.

This table, showing all the services available to the client and how they can be implemented, is upgraded every time a new sensor executing new services is plugged.

III. DYNAMIC SERVICES

Fig. 1. IP table routing and service table.

III. DYNAMIC SERVICES

The web service presents a database (DB) of functions that stores all the executable functions. A typical function executes the following tasks: 1) reserves the required memory to every element; 2) receives all the values from the services involved in the

function; 3) performs all the operations necessary to have the

correct result; 4) gives the result to the web service that resends it to the

client, using SOAP.

C. Communication Protocol The XML enables sending information using any c

ommunication protocol Every node uses TCP/IP sockets on the 8080 port

to receive and send an XML packet called servent The network makes the request–response packet

transmission possible through the nodes.

the request–response packet : IP request–response LIST request–response SERVICE request–response

Using the XML tree property,every array component is considered as a node in the XMLpacket. PING: This is used by the server to check if all the net

work nodes in the IP table routing are still connected. BYE: This is a mechanism adopted by the network to i

nform the server that the node has gone down.

D. Dynamic Web Service its main limitation is that when a developer wants

to use a remote resource, he or she imports the WSDL contract on its application only for the time he or she queries the web service.

To obviate this restriction, it is necessary to export “a web service of web services”

The methods adopted for managing the services available on the smart sensor are the following: LIST: to have the list of all the active web

services; REQUEST SERVICE: to request a particular

service; INFORMATION: to have other information on the

web service

IV. DISTRIBUTED ARCHITECTURE

The architecture proposed for the monitoring system utilizes a hierarchical clustered structure.

In particular, there are four main levels: 1) central lab (CL); 2) peripheral labs (PLs); 3) field labs (FLs); 4) field instrument (FI).

A. Synchronization Problem Here, the timing constraints are met by special

programming, combined with the use of high-performance communication technologies capable of supplying a deterministic latency.

One is based on the use of real-time clocks embodied in the system components and synchronized, interacting via LANs and the Internet.

In this environment, the most widely used techniques for synchronizing clocks are the following Network time protocol (NTP, RFC 1305):

Targets are autonomous systems that are widely dispersed on the Internet .

IEEE 1588 (precision time protocol): Targets are groups of relatively stable components that are

locally networked (a few subnets) and cooperating on a set of well-defined tasks.

Global Positioning System (GPS): Targets are autonomous and widely dispersed.

TABLE I DIFFERENCES BETWEEN MAIN SYNCHRONIZATION STANDARDS

In the NTP determining-time protocol, the time stamps exchanged between the server

and, eventually, many other subnet peers are used to determine individual round-trip delays and clock offsets, as well as to provide reliable error estimates.

In the IEEE 1588 protocol, the message exchange between master and

slave is used. The protocol determines a unique master among

a group of clocks, using the best master clock algorithm.

GPS simple to use

V. FI IMPLEMENTATION

Fig. 4. Smart sensor simplified block diagram.

Fig. 5. Linking schema of the whole system.

FOX Board LX832

dsPIC(數位訊號控制器 )

In addition to dip/swell detection, the rms values are also averaged over 3 s,

The 3-s averaged values and the detected dip/swell information are sent to the micro web server , which exchanges 5-B messages.

The measurement result is expressed with 4 floating-point bytes, whereas the last byte defines the type of result

FOX Board stores the received information in a structured query language (SQL) DB on a universal serial bus (USB) mass-storage device.

A. Microcontroller System A new kind of microcontroller, i.e., the dsPIC 16-b digital sig

nal controller (DSC), was adopted to implement the data acquisition and preprocessing.

B. Networking Embedded System For the network connection and the web server implementa

tion,a low-cost embedded system for developing Internet devices, the FOX Board, was used.

C. Synchronization for Data Transfer During boot time, FOX Board synchronizes the start of the

acquisition of the three dsPICs, adopting a synchronization protocol. After power on, all dsPICs wait until the FOX Board is ready

and raise the OG2 logical value. Each dsPIC reads the logical value and sends the FOX a c

onventional string. After the reception of strings from all the dsPICs, the FOX Board lowers the OG2 logical value. • When OG2 becomes low, dsPICs begin acquisition and preprocessing operations.

D. RMS Algorithm The algorithm adopted for the rms calculation is based on t

he Eulero’s integration of square values of acquired samples

N is the ratio between the sampling rate and the input signal frequency

To store the N samples, a circular firstin–first-out buffer was used. The sliding-window application leads to

VI. DEVELOPED SYSTEM

A. Open-Source Software Internet Platform B. Web Service

The NuSOAP web service exports three basic services from which all information stored can be obtained: 1) request RMS values in a particular interval of days and/or h

ours; 2) request information about voltage dips that occ

urred in a particular interval of days; 3) request information about voltage swells that o

ccurred in a particular interval of days.

In particular, the complex data types are the following: 1) date: a simple class that the developer uses to

query the web service; 2) floating array: the acquired rms result.

C. .NET Client For the client development, the VB.NET based on

Framework .NET 1.1 was adopted.

Fig. 8. Windows form schema.

Fig. 9. RMS time graph.

Fig. 10. RMS timetable graph.

Fig. 11. Dips statistical aggregation.

Conclusion

1. 感測網路的持續監控是必要的,但透過 web service 可以讓我們在遠端就能得到需要的資訊。

2. Web Service 在清單控管上,實施 IP 話可以提升服務的控管能力。且可以知道線上有哪些服務可供使用。