Next Article in Journal
Converged Security and Information Management System as a Tool for Smart City Infrastructure Resilience Assessment
Previous Article in Journal
Availability and Adequacy of Facilities in 15 Minute Community Life Circle Located in Old and New Communities
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

IoT Orchestration-Based Optimal Energy Cost Decision Mechanism with ESS Power Optimization for Peer-to-Peer Energy Trading in Nanogrid

1
Department of Computer Engineering, Jeju National University, Jeju-si 63243, Republic of Korea
2
Big Data Research Center, Jeju National University, Jeju-si 63243, Republic of Korea
3
Department of Electronic Engineering, Jeju National University, Jeju-si 63243, Republic of Korea
4
School of Electronics, Electrical Engineering and Computer Science, Queen’s University Belfast, Belfast BT7 1NN, UK
*
Author to whom correspondence should be addressed.
Smart Cities 2023, 6(5), 2196-2220; https://doi.org/10.3390/smartcities6050101
Submission received: 12 July 2023 / Revised: 6 August 2023 / Accepted: 15 August 2023 / Published: 22 August 2023

Abstract

:
The Internet of things has revolutionized various domains, such as healthcare and navigation systems, by introducing mission-critical capabilities. However, the untapped potential of IoT in the energy sector is a topic of contention. Shifting from traditional mission-critical electric smart grid systems to IoT-based orchestrated frameworks has become crucial to improve performance by leveraging IoT task orchestration technology. Energy trading cost and ESS power optimization have long been concerns in the scientific community. To address these issues, our proposed architecture consists of two primary modules: (1) a nanogrid energy trading cost and ESS power optimization strategy that utilizes particle swarm optimization (PSO), with two objective functions, and (2) an IoT-enabled task orchestration system designed for improved peer-to-peer nanogrid energy trading, incorporating virtual control through orchestration technology. We employ IoT sensors and Raspberry Pi-based Edge technology to virtually operate the entire nanogrid energy trading architecture, encompassing the aforementioned modules. IoT task orchestration automates the interaction between components for service execution, involving five main steps: task generation, device virtualization, task mapping, task scheduling, and task allocation and deployment. Evaluating the proposed model using a real dataset from nanogrid houses demonstrates the significant role of optimization in minimizing energy trading cost and optimizing ESS power utilization. Furthermore, the IoT orchestration results highlight the potential for virtual operation in significantly enhancing system performance.

1. Introduction

The energy sector is responsible for approximately 75% of greenhouse gas emissions, posing a significant challenge to global climate stability [1]. As outlined in the IRENA 2020 report, the goal is to reduce 70% of global energy-related CO2 emissions by 2050, with renewable energy, enhanced energy efficiency, and increased electrification driving over 90% of this reduction [2]. In 2002, R.H. Lasseter introduced the concept of microgrids, which are low-voltage and environmentally friendly distribution systems that concurrently manage distributed generation systems. A simplified version of a microgrid is called a nanogrid, which comprises a load that serves a single household. Fundamentally, a nanogrid is recognized as a self-contained entity accountable for overseeing the administration, voltage regulation, and reliability of the system. Typically, it incorporates at least one gateway to establish an external connection [3]. The simplicity of interconnectedness has brought about the idea of peer-to-peer (P2P) energy trading. This facilitates the utilization of renewable energy sources, reducing dependence on the utility grid and lowering the costs for nanogrids. P2P energy trading applies a concept similar to P2P networking in computer science, where systems within P2P networks are distributed horizontally. This implies that each system engages in symmetrical interactions [4,5]. The primary aim of peer-to-peer (P2P) energy trading is to reduce reliance on traditional energy suppliers (such as the power grid) and meet energy needs with enhanced cost-effectiveness [6,7]. This energy trading process utilizes online services rooted in information and communication technologies (ICT) to facilitate peer interactions [8]. Effective energy trading operation requires optimal planning to meet immediate energy requirements, while minimizing costs. The scientific community has introduced diverse models for peer-to-peer (P2P) energy trading, aiming to refine trading approaches for the benefit of prosumers. These models enhance energy demand response signals, lower energy costs, and optimize ESS power in renewable P2P nanogrid energy trading systems [9,10].
The Internet of things (IoT) has tremendously transformed the traditional paradigm in multiple domains, encompassing smart residences, urban environments, and healthcare implementations [11,12,13]. One of the key contributions in the inception of IoT technology was realized by Ashton Kevin, who coined the idea of digitally transforming the physical realm to enable intelligent operations [14]. Challenges posed by conventional energy trading optimization solutions, such as scalability and real-time adaptability, can be effectively addressed through IoT task orchestration technology. The Internet of things (IoT) involves an interconnected system that links physical devices; incorporating sensors, software, or similar technologies; facilitating effortless communication between these devices and individuals through the Internet [15]. Task orchestration is the coordinated management of activities to achieve a desired goal efficiently and systematically, often involving the automation and coordination of multiple components or participants [16].
Mission-critical systems encompass a diverse range of applications, including real-time navigation, healthcare, and energy power [16,17,18]. A nanogrid within a healthcare clinic, or a connection with separate entities in the form of a peer-to-peer (P2P) exchange of eco-friendly energy, can be deemed as a mission-critical application. P2P energy operation refers to the decentralized management and operation of energy generation, consumption, and trading within a nanogrid system. In such circumstances, it becomes imperative to secure a seamless provision of energy. Comparable to indispensable systems in healthcare [13], the efficiency of vital mission-critical power architectures may be substantially improved by employing IoT technology to optimize fundamental facets of energy operations. An illustrative example of such a system is explained in [16], where IoT task orchestration is employed to improve the power of nanogrid energy management systems. Task orchestration involves the coordination and automation of diverse tasks and processes through the replication of virtual objects. This orchestration in mission-critical architectures exhibited its efficacy in enabling autonomous process management [19,20].
Although IoT task orchestration is extensively utilized in domains like healthcare [13] and manufacturing, its adoption in the energy sector is constrained. While previous research has predominantly centered on smart-grid energy management, there exists potential for IoT to be extended to encompass pivotal energy domains, including energy trading. The subsequent subsections succinctly delineate the motivation and contributions of our study, while a detailed critical analysis is described in Section 2.

1.1. Motivation

Based on an exhaustive critical analysis of the current state-of-the-art (Section 2), the key motivation behind the proposed study is explained below:
  • While IoT task orchestration technology has been widely applied across domains like healthcare, manufacturing, and mountain fire safety management, its utilization within the energy sector has been comparatively limited [16]. In this regard, the proposed study employs IoT task orchestration technology to address scalability and real-time adaptability challenges that arise from manual intervention in current energy trading optimization solutions;
  • Existing IoT orchestration-based energy solutions have primarily focused exclusively on the smart-grid energy management aspect, [16,17]. However, we posit that nanogrid energy trading is a mission-critical application that should leverage IoT technology to address the limitations of conventional energy optimization solutions;
  • Several existing studies centered around IoT orchestration [13,16] have concentrated on isolated facets of task orchestration, like optimizing scheduling or integrating predictive optimization for decision making in orchestration. Conversely, our proposed study offers a comprehensive approach, addressing energy trading cost optimization and ESS power optimization, seamlessly integrated into a fully IoT-orchestrated energy trading framework for achieving an optimal and orchestrated solution within nanogrid energy trading;
  • Unlike contemporary studies employing conventional machine learning algorithms [21], we employ TabNet-based prediction model to reveal key hidden aspects concerning energy consumption, load patterns, and photovoltaic (PV) generation, thereby assisting energy distributors and peers in making informed decisions to optimize local distributed energy resource (DER) utilization through early anticipation of vital energy attributes;
  • In contrast to most pertinent studies, our proposed research evaluates its potential through an extensive case study utilizing real data sourced from nanogrid households. This empirical case study furnishes evidence of the effectiveness of the proposed system, setting it apart from other studies.

1.2. Contribution

To recapitulate, the primary contributions of the proposed study are delineated below:

1.2.1. Energy Trading Cost Optimization

  • Energy trading cost optimization requires predicted and actual load values as input, for which we employed TabNet architecture to predict nanogrid energy load and other parameters.
  • The TabNet prediction model is employed to forecast energy load, PV generation, and energy consumption, aiding energy distributors and peers in formulating efficient decision-making strategies. The prediction outcomes are compared with BD-LSTM to assess its position within the current state-of-the-art.

1.2.2. Optimal Energy Trading Decision:

  • An optimal energy storage system (ESS) power-sharing plan is developed for optimal energy trading between nanogrids through an objective function, presenting an effective energy distribution mechanism to proficiently manage the charging and discharging processes of the energy storage system (ESS), thereby optimizing surplus energy management within the ESS.

1.2.3. IoT Task Orchestration-Based Optimal Energy Trading System

  • Another novelty of the proposed study is the implementation of the IoT task orchestration concept, wherein the whole energy trading process is employed in a virtualized manner using simulated replications of physical resources (i.e., photovoltaic and ESS assets) involved in the trading process.
  • The case study is conducted, utilizing data from 24 nanogrid residences equipped with photovoltaic (PV) and energy storage system (ESS) installations, to assess the effectiveness of the proposed system’s optimization modules.
  • To evaluate the IoT task orchestration module, we employ evaluation measures including round trip time (RTT), latency, throughput, and response time.
  • A comparison with existing literature is conducted to ascertain the contribution of the proposed system with those in the existing research.

2. Related Work

This section comprehensively analyzes contemporary, state-of-the-art energy optimization solutions and mission-critical IoT applications implemented across diverse disciplines.

2.1. Energy Optimization Solutions

The scientific community has proposed different P2P energy trading frameworks to enhance trading mechanisms, benefiting both consumers and prosumers through better management of energy demand and response and decreased energy costs [9,10]. The optimization techniques hold significant importance in delivering sustainable, intelligent solutions [22]. Energy optimization involves the identification of the most optimal choice among various solutions for effective energy management. A cost-effective energy pricing strategy was implemented in [23], employing a two-stage pricing approach. Wind power producers benefited from a bid-driven peer-to-peer energy trading approach [24]. The research study in [20] investigates the integration of microgrid and blockchain technologies within collective energy communities to minimize energy costs. It emphasizes sustainable and cost-effective energy solutions for achieving a net-zero energy system. By leveraging these technologies, this paper aims to enhance electrification in transportation, buildings, industry, rural/remote areas, and islands, leading to overall energy cost reduction and a green ecosystem. Similarly, another study [25] presents a cost optimization strategy for power management in nanogrids using peer-to-peer (P2P) trading, renewable energy sources (RESs), and energy storage systems (ESSs). The approach aims to minimize grid power consumption, electricity cost, and appliance scheduling delay through multi-objective optimization and considering ESS lifetime. The strategy results in an average reduction of nanogrid electricity cost by 2.86% and ESS degradation cost by 32.75%, demonstrating its cost-efficient and sustainable energy trading capabilities. The research in [26] proposes an optimal energy sharing plan for nanogrid clusters (NGCs) using a hybrid cyber-physical peer-to-peer (P2P) framework. The plan aims to enhance self-sufficiency and photovoltaic (PV) consumption in the NGCs. The approach includes an energy sharing strategy, an online optimization model based on Lyapunov optimization, and realistic data experiments to demonstrate its effectiveness in improving the energy sharing plan within the NGCs.

Critical Analysis of Energy Optimization Solutions

A significant aspect pertaining to the existing energy optimization methodologies is that none of them have exploited the potential of IoT orchestration technology. We posit that, similar to its use in other domains, the integration of IoT technology should be employed within energy trading applications to alleviate the following critical challenges:
  • Scalability issues caused due to huge manual intervention for managing and coordinating multiple devices and systems in a distributed energy environment (e.g., nanogrids and energy communities).
  • The absence of IoT technology from mission-critical energy trading system may result in limited real-time adaptability, potentially hindering the optimal use of energy resources.
  • IoT orchestration technology automates and coordinates device interactions, facilitating seamless communication and data exchange. The absence of this technology could necessitate greater manual intervention for managing energy sharing and optimization tasks, reducing automation.

2.2. IoT Technology-Based Mission Critical Systems

Here, we will examine the current state-of-the-art studies that utilize IoT technology for managing mission-critical operations across several domains, encompassing healthcare [13], smart manufacturing, enterprise applications [14], fire management, and energy [16]. The study in [27] emphasized the need for a comprehensive closed-loop IoT healthcare environment specifically tailored for elderly patients’ health monitoring. This paper addresses this gap by proposing an intelligent task mapping architecture designed for timely interventions, based on real-time health sensing data from wearable sensors, demonstrating its reliability and effectiveness in critical tasks within IoT environments. The study incorporated conventional machine learning algorithms to implement the prediction module. A smart patient health monitoring system (PHMS) [13], with an optimized scheduling mechanism based on IoT-tasks orchestration architecture, was proposed to address the limitations of traditional IoT-based healthcare systems, aiming to efficiently monitor patient health conditions. It consists of two core modules: an optimized time-constraint-aware scheduling mechanism for autonomous healthcare tasks and an optimization module for enhancing e-health industry services. IoT task orchestration architecture [16] was introduced for efficient energy management in nanogrid systems. The architecture minimizes non-renewable energy use and maximizes renewable energy utilization. A task scheduling algorithm is presented to handle mission-critical tasks within strict deadlines, reducing task starvation rates. The study [14] introduces a novel multi-device multi-tasks management and orchestration (MDMT-MOA) architecture for enterprise Internet of things (EIoT) applications. It emphasizes task-level orchestration to automate business processes and involves embedded devices in enterprise operations. The architecture is efficient, scalable, fault-tolerant, and adaptable to new business models, making it a promising solution for enhancing efficiency and customer-centric practices in EIoT environments. The study focuses on providing ease to both designers and users of enterprise IoT applications. Another study [28] introduces a precise and innovative method for timely mountain fire detection using IoT technology. The approach employs task orchestration and predictive analysis to ensure scalability and optimal latency. The architecture is based on microservices and device virtualization, enabling lightweight and parallel task handling for efficient fire detection and notification.

Critical Analysis of Contemporary IoT Orchestration-Based Solutions

Based on the crucial research gaps identified through critical analysis of the existing literature, the proposed study primarily focuses on implementing an IoT task orchestration-based energy trading system that specifically aims to implement energy trading cost and ESS power optimization modules within the orchestrated framework. The analysis is comprehensively illustrated in Table 1.
IoT task orchestration is prevalent in healthcare and manufacturing, but its potential in the energy sector is underutilized. While previous studies have focused mainly on smart-grid energy management, we believe IoT can be extended to other vital energy domains, such as energy trading. Our study uniquely addresses energy trading cost and ESS power optimization, integrated into an IoT-orchestrated nanogrid energy trading framework. Unlike the majority of studies, our research distinguishes itself by integrating unconventional prediction modules. Moreover, our empirical case study, utilizing real nanogrid data, validates our system’s efficiency.

3. Materials and Methods

This section explains the detailed methodology for implementing a nanogrid energy trading framework using an IoT task orchestration mechanism. The main idea behind the proposed technique is to virtualize the overall nanogrid energy trading procedure with the help of sensors and an IoT edge device to reduce the operational cost involved in maintaining the physical resources. The proposed architecture implements three modules: (1) energy trading cost optimization using the proposed objective function; (2) ESS power optimization for nanogrid houses participating in P2P energy trading; and (3) virtual execution of the entire nanogrid energy trading architecture with the help of IoT-task orchestration to minimize the operational cost incurred by involving physical resources, such as a photovoltaic and energy storage system (ESS) battery. The proposed architecture of the proposed IoT-enabled task orchestration-based optimal nanogrid energy trading system is shown in Figure 1. First of all, input parameters for nanogrid houses including energy consumption, ESS data, energy load, energy generation, PV, electricity cost, and photovoltaic data, are forwarded to the prediction module, which employs a tabNET-based prediction module to predict energy load, PV generation, and energy consumption. The proposed study also performs analysis of the aforementioned parameters before applying the prediction module. Some prediction outcomes are forwarded to the energy trading module to be incorporated in the energy cost optimization objective function.
The proposed objective functions focus on minimizing trading cost and ESS power using a particle swarm optimization algorithm. The energy trading cost and power optimization module takes the required parameters as input and forwards other parameters to the virtualization module to implement task orchestration. First of all, a user interacts with the system using an energy trading desktop application on a PC server (see Figure 1). The proposed energy trading operation takes place between the prosumer and consumer. The utility gets involved if the prosumer is unable to meet the energy requirement of the consumer. We implement an objective function that focuses on optimizing the nanogrid trading cost under certain constraints using a particle swarm optimization algorithm. In this study, if a user wishes to optimize nanogrid trading cost, then the IoT is executed prior to its deployment to the physical devices. As per the concept of a digital twin, the proposed architecture is segregated into two parts: (1) virtual space and (2) physical space. The virtual space contains primary steps for task orchestration, such as task generation, device virtualization, task scheduling, and allocation; and physical space comprises the virtual resources on which the required tasks will successfully be deployed or executed.

3.1. TabNet-Based Prediction Module

The TabNet model represents an end-to-end deep learning methodology that has showcased robust performance across various datasets. This model comprises an encoder that employs sequential decision-making steps to encode features, leveraging sparse learned masks to incorporate relevant features for each row selectively through attention mechanisms. The encoder incorporates sparsemax layers to guarantee the selection of a restricted set of features. One advantage of employing learned masks is the ability to expand feature selection beyond a binary approach. Instead of applying a rigid threshold to a feature, a trainable mask can make a gradual decision, enabling more adaptable and differentiable techniques for feature selection.

3.2. Optimization Module

3.2.1. Energy Trading Cost Optimization

Prior to implementing an IoT-task orchestration mechanism, we also suggest energy trading cost optimization by implementing an objection function using particle swarm optimization. The acronyms used in the proposed objective function are illustrated in Table 2.
The following energy cost optimization objective function focuses on reducing energy cost to be traded among nanogrid houses connected in a peer-to-peer manner.
minimze ( P t ) = X 1 X 2
where the X1 computes the actual load/energy usage of nanogrid houses, and X2 computes the predicted values of energy usage or load that is obtained using TabNet encoder-decoder-based prediction architecture. The subsequent constraint establishes the relationship between the total load in an interval and the power allocated to a single consumer for energy selling.
The X1 and X2 parameters hold the following equations:
X 1 = ( s 0 l t + s 1 2   l t 2 )  
X 2 = ( s 0 l t + s 1 2   fl t 2 )  
The constrain on Equation (4) indicate how the total load within a given interval is linked to the amount of energy available to an individual consumer for energy trading.
  l t = Pow tbf + m   M Pow mt   flow mt   ( for   all   t T )  
and
0 I m + t     T L . Pow m   flow m     c m
The subsequent Equation (6) denotes the final amount of energy for the mth house at the end of the interval that should exceed the value of threshold.
  I m + t T L . Pow mt   flow mt > ratio m c m
The constraint imposed on the above equation’s parameters is shown in Equation (7).
0 Pow mi Pow max

3.2.2. Optimal Energy Trading Decision

The connectivity between nanogrids and the utility grid is established through BD-DC-AC converters to maintain an energy equilibrium. In instances of surplus energy within a nanogrid, the converter initiates its inverter mode, returning excess energy back to the grid. Conversely, during energy shortages within the nanogrid, the converter draws energy from the grid. Figure 2 illustrates the optimal energy trading decision process, while each of the depicted modules is elaborated upon in this section.
Consider N as the collection of nanogrids in the suggested energy trading system, where n denotes the total number of nanogrids.
N = { N 1 ,   N 2 ,   N 3 , ,   N i }
The value of ±1 is utilized to denote energy buying and selling. For example, if a nanogrid is allocated the value of ‘+1’, it signifies that the nanogrid has an excess of energy to be traded with nanogrids within the P2P network. On the other hand, if the value assigned is ‘−1’, it indicates that the nanogrid lacks sufficient energy to meet its energy requirements, and as a result, it needs to receive energy from other connected nanogrids (given first priority) or the utility grid. ESS refers to the collection of energy storage systems that are installed in each nanogrid. For example,
E = { E 1 ,   E 2 ,   E 3 , ,   E i }
In this context, the variable ‘i’ corresponds to the total count of energy storage systems (ESS), which is equivalent to the number of houses equipped with a nanogrid.
Assume t is a particular duration of time, and L denotes the load requirement. Therefore, L i ( t ) represents the load demand for the ith nanogrid at time t. Similarly, solar i ( t ) represents the power generated by the photovoltaic (PV) system in the ith nano-grid at time t, which can be employed either to charge E i or meet L i ( t ) . Additionally, any excess energy produced by the solar system can be sold to other nanogrids in need. The energy generated by the PV system to satisfy the load demands of its nanogrid is referred to as self-supplied energy, which is expressed as follows:
s i ( t ) = min { L i ( t ) solar i ( t ) }
The energy storage system (ESS) unit comprises batteries that are employed for storing energy generated by the PV system, along with a bi-directional DC–DC converter. Leftover energy in the ESS during a specific time interval t, is referred to as r k ( t ) . Decisions regarding ESS charging, which include Dk(t) and PVk(t), as well as the energy traded with other nanogrids, depend on both factors.
The subsequent situations are taken into consideration for (P2P) energy sharing/trading:
  • In situations where the trading function has a value of +1, preference will be given to energy exportation by PV, meaning that any surplus/excess energy generated by solar i ( t ) will be employed for trading. In the absence of excess energy, the energy saved in ess ( t ) is utilized for trading.
  • In cases where the trading function is equal to −1, the purchased energy can only be utilized to supply Dk(t) and cannot be stored in e s s i .
  • The energy that remains after energy trading during the time period t is referred to as:
    r = { r 1 ,   r 2 ,   r 3 , ,   r i }
The ‘r’ represents the energy that remains in the ESS of the ‘k’ nanogrid at a specific time, t. The ‘r’ is subject to a constraint based on the ESS capacity. The following equation denotes the constraint:
r m i n , i     r i     r m a x , i  
The r m a x , i   represents the maximum capacity of the energy storage system in kilowatt hours (kWh) for the i nanogrid, whereas r m i n ,   k   represents the minimum energy of ESS that is set by the depth of discharge (DoD) to prevent over-discharging.
The energy that is exchanged between the nanogrids is referred to as s i ( t ) , which indicates the energy exchanged by the ith nanogrid at a particular time ‘t’. The value of s i ( t ) will serve as a decisive indicator, while also indicating the amount of excess energy present in the nanogrid. If the shared energy exceeds zero, the trading function will be assigned a value of +1. Additionally, the s i ( t ) value is also helpful in determining the amount of surplus energy available in the nanogrid. If the shared energy exceeds zero, the trading function will be set to +1; otherwise, it will be set to −1. The following are the constraints that are applied to energy sharing. i s i ( t ) denotes the remaining energy in N. The energy shared by the nanogrid at time t, i s i ( t ) must be within the range of 0 and the maximum energy that can be shared at that time. The maximum limit of the shared energy, denoted as s m a x ( t ) , is expressed by the rated energy of the N k BD–DC–DC converter interface. Likewise, the excess energy produced by solar power is referred to as k s k ( t ) . The energy trading value is determined by the following function.
excess i ( t ) = { min { ( solar i ( t ) L i ( t ) ) ,   s max , i }   N i + 1   0 ,   N i 1  
The determination of s u r p l u s i ( t ) , value is dependent on two factors, namely (1) the maximum energy amount in e i at time t as expressed using the rated power of the DC-DC converter, and (2) r m a x , i .
A term used to describe the energy discharged from e x c e s s i ( t ) Essi fulfils the energy requirement for ith nanogrid, and is expressed as:
  D i ( t ) = {   0 ,   N i + 1 { min ( L i ( t ) solar i ( t ) ) ,   L max ,   k   }   N i 1  
The maximum energy that can be discharged from e i during time t is denoted by d i s m a x ,   i and is determined as per the leftover energy in the ESS and the power of the BD–DC–DC converter. The energy flow decision is taken using the values of +1 and −1 are expressed below:
                            { r ( t + 1 ) = r ( t ) + excess i ( t ) stored i ( t )               N i + 1                           r ( t + 1 ) = r ( t ) Dis i ( t )                   N i 1          
To purchase energy (+1), e i ( t ) must comply with the following two requirements: if the value of N equals to 1 and excess energy of ith nanogrid at time interval t is less than or equal to energy stored in ESS at time-interval t (i.e., e x c e s s i ( t ) E i ( t ) ), then the discharging mode is turned on, and the excess power for the (i + 1)th nanogrid is equal to the amount of ESS energy stored in the ith nanogrid at timestamp t subtracted by the excess energy for the ith nanogrid house at time interval t, i.e., E i ( t ) E x c e s s i ( t ) . On the other hand, if the excess energy of the kth nanogrid at timestamp t is less than the energy stored in the ith nanogrid’s ESS, then the charging mode is turned on, and the excess energy for (i + 1)th nanogrid at time interval t becomes the subtraction of the excess energy of the ith nanogrid house, and the energy stored is the ESS of ith nanogrid at time t, i.e., e x c e s s i   ( t ) e i ( t ) .
The operational constraints for e i during charging are different when NG = −1 compared to when NG = +1. These constraints depend on the energy consumption and availability of each nanogrid. The traded energy tradedi(t) is defined as:
traded i ( t ) = max r i ( t ) r min , i + excess i ( t ) ,   0
The following constraints are imposed on the above equation.
r i ( t ) e i ( t ) 0  
The aggregate energy shared by nanogrids with a positive value must not surpass the sum of the energy needed by the nanogrids with a negative value. Additionally, the shared energy that is purchased by nanogrids with a negative value from nanogrids with a positive value cannot exceed the energy available for sale by the latter.

3.3. IoT Enabled Task Orchestration-Based Energy Trading Operation

This study employs ioT-based task orchestration that relies on the concept of digital twin wherein physical resources such as solar panel and ESS storage are replicated with physical resources. In the proposed P2P nanogrid architecture, there are two virtual objects: (1) prosumer and (2) consumer, and these virtual objects contain all the physical resources installed within the nanogrid, such as solar panel and ESS. Further virtual objects may be added as per the required energy trading operation.

3.3.1. Energy Task Generation

The task generation module, as shown in Figure 1, integrates an NLP (natural language processing) service analyzer to generate tasks by carefully investigating the service description given as an input by a user through their interaction with the nanogrid desktop application. By utilizing NLP techniques, tasks are extracted from the user’s description, which are then classified as either periodic or event-based, depending on the presence of specific adverbs and main verbs in the sentence [16]. The service analyzer parses and tokenizes the input, extracting tasks by identifying their token positions. After the tasks are extracted, they are forwarded to the task generator manager and stored in the task database. Within the task repository, the task generator manager generates the tasks along with their corresponding methods and attributes, saving them temporarily in a designated location. Subsequently, the tasks are transformed into a format compatible with MySQL and stored in the task repository for long-term storage. The repository allows for retrieval of the tasks in multiple formats, including XML, JSON, or SQL-native database cursors. Subsequently, the mapper module utilizes the tasks obtained from the repository to map them onto distinct virtual objects. The metadata pertaining to the generated tasks is provided in Table 3.

3.3.2. Device Virtualization

The service description serves as the basis for task generation, which involves mapping tasks onto one or more virtual objects. Tasks are constructed by combining multiple virtual objects, and similarly, tasks are assigned to specific virtual objects. The tasks and Vos are then integrated to create a URI that encompasses the resource ID and the metadata details necessary for measuring process output. The URI serves as a gateway to access devices in the trading architecture and enables communication among edge or cloud platforms and IoT users who utilize end services.

3.3.3. Energy Task Mapping

Once the tasks and virtual objects are created, the next step involves their mapping which is performed using drag-drop technique executed using Jsplumb. After the mapping takes place, the mapping configuration is stored in the database. A typical mapper entity includes the IDs of the associated tasks and virtual objects, along with a timestamp indicating when the mapping occurred. The output generated by the mapper is formatted as a message with specific parameters, as illustrated in Table 3.

3.3.4. Energy Task Scheduling

In IoT applications, the main goal of task scheduling is to arrange tasks in optimal sequence across the IoT devices. This sequence is determined by considering task attributes such as priority, deadline, urgency, and others. The task scheduler organizes input tasks into a three-dimensional tuple <T, VO, time>, in which T represents an individual task, VO signifies the virtual object, and t denotes the specific time instance when task T is allocated to the virtual object VO. In assessing scheduling feasibility, the scheduler takes into account the output attributes, such as missed tasks, response time per task, partially missed tasks, throughput, and latency. To determine the available resources and time intervals for scheduling, the scheduler relies on input data, including task and device lists. The scheduler’s output updates the message profile derived from the mapper, integrating task priority and timing into the existing parameters. The system initiates by creating a list of existing tasks and extracting the metadata. Based on these profiles, priority is assigned to each task. The system then proceeds with task ordering, prioritizing tasks based on their assigned priority. To establish a consensus regarding task ordering, the system applies a selected approach or methodology. After the scheduling process is finished, the tasks and their respective scheduling order are stored in the task repository. If there are any modifications in the task profile, the system retrieves the saved information and adjusts the task order based on the scheduling consensus to incorporate the updated context. To accomplish the scheduling, we utilize the task scheduling technique introduced by the authors of [16].

3.3.5. Energy Task Allocation and Deployment

Once the tasks have been scheduled, the task allocator module receives the corresponding information and utilizes it to assign each task to a specific device. Additionally, the task allocator module maintains a record of the task device allocation. The allocator leverages the repository that stores virtual objects, tasks, and scheduling information to facilitate the allocation process. Furthermore, the mapper repository assists in determining the deployment of tasks on specific physical sensors by providing recommendations and information regarding the recommended tasks and their corresponding physical devices. This eliminates the necessity for computing this information in real-time, leading to time savings. As previously mentioned, task allocation occurs on embedded hardware, which is interconnected with numerous sensors. The main difference between scheduling and allocation lies in the use of the virtual object ID. In the scheduling phase, the virtual object ID is utilized, while in the allocation phase, the virtual object ID is employed to identify the corresponding physical device ID. The deployment stage concludes the process by assigning each task to its designated physical device.
The proposed modules are assessed using standard evaluation measures. The prediction module employs root mean squared error, while the IoT-task orchestration module is evaluated using round trip time, throughput, latency, and response time.

4. Implementation Results and Performance Analysis

This section provides details on implementation results, along with a performance analysis conducted for the proposed IoT orchestration-based optimal nanogrid energy trading system. The technology and programming language employed in the proposed study are illustrated in Table 4.
Raspbian is an open-source operating system (OS) designed specifically for the Raspberry Pi single-board computers. Raspberry Pi interacts with the server through the web using the designed energy trading APIs through the HTTP protocol.

4.1. Case Study

To validate our experiments, the proposed study employs a dataset comprising 12 nanogrids situated within Jeju City, South Korea’s residential area. This dataset serves as a pivotal case study for evaluating our proposed IoT-orchestrated optimal energy trading framework, encompassing energy prediction, cost analysis, and ESS power optimization. The dataset captures real-world energy parameter values across a network of 12 nanogrid houses over a 24 h period. Table 5 provides an overview of the employed dataset, including energy generation, demand, load, ESS charge, discharge, and total cost for each of the 12 nanogrid houses.
The dataset remains consistent across the 12 nanogrid houses for the 24 h daily interval. To provide further clarity on the dataset’s behavior, Figure 3 illustrates the pattern of these values.

4.1.1. TabNet Prediction Performance Analysis

The prediction models play a pivotal role in revealing implicit knowledge and detecting hidden patterns within the data. This knowledge is then applied to formulate effective policies. In this study, we employ a TabNet prediction module with a 10-fold cross-validation technique to predict energy generation, energy demand, energy load, and energy cost. For comparison analysis, we use the BD-LSTM technique, as it has been utilized by existing energy load prediction-based studies. The actual and predicted energy generation, demand, load, and cost values depicted in Figure 4a–d demonstrate that, in most cases, the TabNet model outperforms the BD-LSTM model. Moreover, after scrutinizing the RMSE values in the learning curve of both models, as depicted in Figure 4e, it becomes evident that the TabNet model consistently outperformed the BD-LSTM model in predicting all four energy parameters: “energy generation”, “energy demand”, “energy load”, and “energy cost”. The RMSE scores were calculated using normalized values.

4.1.2. Energy Cost Optimization:

The proposed energy cost optimization objective function is implemented in MATLAB using particle swarm optimization (PSO) with the defined configuration settings shown in Table 6.
Integrating forecasted and actual load values, the function computes the optimal energy price. The optimized results (shown in Figure 5a–l) demonstrate the pivotal role of optimal energy pricing in achieving energy cost efficiency. In 12 plotted comparisons, we analyze energy trading costs across nanogrids (NG1 to NG12). Each plot contrasts PSO-optimized costs (green line) with non-optimized costs (grey line) over 24 h. The x-axis signifies timesteps (hours), and the y-axis represents energy trading costs (USD). Overall, it is evident that the trading costs for a substantial majority of the involved nanogrid houses experienced a noteworthy reduction. This outcome underscores the effective impact of the proposed energy trading optimization approach within the realm of nanogrid systems.

4.1.3. Optimal Energy Trading Decision

This section presents the results obtained for optimal energy storage system (ESS) power allocation to facilitate energy trading for individual nanogrid houses within a peer-to-peer network (shown in Figure 6). To illustrate the effectiveness of the optimized ESS state of charge (SoC) planning, we examine the performance across the following three scenarios:
  • Scenario 1-Normal Day Scenario: Simulate a typical day with moderate solar energy and demand, assessing how the IoT-orchestration system optimizes energy trading and ESS power for cost efficiency.
  • Scenario 2-High Solar Generation Scenario: Evaluate the system’s handling of surplus solar energy on a sunny day through effective energy trading and ESS storage strategies.
  • Scenario 3-Energy Deficit Scenario: Examine the system’s response to low solar energy levels, testing its adaptability through energy trading and ESS usage under cloudy conditions.
The simulation outcomes depicted in Figure 6a–f showcase the dynamic behavior of energy trading decisions and the energy storage system (ESS) state of charge (SOC) over time for a group of 12 nanogrid houses. Each nanogrid house is associated with a distinct scenario, capturing diverse energy trading patterns and state-of-charge (SoC) variations. The figure present two subplots corresponding to each scenario for each of the 12 participating nanogrid houses. The upper subplot illustrates energy trading decisions made using the proposed optimal ESS plan, highlighting fluctuations in kWh energy exchanged by a specific nanogrid house in the roles of either a consumer or a prosumer over 24 h periods. The lower subplot showcases the SoC of the ESS, representing the optimal energy storage level normalized between −0.2 and 1. These plots offer valuable insights into the evolution of energy trading and ESS SoC under different scenarios, providing a comprehensive perspective on the intricate dynamics within the proposed optimal ESS planning for energy trading. For demonstration purpose, we have shown the results for 12 nanogrid houses.

4.2. IoT Orchestration-Based Optimal Nanogrid Energy Trading Performance

This section includes the performance analysis attained by implementing IoT-task orchestration architecture. As explained earlier, the orchestration is implemented by replicating the physical resources involved in the nanogrid energy trading process, including photovoltaic systems (PV), energy storage systems (ESS), and electric appliances of a nanogrid house. For monitoring photovoltaic (PV) data from a nanogrid using Raspberry Pi, we use a current sensor (ACS712) to measure the current flowing through the PV panels and voltage sensor to measures the voltage level of the energy storage system (ESS). We connect the Raspberry Pi to the sensors via a designed remote desktop application interface. The interfaces shown in Figure 6 take the desired description from a nanogrid prosumer or consumer and manage the NLP module to generate the tasks to be processed by the IoT task orchestration module to execute the energy operation required by the user, as shown in Figure 7.
The task generation manager (TGM) module offers a platform to generate task objects (TO) through a systematic process that involves initializing TGM components, receiving the configuration profile, and subsequently transforming service data into actionable tasks. Once the tasks are extracted and stored in the task repository, the next step involves the mapping of the tasks to the corresponding virtual resources. Each virtual object represents a physical resource. A user may add/delete the virtual object, along with the associated metadata, as shown in Figure 8.
Tasks and virtual objects are stored in respective repositories and sent to the task mapping module, utilizing the JSPlumb library for drag-and-drop functionality. The task-to-virtual-object mapping is forwarded to the task scheduling and allocation unit on the Edge node via Raspberry Pi. Scheduling begins by connecting to the task configuration manager (TCM) repository and initializing components. Tasks are extracted, parsed, and processed, resulting in a prioritized list based on profiles and arranged using round-robin [29], FEF [30], and Time-Aware [16] methods. Task allocation follows, with virtual object IDs from the scheduling message used to locate associated physical devices. The allocator schedules tasks on relevant sensors, updating device information in the payload. Once allocated, tasks are deployed on physical resources in the specified order.

4.2.1. Round Trip Time Analysis

Round trip time (RTT) refers to the total time it takes for an energy task to travel within the orchestration until it is deployed to the physical device, measuring the latency and responsiveness of the system. The list of IoT energy trading tasks executed for performance analysis is shown in Table 7. The minimum reported RTT value for “T1” is 6 ms, the average RTT value for “T1” is 10 ms, and the maximum RTT value for “T2” is 18.5 ms, as shown in Figure 9a.

4.2.2. Throughput Analysis

The throughput analysis of the proposed energy trading architecture for 12 nanogrid houses (4, 8, and 12) is depicted in the Figure 8b. With an increasing number of houses, performance improves, as reflected in the rising minimum, average, and maximum throughput values. For four houses, the throughputs are 4.19, 6.52, and 8.99 tasks/s. For eight houses, they increase to 12.33, 14.88, and 17.19 tasks/s, and for twelve houses, they rise to 20.17, 23.37, and 25.07 tasks/s using RR scheduling. This pattern showcases scalability, efficiency, and higher task execution capabilities as more houses integrate, enhancing system performance.

4.2.3. Latency Analysis

The latency analysis, shown in Figure 8c, exhibit the results attained by executing the tasks through three scheduling methods: RR [29], FEF [30], and time-aware scheduling [16]. The best results for four houses attained using RR are 4.87 minimum, 6.84 average and 9.15 maximum throughput values, followed by time-aware and FEF scheduling algorithms for 8 and 12 houses, respectively. This underscores the effective enhancement of system responsiveness through the proposed IoT task orchestration approach.

4.2.4. Response Time Analysis

Response time is measured using two parameters, task failure and task starvation. The task failure refers to the inability to complete a task successfully, while task starvation indicates a task’s prolonged delay or lack of execution due to resource constraints. The task failure rate was 5.32% for 4 nanogrid houses using round-robin scheduling, 13.9% for 8 houses using FEF scheduling, and 21.04% for 12 houses using FEF scheduling, as shown in Figure 8d.

4.3. IoT Orchestration Comparative Analysis

A comparison is drawn with an existing study [16], despite variations in the dataset due to the scarcity of similar energy-related applications employing IoT task orchestration. This approach was adopted to assess the performance of the proposed system within the available context. The throughput analysis comparison shown in Figure 10a indicates that the proposed study consistently outperforms that used in [16], in throughput across the round-robin, FEF, and time-aware algorithms. Remarkably, in the proposed study, round-robin achieves a maximum throughput of 17.19, significantly surpassing the study in [16], with RR throughput results of 12.34 s. Similar to throughput analysis comparison, the latency analysis comparison shown in Figure 10b reveals that the proposed study achieves consistently lowers latency in the round-robin, FEF, and time-aware algorithms compared to those used in [16]. Notably, the round-robin and FEF methods stand out, underscoring the approach’s potential to minimize latency for the nanogrid houses. The response time analysis comparison between the proposed study and that in [16], in terms of task starvation and task failure using round-robin, FEF, and time-aware scheduling, is shown in Figure 10c. The proposed study demonstrates better performance, achieving lower percentages in both metrics across the algorithms. Notably, the round-robin and FEF algorithms in the proposed study notably reduced “task starvation” and “task failure”, indicating enhanced task execution efficiency and reliability.

5. Conclusions

This paper introduces a peer-to-peer nanogrid energy trading system that utilizes IoT task orchestration and digital twin-based technology to enhance the performance of traditional P2P trading mechanisms. The implemented system incorporates an IoT-enabled task orchestration framework that employs service information analysis provided by users to automatically generate energy tasks. The energy tasks are scheduled, taking into account time constraints, and dynamically allocated to physical resources within the proposed system. The optimization module is implemented using particle swarm optimization to enhance the scheduling process. The initial step involves the implementation of a P2P energy trading system for the nanogrid, followed by the incorporation of relevant tasks into a generated task list within the model. The process involves the creation of virtual objects made up of physical resources, and subsequently, autonomously mapping tasks to their respective virtual objects. Moreover, the system arranges the tasks in a scheduled manner to determine the optimal execution order and assigns them to the appropriate sensors, dynamically deploying them to the available physical resources. The performance of the virtualization module is evaluated using commonly employed performance analysis measures such as RTT, throughput analysis, latency analysis, and response time. The evaluation results and comparison with state-of-the-art approaches clearly indicate that the proposed technique surpasses existing IoT orchestration architectures in various domains, including the smart grid. The proposed architecture presents a sustainable and efficient solution for the real-time-based smart grid industry, effectively handling the allocation process of energy trading tasks. It is our assertion that this architecture offers significant benefits in managing such tasks. In the future, we intend to extend the study by exploring how the nanogrid energy trading mechanism can be integrated into larger smart city initiatives.

Author Contributions

Conceptualization, F.Q. and H.J.; methodology, F.Q.; validation, F.Q., H.J., N.I. and D.-H.K.; formal analysis, F.Q.; investigation, F.Q.; resources, F.Q.; data curation, F.Q. and H.J.; writing—original draft preparation, F.Q. and N.I.; writing—review and editing, F.Q. and N.I.; visualization, F.Q. and H.J.; supervision, D.-H.K.; project administration, D.-H.K.; funding acquisition, D.-H.K. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by Energy Cloud R&D Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Science, ICT (2019M3F2A1073387), and this work was supported by Korea Institute of Energy Technology Evaluation and Planning (KETEP) and Ministry of Trade, Industry and Energy (MOTIE) of the Repulic of Korea (No. 20223030040050), Any correspondence related to this paper should be addressed to DoHyeun Kim.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. de Souza Ribeiro, L.A.; Saavedra, O.R.; De Lima, S.L.; de Matos, J. Isolated micro-grids with renewable hybrid generation: The case of Lençóis island. IEEE Trans. Sustain. Energy 2010, 2, 1–11. [Google Scholar] [CrossRef]
  2. Kirthiga, M.V.; Daniel, S.A.; Gurunathan, S. A Methodology for Transforming an Existing Distribution Network Into a Sustainable Autonomous Micro-Grid. IEEE Trans. Sustain. Energy 2012, 4, 31–41. [Google Scholar] [CrossRef]
  3. Lasseter, R.H. Microgrids. In Proceedings of the 2002 IEEE Power Engineering Society Winter Meeting (Cat. No. 02CH37309), New York, NY, USA, 27–31 January 2002; Volume 1, pp. 305–308. [Google Scholar]
  4. Werth, A.; Kitamura, N.; Tanaka, K. Conceptual study for open energy systems: Distributed energy network using interconnected DC nanogrids. IEEE Trans. Smart Grid 2015, 6, 1621–1630. [Google Scholar] [CrossRef]
  5. Tanenbaum, A.S.; Steen, M.V. Distributed Systems: Principles and Paradigms, 2nd ed.; Prentice-Hall: Upper Saddle River, NJ, USA, 2007. [Google Scholar]
  6. Li, Z.; Bahramirad, S.; Paaso, A.; Yan, M.; Shahidehpour, M. Blockchain for decentralized transactive energy management system in networked microgrids. Electr. J. 2019, 32, 58–72. [Google Scholar] [CrossRef]
  7. Ali, F.S.; Aloqaily, M.; Alfandi, O.; Ozkasap, O. Cyberphysical blockchain-enabled peer-to-peer energy trading. Computer 2020, 53, 56–65. [Google Scholar] [CrossRef]
  8. Küster, K.K.; Aoki, A.R.; Lambert-Torres, G. Transaction-based operation of electric distribution systems: A review. Int. Trans. Electr. Energy Syst. 2020, 30, e12194. [Google Scholar] [CrossRef]
  9. Pop, C.; Cioara, T.; Antal, M.; Anghel, I.; Salomie, I.; Bertoncini, M. Blockchain Based Decentralized Management of Demand Response Programs in Smart Energy Grids. Sensors 2018, 18, 162. [Google Scholar] [CrossRef]
  10. Sikorski, J.J.; Haughton, J.; Kraft, M. Blockchain technology in the chemical industry: Machine-to-machine electricity market. Appl. Energy 2017, 195, 234–246. [Google Scholar] [CrossRef]
  11. Imran; Ghaffar, Z.; Alshahrani, A.; Fayaz, M.; Alghamdi, A.M.; Gwak, J. A Topical Review on Machine Learning, Software Defined Networking, Internet of Things Applications: Research Limitations and Challenges. Electronics 2021, 10, 880. [Google Scholar] [CrossRef]
  12. Sicari, S.; Rizzardi, A.; Grieco, L.A.; Coen-Porisini, A. Security, privacy and trust in Internet of Things: The road ahead. Comput. Netw. 2015, 76, 146–164. [Google Scholar] [CrossRef]
  13. Zanella, A.; Bui, N.; Castellani, A.; Vangelista, L.; Zorzi, M. Internet of things for smart cities. IEEE Internet Things J. 2014, 1, 22–32. [Google Scholar] [CrossRef]
  14. Ahmad, S.; Kim, D. A multi-device multi-tasks management and orchestration architecture for the design of enterprise IoT applications. Futur. Gener. Comput. Syst. 2019, 106, 482–500. [Google Scholar] [CrossRef]
  15. Zheng, J.; Simplot-Ryl, D.; Bisdikian, C.; Mouftah, H. The internet of things [Guest Editorial]. IEEE Commun. Mag. 2011, 49, 30–31. [Google Scholar] [CrossRef]
  16. Qayyum, F.; Jamil, H.; Jamil, F.; Ahmad, S.; Kim, D.H. IoT-Orchestration based nanogrid energy management system and optimal time-aware scheduling for efficient energy usage in nanogrid. Int. J. Electr. Power Energy Syst. 2022, 142, 108292. [Google Scholar] [CrossRef]
  17. Hammoudeh, M.; Ghafir, I.; Bounceur, A.; Rawlinson, T. Continuous Monitoring in Mission-Critical Applications Using the Internet of Things and Blockchain. In Proceedings of the 3rd International Conference on Future Networks and Distributed Systems, Paris, France, 1–2 July 2019; pp. 1–5. [Google Scholar]
  18. Öhrvik, H.; Aaseth, J.; Horn, N. Orchestration of dynamic copper navigation—New and missing pieces. Metallomics 2017, 9, 1204–1229. [Google Scholar] [CrossRef] [PubMed]
  19. Ding, Z.; Ota, K.; Liu, Y.; Zhang, N.; Zhao, M.; Song, H.; Liu, A.; Zhiping, C. Orchestrating Data as a Services-Based Computing and Communication Model for Information-Centric Internet of Things. IEEE Access 2018, 6, 38900–38920. [Google Scholar] [CrossRef]
  20. Wu, Y.; Wu, Y.; Cimen, H.; Vasquez, J.C.; Guerrero, J.M. Towards collective energy Community: Potential roles of microgrid and blockchain to go beyond P2P energy trading. Appl. Energy 2022, 314, 119003. [Google Scholar] [CrossRef]
  21. Zhang, L.; Wen, J.; Li, Y.; Chen, J.; Ye, Y.; Fu, Y.; Livingood, W. A review of machine learning in building load prediction. Appl. Energy 2021, 285, 116452. [Google Scholar] [CrossRef]
  22. Wahid, F.; Fayaz, M.; Aljarbouh, A.; Mir, M.; Aamir, M.; Imran. Energy consumption optimization and user comfort maximization in smart buildings using a hybrid of the firefly and genetic algorithms. Energies 2020, 13, 4363. [Google Scholar] [CrossRef]
  23. Moradzadeh, B.; Tomsovic, K. Two-Stage Residential Energy Management Considering Network Operational Constraints. IEEE Trans. Smart Grid 2013, 4, 2339–2346. [Google Scholar] [CrossRef]
  24. Vahedipour-Dahraie, M.; Rashidizadeh-Kermani, H.; Shafie-Khah, M.; Siano, P. Peer-to-Peer Energy Trading Between Wind Power Producer and Demand Response Aggregators for Scheduling Joint Energy and Reserve. IEEE Syst. J. 2020, 15, 705–714. [Google Scholar] [CrossRef]
  25. Jin, H.; Lee, S.; Nengroo, S.H.; Ahn, G.; Chang, Y.-J.; Har, D. P2P power trading of nanogrids for power management in consideration of battery lifetime of ESS. Energy Build. 2023, 297, 113290. [Google Scholar] [CrossRef]
  26. Liu, N.; Yu, X.; Fan, W.; Hu, C.; Rui, T.; Chen, Q.; Zhang, J. Online Energy Sharing for Nanogrid Clusters: A Lyapunov Optimization Approach. IEEE Trans. Smart Grid 2017, 9, 4624–4636. [Google Scholar] [CrossRef]
  27. Imran; Iqbal, N.; Ahmad, S.; Kim, D.H. Health Monitoring System for Elderly Patients Using Intelligent Task Mapping Mechanism in Closed Loop Healthcare Environment. Symmetry 2021, 13, 357. [Google Scholar] [CrossRef]
  28. Imran; Ahmad, S.; Kim, D.H. A task orchestration approach for efficient mountain fire detection based on microservice and predictive analysis in IoT environment. J. Intell. Fuzzy Syst. 2021, 40, 5681–5696. [Google Scholar] [CrossRef]
  29. Rasmussen, R.V.; Trick, M.A. Round robin scheduling—A survey. Eur. J. Oper. Res. 2008, 188, 617–636. [Google Scholar] [CrossRef]
  30. Malik, S.; Kim, D. A Hybrid Scheduling Mechanism Based on Agent Cooperation Mechanism and Fair Emergency First in Smart Factory. IEEE Access 2020, 8, 227064–227075. [Google Scholar] [CrossRef]
Figure 1. IoT-orchestration-based optimal nanogrid energy trading system for efficient energy trading operation.
Figure 1. IoT-orchestration-based optimal nanogrid energy trading system for efficient energy trading operation.
Smartcities 06 00101 g001
Figure 2. ESS power optimization module for optimal energy trading decision.
Figure 2. ESS power optimization module for optimal energy trading decision.
Smartcities 06 00101 g002
Figure 3. Nanogrid house energy parameter flow behavior pattern.
Figure 3. Nanogrid house energy parameter flow behavior pattern.
Smartcities 06 00101 g003
Figure 4. This figure shows the actual and predicted values of key energy parameters, including actual and predicted energy generation, energy demand, energy load, and energy cost: (a) actual and predicted energy generation values using the TabNet and BD-LSTM prediction module, (b) actual and predicted energy demand values using the TabNet and BD-LSTM prediction module, (c) actual and predicted energy load values using the TabNet and BD-LSTM prediction module, (d) actual and predicted energy cost values using the TabNet and BD-LSTM prediction module, and (e) the learning curve for the BD-LSTM and TabNet models.
Figure 4. This figure shows the actual and predicted values of key energy parameters, including actual and predicted energy generation, energy demand, energy load, and energy cost: (a) actual and predicted energy generation values using the TabNet and BD-LSTM prediction module, (b) actual and predicted energy demand values using the TabNet and BD-LSTM prediction module, (c) actual and predicted energy load values using the TabNet and BD-LSTM prediction module, (d) actual and predicted energy cost values using the TabNet and BD-LSTM prediction module, and (e) the learning curve for the BD-LSTM and TabNet models.
Smartcities 06 00101 g004
Figure 5. Illustration of the non-optimized and PSO-based optimized nanogrid energy cost values for 12 distinct houses (al) over a 24 h time interval. The x-axis represents timesteps in hours, while the y-axis depicts the trading cost value in US dollars.
Figure 5. Illustration of the non-optimized and PSO-based optimized nanogrid energy cost values for 12 distinct houses (al) over a 24 h time interval. The x-axis represents timesteps in hours, while the y-axis depicts the trading cost value in US dollars.
Smartcities 06 00101 g005aSmartcities 06 00101 g005b
Figure 6. Optimal energy trading decisions and ESS SoC across a 24 h interval for six nanogrid houses; (a) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 1, (b) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 2, (c) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 3, (d) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 4, (e) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 5, (f) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 6.
Figure 6. Optimal energy trading decisions and ESS SoC across a 24 h interval for six nanogrid houses; (a) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 1, (b) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 2, (c) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 3, (d) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 4, (e) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 5, (f) energy trading decision over interval of 24 hours based on ESS SoC for Nanogird House 6.
Smartcities 06 00101 g006aSmartcities 06 00101 g006b
Figure 7. NLP-based interface for energy trading task generation and the flow of the task generation manager.
Figure 7. NLP-based interface for energy trading task generation and the flow of the task generation manager.
Smartcities 06 00101 g007
Figure 8. IoT-orchestrated virtual object creation interface in IoT-orchestration and its execution flow.
Figure 8. IoT-orchestrated virtual object creation interface in IoT-orchestration and its execution flow.
Smartcities 06 00101 g008
Figure 9. This figure shows the results for round trip time analysis, throughput, latency, and response time analysis for real-time energy tasks executed in the proposed IoT-orchestrated energy trading system using three scheduling techniques: (a) round trip time analysis of energy trading tasks, (b) throughput analysis of tasks executed per second, (c) latency analysis of tasks executed per milliseconds, as well as (d) response time: task failure and task starvation analysis.
Figure 9. This figure shows the results for round trip time analysis, throughput, latency, and response time analysis for real-time energy tasks executed in the proposed IoT-orchestrated energy trading system using three scheduling techniques: (a) round trip time analysis of energy trading tasks, (b) throughput analysis of tasks executed per second, (c) latency analysis of tasks executed per milliseconds, as well as (d) response time: task failure and task starvation analysis.
Smartcities 06 00101 g009
Figure 10. This figure shows the comparison analysis for throughput, latency, and response time for real-time energy tasks executed in the proposed IoT-orchestrated energy trading system using three scheduling techniques (a) maximum, minimum, and average throughput comparison using three scheduling methods; (b) maximum, minimum, and average latency comparison using three scheduling methods; and (c) response time comparison analysis: task starvation and task failure comparison using three scheduling methods.
Figure 10. This figure shows the comparison analysis for throughput, latency, and response time for real-time energy tasks executed in the proposed IoT-orchestrated energy trading system using three scheduling techniques (a) maximum, minimum, and average throughput comparison using three scheduling methods; (b) maximum, minimum, and average latency comparison using three scheduling methods; and (c) response time comparison analysis: task starvation and task failure comparison using three scheduling methods.
Smartcities 06 00101 g010
Table 1. Critical analysis with contemporary state-of-the-art IoT orchestration systems.
Table 1. Critical analysis with contemporary state-of-the-art IoT orchestration systems.
ApproachDomainObjective Prediction
M
Optimization Real-Time/
Real Dataset
Pros Cons
[27]HealthcarePresents an IoT healthcare architecture with intelligent task orchestration and prediction for elderly health monitoring.×Effective for critical healthcare applications.-Utilizes conventional machine learning techniques.
-Enhances prediction outcomes.
[14]Enterprise applicationsIntroduces MDMT-MOA architecture for efficient EIoT and traditional IoT orchestration; enhancing business processes and IoT app performance.××-Applicable to real-time mission-critical enterprise applications.
-Enhances usability for enterprise IoT application designers and users.
Missing performance comparisons to existing architectures.
[28] Fire management Suggests microservice-based IoT orchestration for improved mountain fire detection, safety, and damage reduction.×Employs predictive analytics for informed fire mitigation decisions by safety authorities.-Lacks comparison with the current state-of-the-art.
-Claims a perfect solution, but lacks evaluation using real dataset scenarios.
[16]Energy Proposed IoT-enabled orchestrated architecture for efficient nanogrid energy management. ××Effective for mission-critical smart grid energy applications.Lack of case study-based evaluation for prediction and optimization modules.
Proposed
Study
Energy -Overcomes scalability issues.
-Integrates energy trading cost and ESS power optimization in a fully IoT-orchestrated framework to virtually implement the entire architecture.
-Utilizes TabNet prediction module to enhance conventional ML model performance.
-Provides a comprehensive comparison with contemporary state-of-the-art.
The potential could be further enriched by considering various scenarios in multiple case studies.
Table 2. Acronyms for the proposed objective function for energy cost and ESS power optimization.
Table 2. Acronyms for the proposed objective function for energy cost and ESS power optimization.
AcronymDescription Acronym Description
Pprice of energyNnanogrid houses
Ntime intervalEenergy storage system installed in house
Mno. of HomesIindex of house
tinterval timeSself-sufficient
s 0 real-time pricing model interceptLenergy load
s 1 real-time pricing slope solarsolar: photovoltaic energy
l t load interval in interval irremaining power
Pow mt m consumer power in ith intervalNN
flow mt interval within energy flowexcesssurplus energy owned by N
l m starting energy usage of m consumersDisdischarging energy
Llength of intervalstoredstored energy
ratiofinal energy ratio of m housetradedtraded energy
c m capacity of m consumerssharedshared; energy shared by each nanogrid
pow max maximum energy power
Table 3. Task and message profile-related metadata in IoT task orchestration.
Table 3. Task and message profile-related metadata in IoT task orchestration.
Task Metadata Message Profile
IDTask IDMsgIDUnique identifier of the message
NameName of taskMicroservice IDMicrosevice ID to which task belongs
TypeType of task, such as periodic, urgent, etc.SourceSource from where the message was generated
Arrival TimeTime at which task arrivedDestinationDestination points of the message
Execution TimeTime at which execution commencedTask IDID of task
DeadlineDeadline of the taskVO IDVirtual object ID
msidMicroservice ID at which task belongsCreated_atTime at which the mapping occurred between task and VO
PriorityUrgent/non-urgent typeUpdated_atTime at which mapping was updated
Created_atTask generation time
Updated_atTask update time
Table 4. Implementation tools and techniques.
Table 4. Implementation tools and techniques.
Technology NameDetail
OSindows 10 for PC server, Raspbian for Edge Raspberry Pi
Programming language Python Flask, JavaScript, HTML, CSS, MATLAB
LibrariesBootstrap 3, Jinja 3, JSplumb for mapping
ServerFlask server
PersistenceMysql
BrowserChrome and Firefox
Core programming language Python 3
Resources current sensor, voltage sensor
Table 5. Overview of nanogrid house data used for case study evaluation.
Table 5. Overview of nanogrid house data used for case study evaluation.
House.HourEnergy Generation (kWh)Energy Demand (kWh)Energy Load (kWh)ESS Charge (kWh)ESS Discharge (kWh)Total Cost (USD)
House 118.7516.4517.842.990.780.16
House 125.5812.7813.383.540.100.49
House 1313.3216.6014.690.921.520.31
House 1-------
House 1-------
House 12410.4713.5816.393.884.700.46
Table 6. PSO optimizer configuration settings.
Table 6. PSO optimizer configuration settings.
S. No 12345
ParametersLocal coefficient Global coefficient Inertia weight No. of particles Iterations
Values1.31.30.518120
Table 7. List of executed IoT energy trading tasks. These are the tasks that were executed to analyze the performance of proposed IoT-orchestrated based nanogrid energy trading system.
Table 7. List of executed IoT energy trading tasks. These are the tasks that were executed to analyze the performance of proposed IoT-orchestrated based nanogrid energy trading system.
Task No.TasksTask No.Tasks
T1getPVT6OptimizeCost
T2getESST7OptimizeESS
T3Compute LoadT8BuyEnergy
T4ComputeSurplusEnergyT9SellEnergy
T5PredictLoadT10EnergyDeamad
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Qayyum, F.; Jamil, H.; Iqbal, N.; Kim, D.-H. IoT Orchestration-Based Optimal Energy Cost Decision Mechanism with ESS Power Optimization for Peer-to-Peer Energy Trading in Nanogrid. Smart Cities 2023, 6, 2196-2220. https://doi.org/10.3390/smartcities6050101

AMA Style

Qayyum F, Jamil H, Iqbal N, Kim D-H. IoT Orchestration-Based Optimal Energy Cost Decision Mechanism with ESS Power Optimization for Peer-to-Peer Energy Trading in Nanogrid. Smart Cities. 2023; 6(5):2196-2220. https://doi.org/10.3390/smartcities6050101

Chicago/Turabian Style

Qayyum, Faiza, Harun Jamil, Naeem Iqbal, and Do-Hyeun Kim. 2023. "IoT Orchestration-Based Optimal Energy Cost Decision Mechanism with ESS Power Optimization for Peer-to-Peer Energy Trading in Nanogrid" Smart Cities 6, no. 5: 2196-2220. https://doi.org/10.3390/smartcities6050101

APA Style

Qayyum, F., Jamil, H., Iqbal, N., & Kim, D. -H. (2023). IoT Orchestration-Based Optimal Energy Cost Decision Mechanism with ESS Power Optimization for Peer-to-Peer Energy Trading in Nanogrid. Smart Cities, 6(5), 2196-2220. https://doi.org/10.3390/smartcities6050101

Article Metrics

Back to TopTop