Uncertain renewable power generation and on-site demand would complicate battery operation and affect profitability. In this paper, a novel battery scheduling model is proposed for maximizing arbitrage benefits while meeting the peak shaving requirements. The proposed model features accurate expectations and is essentially a stochastic optimization accounting for uncertainty. The convexity of the proposed model is strictly proved, which ensures that the global optimal solution is obtainable and computationally attractive. Based on the firstorder optimality condition, we further derive the analytical form of the optimal solution, which explicitly demonstrates the impact of uncertainty on the optimal dispatch of battery storage. Both the convexity and the solution stability of the proposed model are verified through extensive case studies involving various time periods and multiple algorithms for convex optimization. In addition, the change in the trade-off price threshold caused by uncertainty is also illustrated in simulations.