In the 21st century, doctor Xia Zhiting died suddenly and traveled to the Yi Dynasty. She became a refugee and was controlled by the second prince Lingdu with poison. He married the Eastern Palace and became the undercover princess. Little did she know that Prince Ling Ji was the person she had raised in a different time and space. Ling Ji even signed a contract with the system to save her. After Xia Zhiting regained her memory, she helped Ling Ji fight against Ling Du, Zheng Guifei and other forces, exposed the palace secrets, and also attracted talents such as Yu Jiuge. The two worked together to deal with the crisis, and eventually Ling Ji ascended the throne and Xia Zhiting became the queen, jointly promoting the development of Dayi and continuing to write the legend.