Digital Twin and Blockchain Extension in Smart Buildings Platform as Cyber-Physical Systems

.


I. INTRODUCTION
Smart buildings equipped with Internet of Things (IoT) platforms have revolutionized the way we interact with our built environment.These cutting-edge structures offer a plethora of benefits, such as increased energy efficiency, optimized resource management, and enhanced occupant comfort [1]- [3].However, the remarkable advancements, it blockchain is essential to acknowledge that smart buildings are not without their demerits [4].This introduction explores the drawbacks and challenges associated with several researcher in IoTbased smart buildings, shedding light on areas that require careful consideration and mitigation strategies in digital twin [5]- [8].Understanding these demerits is crucial for stakeholders, architects, and policymakers as they navigate the landscape of intelligent infrastructure and strive to strike a balance between innovation and addressing potential drawbacks.
The integration of Digital Twin and blockchain technologies within an IoT platform offers an innovative and comprehensive solution for smart buildings, ensuring seamless integration of a 3D system and robust data security through blockchain [9].Digital Twin's virtual representation of the physical building, complete with real-time monitoring and predictive capabilities, empowers building managers to optimize operations, energy efficiency, and maintenance tasks [10].By complementing it with blockchain, the entire smart building ecosystem becomes fortified with unparalleled data security.Blockchain's decentralized and tamperresistant nature safeguards sensitive information, preventing unauthorized access or data manipulation [11].Additionally, the implementation of smart contracts streamlines processes and enhances data transparency among stakeholders.This integration creates a cuttingedge framework that not only enhances the performance and sustainability of smart buildings but also fosters trust and collaboration within the smart city infrastructure.As smart buildings continue to shape the future of urban living, the combination of Digital Twin and blockchain within the IoT platform sets new standards for datadriven, secure, and efficient building management.
Research and studies have been conducted on [12]- [15] to combine blockchain technology as the security of IoT data within IoT platforms.The integration of blockchain technology offers an innovative solution to establish a secure and transparent system across multiple use cases [16].Blockchain can be utilized to safeguard and manage precious IoT data related to buildings, ensuring their authenticity and integrity [17], [18].Moreover, blockchain can facilitate a seamless and transparent transfer of data without administrator acceptance [19].Blockchain not only enhances efficiency but also provides trusted and auditable data.Blockchain is built using smart contracts that are deployed in it [20].Smart contract codes can be programmed for anything.
However, what makes it different from other computer programs is that smart contracts are stored on the blockchain [21].This makes all interactions with it irreversible.Smart contracts can define rules and automatically apply them via code.This means a thirdparty role to ensure the execution of transactions or activities is no longer necessary [22]- [24].
This study aims to implement a digital twin extension integrated with blockchain technology within an IoT platform, specifically for smart buildings.The digital twin extension will create a virtual replica of the physical smart building, encompassing its 3D system visualization and real-time monitoring capabilities.This virtual representation will enable building managers and stakeholders to gain comprehensive insights into the building's operations and performance.The integration of blockchain technology will be as data security within the smart building ecosystem.By employing blockchain's decentralized and tamper-resistant nature, the study aims to ensure the integrity and immutability of data collected from various sensors and devices within the building.This will prevent unauthorized access, manipulation, or alteration of sensitive data, enhancing the overall security of the smart building infrastructure.[4]The uniqueness from other research is the 3D interaction capabilities within the IoT platform.This unique feature provides an immersive and interactive experience for users, allowing users to visualize and interact with the digital twin in a 3D space and securely recorded on the blockchain.Section II explains the conceptual design and method that describes the system used.Section III explains the implementation of the system and the experimental result.The conclusion of this research will describe in section IV.

II. METHOD
In this section, we will outline our initial research design system for the digital twin platform integrated with blockchain technology shown in Fig. 1.
There are 3 important components for our proposed system related to digital twin assets, digital twin extension, and blockchain that will be described below:

A. Digital Twin Asset
Digital twin assets require several components needed to create a 3d design from its original form.In the entire process, 4 main steps are building access permission to implement the system, information IoT device, detail assets information and 3D design representation with implementing information on real electrical assets such as lights, water heaters, and electrical equipment that can cause damage such as fires to buildings.

B. Smart Buildings Platform
A smart buildings platform is an integrated system that leverages Internet of Things (IoT) technologies to optimize building operations and other integration [25]- [30].Below are the main components typically found in an IoT platform designed for smart buildings: 1) Cloud Gateway: A cloud gateway as a bridge between the devices in the building and the cloud-based services or applications.It serves as an intermediary that facilitates communication and data exchange between local IoT devices and remote cloud servers.In our system we use tuya's platform which is enables manufacturers and developers to connect their IoT devices to the cloud for data management, device control, and application development.
2) Core and Message Distribution: Iot platform core allows users to track, control, and automate various devices and services within their smart home.Home Assistant Core can run on different operating systems, such as Windows, macOS, and Linux.Home Assistant Core uses a message distribution system known as the "event bus" to facilitate communication and coordination among various entities within the platform.
3) Database: IoT platform core uses a default database called SQLite for storing its data.SQLite is a lightweight, serverless, and self-contained SQL database engine that is embedded directly into the Home Assistant Core application.

4) Frontend:
User interface (UI) in Home Assistant programming languages are HTML, CSS, and JavaScript.These three languages work together to create a dynamic and interactive front-end experience for users when managing and controlling their smart home devices and services through the Home Assistant platform.To create 3D graphics and visualizations, we use three.jsthat commonly used for creating 3D graphics and visualizations in web applications.

5) Energy Montoring:
Implementing energy monitoring in an IoT platform involves collecting and analyzing data from various energy-related devices and sensors to gain insights into energy consumption, optimize usage, and identify potential inefficiencies.
Here are the key steps to set up energy monitoring in an IoT platform.The result that already collect from energy monitoring will be used for automation system for efficient electricity.

6) Digital Twin Extension:
A digital twin extension in an IoT platform will provide valuable enhancements and capabilities to the platform, enabling more sophisticated and advanced functionalities.A digital twin extension serves as a virtual representation or mirror of physical assets, devices, or systems in the real world.The digital twin extension allows users to monitor and visualize the status and behavior of physical assets in real-time.It provides a virtual dashboard that displays live data from connected devices, making it easier to monitor and manage assets remotely.

7) Automation:
Automation in an IoT platform can be utilized to optimize electricity consumption, enhance device shutdown during failures, and integrate scenarios for efficient energy management and system response.Automation rules can be set up to optimize electricity consumption based on various factors, such as time of day, occupancy, or energy pricing.For example, during peak energy demand hours or when electricity costs are high, the IoT platform can automatically adjust the settings of energy-intensive devices or reduce their usage to lower energy consumption.Automation can play a critical role in responding to electricity failures or outages.When a power failure is detected, the IoT platform can trigger automated actions to gracefully shut down non-essential devices to conserve battery power or prevent damage upon power restoration.Automation can be used for simulations and "what-if" scenarios.Users can test different conditions or configurations virtually before implementing changes in the real world, helping to optimize performance and avoid costly mistakes.

C. Blockchain
A smart buildings platform is an integrated system that leverages Internet of Things (IoT) technologies to optimize building operations.Below are the main components typically found in an IoT platform designed for smart buildings: 1) Blockchain Extension: Data filter by entity is a method used to selectively process and store data on the Blockchain based on the entities or objects involved.In the context of an IoT system using blockchain technology, data filtering by entity refers to filtering and storing specific data generated by individual IoT devices or sensors on the blockchain.
2) Kafka Consumer and Smart Contract: Kafka consumers and smart contracts serve as essential components, each playing a distinct role in their respective domains.Kafka, a powerful distributed event streaming platform, facilitates real-time data pipelines and streaming applications.A Kafka consumer, as part of this ecosystem, reads data from Kafka topics, enabling the ingestion of data from various sources such as IoT devices and sensors.Smart contracts inherent to blockchain platforms like Ethereum that function as selfexecuting contracts with encoded business logic.When certain conditions are met, smart contracts automatically execute predefined actions without the need for intermediaries.While Kafka consumers drive real-time data streaming and analysis, smart contracts revolutionize trust and automation in blockchain ecosystems, making both components vital contributors to modern applications and systems.
3) Node Validator: The integration of blockchain technology is seamlessly achieved through the utilization for iot platform will use Hyperledger Besu.Hyperledger Besu in the IoT platform for smart buildings established to manage and optimize various building systems and devices.Through blockchain's distributed ledger and immutability features, data from sensors, energy management systems, and other IoT devices within the smart building environment can be reliably recorded and securely stored.In this research, blockchain has been utilized by using Hyperledger Besu as blockchain Ethereum based network framework.In this system, we would like to record all of Digital Twins activity by using WebSocket API, the data would be recorded automatically and filtered based on their entity.

III. RESULT AND DISCUSSION
This section presents environment specification, experimental text, result of the implementation, and performance of the digital twin platform with blockchain integration.The experimental environtment spesification are presented in Table I, Table II, and Table III.Table I presents the specifications of a virtual machine designed specifically for an Internet of Things (IoT) platform.This virtual machine is configured to support IoT applications efficiently.Table II provides specifications for the IoT devices that are implemented within the IT platform, with data from these devices being recorded on the blockchain.These IT devices serve as integral components of the IoT platform, facilitating data collection related to various aspects, such as environmental conditions, energy consumption, and security.The recorded data is stored securely on the blockchain, ensuring its integrity and immutability while enabling transparent access and verification.Table III provides specifications for the blockchain server nodes, which collectively form the infrastructure for storing and managing data within the blockchain network.These server nodes collectively form the backbone of the blockchain infrastructure, ensuring the secure storage and management of data.

A. Digital Twin Integration in IoT Platform
This experiment was to determine the successful integration and functionality of an IoT (Internet of Things) system with 3D design capabilities within an IoT platform for digital twins.The experiment was conducted using a laptop as the accessing device to control various smart devices through the 3D design interface.The results of the experiment revealed that the integration of the 3D system and IoT was successful.The system performed well as expected by 3D design can be load in the IoT platform as shown in Fig. 2. The implementation result of the system is displayed in.The result of the system is shown in Fig. 3. Fig 3 .is the 3D digital twin dashboard that has already been implemented in smart buildings iot platform that visualize of the building's physical structure and its real-time IoT data.The integration of 3D technology with IoT systems will be new generation of IoT platforms with wide range of possibilities use case.

B. Digital Twin Extension Performance Result
In this section, we will present the digital twin performance results obtained from testing the digital twin in IoT platform using several models based on the number of floors in the buildings.The result of digital twin performance can be seen in Table IV.

Fig. 4 Average load test duration for digital twin extension
The data on average test times for the digital twin platform implemented in smart buildings in Fig. 4 ranging from 1 floor to 11 floors.The results reveal a gradual increase in average test times as the buildings' size and complexity grow, with the following values: 5.663 seconds for 1 floor, 5.698 seconds for 2 floors, 6.317 seconds for 3 floors, 6.333 seconds for 4 floors, 6.558 seconds for 5 floors, 6.625 seconds for 6 floors, 6.667 seconds for 7 floors, 6.807 seconds for 8 floors, 6.974 seconds for 9 floors, 7.196 seconds for 10 floors, 7.294 seconds for 11 floors and 7.521 for 12 floor buildings.The range of average processing times, from 5.663 seconds to 7.521 seconds with the average time load each floor is 0.227s, Despite the observed trend, the system's performance demonstrates its proficient handling of digital twin simulations across buildings of diverse sizes.The data exhibits a gradual increase in average test durations corresponding to the growing size and complexity of smart buildings, as quantified by the number of floors.

C. Blockchain Performance Result
The test results for the blockchain can be indicate a successful implementation if the data can be encryption.Through the encryption process, the original data is transformed into a scrambled and unreadable form, significantly impeding unauthorized individuals from interpreting or deciphering the information without the appropriate decryption key.The encrypted blockchain data test that can be observed in Table 5. that the result using Hyperledger Besu provides valuable insights into the system's performance with several bandwidth that used in the system.In our speed test, we have set three different bandwidth levels of 6 Mbps, 4 Mbps, and 0.5 Mbps.However, the actual speed test results are 5.39 Mbps, 3.49 Mbps, and 0.49 Mbps.The data collected from the blockchain test using Hyperledger Besu offers valuable insights into the system's performance across different bandwidths.The average processing time for each test trial ranged from 1.066 seconds to 2.006 seconds, showing slight variations based on the bandwidth used.The range of average processing times, from 1.066 seconds to 2.006 seconds, indicates how quickly the blockchain system processes transactions.Despite slight variations based on bandwidth, these processing times are relatively fast.This supports the research objective of assessing the system's performance, demonstrating its ability to handle transactions efficiently under different network conditions.However, the transactions per second (TPS) values were relatively fast, ranging from 1.066 tps to 0.499 tps with positive aspect of the test was that the retention rate for all trials was 100%, indicating that the blockchain system effectively stored and maintained all data and transactions without any losses.TPS values ranging from 1.066 tps to 0.499 tps provide insights into the throughput capacity of the blockchain system.These values represent the number of transactions processed per second.While the variation in TPS is noticeable, all recorded values reflect a system that is capable of processing transactions at a reasonable rate.This aligns with the research objective of evaluating the system's efficiency.

IV. CONCLUSION
The integration of Digital Twin and Blockchain Extension in Smart Buildings Platform as Cyber-Physical Systems has successfully integrated in our IoT system.It can be a transformative paradigm in the realm of building management and operations.The implementation of Digital Twin extensions in smart buildings, as evidenced by our results, reveals an incremental trend in average test times correlated with the growing size and complexity of buildings.These findings showcase the adaptability of Digital Twin technology, which offers immersive 3D visualizations of buildings.This capability empowers data-driven decision-making and facilitates remote management, thereby enhancing the overall operational efficiency of smart buildings.this research underscores the effectiveness of both Digital Twin technology and blockchain extension in revolutionizing smart building management.Digital Twins empower data-driven decision-making and remote management by using interactive 3D models that will be the future of current IoT system that has static implementation, while blockchain ensures the integrity and security of stored data and transactions.Together, they create a robust foundation for the future of smart buildings in internet of things.This research offering enhanced efficiency, security, and connectivity.These research objectives also highlight the immense potential of this integrated approach in shaping the future of building management, Internet of Things, and Cyber-Physical Systems.commitment to promoting scientific research and innovation has been instrumental in enabling us to successfully conduct this study and achieve our research objectives.We sincerely appreciate their continued dedication to advancing research endeavors in our country.Our research project was conducted under contract number 4856.06/PL14/PG/2023.