This paper analyzes the main methods of stochastic optimization algorithms to construct a stochastic optimization model. The focus is on the calculation method for risk minimization, combined with the SGD algorithm to guarantee the speed of sublinear convergence. The mean variance of the risk evaluation model is determined by constructing the objective function and constraints, and the investor’s risk is minimized based on calculating the minimum variance of the model. The asset portfolio risk evaluation model can accurately describe the risk of different industries, as demonstrated by the results. According to the correlation coefficient reality, the correlation between industry indices is relatively strong, where the correlation coefficient between raw materials and the optional consumption industry is 0.865, and the correlation coefficient between the optional consumption industry and the financial industry is 0.697.