• Proposing an efficient on-line EMS considering uncertainties of weather conditions, load demand and electricity price during real time. • Introducing an efficient day-ahead scheduling of interconnected nano-grids using an improved version of Aquila Optimization (IAO) algorithm. • Presenting demand side management to enhance the efficiency of the proposed EMS. • Exploiting the cooperation between the nano-grids for economic operation. Integrating distributed energy resources (DERs) utilizing renewable energy sources enhances the performance and efficiency of the power system. Nano-grid (NG) comprises a small scale DERs at a small building. This paper presents an efficient bi-level energy management system (EMS), day-ahead and real time scheduling, for economic operation of grid tied multi-interconnected NGs. Balancing between generation and consumption is secured through exchanging power with the utility grid so the daily energy consumption cost could be optimized. The proposed day-ahead scheduling is applied through two stages. The first is demand side management (DSM) while the second is determining the optimal set-points of different sources in NGs. The optimal set-points obtained from day-ahead scheduling are rescheduled and updated during real time to keep the economic operation under uncertainties of weather conditions, grid tariff and load demand. Advanced meta-heuristic techniques can handle with energy scheduling optimization problem, complex non-linear optimization problem, efficiently considering the different operation constraints. Comparative performance study of the original Aquila optimizer (AO), improved aquila optimizer (IAO), and particle swarm optimization technique (PSO) is investigated in this paper. Results obtained demonstrate that the interconnection between NGs with an IAO based bi-level EMS provides the optimal economic operation.