Ad hoc networks play an important role in mobile communications, and the performance of nodes has a significant impact on the choice of communication links. To ensure efficient and secure data forwarding and delivery, an intelligent routing protocol (IAODV) based on learning method is constructed. Five attributes of node energy, rate, credit value, computing power and transmission distance are taken as the basis of segmentation. By learning the selected samples and calculating the information gain of each attribute, the decision tree of routing node is constructed, and the rules of routing node selection are determined. IAODV algorithm realizes the adaptive evaluation and classification of network nodes, so as to determine the optimal transmission path from the source node to the destination node. The simulation results verify the feasibility, effectiveness and security of IAODV.