Hi! I had asked on reddit but no luck there so I thought I might have a shot here. I remember watching this ~2009-2010.
Plot: a peasant/commoner joins the army and works his way up the ranks and ultimately saves the emperors life in the last episode or so as the emperor was being chased on horseback. The commoner started off prepping food then becoming a common army man and so on and was instrumental in winning numerous battles. The emperor had dreams about this random peasant becoming his general and ultimately saving him on a white horse. The entire show has a lot of close calls where the emperor almost meets up with this commoner but fate/people intervene.