The 2011 French Open champion would have been heavily fancied to triumph against an opponent who was defeated in her final qualifying match on Saturday.
However, teenager Keys was in inspired form against the Chinese as she claimed her first win against a top-10 ranked opponent.
"I didn't think I'd be in, so I just sat around and waited all day, then 10 minutes before the match I got a text message telling me I was going on and to get ready," Keys said on the WTA Tour website.
"I was on the couch doing homework when I got the text message. It was algebra. It helped I had no idea I was going to play, so I didn't overthink it. Then I was so excited and then the adrenaline came and I went out.
"I just kind of started playing, and it felt really good, and I was able to win. It feels great."
Danish 10th seed and 2009 finalist Caroline Wozniacki was another big name to exit at the first round stage after a 6-2 6-4 loss against Kazakhstan's Yaroslava Shvedova, while Italy's Roberta Vinci, seeded 12th, was sent packing following a 6-1 1-6 6-2 defeat against Varvara Lepchenko of the United States.
Petra Kvitova, champion in 2011, survived a first-set blip to edge out Yanina Wickmayer 4-6 7-5 6-4, while 16th seed Ana Ivanovic was also given a scare before she came through against Bethanie Mattek-Sands 6-7 (10-12) 6-3 6-2.
There were no such worries for top seed and defending champion Serena Williams, who was a 7-6 (7/5) 6-1 victor over Yulia Putintseva although her sister Venus was forced to withdraw from the tournament due to a lower back injury.
Fourth seed Agnieszka Radwanska hit back from 3-1 down in the second set to beat Tsvetana Pironkova 6-2 6-4, while Angelique Kerber, seeded sixth, rallied from losing the first set to beat Hsieh Su-Wei, 3-6 6-3 6-2.
Fellow seeds Nadia Petrova (11), Maria Kirilenko (13), Marion Bartoli (14) and Dominika Cibulkova (15) also advanced into the next round as did Kaia Kanepi, Svetlana Kuznetsova, Chanelle Scheepers, Sorana Cirstea, Maria-Teresa Torro-Flor, Ekaterina Makarova and Anabel Medina Garrigues.