## 4 Architecture
### Centralized IoT System with Prevalent Processing in the Cloud  
The first architecture deals with scanning real objects and their real-time reconstruction in virtual environments through sensors. The various components are presented in the component diagram in Figure 1.  
The architecture is divided into two main macro areas. The **Edge** part, in this case, consists only of the various **Client** components that represent a new _\"user\"_ and is responsible for connecting to the cloud server to access the scene shared with other users. It also sends and receives data relating to the object previously recognized by the sensors. The goal is to have one-to-one movement between what the sensor detects and what the cloud reconstructs. The **Cloud** part, on the other hand, is divided into four main components, which are as follows:  
* **Cloud Server**: The cloud server acts as a central point for managing multiplayer connections and processing the tracking data of the object to be recognized. It receives data from clients and routes them for scene processing and synchronization. It uses scalable and reliable cloud resources to ensure a stable connection and rapid data processing.
* **Object Collider**: This is the component responsible for detecting the movements of the user's object using the sensor. It captures the data relating to the position and orientation, and then transmits them to the client for 3D processing and sending to the central server. This saving of the individual positions also allows events to be triggered when there is a collision between reconstructed objects and between a single reconstructed object and a single scene object.
* **Object Creation**: The processing component receives the object tracking data from the server and processes them by creating the associated 3D model the clients need, subsequently routing them via the server to the client.
* **Reconstruction of Data**: to create the object, it is necessary first to reconstruct the object starting from the data that construct the sensors. A rule-based approach or machine and deep learning algorithms [18] can achieve this in many ways.  
The sequence diagram in Figure 2 describes the interaction between these components and their workflow. The client component uses a sensor to capture external data sent to the cloud in real time. The server uses the _Object Creation_ and _Reconstruction of Data_ components to reconstruct the 3D object. In more detail, the Reconstruction of Data component reconstructs the object of interest from the data, and the Object Creation component maps it in 3D. For example, assuming you want to recognize a person's movements, the first component will identify the object in the data stream and map its movements, and the other will reconstruct the avatar based on the real person's movements. Furthermore, particular attention must be paid to the _ApplyOffsetToObjectClient_ method (Figure 3).  
Depending on the number of clients connecting, this method allows a starting offset to be assigned to the individual client reconstruction in the virtual world. The process is dynamic and recalculated each time a new user connects. This algorithm aims to ensure that the generation of 3D objects in VR is associated with a different client and never overlaps. So, the first defined architecture provides a robust and scalable infrastructure through centralized data management. In addition, maintenance and upgrades are facilitated. However, depending entirely on the cloud can cause bandwidth limitations and slow performance when managing large data sets or numerous connected devices.  
Figure 1: This figure shows a component diagram of the first reference architecture in which the entire computation is shifted to the cloud.