IAPSG: A Novel Intelligent Application Platform for Smart Grid

As a basic infrastructure, the power grid nowadays plays a vital role in society. The huge network and lots of equipment bring about the complexity of management and maintenance. To solve this problem, an automatic, intelligent, and highly scalable computer system stays to be introduced. Based on the above, we propose a smart application cloud platform for smart grids. According to different needs, they can be integrated into corresponding field applications, such as power consumption anomaly detection, user clustering, and equipment status monitoring. This PaaS platform benefits from our rich IoT sensing devices and information network, which can provide all kinds of device information for high-level applications to achieve complex functions. In order to verify our proposed structure, we use anomaly detection smart applications for verification. Experiments show that our work greatly reduces the difficulty of developing smart applications and improves the management efficiency of smart grids.


Introduction
Diverse IOT equipment and huge power grid scale pose challenges for power grid management. Some current work uses some traditional schemes of big data to process huge amounts of data of IOT devices. Thanks to the development of artificial intelligence technology, we are able to gain insight into the internal information of these data. A variety of intelligent applications can help us monitor equipment failures, power users' power safety, power equipment maintenance path planning, and key user guarantees.
However, the traditional monolithic application paradigm has been unable to serve the current various smart applications. Multiple smart applications focus on their own single functions. In the case of different business logic, these applications have the same dependence on the underlying data, runtime, etc. This requires a platform that satisfies the need to provide these applications, while allowing each application to function without affecting each other.
We have proposed a novel intelligent application platform for smart grid (IAPSG). This platform uses Kubernetes to run on top of IaaS, so that the platform does not have to pay attention to the underlying infrastructure. Furthermore, as a PaaS platform, this kind of structure encapsulates the rich IOT device data as a data flow component and provides these data flow as a service to upper-layer intelligent applications. The upper layer SaaS can flexibly deploy intelligent applications on the platform without considering the underlying infrastructure and data flow of IOT devices in the power grid. These will be provided to the application as a service, thereby helping the application focus more on the IOP Conf. Series We have adopted a lot of practice, including the deployment of IOT devices, the establishment of platforms and releasing of intelligent applications. These practices show that our platform can perfectly meet the smart application management needs of smart grid scenarios, improve the maintenance efficiency of smart grids and reduce costs. Here we highlight some of our contributions: 1. For the smart grid scenario, IOT device information flow is encapsulated, which can provide a unified IOT device information flow service for a variety of upper-layer applications; 2. The PaaS platform greatly reduces the development requirements threshold of smart grid applications, enabling it focusing on business logic without having to consider infrastructure; 3. Consolidate the past monolithic applications to a unified platform, which can be used in one-stop use, operation and maintenance, etc., reducing the use and maintenance costs.

Background
At present, various industries and city lives are heavily dependent on the supply of electricity. In order to meet this, the power grid contains various electrical equipment and is distributed in different environments while the scale of the power grid is extremely expanding. Complex grids can cause various problems. Some of these problems are caused by faults in power grid equipment, and some are caused by faults on the user side. For example, short-circuits, leakages and other faults may occur in the homes of users. In this case, users need to be alerted and the responsible administrator should be notified to carry out maintenance in time. Various faults cannot be solved by simple and uniform methods. Specific problems can only be monitored and resolved with specific methods. The situation mentioned above makes the current system difficult to deal with. Due to the above, a unified platform which can load all applications with specific functions is urgently needed.

Related Work
In [1], Singh et al. proposed to use rich IOT devices to monitor the state of the power grid and use fog computing for real-time analysis. In [2], the author proposes a Lambda architecture grid big data analysis framework, and uses data visualization applications to verify the effectiveness. However, this framework is aimed at data analysis, and it is difficult to cover other application scenarios, such as equipment inspection, remote control and other artificial intelligence-based applications.
In [3], Kang and others tried to use machine learning algorithms to perform a deeper analysis of power data to obtain the abnormal information contained therein. In [4], Geng et al. further analyzed the power data and classified and detected their existing abnormalities, thus providing an important basis for grid maintenance. Lai and others are not satisfied with the original power data, and expand the data information to other dimensions, such as weather, geographic information, etc. [5]. Though these works mentioned above tried to develop a platform to resolve problems, they stayed a specific field.
In the work of Wang et al [6], it is proposed to use cloud computing to build an information system for a smart grid. They use virtualization technology to realize the construction of smart grid big data platform, and carry out relevant monitoring on the smart grid. In [7], Munshi et al. proposed a big data analysis framework applied to the smart grid for the analysis of electricity meter data. But this data model cannot be applied to complex power grids where multiple intelligent applications coexist.
In [8], Zhang and others reviewed related applications of big data in smart grids. Most of these applications use big data related tools, such as Hadoop, to perform ETL operations on the data of sensors (such as electricity meters), and analyze their internal laws to provide some inspiration for reality. These applications are all monolithic applications. Although they have independent functions, it is difficult to share data and infrastructure.

Motivation
At present, there are several problems in the smart grid. On the one hand, complex power grids require different systems for management, and each task has a dedicated system. These special systems are numerous and their functional coupling leads to a lower overall operating efficiency. The large number of systems means that there is no one-stop access and operation. In the second aspect, these systems are used to sense and control the power grid. The realization of these functions mostly depends on the underlying IOT devices. Each similar system needs to develop a set of code that interacts with the bottom layer which means they cannot reuse existing code. This seriously affects the development efficiency of intelligent systems. Also, it causes great waste. In the third aspect, multiple systems also mean that the maintenance workload is multiple. These systems need to maintain operations such as runtime, configuration files, application updates, releases, and offline operations. These tasks are complicated and error-prone. In order to meet these challenges, it is necessary to develop a system that can decouple existing complex systems and flexibly expand intelligent applications for specific business logic.

System Design
In order to be able to respond to the challenges mentioned above, we use a kind of PaaS systems, integrating the original independent systems and integrating the independent functions of the original systems as independent applications. On the one hand, it can be maintained and operated in a unified manner, which greatly improves the ease of use and efficiency of the system. On the other hand, this method reduces the operation and maintenance costs of the system.
The application of power scenes requires extremely strong robustness, so we used cloud platforms. This can ensure that the system runs normally throughout the year. Moreover, this change avoids the operation and maintenance of real server machines and leave server operation and maintenance to professional cloud service providers. As a PaaS platform, IAPSG encapsulates the details of various power facilities and IOT devices at the bottom and provides service support for upper-layer applications. Specific implementation details will be introduced in the following chapters. In order to have better capabilities in network performance, dynamic management, scalability, and maintainability, we adopted Kubernetes as the underlying framework of the system. Kubernetes can be configured declaratively, and excel in terms of robustness and so on. These features perfectly fit our needs for smart grid application cloud platforms. As a cloud native platform, it has better performance than other platforms in terms of technology maturity and community activity. Considering different types of applications, suitable modes such as side-car, load balancing, Service and other abstractions can be chosen to integrate applications and services. Moreover, the underlying infrastructure of the smart grid can also be deployed as a Pod and exposed as a Service for other applications to call. This modularity can provide the system with unparalleled flexible combination capabilities. IOP Conf. Series: Earth and Environmental Science 632 (2021) 042055 IOP Publishing doi:10.1088/1755-1315/632/4/042055 4 The system is mainly composed of a three layers cloud structure, with IaaS, PaaS, and SaaS from bottom to top. IaaS uses infrastructure services provided by cloud service vendors, with Kubernetes as the base, as the basis for the operation of a real system. In order to serve various smart applications customized for the power grid, the underlying hardware information flow and control information flow are abstracted as independent services to serve as a platform service to SaaS. These information flow components constitute the PaaS platform. To realize the final business function, the top-level intelligent applications use various resources provided by PaaS, such as runtime, information flow, load balancing, service exposure, etc. The entire system decouples and distributes infrastructure, middleware services, and business logic to different layers.
The specific platform layering is shown in figure 1. The IaaS layer focuses on the maintenance of infrastructure and provides system hardware dependence upwards. The PaaS layer uses the hardware package provided by the IaaS layer to run the Kubernetes system on the VM. PaaS encapsulates the IOT device provided by IaaS as an information flow component and deploys it as a Pod in Kubernetes. This component provides information flow service for intelligent applications in the upper SaaS. SaaS is composed of various smart applications and runs on PaaS. Various intelligent applications use the information flow and control flow services provided by PaaS to implement their own business logic.

Motivation
In order to implement this system, we faced several major challenges. In this section, we will introduce our work from the aspects of IOT device initialization, edge computing application in the system, information flow and control flow, and platform intelligent operation and maintenance.

IOT Setup
The SaaS platform's intelligent operation and maintenance applications require large scale data sets as the basis for decision making, and these data are collected by rich IOT devices. In order to obtain rich and timely power grid information, we have carried out a lot of IOT practice.

Figure 2. IOT Devices Setup
First, we install and initialize IOT devices in the power grid on a large scale as shown in figure 2. These devices include various sensors, routers, and gateways. These devices are widely distributed in the transmission network trunk lines, power distribution stations, distribution boxes, main circuit equipment and home gateways. They can monitor the key indicators of power facilities, such as current, voltage, humidity, temperature and other information. Then the information will be transmitted to coordinators, routers, gateways and other devices in different communication methods. These devices will be responsible for these original information preliminary processing and transmission. IOP Conf. Series: Earth and Environmental Science 632 (2021) 042055 IOP Publishing doi:10.1088/1755-1315/632/4/042055 5

Application of Edge Computing
Furthermore, the information streaming of these IoT devices requires the cooperation of various coordinators, routers, gateways and other smart devices as shown in figure 3. Kinds of devices form a huge device tree as shown in figure 4. These devices Large-scale data processing and transmission requires that these devices have corresponding computing capabilities and programmability. On this basis, it is necessary to propose an effective method to encode the transmitted data. Semantic coding not only reduces the amount of data transmission and alleviates the bottleneck of network transmission; it can also shift the calculation to the edge side, reducing the load on the central system.

Figure 3. Smart House Devices
The huge scale of the power grid means that there are a huge number and types of sensors. These sensors are difficult to use the same standard, which also causes the diversification of native data. Most of the raw data collected by the sensors are binary, hexadecimal, etc. Besides that, the indicators are also complex and diverse. Such data transmission to the cloud platform is difficult to be uniformly preprocessed and used, and the transmission of raw data will also bring challenges to the network transmission channel.

Figure 4. IOT Devices Structure
We have used intelligent devices in the transmission path, such as coordinators, routers, gateways, etc., to perform corresponding preprocessing on different types of sensor data, so that different data have IOP Conf. Series: Earth and Environmental Science 632 (2021) 042055 IOP Publishing doi:10.1088/1755-1315/632/4/042055 6 different preprocessing. This paradigm of edge computing can greatly reduce the difficulty of problems caused by large amounts of data and different standards.

Information and Control Stream
In Mao's work [9], he systematically studied energy flow and information flow. Information flow is an indispensable part of the smart grid, we refer to their design. The information flow of the smart device is used as the basis for the decision of the intelligent application. The intelligent application will issue decisions instructions through the downward information flow to control the smart grid equipment or issue early warning information to the maintenance personals. Here we will release the information flow of the control information. This is the control flow.
In Mao's work [9], the energy flow and information flow were systematically studied. We refer to their design and use the information flow in the smart grid as a channel for data uploading and downloading. Smart applications can control smart grid devices or issue early warning information to maintenance personnel through this channel.
After the semantic processing of the edge intelligent device, the sensing information will be continuously transmitted to the PaaS platform via a method shown in figure 5. This platform encapsulates it as a service to provide externally. These information streams will be provided externally by subscription. Here we refer to the design of Kafka. Smart applications interested in the corresponding data stream only need to subscribe to the corresponding Topic to receive relevant information push. For example, an anomaly detection application may be interested in information such as power consumption, current, environmental temperature, and environmental humidity. Applications only need to subscribe to the corresponding topic in the configuration. The information arriving in the related topic will be transmitted to the application through the information pipeline.

Figure 5. Stream
The above transmission pipeline exists as a file so applications can decide when to process it. Designing the information flow as a file has many advantages. For example, the same information flow file can be shared to multiple subscribed applications, greatly reducing the system storage usage. On the other hand, interested applications can also store temporarily unused information in the file pool in case they are needed.
The control flow is implemented as an asynchronous message, supplemented by a priority mechanism. The asynchronous message system improves the response speed and system stability. The message system naturally separates different modules and decouples the system, which is conducive to system maintenance. In addition, the priority mechanism can not only eliminate peaks, but more importantly, ensure that high priority messages are quickly communicated, such as power failure messages.

Automation Devops
In order to achieve flexible application expansion as described in [10], various specific business systems are designed as separate applications. These applications run as Pods on the PaaS platform. Due to the declarative configuration method of the Kubernetes platform, we can flexibly load or remove various applications from the platform. Even, we can perform various operation and maintenance operations on the application, such as grayscale upgrades, through Patch and other methods.
We also designed automated scripting tools to automate operation and maintenance operations, thereby reducing maintenance costs. Such an automated design can also bring obvious benefits, which is to reduce the failure rate caused by manual operation.

Application Demonstration
Here we have selected an application of anomaly detection in the system as an example, this work can refer to Geng's work [4].

Figure 6. KPI Outlier Detection Model
We use the data stream encapsulated by the platform to provide a data source for a KPI anomaly detection application as shown in figure 6. This anomaly detection uses a DNN model [11] to perform a two classes classification of residential electricity data to detect normal and abnormal users. Our platform is shown in figure 7.
Our practice shows that our platform provides one-stop services for upper layer intelligent applications, including the basis of operation (runtime, OS, resources, etc.), data flow (rich monitoring data of the underlying IOT devices), one-stop Manage pages, easy-to-use DevOps.

Conclusion
In this work, we focused on solving the problems of the numerous and redundant dedicated systems in the existing smart grid system. To settle these issues, we proposed a cloud-based smart grid application platform that uses Kubernetes as the underlying technology to disassemble the dedicated grid system into separate applications. In order to improve the utilization rate of the underlying hardware system, it is abstracted as a unified information flow component to serve intelligent applications. This manner not only greatly improves the code utilization rate, but also reduces operation and maintenance costs. Finally, this article introduces a typical application in the application platform, which is anomaly detection. Our practice shows that the intelligent application platform we have proposed can meet the needs of the management and operation and maintenance of the smart grid at this stage.
Finally, we put forward the research work to be carried out in the future. In the power industry and other industries, rich sensing devices such as IOT sensing devices are deployed in infrastructure. In the power industry, although we encapsulate it uniformly and achieve efficient use, there is still considerable redundancy between different industries [12]. In the next step, our work will focus on how to eliminate the redundancy of the sensing infrastructure between industries, such as residential property, security, telecommunications, etc. A unified sensing service will achieve more efficient use of resources.