Historically, the ancestors of Han nationality in China, like other nationalities in the world, had sex worship because of the mystery of sex. Around the Spring and Autumn Period and the Warring States Period, due to economic development, nobles and civilians were further divided, sexual customs were open, and people were free to talk about their sexual lives. At the same time, there is a trend of competing for luxury to cater to the tastes of the nobility. They lead an indulgent life, including keeping female music (the predecessor of official prostitutes), raising prostitutes or playing homosexuality with adult men. Contemporary books such as The Book of Songs also record many beautiful stories about the free communication between men and women. The ancient art of sexual intercourse in China was born in this atmosphere, and basically took shape in the late Qin Dynasty and early Han Dynasty. From the medical books (bamboo slips) unearthed from Mawangdui Han Tomb in Hunan, China, we can know that the philosophy of Yin-Yang and Five Elements was adopted in men's and women's sexual life at that time, which corresponded with heaven. At the same time, it also absorbed the Taoist views on essence, qi and spirit, and emphasized the importance of essence, qi and spirit to the human body. In addition, through the doctor's observation of indulgence, the idea of keeping fit and abstinence was put forward.
During the Western Han Dynasty and the Eastern Han Dynasty, in order to maintain political stability and adapt to the needs of the new social and economic situation, the kings of China adopted Confucianism in governing the country. At the same time, Buddhism, which originated in ancient India, began to spread to China. Taoism, which originated in the Spring and Autumn Period and the Warring States Period and developed on the basis of immortal magic, was formally established at the end of the Eastern Han Dynasty. The sexual customs in this period were still very open, and the Confucian rule of "men and women are not close" has not affected people's daily life. During this period, the art of sexual intercourse also developed, and new sexual intercourse works came out. The alchemy of the immortals in the palace and Immortal Technique, a Taoist fairy, also contain the content of sexual cultivation. Under the heading of "room", Hanshu defines the anthology as one of the four branches of medicine (namely, medical classics, classical prescriptions, room and immortals), and puts forward the basic principle of "having fun but being temperate" in room art. For example, Zhang Heng, a scientist in the Eastern Han Dynasty, describes the husband and wife's harps in Qi Ge Xing, and some couples read illustrated books indoors during sexual intercourse to enhance their sexual pleasure.
China Tang Dynasty was the heyday of ancient feudal society in China. Since the Han Dynasty, the custom of sex is still open, although it was chosen in different dynasties. The most striking feature of the development of coitus art in this period is that many famous Taoist doctors, such as Ge Hong, Tao Hongjing and Sun Simiao, have played a great role in enriching the content of coitus art. However, comparing the literature of sexual intercourse before the Han Dynasty with the literature handed down during this period, we can find that the development of sexual intercourse is mostly limited to observing sexual life more carefully and enriching sexual behavior. Harmonious sexual life, from cherishing qi and blood and saving energy, has developed to emphasizing nourishing yin and yang, restoring mind and strengthening brain; From the initial understanding that it can only promote health and prolong life, it has become the treatment of many specific diseases, and even considered it an important means to make people live forever. But most of them are unfounded.