The paper takes the data of a 50 MW photovoltaic power generation system as a sample, divides the weather conditions into two categories according to whether there is a sudden change, optimises the decomposition number K and penalty factor of variational mode decomposition (VMD) by using the sparrow intelligent algorithm, decomposes the power sequence in a power mode by using the optimised VMD decomposition method and sends all sub-components to a long short-term memory (LSTM) network for prediction.