In order to solve the problem of spectrum resource shortage and high-speed access in 5G network, the multi-agent system is embedded into the standard cuckoo algorithm, and the multi-agent cuckoo algorithm is proposed. Firstly, the spectrum information of network channel sharing available to users is obtained, and the cuckoo search algorithm is used to optimize under the condition of satisfying the quality of service (QoS) guarantee of users, and the optimal allocation scheme is obtained by iterating for many times. The use steps are illustrated by examples. Compared with the traditional genetic algorithm, the calculation complexity can be reduced, and it can also be extended to more users and networks. In this algorithm, each cuckoo represents an agent, and all the agents constitute a von-Neumann structure. Through the neighborhood competition cooperation operator, mutation operator, self-learning operator and the evolution mechanism of cuckoo algorithm, they can continuously enhance the energy and improve the adaptability, and can quickly and accurately find the optimal solution of the problem.