**4. Conclusions**

This paper presented a novel conceptual architecture for the development of the next-generation electricity markets. The architecture helps unlock all the hidden potential of flexible and distributed energy resources, taking into special consideration the potential benefits for active consumers. The novel architecture was proposed based on the analysis of the shortcomings of the existing models that can be found in the literature. This model provides a path that policy-makers can follow to eliminate barriers to integrate DER in a competitive way at the distribution level.

In this new paradigm with a massive integration of renewables, the need for electricity storage and for enhancing the value of demand response resources forces agents' services and transactions to appear. The proposed new architecture focuses on agents who enable flexible resources to be exploited such as storage, virtual power plants, and aggregators. These agents are already operating in some systems and emerging in others. However, the model includes the transactions among them based on an ontological analysis. Furthermore, the transactions among the presented agents are separated in energy, operating services, and economic transactions, which were clearly analyzed and described regarding the o ffered services, taking into account the technical restrictions. This results in a clear proposal of how the future electricity markets could be implemented.

This architecture also presents and characterizes the flexible resources available in the next-generation electricity markets, paving the way for its transactions. This flexibility can be available for two functions: to provide operation services, and the fast and dynamic balancing of electricity consumption and generation at di fferent network levels. Three types of flexibility were shown in the proposed conceptual architecture. Similar to traditional generators, intermittent renewables with batteries are also able to provide flexibility. Consumers with self-generation and batteries can also become a flexible resource for the systems. This also helps them optimize their electricity cost by unlocking resources and allowing them to use their flexibility with an economic purpose. Finally, electric vehicles will also become a major source of flexibility in the system. Even though they are a concrete application, the massive electrification of transport gives as an opportunity to provide flexibility to the system. EVs can be described as consumers with self-generation and batteries if vehicle-to-grid chargers are implemented, or just as flexible consumers if only grid-to-vehicle chargers are installed.

Another novel element is the inclusion of local electricity markets in the conceptual architecture. Currently, these markets are gaining importance and interest due to their capability of reacting to the novel scenario of larger intermittency and decentralized generation at the distribution level. However, their relationships with other agents of the system were not previously studied from an ontological perspective. These relationships were carefully studied and stated. LEMs represent a valuable tool to exchange energy locally in a more dynamic and cost-e fficient way for the power system (grid loss reduction). Furthermore, they also present an opportunity for decentralization and enhancement of competition in real time. It is important to highlight the need to have a fast and reliable communication channel between the local market operator and the DSO. The latter provides the technical restrictions that determine under what limits energy can be traded in these LEMs.

Finally, future work should assess the implementation of a case study with the proposed architecture to assess how the model enhances a more competitive electricity market and how agents are integrated in existing systems. It is also necessary to develop a clear cost–benefit analysis of the implemented model to gain knowledge of it. Moreover, simulations of the market behavior under di fferent time domains also remain as a future objective.

**Author Contributions:** Conceptualization, J.R.-G., D.R.-P., E.-P.L., and C. Á.-B.; data curation, J.-M.C.; formal analysis, J.R.-G. and D.R.-P.; investigation, J.R.-G. and D.R.-P.; methodology, J.R.-G., D.R.-P., and E.-P.L.; supervision, J.R.-G. and C. Á.-B.; validation, J.R.-G., D.R.-P., E.-P.L., and C. Á.-B.; writing—original draft and editing, J.R.-G. and D.R.-P.; writing—review, J.R.-G., D.R.-P., E.-P.L., and C. Á.-B.

**Funding:** This work was supported by the Ministerio de Economía, Industria, y Competitividad (Spanish Government) under research project ENE-2016-78509-C3-1-P, and EU FEDER funds. The authors received funds

from these grants for covering the costs to publish in open access. This work was also supported by the Spanish Ministry of Education under the scholarship FPU16/00962.

**Conflicts of Interest:** The authors declare no conflicts of interest.
