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.













