Influenced by the environment and nodes status,the quality of link is not always stable in actual wireless sensor networks( WSNs). Poor links result in retransmissions and more energy consumption. So link quality is an important issue in the design of routing protocol which is not considered in most traditional clustered routing protocols. A based on energy and link quality's routing protocol( EQRP) is proposed to optimize the clustering mechanism which takes into account energy balance and link quality factors. EQRP takes the advantage of high quality links to increase success rate of single communication and reduce the cost of communication. Simulation shows that,compared with traditional clustered protocol,EQRP can perform 40% better,in terms of life cycle of the whole network.