The term Ri Ben is already in use during the yuan and perhaps the Song, I found that term in Yuan Shi.
I recently read the Xin Tang Shu (written by Ouyang Xiu in the Northern Song), and in the chapter on the Dongyi 东夷, it reads:
日本，古倭奴也。Translation: Riben (Japan) was formerly known as the Wo slaves.
Translation: Later, when they became a little familiar with the Han language, they disliked the name of 'Wo' and changed their name to Riben. Their envoy said that their land is near where the sun rises, hence the name (meaning 'source of the sun'). On another occasion, he said that Riben was a small state that the Wo had conquered, and they adopted its name. The envoy did not make himself clear, and so we remain doubtful about the real reason.