Vous êtes sur la page 1sur 5

Proceedings of the 2009 IEEE

International Con ference on Mechatronics and Automation


August 9 - 12, Changchun, China

Improvement for Real-time Performance in Bluetooth


Home Control Network
Suying Yang, Xin Zhang and Chongquan Zhong
School ofElectronic and Information Engineering
Dalian University of Technology
Dalian, Liaoning Prov ince, China
rr3 19@dlut.edu.cn

Abstract - Measurement and control information should be devices, collect information , and schedule all the home
transmitted in time between devices in Bluetooth Home Control devices in case of emergency . At the same time, EBHS
Network (BHCN) to provide a safe and efficient environment. A provide a connection device for internal network and external
scheme for improving real-time performance of BHCN is network , so remote user can login the EBHS to control and
discussed in this paper. Taking JlC/OS-II which is a real-time OS monitor the devices .
as platform, Embedded B1uetooth Home Server (EBHS) is
constructed as the core of BHCN to realize centralized control of
home devices. By selecting reasonable development protocol
layer and establishing Home Information Storage Structure
(HISS) in EBHS, the time of transmitting information and
connecting device is reduced effectively. According to the
0 :1! Air 'onditiore' I
demand of BHCN, we put forward an improved Bluetooth G :II Ri, e ,o oker I
polling algorithm. The weight of every node is decided by its
polling success rate (PSR) and vacancy rate (VR), and is used to
determine the polling sequence. The simulations show that the
o :II Lighting 'o ntrol I
improvement can effectively reduce the average delay of
transporting data packet and increase the polling success rate.

Index Terms - BHCN, real-time, EBHS, PSR, YR.


o :l! I
Ten~ .emor I

1. INTRODUCTION Fig. I. Modul e of BHCN structure.

With the development of communication, network,


control and artificial intelligent technology, people demand 111. IMPROVING R EAL-TIM E P ERFOR MANCE
more and more critically from comfortable and intelligent The measurement and control information should be
home environment, and the design proposals for Home transmitted in time between devices in BHCN to prevent
Control Network (HCN) emerge in endlessly. The HCN using devices getting out of control caused by delay, especially for
Bluetooth technology is being paid close attention to by sensor devices which are closely linked with the safety in
people gradually for low cost and flexible control. BHCN. We propose a scheme for improving real-time
At the moment, many schemes are intended to improve performance from four aspects.
the real-tim e performance in BHCN. But many of them are
realized difficultly for their complex algorithms , and some A. Selection ofEmbedded OS
need to modify the Bluetooth specification. In this paper, on Currently, both of flC/OS-ll and flClinux are free
the grounds of the special conditions of Home Control embedded OS, which have better capability, open source code
Environment (HCE), we propose an effective scheme which is and are widely used. They can be used as the research model of
convenient to implement to improve the real-time performance RTOS and non-RTOS respectively. flClinux takes more space
on the basis of the existing Bluetooth specification. and has worse real-time performance. Porting flClinux to new
II. BHCN
processor is more complex . Utilizing abundant resources of
Linux, flClinux has advantages over flC/OS-ll for some
The primary target of HCN is to integrate the household complex applications. However, flC/OS-ll takes less space, has
appliances , environment control and security monitoring good real-time performance and executes efficiently. It is
system by unitary control platform [I]. According to the easier to port flC/OS-ll to new processor, and small control
requirements of HCN, BHCN adopts the construction model system or measurement and control system can make full use
that is shown in Fig. I to implement the network control of of the strength of flC/OS-ll for its small but strong and real-
devices [2]. time kernel. The cost and timeliness of information
In BHCN, EBHS constructs a basic Bluetooth network transmission should be considered in HCE. Above all, we
with home device s called Piconet, and EBHS is the Master of select embedded real-time OS flC/OS-ll as development
Bluetooth network . As the core of BHCN, EBHS can control platform.

978-1-4244-2693-5/09/$25.00 2009 IEEE 1752


We customize four tasks for EBHS according to the
requirement and characteristics of home control, which is
shown in Fig. 2.
I) Detecting Task: Receive and process the measurement
data by communicating with sensors and household
appliances , and judge whether the data is out of security range

~~ DerectingTask =:=>~

~==:>Csecurity Contro l Tas~~


~
g
DataBase
~OCal Control Task ~~

~Remote Control Task~


~

Fig. 2. Customizing task s for EBHS . Fig. 3. Bluetooth protocol mode l.

[3]. While the data is out of security range, the detecting task
Adopting HCI protocol to exchange information can
will communicate with security control task through mailbox.
reduce the data redundancy caused by complex protocol, and
2) Security Control Task: When security control task
reduce the slot time spent by transmitting control commands
receives a message sent by detecting task from mailbox , the
and improve communications quality. In BHCN, the
security control task will schedule all of the home devices and
transmission data is almost control commands and parameter
alarm immediately.
information with short length. Synthesizing hardware
3) Local Control Task: Control the home devices except
conditions , we use RS232 HCI protocol.
sensors through EBHS or human-machine interaction device.
4) Remote Control Task: Log on the EBHS and control C. Constructing Device HISS
the home devices except sensors through Internet remotely. In theory, the time of completing a successful process of
From Fig. 2, we see that these four tasks all need access inquiring and connecting is shown in TABLE II.
the database to modify or read the information of BHCN, From TABLE II, we can see that the inquiring time that is
which will cause conflict. Semaphore which can limit much longer than connecting time, so reducing the inquiring
accessing is set to solve the mutual exclusion problem . time can quickly establish connection . The effective method is
The task priority is assigned based on real-time of each to register home device information in EBHS, thereby the
task. The priority of a task must be a number, and the priority EBHS need not inquire the device. EBHS connects the home
becomes higher as the number becomes smaller. The priorities TABLE II
of every task are shown in TABLE 1. TIM E OF COMPLETI NG A S UCCESSFUL PRO CESS OF INQUIRING AN D
CONNECTING
B. Selection ofDevelopment Protocol Layer Minimum Average Maximum
Operation
The specification of Bluetooth system contains Core timc(s) time (s) timc(s)
specification and Profile specification. The Core specification Inquire 0.00125 3-5 10.24-30.72
defines protocol of every layer, and its model is shown in Fig.
Connect 0.0025 1.28 2.56
TABLE I
PR IORITY OF EA CH T AS K
Total 0.00375 4.28-6.28 12.8-3 3.28
Task Name Priority
Security Control Task 2
device using the registered information , so this method can
Local Control Task 4
avoid delay caused by inquiring frequently. We define a
Local Control Task 6 structure called by DeviceInfo to store device information :
Detecting Task 10 struct DeviceInfo
{
unsigned char DeviceID[1 0];
3. The Profile specification defines a mechanism that runs /*Device ID*/
coordinately among the layers to actualize a specific unsigned char DeviceName[30];
application model. /*Device name */
Host Controller Interface (HC!) is an interface for the
unsigned char DeviceManufactureID[16] ;
higher layers in the protocol stack accessing to lower layer
/*Manufacturer*/
transmission proto col. All commands of Bluetooth controller
unsigned char DeviceType;
must be interpreted by HCI, and then they can be executed .
/*Device type */

1753
unsigned char DeviceFunction[ 16]; devices use active mode, and have a little amount of
/*Device function */ information and short transmission delay.
unsigned char DeviceVersionNum[8]; Normal devices include the devices low transmission rate,
/*Device version */ such as television, air conditioner and rice cooker. These
unsigned char DeviceAddress[6]; devices belong to controlled devices and adopt uplink and
/*Bluetooth Address */ downlink transmission mode. We don't need to monitor status
unsigned int DevicePriority; of these devices.
/* Device priority */ The priorities are set according to real-time and security
/* */ requirement, and stored into variable DevicePriority of HISS.
The priorities of normal devices are lower than that of key
};
devices. The order of polling devices is strictly in accordance
D. Polling Scheme with device priority. We use improved algorithm to poll
The traditional polling scheme of Bluetooth is Round devices with the same priorities.
Robin (RR). The master polls the slaves according to a fixed For devices the same priorities, the weight of every device
cyclic order, so this scheme is apt to cause large resource waste is decided by its polling success rate (PSR) and vacancy rate
and low efficiency. There are many related polling schemes for (VR), and is used to determine the polling sequence. PSR is
Bluetooth. Some of these schemes are complex to be defined as follows.
implemented, and excessively demand fairness and efficiency, P .
d
. =~
fD
which leads to increase cost. PS1\. (i=0,1, ... ,N-1) (1)
1) Related Research
1 P
1

Fair Exhaustive Poll (FEP) algorithm uses RR algorithm to


poll active devices and uses Regular Poll algorithm to poll low Where Pdata,i is the number of polled time for device i when it
power devices. Compared with RR' FEP increases efficiency. has data packets to transport or receive, and Pi is the total
However, idle polling may occur in the process of polling. number of polled times for device i. The more PSRiis, the high
[4] suggests a polling-on-demand scheduling algorithm for the probability of transporting data packets of device i is. These
Bluetooth Piconet. The algorithm first computes out estimated two coefficients are computed on the basis of the last polling
value of packet arrival rates and latency time for each link results.
based on the historical data, and then selects a link with the VR is defined as
highest priority to poll and calculate the next polling time.
P
[5] proposes a Patter Matching Polling (PMP) policy for VR j =1- N=f- (i = 0,1, ... ,N-1) (2)
ACL connection in a Bluetooth Piconet. For each master-slave
pair by estimating both sides' packet arrival rates, the master LP
k=O
k
judiciously selects a polling pattern that can best utilize the
network bandwidth. Where Pi is the total number of polled times for device i. The
In [6], a Piconet scheduling algorithm is proposed. This higher VR is, the lower the fairness is.
algorithm uses signal-to-noise ratio and the Nakagami fading To sum up, PSR reflects efficiency and VR reflects
parameter m based on the estimated channel state information. fairness. We define weight regular factor (WRF) a to balance
[7] proposes a Pseudo-random cyclic Limited and Slot- the efficiency and fairness to satisfy the demands of different
Weighted Round Robin (PLSWRR) scheme. This scheme has applications. So polling weight is
the following two important properties: The order in which
slaves are polled in each cycle is determined in a pseudo- W; = aPSR + (1- a)VR
j j (i = 0,1, ... ,N-1) (3)
random manner; the rate of polling to less active slaves is
reduced by taking into account the traffic history. a has a great influence on the real-time performance in
The above mentioned schemes have certain limitations in BHCN. a should be dynamically changed according to actual
HCE. The demand of fairness is not strict, because only low conditions of network. We define an objective function
cost and transmitting data for special devices (such as detecting
WT.
devices which involve security) in time are demanded in HCE. Zj = _1 (i = 0,1, ... ,N-1) (4)
The scheme presented in this paper builds on FEP algorithm Tj
and removes its disadvantages to make it suitable for HCE, and
we also absorb the advantages of some other schemes. Where WT i is the wait time of device i from last time when it
2) Improvement for Polling Scheme has data packets to transport or receive, and T, is the time
According to the characteristics of Bluetooth working interval between last polled time and this polled time.
mode and using frequency and requirement in BHCN, home When Zi is bigger than a certain ratio TG (0.5 in this
devices are divided into key devices and normal devices. paper), a (initial value is 0.5) is regulated. Step length is h
Key devices include sensors which are used for security (0.002 in this paper) at a time.
measurement. This kind of devices are uplink transmission According to FEP algorithm, device status is divided into
devices, namely, the slave sends message to master. These normal status and delay polling status. These two statuses are
exchanged on the basis of the number of polled time for

1754
device i without data packets over a successive time and The average delay of data packet is shown in Fig. 4.
average PSR of device i. The condition of status exchanging In Fig. 4, the average delay of data packet in improve
is defined as follows. algorithm is less than that in other two algorithms, and delay
NDj ~ND in RR is the highest. The more devices in BHCN, the higher
delay we get.
PSR j ~NDR (i =O,I, ... ,N-I) (5)
Fig. 5 shows the correlation curve ofPSR.
{
NS =0j

In Fig 5, PSR in improved algorithm is higher than that in


Where ND j is the number of polled time for device i without
other two algorithms, and RR get the lowest. With the number
data packets over a successive time. NO and NOR are all
of devices increases, there is a trend downward in PSR. But
constants, and they are 5 and 0.2 in this paper respectively.
this is not absolute. Different data environment cause different
When (5) holds , status of the device would be changed
results.
from normal to delay polling status . If a device goes into delay
polling statu s, it couldn 't be polled in a delay period. V. CONC LUSION
IV. SIMULATION We construct EBHS as the core of BHCN based on
By simulating RR, FEP and improved algorithm in llC/OS-ll development platform instead of traditional PC in
BHCN , average delay of data packet and PSR are compared. this paper, which can improve construction flexibility for
The limiting conditions are listed as follows. BHCN. Designing detecting, security control, local control
1) All devices should be in a Piconet where the number of and remote control tasks can offer guarantee for improving
active devices is less than 7. real-time performance of BHCN. HCI layer is adopted to
2) All devices are with the same priority . reduce information redundancy, and HISS is established for
3) Ignore the interference and security of network EBHS to reduce connection time. In the last place the focus is
environment. on researching polling scheme for BHCN, and we propose an
First is to construct virtual simulation environment the improved algorithm based on PSR and VR. By dynamically
parameters of simulation are listed in TABLE 111. ' regulating WRF a and shifting status of devices, the polling
efficiency is improved. The simulations show that the
TABLE III improved algorithm can reduce the delay of transmitting data
PARAMETERS OF S IMULATION E NVIRONMENT
Parameters Value
Simulation cycle 3600000ms - t - - RR
----e- FEP
Simulation times 20 - Improved Algorithm

Polling interval 1000ms


Data generation cycle 1000ms ~ 35
~
Link time 3-2560ms ~ 30

Time of sending data 1-5ms ~ 25


=
c:
~ 20
Data packet is randomly generated. Make sure the same
data environment for thes e thre e algorithms, and obtain 15

average result after several simulations. 10 ------


Next is to set the parameters of the three algorithms
respectively. As the RR algorithm polls data packets in tum, 2.5 3.5 4.5 5.5 6.5
we don't need to set its parameters. Polling delay in FEP is N

the same as that in improved algorithm. The parameters of Fig.5 correlation curve of PSR
improved algorithm are shown in TABLE IV.

900 ,---------.----,--------.----,-----~
TAB L E IV
P ARAMETER OF IMPROVED A LGOR ITHM IN THIS SIM ULATION ~J
Value in this 800
Parameter Range

iI
simul ation
N N~2 2-7 700

a 0.5-1.0 0.5 m
;;
~ 600
TG 0-1.0 0.5 ~
m

h 0-1.0 0.002 ~
~ 500

ND any integer 5 ~
~
Polling delay any integer ND - t - - RR
----e- FEP
-r-e-r- Jmproved Algorithm

1755
N

Fig.4 correlation curve of average delay of data packet


packets, and the real-time performance of BHCN is
significantly improved.

REFERENCES
[1] Lanying Li and Chen Yang, "Design and Implementation of Smart
Home's Terminal Control System Based on S3C44BOX," JOURNAL
HARBIN UNIV SCI. &TECH, vol. 12, no. 3, pp. 84-86,2007.
[2] Zhenchun Wei, Jianghong Han and Jianjun Zhang, "Design of the
Remote Control System in Smart Home," Journal of Hefei University of
Technology (Natural Science), vol. 28, no. 7, pp. 751-754,2005.
[3] Yu Zhou and Bo Jing, "Research and implementation on IlC/OS-II
operating system into wireless networked sensors," in Proc.8th Int. Conf
Electronic Measurement and Instruments, Xi 'an, China, 2007, pp. 4-199 -
4-204.
[4] Fan Yang, Ke Wang and Zhihong Qian, "Polling-on-Demand Scheduling
Algorithm for Bluetooth Piconet and Performance Evaluation," Acta
Electronica Sinica, vol. 35, no. 4, pp. 647-652,2007.
[5] Yeng-Zhong Lee, Rohit Kapoor and Mario GerlaAn, "Efficient and Fair
Polling Scheme for Bluetooth," in Proc. IEEE Military Communications
Conf, 2002, vol. 2, pp. 1062-1068.
[6] Joao Henrique Kleinschmidt, Marcelo E. Pellenz and Luiz A. de Paula
Lima Jr, "An Efficient Polling Strategy for Bluetooth Piconets using
Channel State Information," in Proc. IEEE 6th CAS Symp. on Emerging
Technologies: Mobile and Wireless Comm , Shanghai, China, 2004, vol.
2, pp. 667-670.
[7] Ting-Yu Lin, Yu-Chee Tseng and Yuan-Ting Lu, "An Efficient Link
Polling Policy by Pattern Matching for Bluetooth Piconets," in Proc.
IEEE 36th Hawaii Int. Con! on System Sciences, 2003.

1756