This paper presents a context-based building security alarm through power and sensors analysis. This system is responsible for the real-time monitoring of a building in order to generate alarms whenever abnormal values are detected within a given context. The Fig. 1 shows the main process of this system.
As shown in Fig. 1, the system analyzes IoT environmental sensors and power consumption analyzers, embedded in a SCADA system. In the case of environmental sensors, the system confronts the current values with the predefined rules, which indicate the ranges of values of each alarm level. These rules are also context dependent, since the read values may be normal under certain conditions (e.g., weather conditions and number of people). Each sensor can have particular rules depending on its location (e.g., a temperature sensor in a servers room has alarm triggers for lower temperatures than normal rooms, because the room must be kept cool). In relation to the consumption analyzers, the system confronts the current values with the consumption profile present in the data history for the context in matter. This profile allows to know the minimum and maximum consumption expected in this context, with a small margin of tolerance in order to ignore small variations that normally occur on a daily basis.
When comparing the instant consumption with the previously generated context profiles, it is important to aggregate the instant data in a higher level of granularity (e.g. last minute), which reduces its variable nature and therefore guarantees more solid data, avoiding misleading alarms.
The detection of contexts is performed by separating historical data from each sensor/analyzer into the number of groups that allows to identify the most relevant contexts. For this purpose, clustering is applied, a data mining technique that allows the aggregation of data in a certain number of groups, through the use of k-means algorithm provided by the R tool (R-Project 2018). This analysis is performed twice: one to detect the different types of days (e.g. weekend and weekday) and other to detect the different types of periods of the day (e.g. peak and off peak). By combining both analysis, it is possible to obtain the different contexts (e.g., weekday/weekend peak/off-peak). This analysis has to be performed regularly in order to capture new contexts that may arise. During monitoring, the system identifies the current context, in which each sensor/analyzer are, and confronts its current profile with the profile of that same context. The identification of the current context makes use of classification techniques to select the context, among the different contexts previously detected in historical data, that best represents the present moment. For this purpose, the systems uses the C5.0 algorithm provided by the C50 package of R (CRAN 2018).
The generated alarms are displayed in the graphical interface of the system and sent by email to the responsible parties in order for them to take the necessary actions.