Integrating renewable energy sources, such as wind and photovoltaic power generation, into the power grid is crucial for sustainable power system development and mitigating pollutant emissions. However, these sources’ inherent uncertainty and randomness pose significant challenges to grid operations. Metaheuristic algorithms offer efficient solutions to optimization problems in this context and are widely employed in practice. Kernel Search Optimization (KSO) has emerged as a prominent metaheuristic algorithm due to its parameter-free nature and applicability to power dispatch problems. Nevertheless, KSO’s limited local search capabilities necessitate enhancements for improved performance. This paper introduces an enhanced variant of KSO, termed Upgraded Kernel Search Optimization (UKSO), which incorporates differential evolution techniques, including mutation, crossover, and selection mechanisms, to bolster KSO’s search capabilities and overall performance. The efficacy and feasibility of UKSO are evaluated through comprehensive testing using the CEC2017 benchmark. Comparative analysis demonstrates that UKSO outperforms other algorithms by achieving more optimal solutions. To address power dispatch challenges in the context of renewable energy sources, a Two-Time Energy Dispatch (TTED) model is proposed, leveraging a weighted summation approach to minimize total fuel costs and pollution emissions simultaneously. The application of the Prophet model, based on Bayesian fitting, facilitates accurate prediction of wind and photovoltaic power outputs. Through experimentation across small (8 and 14 units) and large (58 units) systems, the feasibility of UKSO and TTED is validated. In complex scenarios, UKSO demonstrates a 0.69% to 3.64% reduction in pollution emissions and a 0.99% to 1.23% decrease in economic costs compared to KSO under varying weight configurations. Furthermore, UKSO achieves a renewable energy generation utilization rate exceeding 90%, emphasizing its ability to iterate efficiently through complex problems and its efficacy in addressing renewable power dispatch challenges. These results highlight the practical significance of UKSO in optimizing power systems and provide valuable insights for future research and applications in this domain.