As a distributed parallel computing, cloud computing has an absolute advantage in accessing and processing of huge amount of data. How to assign all these virtual cloud computing resources to the user is a key technical issues, scholars have proposed greedy algorithm, FCFS, and other variety of algorithms to solve this problem. However, the algorithms just build a local optimal solution, there is no global allocation of resources in the cloud computing. In order to solve this problem, the authors are inspired from the ant foraging behavior and integrated multi-goal match of the secondary distribution, then, they proposed ant colony optimization algorithm.