Compared with the client/server computing paradigm, which is traditionally widely used, the computing paradigm based on mobile agent provides many powerful advantages in wireless sensor networks. Therefore, the mobile agent as a distributed middleware technology is the subject of this research for efficient automatic data aggregation and energy balance in wireless sensor networks. As the mobile agent's itinerary greatly influences the performance of data aggregation and the overall energy consumption, creating an efficient mobile agent's itinerary is meaningful. Thus, a novel itinerary planning is proposed in this paper. This approach uses iterated local search algorithm to plan a visited itinerary for every mobile agent. This schedule not only takes into account the data loading and actual energy consumption when the mobile agent traverses some intermediate nodes and forwards data by these nodes, but it also makes full use of some nodes from a disjoint itinerary to minimize the overall itinerary cost. Simulation experiments show that this proposed approach performs better than other existing multi-itinerary approaches in terms of energy consumption and service time.