Unmanned Surface Vehicle (USV) is a new type of intelligent surface craft, and global path planning is the key technology of USV research, which can reflect the intelligent level of USV. In order to solve the problem of global path planning of USV, this paper proposes an improved A* algorithm for sailing cost optimization based on electronic charts. This paper uses the S-57 electronic chart to realize the establishment of the octree grid environment model, and proposes an improved A* algorithm based on sailing safety weight, pilot quantity and path curve smoothing to ensure the safety of the route, reduce the planning time, and improve path smoothness. The simulation results show that the environmental model construction method and the improved A* algorithm can generate safe and reasonable global path.