## 5 Architecture of Edge Computing-Based IoT  
Edge computing in IoT focuses on deploying edge computing into different IoT scenarios to reduce network traffic and decision-making delay. With the goal of proposing a novel application scenario for edge computing, we present the architecture of edge computing in an IoT-based scenario. As shown in Figure 1, the architecture is divided into three layers: the IoT layer, the edge layer, and the cloud layer, which are derived from the existing edge computing reference architectures [34, 35]. The proposed architecture in this paper comprehensively considers the characteristics of IoT and edge computing. We focus on the functions that each layer should have and how layers communicate with each other in detail. 1. _IoT layer:_ the IoT layer is formed by all kinds of devices or equipment, handheld terminals, instruments and meters, smart machines, smart vehicles, robots, and other physical objects that monitor services, activities, or equipment in operation. This layer also includes sensors, actuators, controllers, and gateways for IoT environments, allowing for the management and storage of computational resources in IoT devices. These devices or equipment collect a large amount of data by all kinds of sensors using various types of wireless networks, transmit the data to the edge layer, and wait for the control instructions from the edge layer. In IoT environments, a wireless standard, such as Wi-Fi [139], Bluetooth [140], RFID [141], NB-IoT [142, 143, 144], 5G [146, 147], BLE [18], ZigBee [19, 21], LoRa [20], SigFox [139], etc., is normally applied [148]. 2. _Edge layer_: this layer is the core layer of the EC-based IoT architecture and is basically responsible for receiving, processing, and forwarding data flow from the IoT layer. The edge layer also provides time-sensitive services such as edge security and privacy protection, intelligent computing, edge data analysis, process optimization, and real-time control. This layer is located close to the edge endpoint nodes; it corrects the orchestration of the different technological assets in the organization and significantly improves the supply, monitoring, and updating of existing resources. Some of the technical support activities of this layer include: the management of critical business activities, including the management of physical resources, such as sensors, actuators, and controllers, and the study and analysis of large volumes of data in real time. In this layer, the data that are coming from the IoT layer will be filtered and preprocessed, then will be sent to the cloud layer. The sensors in IoT nodes collect the data using microcontrollers with reduced computational and storage resources. These data will be filtered and preprocessed in computing elements in the edge layer. Low-cost solutions such as microcomputers based on architectures such as Raspberry Pi [22] or Orange Pi (which are based on Raspberry Pi) can be used for these computing elements. These devices are able to process a much greater amount of information than the microcontrollers that are usually used in IoT devices, with the purpose of minimizing energy consumption and executing simple reading logic and control programs on general-purpose input and output ports (GPIO), serial ports such as universal asynchronous receiver-transmitter (UART), serial peripheral interface (SPI), or communication buses between integrated circuits (I'2C). This kind of device can come with I/O ports allowing to connect them with sensors and actuators; implementation of the edge and IoT layers within a single device is also possible. These devices are used to coordinate a network of cheaper IoT devices that work as hub elements or data collectors throughout the IoT and up to the edge. These devices sometimes must be powered by batteries and solar panels, which are placed beyond the reach of power supply networks.