I have little authority to answer your question, which is quite complex and due to its nature, political and controversial. Instead, I'd recommend you look into these readings:
- Hudson, Mark J. Ruins of Identity: Ethnogenesis in the Japanese Islands. HONOLULU: University of Hawai'i Press, 1999. www.jstor.org/stable/j.ctt6wqwwr.
- Batten, Bruce L. To the Ends of Japan: Premodern Frontiers, Boundaries, and Interactions. University of Hawai'i Press, 2003. www.jstor.org/stable/j.ctt6wr1r1.
- Tezuka, Yoshiharu. "Japanese National Identity and “Banal” Cosmopolitalization." In Japanese Cinema Goes Global: Filmworkers' Journeys, 9-24. Hong Kong University Press, 2012. www.jstor.org/stable/j.ctt1xwffc.7.
- Tamamoto, Masaru. "The Ideology of Nothingness: A Meditation on Japanese National Identity." World Policy Journal 11, no. 1 (1994): 89-99. www.jstor.org/stable/40209352.
- Toby, Ronald P. "Contesting the Centre: International Sources of Japanese National Identity." The International History Review 7, no. 3 (1985): 347-63. www.jstor.org/stable/40105497.
- Reynolds, Jonathan M. "Japan's Imperial Diet Building: Debate over Construction of a National Identity." Art Journal 55, no. 3 (1996): 38-47. doi:10.2307/777764.
- Yamashiro, Jane H. Redefining Japaneseness: Japanese Americans in the Ancestral Homeland. NEW BRUNSWICK; CAMDEN; NEWARK; NEW JERSEY; LONDON: Rutgers University Press, 2017. www.jstor.org/stable/j.ctt1kt82wn.
- Tai, Eika. "Rethinking Culture, National Culture, and Japanese Culture." Japanese Language and Literature 37, no. 1 (2003): 1-26. doi:10.2307/3594873.
- Howell, David L. "Ainu Ethnicity and the Boundaries of the Early Modern Japanese State." Past & Present, no. 142 (1994): 69-93. www.jstor.org/stable/651197.
- Howell, David L. "Ethnicity and Culture in Contemporary Japan." Journal of Contemporary History 31, no. 1 (1996): 171-90. www.jstor.org/stable/261100.
- Eiji, Oguma. 2000. "Human Sciences and National Identity in Modern Japan: Who Defined the 'Japanese Tradition'?" China Report. 36 (2): 239-251.
- Eiji, Oguma. 1998. "The Boundaries of the 'Japanese': Okinawa, the Ainu, Taiwan and Korea. From Colonial
Domination to the Return Movement"
- Eiji, Oguma. 1995. "The Origin of the Myth of Ethnic Homogeneity: The Genealogy of'Japanese' Self-Images"
Oguma Eiji in particular addresses the Ryukyuans and Ainu. Here's a book review by David Askew:
- Askew, David. "Oguma Eiji and the Construction of the Modern Japanese National Identity." Social Science Japan Journal 4, no. 1 (2001): 111-16. Accessed February 19, 2020. www.jstor.org/stable/30209657.
It's an academic review, so it offers a little bit of summarization.
There are also some semi-related previous threads that could be worth reading too: