To meet the economy requirement of the horticultural machinery, a two-speed transmission system was proposed based on the characteristics of the driving cycle of the horticultural machinery. Firstly, the test cycle of the horticultural machinery was established based on the data collector that fixed on the machinery. Secondly, the two-speed driveline system was designed. To reduce the energy consumption in the horticultural machinery working cycle, the gear ratio of the two-speed gear box was optimized with the goal of minimum energy consumption by the Genetic Algorithm. The optimized gear ratio were 11.6 and 9.62. The comparison of energy consumption between single gear ratio and two-speed gear ratio was made. The comparison result showed that the energy consumption can reduce 0.25% under one transportation test condition, the energy consumption can reduce 0.41% under one ploughing test condition, and the energy consumption can reduce 0.41% under one rotary test condition.