# Edge Computing Parallel Approach for Efficient Energy Sharing in a Prosumer Community

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

## 2. Related Work

## 3. Architecture and Algorithm of the Parallel Approach

#### 3.1. Architecture

- The nano-grid system, which manages and quantifies the energy exchanges among the prosumers, the distribution grid, the local generation plants, and the storage systems;
- The home automation system, which manages the activation/deactivation of the electrical loads, such as the home appliances and the lighting system.

- The aggregator operates as the control center: it receives, aggregates, and manages the electricity data of the entire community;
- The super-users are used as edge nodes and, through their energy-boxes, collect and aggregate electricity data of the different groups;
- The simple users, through their nano-grids, act as smart meters: they measure local electricity data and send it to the super-user of the local group.

- The prediction of the energy production and energy consumption, which in turn are based on the weather forecast and on the characteristics and statistics of the generation plants and the electrical loads [43];
- The energy prices, as determined by the energy market (more details are given in Section 5);
- Information about the possible energy surplus: based on the amount of energy produced and consumed inside the community, the aggregator determines if and at which hours a surplus of energy is available, and tries to redistribute this energy to the prosumer groups, as detailed in Section 3.2.

#### 3.2. Algorithm

## 4. Optimization Model of the Prosumer Problem

#### 4.1. First Stage

#### 4.2. Second Stage

#### 4.2.1. Request Phase

#### 4.2.2. Grant Phase

## 5. Energy Tariffs and Case Studies

- The number of schedulable loads is between 0 and 4; each schedulable load has a rated power between 0.5 kW and 3.0 kW; the working time of each schedulable load varies from 1 to 5 h, and the load is scheduled casually within 24 h; the schedulable loads are interruptible with a 50% probability;
- Each user has a non-schedulable load profile with a power that can vary during the day from 0.1 kW to 0.3 kW;
- The maximum operation power is set to 3 kW, 4.5 kW, 6 kW, or 9 kW;
- For producers: the installed power of PV plants, equipped with storage systems, can vary between 3 kW and 9 kW, and must be a multiple of 0.5 kW.

## 6. Results and Discussion

#### 6.1. Homogeneous User Groups

#### 6.2. Heterogeneous User Groups

#### 6.3. Results for Large Communities

## 7. Conclusions

#### Future Work

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## Abbreviations

MILP | Mixed Integer Linear Programming |

EMS | Energy Management Systems |

GAMS | General Algebraic Modeling Language |

ILP | Integer Linear Programming |

PZ | Zone Price |

PUN | Single National Price |

GME | Italian Energy Market Manager |

## References

- Allwood, J.M.; Cullen, J.M.; Milford, R.L. Options for achieving a 50% cut in industrial carbon emissions by 2050. Environ. Sci. Technol.
**2010**, 44, 1888–1894. [Google Scholar] [CrossRef] [PubMed] - Ritzer, G.; Jurgenson, N. Production, consumption, prosumption: The nature of capitalism in the age of the digital ‘prosumer’. J. Consum. Cult.
**2010**, 10, 13–36. [Google Scholar] [CrossRef] - Alanne, K.; Saari, A. Distributed energy generation and sustainable development. Renew. Sustain. Energy Rev.
**2006**, 10, 539–558. [Google Scholar] [CrossRef] - European Commission. Directive of the European Parliament and of the Council on Common Rules for the Internal Market in Electricity; Technical Report, Directive 2016/0380/COD; European Commission: Brussels, Belgium, 2017. [Google Scholar]
- Mengelkamp, E.; Staudt, P.; Garttner, J.; Weinhardt, C. Trading on local energy markets: A comparison of market designs and bidding strategies. In Proceedings of the 14th IEEE International Conference on the European Energy Market (EEM), Dresden, Germany, 6–9 June 2017; pp. 1–6. [Google Scholar]
- Rathnayaka, A.D.; Potdar, V.M.; Dillon, T.; Hussain, O.; Kuruppu, S. Goal-oriented prosumer community groups for the smart grid. Technol. Soc. Mag.
**2014**, 33, 41–48. [Google Scholar] [CrossRef] [Green Version] - Dukovska, I.; Slootweg, J.; Paterakis, N.G. Decentralized coordination of a community of electricity prosumers via distributed MILP. IEEE Trans. Power Syst.
**2021**, 36, 5578–5589. [Google Scholar] [CrossRef] - Li, Y.; Yang, Z.; Li, G.; Zhao, D.; Tian, W. Optimal scheduling of an isolated microgrid with battery storage considering load and renewable generation uncertainties. IEEE Trans. Ind. Electron.
**2018**, 66, 1565–1575. [Google Scholar] [CrossRef] [Green Version] - Teo, T.; Logenthiran, T.; Woo, W.L.; Abidi, K. Near-optimal day-ahead scheduling of energy storage system in grid-connected microgrid. In Proceedings of the 2018 IEEE Innovative Smart Grid Technologies-Asia (ISGT Asia), Singapore, 22–25 May 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1257–1261. [Google Scholar]
- Novoa, L.; Flores, R.; Brouwer, J. Optimal renewable generation and battery storage sizing and siting considering local transformer limits. Appl. Energy
**2019**, 256, 113926. [Google Scholar] [CrossRef] - Aalami, H.; Moghaddam, M.P.; Yousefi, G. Demand response modeling considering interruptible/curtailable loads and capacity market programs. Appl. Energy
**2010**, 87, 243–250. [Google Scholar] [CrossRef] - Giordano, A.; Mastroianni, C.; Scarcello, L.; Spezzano, G. An optimization model for efficient energy exchange in energy communities. In Proceedings of the 2020 Fifth International Conference on Fog and Mobile Edge Computing (FMEC), Paris, France, 20–23 April 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 319–324. [Google Scholar]
- Giordano, A.; Mastroianni, C.; Scarcello, L. Optimization model for iot-aware energy exchange in energy communities for residential users. Electronics
**2020**, 9, 1003. [Google Scholar] [CrossRef] - Mansini, R.; ‚odzimierz Ogryczak, W.; Speranza, M.G.; The Association of European Operational Research Societies. Linear and Mixed Integer Programming for Portfolio Optimization; Springer: Berlin/Heidelberg, Germany, 2015; Volume 21. [Google Scholar]
- Conforti, M.; Cornuéjols, G.; Zambelli, G. Integer Programming; Springer: Berlin/Heidelberg, Germany, 2014; Volume 271. [Google Scholar]
- Zhu, L.; Li, M.; Zhang, Z.; Xu, C.; Zhang, R.; Du, X.; Guizani, N. Privacy-preserving authentication and data aggregation for fog-based smart grid. IEEE Commun. Mag.
**2019**, 57, 80–85. [Google Scholar] [CrossRef] - Liu, Y.; Yang, C.; Jiang, L.; Xie, S.; Zhang, Y. Intelligent edge computing for IoT-based energy management in smart cities. IEEE Netw.
**2019**, 33, 111–117. [Google Scholar] [CrossRef] - Oprea, S.V.; Bâra, A. Edge and fog computing using IoT for direct load optimization and control with flexibility services for citizen energy communities. Knowl.-Based Syst.
**2021**, 228, 107293. [Google Scholar] [CrossRef] - Barrico, F.; Cappellaro, F.; Palumbo, C. Le Comunità Energetiche in Italia. Una Guida per Orientare i Cittadini nel Nuovo Mercato Dell’energia; Technical Report; ENEA: Stockholm, Sweden, 2020. [Google Scholar]
- Zhou, B.; Zou, J.; Chung, C.Y.; Wang, H.; Liu, N.; Voropai, N.; Xu, D. Multi-Microgrid Energy Management Systems: Architecture, Communication, and Scheduling Strategies. J. Mod. Power Syst. Clean Energy
**2021**, 9, 463–476. [Google Scholar] [CrossRef] - Zou, H.; Mao, S.; Wang, Y.; Zhang, F.; Chen, X.; Cheng, L. A survey of energy management in interconnected multi-microgrids. IEEE Access
**2019**, 7, 72158–72169. [Google Scholar] [CrossRef] - Ouammi, A.; Dagdougui, H.; Dessaint, L.; Sacile, R. Coordinated model predictive-based power flows control in a cooperative network of smart microgrids. IEEE Trans. Smart Grid
**2015**, 6, 2233–2244. [Google Scholar] [CrossRef] - Fathi, M.; Bevrani, H. Statistical cooperative power dispatching in interconnected microgrids. IEEE Trans. Sustain. Energy
**2013**, 4, 586–593. [Google Scholar] [CrossRef] - Kargarian, A.; Rahmani, M. Multi-microgrid energy systems operation incorporating distribution-interline power flow controller. Electr. Power Syst. Res.
**2015**, 129, 208–216. [Google Scholar] [CrossRef] - Gao, H.; Liu, J.; Wang, L.; Wei, Z. Decentralized energy management for networked microgrids in future distribution systems. IEEE Trans. Power Syst.
**2017**, 33, 3599–3610. [Google Scholar] [CrossRef] - Wang, Z.; Chen, B.; Wang, J. Decentralized energy management system for networked microgrids in grid-connected and islanded modes. IEEE Trans. Smart Grid
**2015**, 7, 1097–1105. [Google Scholar] [CrossRef] - Karavas, C.S.; Kyriakarakos, G.; Arvanitis, K.G.; Papadakis, G. A multi-agent decentralized energy management system based on distributed intelligence for the design and control of autonomous polygeneration microgrids. Energy Convers. Manag.
**2015**, 103, 166–179. [Google Scholar] [CrossRef] - Alam, M.N.; Chakrabarti, S.; Ghosh, A. Networked microgrids: State-of-the-art and future perspectives. IEEE Trans. Ind. Inform.
**2018**, 15, 1238–1250. [Google Scholar] [CrossRef] - Bui, V.H.; Hussain, A.; Kim, H.M. A multiagent-based hierarchical energy management strategy for multi-microgrids considering adjustable power and demand response. IEEE Trans. Smart Grid
**2016**, 9, 1323–1333. [Google Scholar] [CrossRef] - Han, Y.; Zhang, K.; Li, H.; Coelho, E.A.A.; Guerrero, J.M. MAS-based distributed coordinated control and optimization in microgrid and microgrid clusters: A comprehensive overview. IEEE Trans. Power Electron.
**2017**, 33, 6488–6508. [Google Scholar] [CrossRef] [Green Version] - Wang, Y.; Mao, S.; Nelms, R.M. On hierarchical power scheduling for the macrogrid and cooperative microgrids. IEEE Trans. Ind. Inform.
**2015**, 11, 1574–1584. [Google Scholar] [CrossRef] - Zhao, B.; Wang, X.; Lin, D.; Calvin, M.M.; Morgan, J.C.; Qin, R.; Wang, C. Energy management of multiple microgrids based on a system of systems architecture. IEEE Trans. Power Syst.
**2018**, 33, 6410–6421. [Google Scholar] [CrossRef] - Jiang, W.; Yang, K.; Yang, J.; Mao, R.; Xue, N.; Zhuo, Z. A multiagent-based hierarchical energy management strategy for maximization of renewable energy consumption in interconnected multi-microgrids. IEEE Access
**2019**, 7, 169931–169945. [Google Scholar] [CrossRef] - Meng, K.; Dong, Z.Y.; Xu, Z.; Zheng, Y.; Hill, D.J. Coordinated Dispatch of Virtual Energy Storage Systems in Smart Distribution Networks for Loading Management. IEEE Trans. Syst. Man Cybern. Syst.
**2017**, 49, 776–786. [Google Scholar] [CrossRef] - Markakis, E.K.; Nikoloudakis, Y.; Lapidaki, K.; Fiorentzis, K.; Karapidakis, E. Unification of Edge Energy Grids for Empowering Small Energy Producers. Sustainability
**2021**, 13, 8487. [Google Scholar] [CrossRef] - Ren, J.; Guo, H.; Xu, C.; Zhang, Y. Serving at the edge: A scalable IoT architecture based on transparent computing. IEEE Netw.
**2017**, 31, 96–105. [Google Scholar] [CrossRef] - Cosic, A.; Stadler, M.; Mansoor, M.; Zellinger, M. Mixed-integer linear programming based optimization strategies for renewable energy communities. Energy
**2021**, 237, 121559. [Google Scholar] [CrossRef] - Belli, G.; Giordano, A.; Mastroianni, C.; Menniti, D.; Pinnarelli, A.; Scarcello, L.; Sorrentino, N.; Stillo, M. A unified model for the optimal management of electrical and thermal equipment of a prosumer in a DR environment. IEEE Trans. Smart Grid
**2017**, 10, 1791–1800. [Google Scholar] [CrossRef] - Giordano, A.; Mastroianni, C.; Menniti, D.; Pinnarelli, A.; Scarcello, L.; Sorrentino, N. A Two-Stage Approach for Efficient Power Sharing Within Energy Districts. IEEE Trans. Syst. Man Cybern. Syst.
**2019**, 51, 1679–1689. [Google Scholar] [CrossRef] - Scarcello, L.; Giordano, A.; Mastroianni, C.; Spezzano, G. Cascade computing model to optimize energy exchanges in prosumer communities. Heliyon
**2022**, 8, e08902. [Google Scholar] [CrossRef] - Guida, A.; Sciandrone, M.; Schoen, F.; Cartis, C. A Branch and Bound Algorithm for the Global Optimization and Its Improvements. Ph.D. Thesis, Universita degli Studi di Firenze, Florence, Italy, 2015. [Google Scholar]
- Krishnamoorthy, B. Bounds on the size of branch-and-bound proofs for integer knapsacks. Oper. Res. Lett.
**2008**, 36, 19–25. [Google Scholar] [CrossRef] - Belli, G.; Burgio, A.; Menniti, D.; Pinnarelli, A.; Sorrentino, N.; Vizza, P. A multiperiodal management method at user level for storage systems using artificial neural network forecasts. In Proceedings of the 2016 IEEE 16th International Conference on Environment and Electrical Engineering (EEEIC), Florence, Italy, 7–10 June 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 1–5. [Google Scholar]
- Stueber, T.; Heimgaertner, F.; Menth, M. Day-Ahead Optimization of Production Schedules for Saving Electrical Energy Costs. In Proceedings of the Tenth ACM International Conference on Future Energy Systems, Phoenix, AZ, USA, 25–28 June 2019; ACM: New York, NY, USA, 2019; pp. 192–203. [Google Scholar]
- Cicirelli, F.; Guerrieri, A.; Mastroianni, C.; Scarcello, L.; Spezzano, G.; Vinci, A. Balancing Energy Consumption and Thermal Comfort with Deep Reinforcement Learning. In Proceedings of the 2021 IEEE 2nd International Conference on Human-Machine Systems (ICHMS), Magdeburg, Germany, 8–10 September 2021. [Google Scholar]

**Figure 3.**The chronological flow of the Parallel approach algorithm. In the figure, the cloud represents the aggregator, and the big and small houses represent, respectively, the super-users and the simple users.

**Figure 5.**Aggregate profile of the energy community, computed at the end of the first and second stages when using the Parallel approach. Positive (negative) values correspond to energy injected to (absorbed from) the grid.

**Figure 6.**Amount of energy surplus computed by the first stage and amount of energy surplus redistributed to the groups by the second stage.

**Figure 7.**Daily cost profile of the community considering the energy exchanged with the external grid. Comparison among the Separated, the Unified, and the Parallel approach.

**Figure 8.**Computing time needed to solve the prosumer problem versus the number of users. Comparison among the Separated, Unified, and Parallel approach. The group size of the Parallel approach is set to 10.

**Figure 9.**Amount of memory needed to solve the prosumer problem using the Unified approach, versus the number of users.

**Figure 10.**Case B. Aggregate profile of the energy community, computed at the end of the first and second stages when using the Parallel approach. Positive (negative) values correspond to the energy injected to (absorbed from) the grid.

**Figure 11.**Case B. Amount of energy surplus computed by the first stage and amount of energy surplus redistributed to the groups by the second stage.

**Figure 12.**Case B. Daily cost profile of the community, considering the energy exchanged with the external grid. Comparison among the Separated, Unified, and Parallel approaches.

**Figure 13.**Computing time versus group size, for different values of the number of users in the community.

**Figure 14.**The daily cost profile of the community versus the group size, for different values of the number of users in the community.

H | set of the hours of a day |

${H}^{*}$ | set of surplus hours |

U | number of users; a single user is denoted with the integer u, $1\le u\le U$ |

G | number of groups; each group is denoted with the integer g, $1\le g\le G$ |

${U}_{g}$ | set of users that belong to the group g; |

${A}_{u}$ | set of schedulable loads of user $u\in {U}_{g}$ |

${B}_{u}$ | set of non-schedulable loads of user $u\in {U}_{g}$ |

${E}_{imp}^{h,u}$ | electrical energy imported from the group g at hour $h\in H$ by user $u\in {U}_{g}$ |

${E}_{exp}^{h,u}$ | electrical energy exported to the group g at hour $h\in H$ by user $u\in {U}_{g}$ |

${E}_{impG}^{h,u}$ | electrical energy imported from the grid at hour $h\in H$ by user $u\in {U}_{g}$ |

${E}_{expG}^{h,u}$ | electrical energy exported to the grid at hour $h\in H$ by user $u\in {U}_{g}$ |

${E}_{cha}^{h,u}$ | electrical energy stored in batteries during hour $h\in H$ by user $u\in {U}_{g}$ |

${E}_{dis}^{h,u}$ | electrical energy drawn from batteries during hour $h\in H$ by user $u\in {U}_{g}$ |

${y}_{a}^{h,u}$ | status of the schedulable load $a\in {A}_{u}$ at hour $h\in H$ by user $u\in {U}_{g}$ (1 = on; 0 = off) |

${z}_{a}^{h,u}$ | auxiliary variable set to 1 if the schedulable load $a\in {A}_{u}$ is activated at hour |

$h\in H$ by user $u\in {U}_{g}$, 0 elsewhere | |

${E}_{req}^{h,u}$ | electrical surplus energy requested at hour $h\in {H}^{*}$ by user $u\in {U}_{g}$ |

${\alpha}_{a}^{u}$, ${\beta}_{a}^{u}$ | start and end time range for scheduling the load $a\in A$ of user $u\in {U}_{g}$ |

${\theta}_{a}^{u}$ | duration of the working time of the schedulable load $a\in A$ of user $u\in {U}_{g}$ |

${E}_{a}^{h,u}$ | rated hourly power of the load $a\in A$ of user $u\in {U}_{g}$ |

${x}_{b}^{h,u}$ | consumption forecast for non-schedulable load $b\in B$ at hour $h\in H$ |

of user $u\in {U}_{g}$ | |

${E}_{PV}^{h,u}$ | production forecast for PV plants at hour $h\in H$ of user $u\in {U}_{g}$ |

${E}_{maxGrid}^{u}$ | maximum operation power that can be imported from the grid |

${\eta}_{cha}^{u}$, ${\eta}_{dis}^{u}$ | charging/discharging efficiency factors of the electrical storage system |

of user $u\in {U}_{g}$ | |

$SO{C}_{max}^{u}$ | maximum percentage of the state of charge of the electrical storage system |

of user $u\in {U}_{g}$ | |

$SO{C}_{min}^{u}$ | minimum percentage of the state of charge of the electrical storage system |

of user $u\in {U}_{g}$ | |

${E}_{maxCha}^{u}$ | maximum charging power of the electrical storage system of user $u\in {U}_{g}$ |

${E}_{maxDis}^{u}$ | aximum discharging power of the electrical storage system of user $u\in {U}_{g}$ |

${C}_{max}^{u}$ | maximum capacity of the electrical storage system of user $u\in {U}_{g}$ |

${E}_{STO}^{u}$ | residual energy of the day before stored in the electrical storage system |

of user $u\in {U}_{g}$ | |

${c}^{h}$, ${p}^{h}$ | buying/selling tariffs applied when importing/exporting energy |

inside the community | |

${c}_{s}^{h}$ | cost to import an electrical $kWh$ of surplus energy at hour $h\in {H}^{*}$ |

$PU{N}^{h}$ | buying cost applied when importing energy from the external grid |

$P{Z}^{h}$ | selling price applied when exporting energy to the external grid |

${E}_{expFS}^{h,u}$ | electrical energy exported into the grid in the first stage at hour $h\in {H}^{*}$ |

by user $u\in {U}_{g}$ | |

${E}_{acc}^{h,u}$ | amount of energy surplus granted at hour $h\in {H}^{*}$ to user $u\in {U}_{g}$ |

**Table 4.**Energy cost incurred by the single groups and the community, after the first and second stages, when considering the energy exchanged with the external grid.

Stage | First | Second | |
---|---|---|---|

Partial cost [€] paid by | Group 1 | 8.903 | 8.218 |

Group 2 | 5.913 | 5.884 | |

Group 3 | 7.512 | 7.512 | |

Group 4 | 4.727 | 4.405 | |

Group 5 | 12.729 | 12.700 | |

Group 6 | 7.917 | 6.526 | |

Group 7 | 5.895 | 5.895 | |

Group 8 | 12.829 | 12.829 | |

Group 9 | 8.958 | 7.254 | |

Group 10 | 9.803 | 9.803 | |

Community cost [€] | 85.239 | 81.025 |

Stage | First | Second | |
---|---|---|---|

Execution time [ms] | Group 1 | 854 | 994 |

Group 2 | 702 | 963 | |

Group 3 | 664 | 957 | |

Group 4 | 594 | 905 | |

Group 5 | 657 | 657 | |

Group 6 | 606 | 895 | |

Group 7 | 607 | 919 | |

Group 8 | 646 | 1040 | |

Group 9 | 711 | 1000 | |

Group 10 | 694 | 1090 | |

Max time [ms] | 854 | 1090 |

Separated | Unified | Parallel | |
---|---|---|---|

daily cost | EUR 129.128 | EUR 75.339 | EUR 81.025 |

execution time | 123 ms | 16,034 ms | 1687 ms |

**Table 7.**Case B. Energy cost incurred by the single groups and the community, after the first and second stage.

Stage | First | Second | |
---|---|---|---|

Partial cost [EUR] paid by | Group 1 | 12.646 | 6.019 |

Group 2 | 12.138 | 5.836 | |

Group 3 | 1.652 | 1.652 | |

Group 4 | 3.057 | 3.057 | |

Group 5 | 6.699 | 5.942 | |

Group 6 | 9.142 | 9.048 | |

Group 7 | 6.028 | 6.028 | |

Group 8 | 6.718 | 6.718 | |

Group 9 | 2.495 | 2.495 | |

Group 10 | 5.403 | 5.403 | |

Community cost [EUR] | 65.979 | 52.198 |

Separated | Unified | Parallel |
---|---|---|

112.230 € | 45.504 € | 52.198 € |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Scarcello, L.; Giordano, A.; Mastroianni, C.
Edge Computing Parallel Approach for Efficient Energy Sharing in a Prosumer Community. *Energies* **2022**, *15*, 4543.
https://doi.org/10.3390/en15134543

**AMA Style**

Scarcello L, Giordano A, Mastroianni C.
Edge Computing Parallel Approach for Efficient Energy Sharing in a Prosumer Community. *Energies*. 2022; 15(13):4543.
https://doi.org/10.3390/en15134543

**Chicago/Turabian Style**

Scarcello, Luigi, Andrea Giordano, and Carlo Mastroianni.
2022. "Edge Computing Parallel Approach for Efficient Energy Sharing in a Prosumer Community" *Energies* 15, no. 13: 4543.
https://doi.org/10.3390/en15134543