This paper designs a system architecture that combines 5G power virtual private network and digital twins, and considers the construction method of synchronization during the digital twins of terminals. We propose a hierarchical multi-agent reinforcement learning algorithm to determine the allocation of resources to power user terminals and the placement of digital twins. The upper layer achieves the allocation of sliced communication resources through deep Q network, and the lower level achieves the placement of digital twins in power user terminals through multi-agent deep reinforcement learning. The experimental results show that the proposed hierarchical multi-agent algorithm can achieve the better system benefits when the synchronization strength of the digital twin of the power user terminal is reached.