Resource allocation in cloud computing has always been the focus of research, and in this paper, a resource allocation in cloud computing based on improved bat algorithm has been proposed. Differential genetic algorithm is introduced into bat algorithm and mutation, crossover and selection, etc. are employed to avoid individuals from falling into local optimum, and premature of the optimal solution. The improved bat algorithm can effectively improve the convergence speed and precision of the algorithm. Simulation experiments have shown that algorithm in this paper can not only greatly improve performance of the algorithm, but also optimize the resource scheduling capability in cloud computing system and improve utilization rate of resources in could computing.