Against the background of the dual challenges of global energy demand growth and environmental protection, this paper focuses on the study of microgrid optimization and scheduling technology and constructs a smart microgrid system integrating energy production, storage, conversion, and distribution. By integrating high-precision load forecasting, dynamic power allocation algorithms, and intelligent control technologies, a microgrid scheduling model is proposed. This model simultaneously considers environmental protection and economic efficiency, aiming to achieve the optimal allocation of energy resources and maintain a dynamic balance between supply and demand. The goose optimization algorithm (GO) is innovatively introduced and improved, enhancing the algorithm’s ability to use global search and local fine search in complex optimization problems by simulating the social aggregation of the goose flock, the adaptive monitoring mechanism, and the improved algorithm, which effectively avoids the problem of the local optimal solution. Meanwhile, the combination of super-Latin stereo sampling and the K-means clustering algorithm improves the data processing efficiency and model accuracy. The results demonstrate that the proposed model and algorithm effectively reduce the operating costs of microgrids and mitigate environmental pollution. Using the improved goose algorithm (IGO), the combined operating and environmental costs are reduced by 16.15%, confirming the model’s effectiveness and superiority.