This paper presents a hierarchical lane-changing trajectory planner based on the least action principle for autonomous driving. Our approach aims to achieve reliable real-time avoidance of static and moving obstacles in multi-vehicle interaction scenarios on structured urban roads. Unlike previous studies that rely on subjective weight allocation and single weighting methods, we propose a novel trajectory planning strategy that decomposes the process into two stages: candidate trajectory generation and optimal trajectory decision-making. The candidate trajectory generation employs a path-velocity decomposition method, using B-spline curves to generate a multi-objective optimal lane-changing candidate path. Collision checking eliminates paths at risk of collision with static obstacles. Dynamic programming (DP) and quadratic programming (QP) are then used to plan the velocity of safe paths, generating candidate lane-changing trajectories based on curvature checking. The optimal trajectory decision-making process follows the decision mechanism of excellent drivers. We introduce a comprehensive evaluation function, the average action, which considers safety, comfort, and efficiency based on the least action principle. Feasible trajectories are ranked based on their average action, and the trajectory with the minimum average action and no collision risk with moving obstacles is selected as the tracking target. The effectiveness of the proposed method is validated through two common lane-changing scenarios. The results demonstrate that our approach enables smooth, efficient, and safe lane-changing while effectively tracking the planned velocity and path. This method offers a solution to local trajectory planning problems in complex environments and holds promising prospects in the field of autonomous driving.