This paper focuses on the problem of automatic parking trajectory planning in unstructured scenarios. The proposed algorithm adopts a combination of graph search and optimization strategy. First, A* search is utilized to obtain paths connecting the global start and end points. Second, the path is divided into three segments and subpaths are searched using the hybrid A* algorithm and the proposed A*-iBspline algorithm. Finally, the three subpaths are merged and a valid initial guess is generated for the OCP. Additionally, an iterative framework is used to improve the quality of the OCP solution. Simulation results show that the proposed algorithm has a significant advantage over existing methods in terms of time and applicability.