A two-layer multi-time scale stochastic production simulation framework is constructed to account for the long-term contract electricity quantity of ultra-high voltage direct current (UHVDC) transmission. On the upper layer, based on the characteristics of load demand and renewable energy output extracted from the historical operating data, monthly and daily production simulation models are carried out considering the seasonal characteristics of hydropower during a high-water period and low-water period to optimize the distribution of contract electric quantity sending through UHVDC transmission in the target year or month. According to the DC transmission electric quantity optimized by the daily production simulation in the upper layer, together with the forecast scenario, the lower layer of the framework provides the optimization of day-ahead scheduling and intra-day rolling dispatch in the implementation process. The day-ahead dispatch optimization makes full use of the adjustment capability of transmission and optimizes the DC transmission electric quantity correction. Its compensation is based on the result of the daily production simulation, then the correction will be returned to the upper layer to restart the optimization of the remaining UHVDC contract electric quantity of the subsequent period and its distribution plan. Combined with the day-ahead DC transmission plan, the intra-day rolling optimization is carried out to adjust the output of the unit using more accurate forecasting scenarios. The distributionally robust optimization model is used in the lower layer to convert an uncertain problem into a deterministic quadratically constrained quadratic programming (QCQP) problem according to the form of an uncertain distribution set. Then the QCQP problem is further converted into a linear programming (LP) problem by using the reformulation linearization technique (RLT). A test system with the energy composition and distribution referring to a real provincial power grid in northwest China is established for verification. The results show that the proposed method can effectively improve the economics of system operation and the accommodation of renewable energy based on ensuring security.