The use of maximum power point tracking (MPPT) technology has significantly increased the conversion efficiency of PV modules. However, the presence of partial shading in PV arrays can lead to multi-peaked output curves, which traditional MPPT methods struggle to track due to falling into local maximum power points. The paper proposes a MPPT control algorithm based on the combination of differential flat control (DFBC) and adaptive particle swarm optimization (APSO) algorithm. The PSO output value is used as the feed-forward feedback input of differential flat, and a second-order controller is used to track the reference flat trajectory, achieving global MPPT through differential flat control. The algorithm can overcome the system oscillation caused by the randomness of the PSO algorithm with the initialized particle position and the existence of control lag misjudgment. Simulation and experimental results show that the algorithm not only solves the problem that the traditional MPPT algorithm cannot find the global maximum power point, but also solves the problems that the traditional particle swarm algorithm has large randomness, slow convergence speed, and easy to produce large oscillations. The algorithm has greatly improved the tracking accuracy, tracking speed and response speed, realizing fast and accurate response to external changes, reducing energy loss, and improving the dynamic tracking performance of the system.