Path planning is the key to the autonomous flight of unmanned aerial vehicle (UAV). Aiming at the problems of blind search, long and zigzag path in the path planning of three-dimensional space environment, A heuristic bidirectional target RRT fusion A* algorithm was proposed. Firstly, the algorithm combines heuristic probability and bias expansion strategy to improve the target orientation of sampling. After obtaining the complete path point, the shortest path is obtained by fusing redundant nodes in the complete path of A* algorithm. Finally, B-spline algorithm is used to smooth the path, which obtains a smooth feasible path. Experimental results show that compared with the traditional B-RRT algorithm, the improved B-RRT algorithm improves the node utilization by 9.6 times, reduces the extension nodes by 86.9%, shorts the search time by 21.46%, and shorts the path by 7.9%.