With the development of space technology, asteroid exploration will become a hotspot in the deep space exploration field. Space flight trajectory has the following requirements: needing a long time, having many engineering constraints, having a large number of targets, and having a series of feasible solutions. So how to find the global optimum flight program is the core issue of the deep space exploration trajectory design. This paper proposes a novel method to design the optimal trajectory by differential evolution (DE) algorithm for asteroid exploration based on mixed coding. In our method, the celestial sequence and the time sequence are coded together into the chromosomes of DE and optimized them simultaneously. The chromosomes are designed to include four parts: the celestial sequence, the exploration type, the time sequence, and the return time. The algorithm can make full use of the characteristics of the high efficiency and global optimization ability of differential evolution and can also avoid the problem of high complexity of the branch-and-bound algorithm and the problem of nonglobal optimal solution of the greedy algorithm. The algorithm is adopted to solve the Fourth Contest of National Space Orbit Design in China, and the result shows that both the computational efficiency and the performance of the algorithm are superior.