Shangshu appeared very early, dating back to the pre-Qin Dynasty, when he was a subordinate official of Shaofu. The shaofu's duty was to manage the emperor's financial and private life, and there were six subordinates, namely Shangyi, Shangshi, Shangguan, Shangxi, Shangyu, and Shangshu, and Shangshu could be regarded as the private secretary who managed the receipt and dispatch of the monarch's documents, and his position of authority was very light.
In the Eastern Han Dynasty, the Shangshu institution was called Shangshutai, because the Guangwu Emperor Liu Xiu objectified the Three Gongs mascot, and the edict did not have to go through the discussion between the Chancellor and the Imperial Shi Dafu as in the Western Han Dynasty, but could be directly issued by the Shangshutai, so this institution was suddenly bullish, and the chief of the Shangshutai, Shangshuling, was also known as one of the "Three Sittings". Because it has become a place to draft edicts and introduce policies, if the minister wants to take charge of the government, he must record Shang Shushi, that is, he must be in charge of Shang Shutai.

Liu Xiu
As Shang Shutai became increasingly important, its work became more complex and its institutions slowly expanded. The orders issued by Shangshutai need to be implemented by government officials such as Jiuqing, so Shangshu often acts as an agent of the emperor to convey orders and work guidance to government officials. Gradually, Shang Shutai began to develop in the direction of government affairs agencies, and the various ministries under its jurisdiction also had official names.
By the time of the Cao Wei Dynasty, the Zhongshu Institution was established, and the Shangshu Institution was divided from the authority of mastering the secrets and participating in the performance, and the Shangshutai was transformed into a government affairs agency. After the transformation, Shangshu Ling and Shangshu servants were more like prime ministers who presided over political affairs, while the various Shangshu who were responsible for specific affairs had a great overlap with Jiuqing in terms of authority. The overlap of powers between Shangshu and Jiuqing sparked many discussions among the ministers during the Western Jin Dynasty, and finally a large-scale merger of Jiuqing was carried out during the Eastern Jin Dynasty, and since then Shangshu's handling of government affairs has become a formal model, and Shangshu Ling is no longer the emperor's personal secretary, but a courtier leader.
From its birth to its development, Zhongshu was inseparable from Shangshu. Zhongshu was born during the reign of Emperor Wu of the Han Dynasty, and its full name is Zhongshu, and it is known from the name that this position has a lot to do with Shangshu. In order to facilitate the handling of government affairs in the harem, Emperor Wudi of the Han Dynasty used eunuchs who could enter and leave the harem as Zhongshu and was responsible for passing on the chapter of Shangshu.
During the Western Han Dynasty, zhongshu was abandoned at the time, and in the Eastern Han Dynasty, there was no zhongshu. At the end of the Eastern Han Dynasty, Cao Cao set up a secretarial order to be in charge of Shangshu, which was very similar to the Zhongshu order of the Western Han Dynasty, but the secretarial order was held by a scholar rather than a eunuch. After Cao Pi became a Han Dynasty, he changed his secretary to Zhongshu, with the chief official called Zhongshu Jian and the second official zhongshu ling, still serving as a scholar.
Cao Cao
Cao Wei's Zhongshu Supervision Agency replaced the Shangshutai Canonical Master and the Cashier's Office as the Emperor's new personal office. And because zhongshujian accompanied the emperor for a long time, he could not only issue government decrees, but also participate in government decision-making. Therefore, although Shang Shuling's status was higher than that of Zhongshu Supervisor, officials were more willing to stay in Zhongshu Province. During the Eastern Jin Dynasty, the powerful ministers usually had to record Shangshu on the one hand and serve as zhongshu supervisors at the same time to control the overall situation.
In the Southern Dynasty period, due to the great progress of imperial power compared with the Eastern Jin Dynasty, the emperors began to weaken the power of the warrior clan, promote and reuse the Han people, so the power of zhongshu supervisor, ling, etc. was gradually transferred, and the minor status of zhongshu sheren often exercised important duties. In Southern Qi and Southern Liang, the control of zhongshu she people over Zhongshu Province was formally institutionalized, and the institutions were gradually improved, forming various bureaus under Zhongshushe people to guide Shangshu And Cao in government affairs, which was very similar to the relationship between Shangshu and Jiuqing in that year, and this institution was also known as Zhongshushe Province. However, due to the destruction of Southern Chen by the Sui Dynasty, history did not develop along this trajectory in the end.
Compared with the above two institutions, the situation in Menxia Province is troublesome and troublesome, and it is simple and simple. Trouble means that the changes in its organizational structure are very complex and difficult to sort out, and simple means that its functions are relatively stable and there are no major changes.
Menxia was originally not a specific official agency, but a general term for the emperor's attendants, attendants, left and right Cao, zhu officials, scattered horses, regular attendants, and middle-ranking personnel. The most important of these personnel is the Serab, who was originally a priest whose functions included serving the Son of Heaven and acting as an advisor. In the late Eastern Han Dynasty, the organization of Shizhong began to improve, and the institution of Shizhong Temple was established, which became the prototype of the later Menxia Province. Another important official position in shizhong temple is the Yellow Gate Attendant, also known as the Gate Attendant.
In the Western Jin Dynasty, the temple was further expanded and renamed Menxia Province, and scattered riding changshi and scattered riding shilang were also included. During the Wei and Jin dynasties, the Scattered Horse Attendants and Scattered Horse Attendants accompanied the Emperor, often participated in state affairs discussions, belonged to the Emperor's advisory team, and were prominent positions held by the sons of nobles. During the Eastern Jin Dynasty, the Scattered Horse Changshu and so on were abolished, and in the Liu Song Dynasty, it was re-established, and the Scattered Horse Province, also known as Jishu Province, was often called Xiaomenxia, while the Southern Qi Period simply handed over the Jishu Province to the command of Menxia Province. However, at this time, the Jishu Province was basically an idle institution, and its positions were generally awarded to elderly officials as honorary official positions. In the Southern Liang period, Jishu Province was separated from Menxia Province, and its status and authority were also promoted, and the scattered horses were comparable to those in the shizhong. Some of the responsibilities of menxia province were also assigned to the province of Jishu, such as the province reading texts and giving opinions, etc., and the two became parallel institutions.
Liu Yu
Unlike Shangshu and Zhongshu, who have been changing their duties, Menxia Province has long been the emperor's personal adviser, so its status has also changed according to the strength of the imperial power. During periods such as Cao Wei and the Western Jin Dynasty, when emperors were in power, shizhong was naturally an important position that could play a key role in policymaking. However, during the Eastern Jin Dynasty, the importance of the servants declined. In the Southern Dynasty, the servants became important again, and even with the authorization of the emperor, they could even directly exercise government affairs.