A Smart Electronic Tagging System Based on Context Awareness and Machine-to-Machine Interworking

The existing electronic tagging system traces the location of a sex offender using triangulation by communicating with Global Positioning System (GPS) satellites and mobile phone base stations. The acquired location information is used to prevent the offenders from perpetrating repeat crimes. However, the battery resources of such a system are inadequate as it has to trace the location of the moving target in real time and consumes a large amount of battery power while communicating with GPS satellites and mobile phone base stations. In addition, the systems cannot infer the mental state of the targets or detect their alcohol consumption levels, which may be necessary for the prevention of a repeat crime. The purpose of this study is to connect the Ubiquitous System Network (USN), which consumes little electricity, and Android mobile platforms, which are commonly used for machine-to-machine communication. Thus, this system will legally facilitate the protection of minors by providing information only about the target's approach to certain facilities. In addition, the system uses an Android platform to process data measured by the USN's sensors, which can also detect alcohol intake and infer the mental state of the target, and then initiates the corresponding real-time context-awareness services.


Introduction
Electronic tagging is a service that monitors the location or condition of a person wearing a tagging device using Global Positioning System (GPS) satellites and electronic devices.The tagging device is attached to a person who may commit repeat crimes, such as kidnapping, homicide, or sexual assault, and thus the service is used to help protect society from these offenders.
In Korea, SK Telecom, Elastic Network, and Samsung Data System have released various electronic tagging product services since 2008 in which a Ubiquitous Sensor Network (USN) is connected using Code Division Multiple Access (CDMA) [1].In addition, studies have been conducted on inserting a microelectronic chip in the body of a sexual offender or using a monitoring target in which bioelectronics technology is implemented [2].Users of the system can be seen as regards ex-convicts as potential criminals and thus are open to charges of violating the principles of equality and proportionality of punishment, infringing human rights, imposing a double punishment, and so forth [3].Nevertheless, the research on electronic tagging for the purpose of preventing major offences such as kidnapping, homicide, and sexual assault continues briskly.However, the existing electronic tagging technology has several problems in terms of its ability to facilitate the prevention of sexual assaults and other crimes: low electrical capacity of batteries, difficulty in detecting an emotion or physical change in the target and determining the target's exact location, and so forth.
The legal constraints in Korea are such that the list of people who are required to wear an electronic tagging device is managed solely by the Ministry of Justice, and detailed information about them is not open to the police or ordinary citizens.In Korea, the real-time location of a person wearing an electronic tagging is not publicly available in order to protect the human rights of the ex-convict.Thus, it is impossible to detect the approach of such persons to facilities for children, such as nurseries or kindergarten schools, making minors vulnerable to being the victim of repeating offenders.As it is illegal in Korea to locate the exact position of a person who is wearing an electronic tagging device [4], the Smart Electronic Tagging (SET) system, based on the Machine-to-Machine (M2M) method, which notifies, in real time, only the approach of a person wearing an electronic tagging to facilities for children, is developed.The remainder of this paper is organized as follows.In Section 2, an introduction to the existing electronic tagging system, with which the proposed SET system will be compared, is given for.In addition, methods for saving energy, location tracing, and inferring the mental state of the target using sensors in M2M and the existing sensor network are described.In Section 3, the architecture, flow of data in each device, principles of operation of the proposed SET system, and a context-awareness service using sensors are explained.In Section 4, the details of the development of the hardware and software for each device in the SET system are given, and the components of the realization of the test bed and the data results of the tests are shown.Finally, in Section 5, we present conclusions and the direction of future studies.

Related Works
2.1.The Existing Electronic Tagging System.Three types of systems are used for monitoring people wearing an electronic tag: passive, active, and tracking.The method used in Korea belongs to the tracking type [3].
The electronic tagging system used in Korea is composed of the attached device (electronic tag), tracking device (portable terminal), and home supervision device, as shown in Figure 1.When the electronic tag and portable terminal are located within 5 m of each other and communicate normally, location tracing is accomplished through communication between the portable terminal and GPS satellites [5].The satellites transmit the information to a central location tracing control center in the Seoul Probation Office for the real-time 24-hour tracking of targets [6].If the portable terminal of a target is in an area where it cannot easily communicate with GPS satellites, its location is traced to within a 100 m radius using the Location Based Service (LBS) of mobile communication networks or Wireless-Fidelity (Wi-Fi) using the CDMA signal based on Time Division Multiple Access (TDMA) and Observed Time Difference Of Arrival (OTDOA) received by the portable terminal every 10 s [7].
However, the method of communicating with GPS satellites or CDMA base stations allows a time gap of around 45 s between the previous and actual location of the person who is wearing the electronic tag [6,7].As this method shows only the radius within which the target is located, it does not show on which floor of a building the person is located.Furthermore, it does not give detailed information about the emotion or physical state of the target.As a result, the ability of the existing electronic tagging system to help prevent a crime if it is committed in the basement of the apartment building where the target lives, or if a repeat crime is planned in nearby facilities for children, is limited.

Machine-to-Machine.
M2M is defined slightly differently in different countries.In Korea, M2M is defined as a "nextgeneration fusion infrastructure which provides intelligent services using various media instead of the services based on single media by expanding the communication between man for the usage of information into the communication between man and machine and machine and machine" [8].
The M2M architecture defined by European Telecommunications Standards Institute (ETSI) is shown in Figure 2 [9].All the architectures of the SET system, such as the collection of information by the tail machine, communication between the tail machine (i.e., the sensor node) and the gateway, processing of the information sent by the tail machine, and provision of services to users using application programs that do not require manual operation, are structured in the same way.
SET was established as an M2M system that uses USN and the Android platform.The sensor node, which is the tail machine of the SET system, autonomously collects the sensing data of the target using the heart rate, acceleration, and body temperature sensors, and the collected information  is transmitted to the gateway within the scope of communication through USN.The sensor information is processed in the Android platform and transmitted to the server through Wi-Fi.The server adjusts the urgency level given to the processed information according to the degree of danger and sends notices of impending danger to the different components.

Energy
Saving.In the SET system, the lifetime of the sensor node in the electronic tag significantly affects lifetime of the overall system, which uses the wireless sensor network.That is, the lifetime of the wireless sensor network is affected by how efficiently the sensor node uses the limited energy.Therefore, it is essential to minimize the waste of energy in an SET system that uses sensor nodes.
The main factors leading tor energy waste in wireless sensor networks are collision, overhearing, and control packet overhead.Thus, the adaptive idle listening method should be applied to the SET system, which uses a wireless sensor network, to reduce the energy used by the sensor nodes.In addition, it is also necessary to examine the research on saving energy based on the Media Access Control (MAC) protocol of the SET system.
The asynchronous MAC protocol [10] is a method that transmits data when the communication channel is idle.The checking of the physical link of the channel relies heavily on the Radio Frequency (RF) chip and has the shortcoming of increased energy waste due to the transmission node overhearing the preamble.Moreover, the asynchronous MAC protocol consumes unnecessary energy since data collisions can be found even after all preambles are transmitted.
Still, the asynchronous MAC protocol is easily implemented because it does not have to be synchronized, and it can maximize energy saving since it consumes a small amount of energy when there is little competition and information in the wireless network.Moreover, the asynchronous MAC protocol is appropriate for the proposed SET system as it can reduce idle listening.
The weakness of the asynchronous Berkeley MAC (B-MAC) protocol lies in the increase in transmission delay, the collision of data, and large overhead due to long preambles.Energy also continues to be consumed because of the continuous disagreement in communication time between the sensor nodes and the coordinator due to the fixed length of the duty cycle.
However, in the SET system proposed in this study, the coordinator and the sensor nodes communicate only within the communication scope, causing little data collision due to competition.The phenomenon of energy dissipation due to the increased delay in data can be resolved by using the adaptive duty cycle method [11], and the proper wakeup and idle listening can be predicted by the duration field included in the ACK.
As previously mentioned, if competition intensifies, the possibility of data collision increases in the B-MAC protocol, which has a long preamble.Clearly, the problem can be solved using the result of a previous research on Low Power Listening (LPL), but as the CC2420 RF chip in this system does not support LPL, it is impossible to use the technique to occupy the channel with the preamble before data transmission.
Therefore, the CC2420 chip checks the condition of the channel in various modes using the Channel Clear Assessment (CCA) for data transmission and communication and approaches the channel using the back-off method if the communication channel is in use.The CCA consumes less energy than LPL due to the short time required to distinguish noise from the signal.In addition, most IEEE 802.15.4 RF chip manufacturing companies define the Listening Interval Time (LIT) to conduct functions similar to those of LPL as longer than the time of the completion of the preamble transmission.Through these methods, the energy attrition due to a fixed wakeup time can be overcome, and the same functions as LPL can be accomplished [12][13][14].Using CC2420, as many as 16 bytes of preamble can be supported, which can be adjusted by the user.The channel-occupying time is only 0.512 ms.If LPL is operated here, the energy consumed for turning the RF switch transmitter on and off increases, reducing efficiency.
An additional problem pertaining to LPL is that data transmitted after the preamble are transmitted for a time longer than the length of the data transmission in the process of communication between the sensor node of the electronic tag and the coordinator.Although the coordinator knows that the sensor node is transmitting data, it does not know the exact timing of the data transmission, and thus, it has to receive all the preambles.
If 64 bytes of data are transmitted consecutively based on CC2420, as in this study, the interval time between packets will be 8 ms with about 2 ms of channel occupying time as TX data length PPDU data length = 64 (byte) * 8 (bit) 250, 000 (bit/sec) = 2.048 (ms) .
The sensor node of the electronic tag checks the channel in every preamble cycle.CC2420 takes longer time to transmit than the channel occupying time (2 ms), and the channel is checked for a time shorter than the interval between imaginary preambles (10 ms).If the channel is to be used in idle condition by checking the channel for a time shorter than 10 ms, the beacon should be received or the back-off must be conducted after transmitting the data.More energy may be consumed when using CC2420 than when using LPL, as the CCA should be repeated during the time of the imaginary preamble packet.However, the sensor node of the electronic tag can reduce energy consumption to one-fifth of that used for LPL in the B-MAC protocol by transmitting the preamble packet for just 2 ms at 10 ms intervals.

Location Tracking.
The location tracking of an electronic tag is calculated by the triangulation method using the distance measured from the GPS satellite during communication.
The GPS satellite communication method is used more frequently outdoors than indoors.The GPS chip is expensive and much more additional energy is consumed by GPS satellite communication [15,16].Therefore, various methods that use less energy than GPS satellite communication to acquire of location information have been researched [17].
However, it is not necessary for the SET system to know the exact location of the target being monitored, because it is necessary to know only when the target approaches a certain area in real time.Since the above methods consume a large amount of energy, they will not be applied to the SET system.Instead, the SET system will apply a cell-based location tracking method, which transmits details of the target's approach, in order to reduce consumption of energy used in location tracing.
In the SET system, the operating distance for communication between the sensor node and the gateway is a 40 m radius from the gateway.Within this distance, the sensor node and the gateway can communicate even in the worst conditions.In other words, a gateway can communicate with all the sensor nodes within an 80 m distance.This is explained in detail in Section 4. Therefore, as shown in Figure 3, a SET system can be implemented by installing several gateway cells to cover all facilities for children, such as a nurseries and kindergarten or elementary schools.
Therefore, in the cell-based location tracking method for the SET system, the sensor node of the electronic tag does not consume battery resources for communication with GPS satellites and exact location tracing, and thus it is possible to monitor the target for a longer time than that permitted by the existing electronic tagging systems without changing the battery.

Infer a Psychological State Using Sensor.
In Korea, the number of sexual assaults has more than doubled over the past 10 years, and the rate of repeat offenders is about 60%, which is very high.The repeat rate of offenders who have sexually assaulted children aged 13 and younger is higher than that for other crimes by up to 10% [18].The prevention of such repeat crimes would be facilitated by gathering data for changing the emotional state of the offenders and analyzing it to predict a repeat offense.
While it is realistically impossible to gather data directly for changing emotions, it is possible to analyze the physical changes caused by emotional changes and gather data related to them.A good example of such technology is the polygraph.
However, the patterns and profiles of sexual assaults found in real-time sensor data have yet to be organized, and there is no exact real-time biometric information for each sexual offender.In addition, it is prohibited to distribute detailed biometric profiles of sexual offenders to the public.
Therefore, in this study, the psychological condition of the target is inferred using the data measured by heart rate, body temperature, and acceleration sensors.The heart rate sensor measures the number of cardiac impulses by gauging the main artery in the leg of the target, and the body temperature sensor and accelerometer measure the body temperature and the acceleration of the , , and  axes of the target's ankle, respectively.The psychological condition of the target is inferred in real time using the sensor data.These inferred data will be used to interrupt and prevent repeated sexual assaults.
The standard for the heart rate to be applied in the SET system is referred to in general medical literature [19][20][21][22][23][24][25][26].The heart rate is the number of heart beats per a unit of time, and it is usually expressed in Beats Per Minute (BPM).The heart rate varies according to the body's demand for oxygen intake and carbon dioxide emission while exercising or sleeping.The normal heart rate range is 60-100 bpm [21][22][23][24].The heart rate is also related to age and gender [27].
The reasons for an increase in heart rate are as follows.First, the heart rate can increase due to a rise in blood pressure and respiration rate caused by mental excitement [28].Second, the heart rate can increase due to the transmission of catecholamines to the sympathetic nerve due to stress [29].Third, if the body temperature increases for various reasons, the blood vessels on the surface of the skin expand to reduce the body temperature and as a result the amount of circulating blood decreases.However, oxygen and glucose, which are carried by the blood, have to be supplied constantly, and thus the heart rate increases to maintain the total cardiac output [30].
A standard for heart rate is required in order to infer the mental state of the target being monitored by sensors using the SET system.Therefore, the standard for the heart rate that signals the danger that the target will commit a repeat crime was set to 160 bpm, according to the following information.
The heart rate of ordinary people varies widely, with 60-100 bpm being considered the normal range.However, when an ordinary person exercises, the heart rate rises sharply, and different persons will have different heart rates for different exercise intensities.Doctors recommend doing moderate exercise and refraining from over exercising to maintain health.They suggest exercises that maintain about a heart rate that is 80% of the maximum (HR max ), following the guidelines of the American College of Sports Medicine shown in Table 1 [31].
The formula for the calculation of the maximum heart rate was established by Dr. William Haskell, a sport physiologist, and Samuel Fox, a heart medical scientist, during the late 1960s [32].A revised formula was published by Gellish et al., Londeree, and Moeschberger [33,34], which is written as HR max = 217 − (0.85 * age) . ( The maximum heart rate is calculated for each age using (2), and 80% of the maximum heart rate is calculated using (3).About 80% of the maximum heart rates calculated for different ages using ( 3) is shown in Table 2 as The body of an ordinary habitual sex offender secretes dopamine due to the sensitive reaction of the autonomic nervous system and the endocrine system as soon as he decides to commit a repeat crime.This dopamine excites the , 1 adrenaline receptor, and the sympathetic nerve is excited by the secretion of adrenaline, increasing the heart rate, and the heart's contractile power.The heart rate at this time rises to a point that cannot be reached by normal people even after exercising [35][36][37].Therefore, the standard value for the heart rate sensor was set at 160 bpm, which is higher than that which can be reached by normal people after correct exercising.
According to a report of the Korean Institute of Criminology, about 12% of the rapists in Korea committed rape after drinking alcohol [38,39], but as shown in Table 3 almost 40% of repeating sexual offenders committed sexual assaults after drinking alcohol.In addition, most assailants who committed sexual assaults on minors and women confessed that they committed the crime after drinking alcohol [40].
Thus, when identifying the context for a sexual assault, it is most important to determine whether the target is under the influence of alcohol, because in that case the probability of the sexual offender committing a repeat crime is almost 40%.If a target is found near facilities for children after consuming alcohol, the situation becomes very dangerous.
For ordinary people, the heart rate after drinking alcohol is measured mostly in the 60-100 bpm range [41].Therefore, it is not easy to decide whether someone has consumed alcohol using only a heart rate sensor; however, alcohol consumption can be inferred on the basis of data that show changes in the heart rate pattern similar to those seen after drinking alcohol [41][42][43].In ordinary people, the heart rate rises by about 10 bpm from the average heart rate within 2 h of drinking alcohol.Subsequently, the difference between the highest heart rate and the lowest heart rate increases to more than 20 bpm within 10 h.In addition, the body temperature remains low after alcohol consumption [44,45].Such characteristics of the values measured by sensor are used to infer the identification of the context.

The Proposed System
3.1.The Smart Electronic Tagging System.The SET system is based on M2M.It is composed of two parts, the USN and the Android platform; an overview of its system architecture is shown in Figures 4 and 5.
The constituents of the SET system are the USN-based Security Sensor Node (SSN), which is attached to the monitored target as an electronic tag; the Android platform-based Security Sensor Gateway (SSG), which collects information; the Central Crime Management Center (CCMC), which manages and controls the overall system, being linked to the gateway, and provides context-awareness service; the smart mobile terminals, which receive information about the target's approach.
Since the information about the target must be protected from network intervention, hacking, and so forth, the information is collected through a USN-based network and encoded in the security wireless system.Then, the information is received, decrypted, and transmitted through Wi-Fi and the Internet by the unsecured mobile management system, separately.

Security Sensor Node.
The SSN is the electronic tag of the target.When it is within the communication sphere of the SSG, which plays the role of coordinator, it transmits the sensed packet information to the SSG periodically.If it is not within the communication sphere of the SSG, as aforementioned, a channel condition checking method through CCA using the CC2420 RF chip and LIT is applied.In addition, the energy-saving phase is performed in the SSN by predicting wakeup and idle listening using the duration field included in the ACK.Therefore, the SSN does not transmit the sensed packet information moving as in the adaptive sleep mode.
The SSG requests information about the approaching SSN through the broadcast beacon message in about 1,000 ms units.Thus, the SSN node prevents the loss of energy caused by periodical transmission and induces the connection of the cluster unit.If there are several SSNs in the communication sphere of the SSG, the SSN forms a star topology network structure to conduct individual communication with the SSG.
The SSN is composed of three parts: the Sensor Subsystem (SS), which measures and collects the sensor information, the Communication Subsystem (CS), which communicates with the SSG and the device that collects fixed information, and the Main Module Subsystem (MMS), which is responsible for processing the collected sensing data, encoding, and minimizing power usage.
The primary data in the SET system are created as shown in Table 4 using the data value generated through the body temperature gauge, accelerometer, and heart rate sensor hardware of the SS by the TinyOS v2.0.2 based MMS in the SSN.The MMS is composed of software for low power processing and information transmission that is appropriate for the proposed SET system, on the basis of the TinyOS.In order to avoid the risk of electronic tagging information being duplicated and falsified and to protect the data, the data measured at the SS are encoded by the Advanced Encryption Standard (AES) 128 bit encryption algorithm [46] using the TinyOS option.
If the broadcast beacon message is received from the SSG or fixed node through the CS, these encoded data are transmitted to the SSG or fixed node through the CC2420 RF chip.

Security Sensor Gateway.
The SSG is the center of the M2M system, which connects the USN and the Android platform in the SET system.The hardware of the SSG is composed of a coordinator, USB-to-serial board, and Android Gateway Device (AGD).
The SSG is linked to the USB interface through the GPIO expansion of the coordinator, and it communicates with the wireless sensor network.When the mobile node of the electronic tag (SSN) receives the SSG's broadcast beacon message within a 40 m radius of the SSG, the SSN transmits the collected sensor data to the SSG.
At this time, the coordinator broadcasts a request through the beacon to the SSN to transmit the AES 128 bit encoded data.The encoded sensor data that the coordinator receives from the SSN are restored to the initial 64 byte data through an AES 128 bit decryption algorithm in its own TinyOS option.The decrypted information is transmitted to the AGD through the USB-to-serial interface.
Then, the AGD converts the decrypted 64 byte data to 44 byte data using the Detection Application Program (DAP) as shown in Table 5, transmits the data to the CCMC through the Wi-Fi communication network connected to the AGD, and displays this information on the AGD screen through the Android Graphical User Interface (GUI) layout developed in Extensible Markup Language (XML).

Central Crime Management
Center.The CCMC is a 24/7 server that is connected through the Internet.The CCMC communicates data using many AGDs set in a certain Internet Protocol (IP) and port; it receives data from the AGD through Wi-Fi communication and saves it in the Data Base (DB).At the same time, the CCMC analyzes the data and provides the context-awareness service.To provide the contextawareness service, the SET system sets up danger levels in advance by classifying the risk grades of the monitored targets, as shown in Table 6.The M2M-based SET system processes the complicated data obtained from the heterogeneous USN and Android platform to offer the various types of context-awareness services.A context-awareness service is a smart service that is applied appropriately to real-time dangerous situations based on the information measured by the sensors.
The SSN of the monitored target is given a unique number in advance for each danger level according to the type of the target's previous crime, as shown in Table 6.The CCMC extracts and analyzes the information in the contextawareness data according to the received SSN unique number and provides the appropriate information in real time based on the analysis of the context.The heart rate, body temperature, and 3-axis acceleration sensors are attached to the SSN.In addition to the SSN's unique number information, the CCMC uses the sensor measurement values of these sensors to infer the mental state of the target and provides status information according to the flow chart of context-awareness services, as shown in Figure 6, to help preempt crimes.
The procedures of the context-awareness service are as follows.From the SSN's rate, body temperature, and acceleration sensors, the CCMC receives the accumulated highest, lowest, average, and current values of each sensor.First, the CCMC checks whether the monitored target has consumed alcohol.First, CCMC checks whether the current value of the measured heart rate surpasses the recorded highest value and sees whether the value of heart rate exceeds the highest heart rate by more than 10 bpm compared to the average value in order to confirm that a pattern of alcohol consumption is present.As the body temperature decreases after drinking alcohol, the CCMC checks whether the current value of the measured body temperature is lower than the average value and confirms through the accelerometer that the target is not running.The 3-axis acceleration sensor attached to the ankle of the target receives the data value of the , , and  axes about every 1000 ms and it has the highest, lowest, average, and current values.If there is no motion, the data values of the three axes in the acceleration sensor change minutely.If the target stops, walks, runs, or takes the elevator, the data values of the three axes will change dramatically, and the changing patterns for each behavior shown on the graphs make it possible to distinguish between them [47][48][49][50].This will be explained when the values actually measured by the three-axis acceleration sensor in the acceleration sensor measurement experiment in Section 4 are given.If all these conditions are satisfied, the CCMC will decide that the monitored target has consumed alcohol and intends to make a sexual assault, as shown in Table 7.The danger level is then set as the highest "urgent" level to initiate the contextawareness service.
The CCMC also checks whether the current value of the measured heart rate has surpassed the lowest value, and whether the value of the heart rate exceeds the lowest heart rate by more than 20 bpm compared to the highest value in order to confirm whether a pattern of alcohol consumption is present and confirms through the acceleration sensor that the target is not running.If these conditions are satisfied, the CCMC will decide that the monitored target consumed alcohol and the danger level is set at "urgent" level.If it is inferred that the target consumed alcohol, as in the two above examples, the CCMC sets the danger level of the target as the "urgent" level for 24 hours, and the context-awareness service is provided.In a normal person, alcohol elimination from the body takes approximately 24 hours [51].Therefore, the dangerous elements of the target can last for 24 hours.Except for the two examples described above, the target is regarded as not having consumed alcohol.
Second, the CCMC determines whether the average value of the heart rate recorded by the sensor exceeds 160 bpm.It was explained in Section 2 that this is the standard set for a heart rate that signals the danger that an offender is committing a repeat crime.If the heart rate is 160 bpm or lower and the value of the acceleration sensor indicates running or walking, the monitored target is wandering around a facility for children.Thus, the context-awareness service is implemented according to the danger level shown in Table 6.
Third, if the data value of the acceleration sensor in case 2 indicates that the target has stopped, the target has infiltrated International Journal of Distributed Sensor Networks into the facility for children and is not moving.In this case, it is inferred that the target is watching the children attentively, and they are vulnerable to being an object for a repeat crime.Thus, the danger level is set as the highest level and the context-awareness service begins to be implemented.
Fourth, if the heart rate exceeds 160 bpm, the target's body temperature is measured immediately.The CCMC checks whether the current value of the body temperature according to the sensor has increased or decreased within 0.5 ∘ C of the average value.Usually, the body temperature of ordinary people aged 18-40 is 36.4-37.2∘ C. The body temperature changes naturally according to the time of the day; the normal range of change is about 0.5 ∘ C [52].Therefore, if the body temperature changes by more than 0.5 ∘ C, the CCMC checks whether it is higher than the average value and whether the target is running according to the value measured by the acceleration sensor.If all these conditions are satisfied, it is inferred that the target is exercising, and the normal contextawareness service is offered.
Fifth, if the heart rate of the target exceeds 160 bpm and the body temperature is more than 0.5 ∘ C above or below the average value and it is confirmed through the acceleration sensor that the target is walking, it is inferred that the target is in tension due to stress or pain, and the normal service is provided Sixth, if the heart rate of the target exceeds 160 bpm and the body temperature is more than 0.5 ∘ C above or below the average value and it is confirmed through the acceleration sensor that the target is stationary, it is inferred that the target is mentally excited by a plan to commit a repeat crime or is imagining an intended sexual assault or molestation and the minors in the relevant area are very likely to be in danger.In this case, as the minors can be the potential victims of a repeat crime of the monitored target, the highest danger level is set, and the corresponding context-awareness service is provided.
Seventh, if the heart rate of the target exceeds 160 bpm and the body temperature changes within a 0.5 ∘ C range, it is inferred, regardless of the change in the acceleration sensor, that the target is mentally excited by a plan to commit a repeat crime or is imagining an intended sexual assault or molestation.In this case, the highest danger level, "urgent, " is set and the corresponding context-awareness service is provided to protect the minors.
This context-awareness service is accompanied by the AGD's unique number information in the packet data.In this case, the location of the monitored target can be found via cell-based location tracking without GPS information, and as a result both the context-awareness and location-awareness service can be activated.When the location awareness service is provided using GPS, the packet data of the GPS is composed of about 26-64 bytes, depending on the number of GPS communication satellites [53].However, in the SET system, it is possible to provide the location awareness service with 1 byte of information using the AGD's unique number.
The CCMC sets the procedures of the context-awareness service according to the danger level of the approaching monitored target and implements services appropriate for each level.Notification of the highest danger level, the urgent level, is sent by Short Message Service (SMS) to multiple sets of smart mobiles registered in advance at the police station and the CCMC.The communication module of the server includes the connection-waiting function for the smart mobile.It sends the current data in real time whenever there is a request for communication from multiple sets of smart mobiles.In addition, the information on danger is notified to the AGD and the CCMC adjacent to the AGD that is being approached by the target.Moreover, the data are saved in the DB and the information is shown on the screen of the persons using the server through the GUI-based monitoring program developed in XML.

Smart Mobile Device.
The mobile phone used is an Android smart phone in which the Reception Application (RA) is installed.When the specific IP and port of the server are input using the RA, the smart phone receives the data from the server in real time in about 1000 ms units.A text banner, sound, or vibration alerts the user to the incoming data.These data include the danger level of the target and the measured time.
In addition, if the smart mobile is not able to receive data due to lack of reception, the server of the CCMC saves the information on the IP and the MAC Address of the smart mobile and transmits the information to the smart mobile later, when it is connected.The multitasking function of the Android OS is used to save the information in the external memory in a real time log even if the smart phone is not activated all the time, and this saved information can be viewed later.

Implementation
4.1.The Test Bed Configuration.The SET system is composed of the USN and the Android platform based on M2M, as shown in Figure 4.The SET system shown in Figure 7 constitutes a test bed.
All the programs in the SET system were developed in two computer languages.The programs for transmitting data from the SSN to the coordinator were developed using the nesC language, and the programs for transmitting from the AGD to the CCMC and the smart mobile device were developed using the Java language.To show the entity relationships of the data in each device in the SET system in a unified modeling language for object-oriented analysis and design, a class diagram is presented in Figure 8.
The SSN and SSG were produced and implemented directly; their detailed specifications are shown in Table 8.
The CCMC is contained in an ordinary x86-based laptop computer with a Wi-Fi wireless Internet network; its OS is Windows 7. If a target approaches a facility for children or a certain facility, the CCMC indicates the information on the screen of the laptop computer for user in the GUI-based monitoring program using the context-awareness service.
The smart mobile device is an ordinary Android smart phone.When it receives data concerning the approach of a target from the CCMC through the Internet, it alerts the user through vibration, sound, and a text banner; the data appear on the screen through an Android application, as shown in  Figure 9(a).In addition, the data received from the beginning of the communication with the CCMC are saved in text files for each day to be viewed at any time using the "Show History Log" button of the application, as shown in Figure 9(b).

Experimental Results.
The heart rate, accelerometer, and body temperature sensors are attached to the SSN.The accelerometer is a device that can measure the amount of change in acceleration in 3D space: the , , and  axes.Analysis of the data of the 3-axis accelerometer allows patterns of stop, walking, running, climbing steps, and so forth to be determined sequentially in a 3D space; they are simultaneously divided into action units.Action patterns according to movement measured by an accelerometer have been researched using various techniques [54][55][56]; the Hidden Markov Model (HMM) is considered an appropriate model of the characteristics of time series data [57].
However, the application of patterns based on the HMM increases the load on the SET system, and the response speed in the case of uncertainty is slow.Therefore, in the SET system, the axis of time and the axis of the measured value of the sensor were separated into individual sections.The SSN was attached to the ankle of a subject to test the accelerometer.The subject performed movements of six kinds sequentially for about 67 m, and the data values were measured, as shown in Figure 10.
The lateral axis is the value of the time per second, and the longitudinal axis is the value of the 3-axis acceleration of the subject obtained through the accelerometer.The subject walked for about 17 minutes in area A, ran for about 17 m in area B, climbed steps for about 17 m in area C, was in a descending elevator for about 4 m in area D-1, was in an ascending elevator for about 4 m in area D-2, and remained standing for about 8 m in area E on the 6th floor of the building.Using the values measured in the test, the subject's condition of walking, running, or remaining at rest could be inferred with the 3-axis measured values of the accelerometer alone.The data on the movement in the , , and  axes were applied to the context-awareness service.
The heart rate sensor and the body temperature sensor are also attached to the SSN.The heart rate sensor is a device that measures the heart rate using an Infrared-Light Emitting Diode (IR-LED) light that penetrates a body's tissue.The frequency of the change in light reflected from the tissue represents the heart beat.The body temperature sensor is a device that measures body temperature by sensing the value of the electrical resistance of the body, which varies according to its temperature.those measured immediately after the subject ceased running but continued to decrease gradually; however, the values were maintained at a higher level than those for the walking condition in area A. The subject was also in a descending elevator for about 4 m in area D-1 and in an ascending elevator for about 4 m in area D-2 and remained standing for about 8 m in area E on the 6th floor of the building.During these three activities, the subject simply stood still, and thus the value of the heart rate and the body temperature kept decreasing gradually until returning to the normal value.Thus, the data values for the subject's walking, running, and rest conditions were obtained through measurement of the heart rate and the body temperature.These data can be applied to the context-awareness service.
The sensor data are generated in the SSN of the monitored target and arrive at the smart mobile after passing the SSG and CCMC of the SET system.USN communication is transmitted from the SSN to the SSG.A test was performed in this environment to find the time required for data transmission according to the distance of the SSN.The measurement values obtained are shown in Figure 12.In addition, at this time, the CPU usage in the AGD Android platform was also measured.
The lateral axis is the value of the distance per meter between the SSN and SSG, and the longitudinal axis on the left is the value of the time per second taken by the International Journal of Distributed Sensor Networks data generated in the SSN, as shown in Table 4, to arrive at the smart mobile device.The longitudinal axis on the right represents the amount of CPU used by the data generated in the SSN to pass the AGD after being converted as shown in Table 5. USN communication is used to transmit the data generated by the SSN to the SSG.According to the test, the data information of the SSN is received by the SSG within a distance of up to 50 m.However, if the distance between the SSN and the SSG is more than 40 m, 2 out of 12 pieces of data (17%) transmitted for about 12000 ms are not received.It is thought that this phenomenon is caused by environmental noise.As the SSN plays the role of the electronic tag, 100% of the information of the SSN must be received within the range of the SSG.Therefore, the maximum range for the communication of SSG in the SET system has been determined to be a 40 m radius.
In addition, there was no significant change in the amount of usage of the CPU in the AGD in relation to distance when only one SSN was used for the test.However, when two SSNs were used at the same time, the amount of usage of the CPU increased gradually as the distance increased, and at 50 m the amount of usage of the CPU reached 50%.It is inferred that as the CPU of the AGD is a single Application Processor (AP), it uses multithreading when overlapped data packets are received according to the distance, which increased the amount of usage of the CPU.If the AP of the AGD had been a dual or quad core, the load would not have been so large.In addition, it is inferred that with the current, single AP, the time for data transmission is delayed, as much of the data processing slows down when four or more SSNs connect with the SSG at the same time.
The SSN in the SET system had a limited power supply.It collected the information on the monitored target in about 1000 ms units using the built-in sensors.When the SSN received the SSG's broadcast beacon message, it transmitted the collected sensor data to the SSG.However, if the SSN was not within the communication sphere of the SSG, it went to sleep mode for energy saving.In the existing electronic tagging system, the electronic tag had a limited power supply.It communicated with portable terminal through 400 MHz Industrial, Scientific, and Medical (ISM) two-way radio bands.It communicated with the portable terminal 24 hours a day in about 10000 ms units.If the two-way communication was successful, the electronic tag went to sleep mode to save energy until the next communication.
The SSN's power switch was changed from the OFF to the ON state for measuring power consumption within the communication sphere of the SSG.However, the electronic tag had no power switch, and therefore the power consumption was measured assuming that the tag was in the ON state while being within communication range of the portable terminal.The power consumption of the SSN and the electronic tag was measured for 1000 ms in the same environment.The measurement results are shown in Figure 13.The horizontal axis is the value of the time in ms and the vertical axis is the value of the current in mA that was consumed in communication between the SSN and SSG, that is, the electronic tag and the portable terminal, respectively.
The SSN consumed a maximum current of 18 mA during approximately 25 ms in order to initialize the device and consumed a maximum current of 13 mA during approximately 40 ms in order to collect the values of the sensor data.In addition, when the SSN communicated with SSG, it consumed a maximum current of 26 mA during approximately 30 ms when receiving and a maximum of 38 mA current during approximately 120 ms when transmitting.It consumed less than 1 mA in sleep mode.
It was difficult to measure the amount of current used for initializing the electronic tag, because there was no power switch.When the electronic tag communicated with the portable terminal, it consumed a maximum current of 31 mA during approximately 150 ms when receiving and a maximum of 46 mA during approximately 100 ms when transmitting.It consumed less than 2 mA current in sleep mode.
The SSN used 4500 mA while communicating with the SSG, whereas the electronic tag used approximately 8000 mA while communicating with the portable terminal for 1000 ms in the same environment.These results show that the SSN can save approximately 56% of the energy used by the electronic tag.Therefore, the SET system is better than the existing electronic tagging system in terms of energy efficiency.

Conclusion
It is difficult to change batteries in the existing electronic tagging system, and thus it is essential to use as little power as possible.However, the existing electronic tagging system has problems in accomplishing low power consumption as it conducts location tracking by using a triangulation method to communicate with the GPS satellites and mobile phone base stations.Exact location tracking is also difficult to achieve in this way as the maximum error is 2 km, due to buildings, forests, or low reception regions in downtown areas.In addition, while sexual assaults are increasing every year and sexual crimes against minors when the offender is under the influence of alcohol are becoming more ferocious, the existing electronic tagging does make it possible to know whether the monitored target only consumed alcohol.It has become much more difficult to protect minors as location tracking of a target wearing an electronic tag by unauthorized people is illegal under the Korean law.
USN technology is used because it is lightweight, cheap, and simple to operate, in addition to consuming very little electricity.Additionally, the usage of smart phones has become common in Korea and the US, with about 50% of the population using such a device.Thus, this thesis has proposed the SET system, which uses the M2M method based on the USN and Android platforms, utilizing only their strong points.This paper proposed M2M and context-awareness service methodology as a system that will notify the approach of a monitored target.In our study, a test bed was established to verify the validity of the SET system.
The equipment actually developed and produced to implement this system includes an SSN, coordinator, USBto-serial board, and an AGD.The Java language was used for the programming of the SSG, CCMC, and smart mobile device.The performance of the equipment in the system was confirmed through the establishment and testing of the test bed.In the future, this study will be expanded by linking the electronic tagging system with the SET system for the purpose of monitoring sexual assaults.

Figure 4 :Figure 5 :
Figure 4: The architecture overview in the SET system.

Figure 6 :
Figure 6: The flow chart for the context-awareness service.

Figure 7 :
Figure 7: The test bed configuration of the SET system.

Figure 11 :
Figure 11: The data values measured with a heart rate and body temperature sensor.

Figure 12 :
Figure 12: The data transmission time in the SET system and the measured amount of CPU usage in the AGD.

Figure 13 :
Figure 13: The power consumption in SSN and the electronic tag.

Table 1 :
The recommended exercise intensity.

Table 2 :
Maximum and 80% heart rate according to age.

Table 3 :
The number of sex offenders and repeat offenders under the influence of alcohol in Korea.

Table 4 :
The packet structure in SSN.

Table 5 :
The packet structure converted into AGD.

Table 6 :
The danger level in the SET system.

Table 7 :
The context-awareness algorithm.

Table 8 :
The detail specification of SSN and SSG.