Shen Yun-ying, born in 1628, near the end of the Ming Dynasty, was the daughter of the commander of the garrison at Taochow. Her father saw to her education, teaching her both literature and the martial arts, though at the time, society's attitude toward women was "Lacking skill is a woman's greatest virtue." Yet Shen Yun-ying developed great skill in calligraphy, historical studies, combat exercises, horseback riding, and archery; she was unlike an ordinary woman, almost like a young man.
At the end of the Ming Dynasty the imperial government was corrupt and the people's life hard. Bandits were everywhere.
When a group of bandits led by Chang Hsien-chung came south to attack Taochow, Shen Chih-hsu, Yun-ying's father, led a counterattack. However, the townspeople were very frightened and fled during the battle, and Shen himself was killed.
Shen Yun-ying did not want her father to die in vain. She rallied the townspeople and said, "We all know of the viciousness of Chang Hsien-chung. Today the bandits are outside the city; if we don't boldly defend it, but are afraid, our property will be destroyed, and we ourselves will be like fish caught in a net. If we unite, perhaps there is a chance. How can we not unite and fight the bandits to the end?" The people took heart; they united and faced the brigands, defeating them and giving Taochow peace.
After the victory over the rebels, Shen Chih-hsu's body was recovered. The people in gratitude helped Yun-ying conduct her father's funeral. The emperor also rewarded her by making her a special forces general, and by letting her assume her father's position as Taochow garrison commander.