Smart metering system data analytics platform using multicore edge computing

Received Dec 2, 2020 Revised Jan 10, 2021 Accepted Jan 20, 2021 The smart grid revolution has only been possible, thanks to the development and proliferation of smart meters. The increasingly growing computing capabilities for Internet of Things devices have made it possible for data to be processed directly from the devices where it is produced; this has been called edge computing. Edge computing is allowing the smart grid to become increasingly intelligent to solve problems that make electricity consumption more efficient and environmentally friendly. This work presents the implementation of a smart metering system that allows data analytics using a multiprocessing architecture directly on the smart meter. The results show that the development of smart meters with data analytics capabilities at the edge is a reality today, and the use of multiprocessing permits the improvement of data processing.


INTRODUCTION
The world has been revolutionized thanks to the technologies that are emerging within the so-called fourth industrial revolution. This revolution is characterized by the rise of cyber-physical systems (CPS) whose fundamental characteristic is the integration of physical objects with people, through the technologies and the data which is being generated [1]. The CPS are transforming the electrical industry allowing to have a more reliable, cleaner and cost-effective power grid. The electricity sector is of utmost importance for the development of the industry, economy, and society in general, which is why the improvement of the grid affects practically all human activities. The inclusion of CPS has provided the grid with data analytics and communication capabilities, which provides it with certain intelligence, which is why it has been called the smart grid (SG) [2].
The SG started with the inclusion of smart metering systems (SMS) whose main component is smart meters (SM). SMS allows to know the electricity consumption of end users through web portals or mobile applications that permit the visualization of information such as consumption patterns and the cost of said energy. SMs can be viewed as Internet of Things (IoT) devices because they are embedded systems with wired and wireless connectivity capabilities. SMS also allows you to handle electrical system operations such as outages and reconnections automatically. In recent years, SMs allow measuring the electricity production of end users called prosumers, which through distributed energy resources (DER) can produce electrical energy that helps them lower their energy costs [3]. One of the main trends in distributed computing is to divide computing and processing capabilities into three levels, called: cloud, fog, and edge. Edge computing refers to running processes closer to where the sensor and actuator data is acquired in the end devices. End-end devices are generally IoT devices or embedded systems with more limited processing and storage capabilities than devices in the fog and the cloud [4]. Although in recent years, the capacity of hardware systems for IoT has increased, making them increasingly available for data analytics and machine learning applications, even in many IoT applications, more significant hardware features are required.
Currently, SMs are beginning to have greater computing capacity that makes them more viable to carry out data analytics and machine learning processes directly on the device, which is why edge computing is beginning to be applied in SMs. Significant computing power is required for some data analytics and machine learning applications in SM. Traditionally, multi-core processing systems, multiprocessors, or acceleration hardware such as graphics processing units (GPUs) and computational neural sticks, among others, have been used [5].
Many simple board computers (SBC) are using multicore processors and even GPUs, such as the case of Google Coral AI and Nvidia Jetson Nano, to name a few. Although the most current operating systems and compilers can support the development of concurrent and parallel processing systems, the design of algorithms that can be executed concurrently and in parallel is still required. The present work shows an SM that uses parallel edge computing in SMS for data analytics applications. The results show a significant improvement compared to the use of SM with traditional processing. This paper is structured as follows. Section 2. presents a short review of the literature regarding data processing in parallel in edge computing, while Section 3. shows the architecture proposed for the development of edge computing in SMs. The results obtained are discussed in Section 4. Finally, in Section 5. the conclusions and future work in this research area are presented.

PARALLEL PROCESING IN EDGE COMPUTING
Most of the multiprocessing related works in SG have focused on the cloud or fog part: in both cases, there are sufficient computing capacities to perform data analytics and machine learning processes as in [5][6][7]. Recently much of the multiprocessing work in edge computing has focused on image processing and computer vision taking advantage of the capabilities of the GPUs that are being incorporated into SBCs: an example of these are the [8][9][10][11][12] related works. The use of SBC with the integration of GPU use has been studied by various works [13][14][15] in which the Jetson Nano board stands out for its excellent performance and low costs.On the other hand, computing processing is being carried out on edge with this type of board for different contexts, such as sound management and error detection [16,17].
One of the main characteristics that a multiprocessing system should have is the handling of appropriate algorithms to be executed in this class of concurrent and parallel hardware platforms: for this reason, various authors have focused on the parallelization of forecasting and classifying algorithms that allow improvements in the results of process time and effectiveness [18][19][20][21]. In the past year, there was an exponentially growing interest in edge computing applications using SBC like Jetson Nano. For instance, in [22] a novel erasure-code system is presented. In [23] the authors present deep learning techniques optimized for edge computing. Other works are focused on enhanced biometrics security in edge devices [24]. In [25] the authors present a Recurrent Neural Network (RNN) for classification power systems contingences using edge devices. Other novel diverse applications using Jetson Nano for edge computing are presented in works [26][27][28][29]. In general, edge computing applications for data analytics in the smart grid are only just beginning to emerge, and as IoT hardware becomes more capable of data analytics and machine learning applications, works in the field of SMS will appear.

FORECASTING IN SMART METERING SYSTEM USING A MULTICORE ARCHITECTURE
A SM was developed using a Jetson Nano board using current and voltage sensors. Figure 1 shows a diagram of the hardware architecture used for the acquisition of electrical signal values using a SmartPi energy board The connection between the two boards is made through the General Input and Output Ports (GPIO). SmartPi essentially works with the Raspberry Pi but can be adapted to the Jetson Nano with some modifications. Household appliances and Distributed Energy Resources (DER) such as photovoltaic panels and wind turbines are connected through each of the three phases of the three-phase meter to its corresponding voltage and current sensor.
The data values used are current intensity (A), voltage (V), active power (W), power factor, reactive power (W), energy consumed (kWh), and energy produced (kWh). One of the main problems in the SG is  13 forecasting the energy consumption/production of the prosumers. For this reason, we choose the implementation of a forecasting algorithm for testing the SM architecture using the time series approach. Due to the use of large time series is very complex for IoT embedded devices, it is necessary to improve the forecasting model's performance at edge computing. Jeston nano is an SBC with a Quad-core ARM microprocessor with a GPU included with 128-cores. The cores were used to develop a parallel power consumption forecast algorithm to detect possible anomalies that could be considered failures. The algorithm used is described in Algorithm 1. In general, the algorithm uses the ARIMA technique dividing the data by periods depending on the granularity of the study time, which can be per day, week, month, or year. With data segmentation, the calculations are processed in parallel according to the indicated time window, except for the data that intersects between periods that need to be completed separately. Once the computations have been carried out in parallel, the results are gathered. Algorithm 1. was implemented using the Python language through the statsmodels library using the PyCUDA framework for handling parallel calculations through the various GPU cores. The implementation tries to use the 128 available cores.

RESULTS AND DISCUSSION
To compare, a traditional sequential classification algorithm was used, comparing it with the parallel algorithm described previously in Algorithm 1. Since there are few measurement data (14 months of readings), it was decided to use the data sets described in IEEE DataPort [30] and UCI Machine Learning [31] with their adaptation of data to the variables of interest in this work (Timestamp and Energy Consumption) grouping according the period of evaluation. The IEEE Dataset has a lot of variables and it has data for 3248 SM in one year. The readings are in slots of 30 minutes. The data must be grouped according of each SM.
The UCI dataset has information of only one meter in slots of 15-minutes. The energy has expressed in each of the three phases; for this reason, the energy consumption must be summarized. The total number of instances are 2,075,259. The readings are from between December 2006 and November 2010 (47 months). Table 1 shows the results of the execution of forecasting models using linear architecture comparing them with their parallel equivalent, taking into account different partition sizes: week, month, day, and year for the IEEE dataset, while in Table 2 shows the same results but for the UCI dataset. The times are expressed in minutes. Both models have the same accuracy. The results show a considerable decrease in execution times in both cases, although they are dependent on the size of the data and the granularity of the information analysis. The greater the amount of data, the longer the processing time. The complexity of ARIMA sequential is equivalent to O(n) and the parallel version is equivalent to O(n log n) + C where C is the delay time to integrate the non-parallel data. Both models (parallel and non-parallel) have the same accuracy R 2 =89.97% with the IEEE dataset and R 2 =83.25% with the UCI dataset. There are other methods/techniques for anomaly detection that could be implemented in this parallel framework. Still, not all methods/techniques are suitable to be programmed in parallel due to restrictions of any parallel algorithm. Particularly, the simplest implementations are better for IoT and embedded devices.

CONCLUSION AND FUTURE WORK
The use of edge computing is growing day by day, allowing IoT devices to have greater functionality. In the case of the smart grid, many IoT devices are benefiting from the management of computing at the edge, and particularly in SMS, it will be widely used to improve data analytics processes through various statistical, probabilistic, and machine learning and artificial intelligence. The integration of multiprocessing architectures in the IoT hardware will make it possible to improve execution times in forecasting and data classification models in edge computing. For this, it will be necessary to adapt the algorithms so that they can be executed in parallel. This work demonstrates that it is already feasible to perform edge computing using a multiprocessing architecture in smart metering systems. The results show a considerable reduction in processing times that make it a viable option for processing data closer to the source of the data.
As future work in the first instance, the design of a more elaborate data processing algorithm is contemplated to take advantage of the computing capabilities of SM. Besides, it is contemplated the integration of this architecture of measurement and data analytics using computing schemes at the level through data concentrators and computing in the cloud using the servers of the Metering Database Management Systems (MDMS).