In machine type communication networks with limited power and scarce spectrum resources, traditional resource allocation algorithms are difficult to meet the increasing QoS requirements of machine type communication devices. With single cell as background, a two-layer network model is constructed to reduce the access burden of base stations and ease the congestion of machine-type communication network. On this basis, spectrum allocation and power allocation are optimized to maximize system throughput, and a distributed Asynchronous Advantage Actor-Critic algorithm is proposed to solve the problem. Simulation results show that the proposed algorithm can improve the throughput of the system and converge faster than the traditional reinforcement algorithm.