Given the growing popularity of the peer-to-peer (P2P) network systems in the recent years, efficient query routing under highly dynamic environments is still lacking in several P2P network systems. In response to this challenge, this paper proposes a new churn-resilient system to find alternative routing paths for the purpose of balancing the query loads under higher network churns and heavy workloads, ultimately to improve the search efficiency. Two novel methods are devised to balance the network query loads among both inter- and intragroup level peers. First, a resource grouping and a rewiring method is proposed to spontaneously organize and cluster the peers having same resources together. This strategy facilitates the peers to evolve the network into a cluster-like topology and balances the query loads among the intergroup peers. Second, a collaborative Q -learning method is proposed to balance the query loads among the intragroup peers in order to intelligently avoid queries being forwarded to the congested peers in the network. Experiments conducted under dynamic network scenarios demonstrate that our proposed method achieves better search performances with a more balanced network load than the existing methods, and further exhibits higher robustness and adaptability under higher network churns and heavy network loads.