Digital Twin Concept, Method and Technical Framework for Smart Meters

: Smart meters connect smart grid electricity suppliers and users. Smart meters have become a research hotspot as smart grid applications like demand response, power theft prevention, power quality monitoring, peak valley time of use prices, and peer-to-peer (P2P) energy trading have grown. But, as the carriers of these functions, smart meters have technical problems such as limited computing resources, difficulty in upgrading, and high costs, which to some extent restrict the further development of smart grid applications. To address these issues, this study offers a container-based digital twin (CDT) approach for smart meters, which not only increases the user-facing computing resources of smart meters but also simplifies and lowers the overall cost and technical complexity of meter changes. In order to further validate the effectiveness of this method in real-time applications on the smart grid user side, this article tested and analyzed the communication performance of the digital twin system in three areas: remote application services, peer-to-peer transactions, and real-time user request services. The experimental results show that the CDT method proposed in this paper meets the basic requirements of smart grid user-side applications for real-time communication. The container is deployed in the cloud, and the average time required to complete 100 P2P communications using our smart meter structure is less than 2.4 seconds, while the average time required for existing smart meter structures to complete the same number of P2P communications is 208 seconds. Finally, applications, the future development direction of the digital twin method, and technology architecture are projected.


Introduction
The energy sources of clean energy, such as wind energy, hydro energy, and solar energy, are different from thermal power generation (Niaz et al., 2023). Local natural factors have a significant impact on a significant amount of clean energy generation, making it challenging to maintain stable power generation. This can cause one peak and one valley in the power grid, posing a huge challenge to the stable power supply of centralized power supply systems. The widespread use of distributed clean energy sources such as wind, hydro, and solar energy will inevitably make it difficult to maintain centralized power systems and cope with future development (Kader et al., 2022). Therefore, distributed power supply systems will gradually become a new choice to improve power supply efficiency and reliability.
On this basis, it describes the potential shortage of computing resources, difficulties in subsequent upgrades, and high costs faced by smart meters on the user side. The difference between smart grids and traditional power grids lies in the direction of information flow, which means that the one-way flow of information from the grid to power users has become a twoway flow between the grid and power users (Sarwar et al., 2016). In addition to requiring power users to promptly comply with various commands issued by the grid, the smart grid also needs to adjust the power supply in accordance with the data reported by power users. The current smart grid has not yet achieved sufficient development, and there are still many changes in the future (Mollah et al., 2020). In addition to the basic ladder billing function, time division billing function, and overdue power-off function on the smart meter, we also need to realize more advanced functions such as load identification, electricity theft prevention, power supply network topology, privacy protection, demand response, P2P energy trading, etc. in the future. The information exchange between the power grid and users requires the participation of smart meters. Sun et al. (2019) proposes a smart meter structure of four MCUs in line with the IR46 standard, namely a metering MCU, a management MCU, an identification MCU, and a load control MCU. In the dissertation, they defined the role of each part and tested the performance of the multi-MCU smart meter in an experimental environment. As shown in Figure 1, smart meters in the smart grid are used to connect the smart grid and power users. Smart meters play an important role in the smart grid. At present, the smart meters in our country mainly adopt the structure of "Microcontroller Unit (MCU) + Special Metering Chip." This structure can meet the basic functions of smart meters, but its scalability is poor. If you want to upgrade new functions, you can only replace them and not upgrade the existing structure.
With the continuous improvement of social requirements for the stability and functionality of the smart grid, smart meters, as the key component of the smart grid and the means of user communication, also need to undertake more and more functions (Chen et al., 2023). The existing smart meter structure no longer meets the smart grid's future development needs, and a new structure is required to meet the smart grid's future development needs.
The smart meters used now may no longer meet the demands of future changes and need to be updated constantly. As a part of the infrastructure, the meters have relatively weak computing power, and large-scale replacement will bring huge economic losses and labor costs, which are doomed to the inability of rapid iteration. This has led to many very valuable applications of smart meters that cannot be put into practice in a timely manner, limiting the rapid development of smart grids (Lang et al., 2021). Therefore, we need a smart meter structure that is easy to upgrade and costs little to upgrade. Xiangqi et al. (2019) proposed a software design scheme based on a single chip, which can separate the metering module from other modules on the basis of a MCU, thus realizing the functional division of a single RFID semi active technology. Lizhou et al. (2018) made a smart meter with a dual MCU that meets the IR46 standard. They separated the metering and management chips so they could work on their own, and they focused on how to upgrade the software in this kind of structure. With the promotion of the IR46 standard, the complexity of smart meter software and hardware increases, and the methods of evaluating the quality of meters become more complex. Peng et al. (2019) proposed a "closed-loop feedback correction" model that can strictly control the key elements and risk points in the development process of smart meters so as to improve the efficiency and quality of the development. In order to test smart meters with higher complexity, Zhang et al. (2019) has designed different software and hardware test systems to test whether the software and hardware design of smart meters conform to IR46 standard. In order to solve the problem that smart meters are expensive and difficult to upgrade, this paper proposes a CDT method for smart meters. The main innovations of this study are as: • This structure uses the container to map the state of physical meters so that they form a digital twin state.

•
By using container technology, a dedicated proxy container is created for each physical meter on the cloud or edge system, transferring application-oriented communication and service models from the physical meter to the corresponding container. The physical meter only embeds three core functions: basic energy metering, one-on-one communication with the container, and timecritical functionality.

•
We advanced smart meters by upgrading the corresponding proxy container, minimize the promotion requirements of users, and improve the computing power of smart meters.
The remaining parts of this research are divided as follows: First, this paper studies the concept of DT. Secondly, we propose a container-based DT method. Third, in order to further validate the effectiveness of this method in real-time applications on the smart grid user side, this article tested and analyzed the experimental results. Fourth, we discussed the application of smart meters. Finally, the container-based DT technology findings are predicted.

Digital Twin Concept
The concept of DTs was put forward very early, but at that time, due to a lack of technology and cognition, it was not taken seriously. In recent years, with the rise of the Internet of Things (IoT) and cloud computing, DTs have gradually become a hot topic of research. The core idea of the DT is to create an image of the physical devices in the physical space in the virtual space and make the objects in the two spaces closely connected through the network connection, as shown in Figure 2. Representation and relevance: virtual images should be as similar to physical entities as possible. However, in some application scenarios, some attributes of physical entities are irrelevant, which should be fully considered when creating mapping models.
Mapp ability: all meaningful attributes and events should be mapped into the virtual image.
Reproducibility: every virtualized physical entity should be able to be replicated in the virtual space.
Entanglement: each DT is closely connected through the network. Changes in physical entities should be synchronized with the virtual image in a timely manner.
Persistence: virtual images and physical entities should have the ability to maintain synchronization for a long time. Even if the connection between them is interrupted, the virtual image should be able to synchronize the state of the physical entity after the connection is restored.
Memory: during the operation cycle of physical entities, a large amount of data will be generated. Virtual images should have storage capacity and store as much data as possible. 109 Combinability: in order to apply DT to large projects, DT should have an effective method for integration and combination.
Manageability: DT must be accurate and have good management skills. It can keep the virtual image's response to the query operation even if the physical entity loses connection, and it can use some methods to limit the impact and damage from the outside on the physical entity.
Scalability: because there are limitations in upgrading physical entities, virtual images should be able to be updated and improved.
Ownership: the ownership of DT is reflected in two parts: the ownership of the data generated by DT and the ownership of the virtual image. First of all, DT generates a large amount of data.
It is important to determine the ownership and use rights of these data. Secondly, because of the replicability of virtual images, there can be many virtual images at the same time, but the ownership of these virtual images may be different. For example, there may be many copies of a photo, but they are only references to the original photo and may belong to different owners.
Service: through the control and function extension of physical entities provided by DT, a large number of new services and functions can be created across the entire DT. In this case, DT has become a means to provide a high level of service for physical entities, which can ensure the availability and effectiveness of DT in use.
Predictability: because the virtual image in DT has all the data of the physical entity and runs in a specific environment, it has the possibility to simulate the behavior of the physical entity for a certain period of time.
The birth and development of DTs provide sufficient development space for the IoT. All devices in the physical world are mapped to the virtual world through DTs, and data is fully mined and utilized by using big data and artificial intelligence to maximize data utilization and realize the ultimate goal of interconnection of all things. Through the analysis and calculation of the mirror data in the virtual space, people can control and predict the actions of the physical devices in the physical space. The attributes of physical entities will be mapped from physical space to virtual space through some mapping relationship, as shown in Figure 3.
Physical Space Virtual Space x 1 x 2 x 3 x 1 x 2 x 3

Digital Twin Method for Smart Meters
This part introduces the DT architecture of smart meters. Figure 4 shows the proposed DT architecture for smart meters. As can be seen from the figure, smart meters play a connecting role between the smart grid and power users, and users' demands interact with the smart grid through smart meters.
The biggest difference between the smart meter structure proposed by us and the existing smart meter structure is that the DT technology is used to arrange a special holder for each physical meter. In external communication, the container corresponding to each physical electricity meter can represent the physical electricity meter to a large extent. In this way, a DT state is formed between the physical electricity meter and the container. Containers can be deployed in the cloud or on edge systems. This lightweight application virtualization technology has been successfully applied in the cloud-computing field (Pahl et al., 2017).

Figure 4. Architecture of Digital Twin Method for Smart Meters
In our proposed smart meter structure, each container only corresponds to one physical meter, such as A' in Figure 4, which can only represent A, and B', which can only represent B, and the data in the container and the container are isolated from each other and cannot be accessed to ensure the security of user data. We guarantee communication between adjacent meters through the virtual network between containers. By means of one-to-one correspondence between containers and physical meters, we can put many smart meter applications into containers corresponding to physical meters instead of physical meters. Therefore, when the application program changes, you only need to upgrade the container, not the physical meter. Obviously, upgrading a container is much easier than upgrading a physical meter.

Results and Discussion
In order to verify the effectiveness of the smart meter structure proposed by us, we designed experimental scenarios for possible scenarios in actual use. Figure 5 shows the communication delay between the smart meter and the application server in our proposed smart meter structure. The x-axis is the communication delay time from the physical meter to the application server, and the y-axis is the probability that the delay time occurs during the experimental test.
(a) Cloud deployment (b) Edge system deployment

Figure 5. End to End Communication Delay Possibility Between Smart Meter and Application Server
In Figure 5 (a), shows that the container is deployed in the cloud, and the communication module between the container and the physical electricity meter is the narrow band (NB) IoT module. Figure 5 (b), shows that the container is deployed in the edge system, and the communication module between the container and the physical electricity meter is a Wi-Fi module. It is clear that even though the smart meter structure that we have proposed includes an additional layer of container as the transit between the physical meter and the application server, the existing smart meter structure is very similar to the smart meter structure that we have proposed in terms of communication delay, and the delay that is introduced by adding containers is very small and can be ignored. This can be seen by the fact that the existing smart meter structure is very close to the smart meter structure that we have proposed. According to the requirements for communication delay of smart meter application proposed in (Li et al., 2017), we extract some of the data and summarize them in Table 1.
According to the data presented in Table 1, the structure of the smart meter that we have suggested is capable of satisfying the communication needs of smart meter applications. Figure 6 shows the time required for P2P communication using our proposed smart meter structure and the existing smart meter structure. The x-axis is the number of P2P communication iterations, and the y-axis is the time required to complete P2P communication iterations. Wherein, Figure 6 (a) indicates that the container is deployed in the cloud, and the communication module between the container and the physical electricity meter is an NB IoT module; Figure 6 (b) indicates that the container is deployed in the edge system, and the communication module between the container and the physical electricity meter is a Wi-Fi module.
(a) Cloudy summer (b) Edge system deployment

Figure 6. P2P Communication Delay Time
For the scenario where the container is deployed in the cloud, the average time required to complete 100 P2P communications using our smart meter structure is less than 2.4 seconds, while the average time required for existing smart meter structures to complete the same number of P2P communications is 208 seconds. The communication time t2 of the smart meter structure proposed by us is significantly less than that of the existing smart meter structure t2 ′ time required. This apparent gap comes from the introduction of containers. Because the physical electricity meter only needs to issue instructions at the beginning of P2P communication and receive results at the end of P2P communication, frequent P2P communication in the middle process is carried out by dedicated containers, and P2P communication between dedicated containers uses the cloud platform or the internal network in the edge system, so there is such a significant difference in the performance of the time required for P2P communication between the two structures.
Similarly, under the existing smart meter structure, even if the physical meters are all in the same Wi-Fi network, the time required for direct P2P communication between them is still not as fast as the smart meter structure proposed by us.

Application of Smart Meters
The development of smart meters is not limited to its own structure, and the application of smart meters is also developing rapidly.

Use of Smart Meter Data
At present, many researches on the application of smart meters focus on the data reported by smart meters, and a large amount of valuable information can be obtained by analyzing and processing the data. Yu et al. (2019) proposes to use a Bayesian network and integrated learning to detect the data reported by smart meters and judge the status of each smart meter, which can quickly find the problem meter. According to the Quilumba et al. (2014), aggregating customer groups with similar load consumption patterns improves power system stability and reduces energy management consumption. Lin et al. (2020), a dynamic data measurement method using the combination of a back propagation neural network and a smart meter is proposed, which improves the accuracy of power measurement and can play a very good role in guiding the power supply of the grid at different times. Ahmadi et al. (2015) introduces a load decomposition scheme using metering data to monitor and understand the load behavior of smart meters so as to achieve near real-time analysis. Chang et al. (2013), a non-intrusive demand monitoring and load identification scheme using intelligent metering data is proposed. A particle swarm optimization algorithm is used to improve the accuracy and efficiency of the calculation. Jin et al. (2017), the metering data reported by smart meters is used to monitor the status of residential and commercial buildings.

Distributed Energy Access
With the increasing popularity of distributed energy (usually from intermittent resources), there are more and more research studies on distributed energy. Real-time monitoring of power quality can optimize the operation of the power grid. For more and more distributed energy sources connected to the power grid, Albu et al. (2016) proposes a signal analysis framework that simplifies the evaluation method of power quality information to assist the power grid in real-time power quality monitoring. According to Miyasawa et al. (2021), local energy self-sufficiency is achieved by combining the data reported by smart meters with distributed energy, which greatly reduces the operating difficulties of wide-area power grids. Aiming at the optimization of battery energy storage capacity, a charging and discharging strategy based on cost and time of use price was proposed, and an optimization model aimed at maximizing revenue was established. Kroposki et al. (2020) investigated how to combine the smart grid and distribute energy in various scenarios in an effective and stable manner.

Supporting Stable Operation of the Smart Grid
As the terminal equipment of the smart grid, smart meters can well assist the continuous and stable operation of the grid. Chakraborty et al. (2018) used the voltage of an intelligent ammeter to measure the even harmonic quantity in the waveform and detect the high impedance fault, which overcomes the problem that the distribution system lacks reliable data near the fault point. Trindade et al. (2016) proposed to combine the voltage monitoring capability of smart meters with the impedance-based fault location method to improve the efficiency of fault location. Liu et al. (2020) proposed an error estimation method for smart meters for fault detection and achieves high detection accuracy in experiments. Luan et al. (2017) provided a method to identify adjacent meters and predict their upstream and downstream relationships by using interval measurements of smart meters to help improve the topology diagram of meters. Siddiqui et al. (2017) proposed a new strategy for using smart meters that can effectively increase the service life of smart meters and reduce energy consumption. Jokar et al. (2015) proposed an energy theft detector based on consumption patterns that can detect suspicious users through normal and malicious consumption patterns. It used intelligent instrument signals to extract features that can quickly identify interference. According to Parvez et al. (2019), a method is made for smart meters that uses support vector machines and practical wavelet filters to find power quality disturbances in real time.

Smart Meter Communication
Long-term fine-grained information collection in the smart grid network will generate a lot of information and interference, so there are many studies on smart meter communication problems. de Souza et al. (2015) has studied the communication protocol of smart meters, hoping to reduce the burden of communication infrastructure by reducing the amount of communication data. Abbasinezhad-Mood et al.
(2019) proposed a key establishment scheme that is not only unaffected by the security problems of previous anonymous schemes and key escrow but also has low computing and communication costs. He also proposed an effective anonymous password-authenticated key exchange protocol that achieves an appropriate level of efficiency without sacrificing the required security (Abbasinezhad-Mood et al., 2018).

Privacy Protection
Aggregating fine-grained measurement data from smart meters in the smart grid gives power supply companies the opportunity to understand the user's power consumption mode, which will bring serious privacy protection problems. The introduction of game theory to solved the access control problem of privacy information. Yang et al. (2014) designed a cost-effective and privacyprotecting energy management technology using rechargeable batteries for privacy protection in smart grids. Liu et al. (2015) proposed a detection method for false data injection to protect the safety of smart meters. Wang et al. (2022) proposed a semi-supervised learning method that does not require user privacy data to replace the widely used supervised learning method that requires user privacy data.

Meter Safety
More and more complex functions are integrated in smart meters, which will bring serious security problems. For the security problem of smart meters, Sun et al. (2020) developed an Advanced Metering Infrastructure (AMI) security test platform, which uses support vector machines (SVM) and time failure propagation graphs (TFPG) to identify attack events. Xiao et al. (2012) proposed a method to detect malicious meter readings in smart grids.

Blockchain
The combination of smart grids and blockchain is also a hot research topic at a time when blockchain is increasingly valued. Blockchain can be used to store and manage power data, perform authentication, and conduct distributed energy transactions (Baig et al., Hu et al., 2020).