The degrees of the scale "gong [宮], shang [商], jue [角], zhi [徵], yu [羽]" are terms which have been in use in Chinese music since the ancient times. The "Commentary of Zuo [左傳]" mentioned the fact that regardless of what type of songs it was, regardless of the area it originated, regardless of the type of scale used, the five tones (of the anhemitonic, tonal pentatonic scale) was the basis of the notes. In the chapter "Discourses of Zhou [周語]" within the book "Discourses of the State [國語]", it was mentioned that "gong" was the starting point in the creation of the modes.
The next question was how these names came about. The musicologist Feng Wen Ci [馮文慈] believed that "gong, shang, jue, zhi, yu" arose from astrology. "Gong" represented the centre of things, and that was the Big Dipper. "Shang, jue, zhi" were three stars within the Azure Dragon of the East, one of the four symbols of the Chinese constellations. "Shang" was Sigma Scorpii, "jue" was Spica, and "zhi" was Alpha Librae. Finally, "yu" was Alpha Crateris, a star within the Vermilion Bird, another symbol of the Chinese constellations. Feng believed that astrology played a huge part in the lives of the ancient Chinese and hence the reflection in the music of the people.
There is also Xi Jie Guan who believes that these names came about when the notes are being sung. In the text "Guanzi [管子], the notes "zhi, yu, gong, shang, jue" were likened to the sounds of the animals on the farm, from the lowest to the highest. "Zhi" was described as the grunts of the boar, "yu" as the neighing of the horse, "gong" as the calling of the cow, "shang" as the baa-ing of the sheep, and "jue" as the cries of the pheasant. Because the names of the animals sounded similar to the words "gong, shang, jue, zhi, yu" in the pronunciation of ancient Chinese, these words could have been derived from that.
As could be seen, these names of the degrees of the scale were already in place by the Spring as Autumn era, but musicologist Feng Wen Ci proposed that they could have arisen even as far back as Western Zhou, or the Shang dynasty.
Music was a mysterious phenomenon to the ancient Chinese and hence the common 1, 2, 3, 5, 6 that we take for granted now was associated with something as far reaching as the skies, or as important to life as the livestock on the farm.
Liu, ZS. (1989). Zhong Guo Gu Dai Yin Yue Shi Jian Shu [中國古代音樂史簡述]. Beijing: Ren Min Yin Yue Chu Ban She.