Cao Min, a modern elite lawyer, died unjustly due to a well-planned act of revenge. His soul was reborn in the highly hierarchical Yong Dynasty and became "Cao Yun", a slave maid in the Ministry of Personnel. She used modern legal thinking and criminal investigation knowledge to start with the unsolved cases in the mansion, step by step to escape from slavery and become the first female criminal officer in history. In the end, she not only rectified her name in the court, but also stood side by side with Xiao Jingyan, the eldest son of the emperor who aspired to reform, and ruled the world together, becoming a legendary queen of a generation.