When facing massive interconnection scenarios of terminals, 5G message service system needs to support large-scale information access and management and provides the efficient and reliable signal control to scheduling a variety of wireless access networks. In this paper, artificial immune theory is applied to the 5G message services. The simulating the immune response mechanism, a semi-distributed dynamic adaptive immune network architecture was proposed. The dynamic learning mechanism and immune memory mechanism of the detector were established, which improved the 5G edge computing capability and reduced the load of the 5G core network. The concept of the immune message distribution system (IMDS) is proposed, which uses clonal selection algorithm to classify and clone the message header, and combines with the affirmative selection algorithm to carry out high-frequency variation on the message body. On the premise of ensuring the diversity of antibodies, the space consumption problem of the hashmap algorithm is effectively solved, and the efficiency of message distribution is improved. The comparison of simulation results shows that the IMDS improves the message recognition ability and adaptive ability of the 5G system and proves the feasibility of semi-distributed immune dynamic learning mechanism.