Aiming at the disadvantages of traditional direct aperture optimization (DAO) method, such as slow convergence rate, prone to stagnation and weak global searching ability, a gradient-based direct aperture optimization (GDAO) is proposed. In this work, two different optimization methods are used to optimize the shapes and the weights of the apertures. Firstly, in order to improve the validity of the aperture shapes optimization of each search, the traditional simulated annealing (SA) algorithm is improved, the gradient is introduced to the algorithm. The shapes of the apertures are optimized by the gradient based SA method. At the same time, the constraints between the leaves of multileaf collimator (MLC) have been fully considered, the optimized aperture shapes are meeting the requirements of clinical radiation therapy. After that, the weights of the apertures are optimized by the limited-memory BFGS for bound-constrained (L-BFGS-B) algorithm, which is simple in calculation, fast in convergence rate, and suitable for solving large scale constrained optimization. Compared with the traditional SA algorithm, the time cost of this program decreased by 15.90%; the minimum dose for the planning target volume was improved by 0.29%, the highest dose for the planning target volume was reduced by 0.45%; the highest dose for the bladder and rectum, which are the organs at risk, decreased by 0.25% and 0.09%, respectively. The results of experiment show that the new algorithm can produce highly efficient treatment planning a short time and can be used in clinical practice.