Traditional linear regression is difficult to capture complex load changes, has low prediction accuracy, and lacks systematicity in distribution network wiring optimization, which affects power supply efficiency. This paper combines big data with machine learning to propose a grid load forecasting and wiring optimization solution. First, after processing based on the Apache Hadoop framework, real-time data access is performed through Kafka, and real-time analysis and calculation are performed using Spark Streaming. Random forest is used for load forecasting, and data access efficiency is optimized through consumer subscription and asynchronous processing. Grafana is used to monitor over-limit alarms to ensure accurate predictions. Then, load and geographic data are integrated, and K-Means clustering is applied to identify high-load areas. The GWR (Geographically Weighted Regression) model is constructed to evaluate the impact of spatial characteristics on load. Finally, based on the distribution network wiring model of load data, the node electrical parameters are set and the wiring scheme is optimized using genetic algorithm. The experimental results show that the load forecast MAE (Mean Absolute Error) is reduced by 21.58%, and the loss is reduced by 33.16% after the wiring mode is optimized. The comprehensive method based on big data effectively improves the load forecasting accuracy and distribution network optimization efficiency, providing an important reference for the development of smart grids.