Aiming at the current situation of rapid application and development of the power system cloud platform, the power grid data analysis and processing resources are unevenly used and the power system data center structure is complex. The current cloud computing has unreasonable resource scheduling problems. So a method for cloud computing virtual resource allocation based on power analysis computing task division is proposed in this paper. This method introduces the concept of membrane computing, and divides the complex analysis tasks under the cloud platform into multiple categories according to the different time of resource allocation. The improved ant colony algorithm is used to achieve the optimal allocation of virtual resources according to the utilization rate of resources and computer energy consumption. The simulation results show that the resource optimization scheduling method based on task classification and ant colony algorithm is efficient and balanced.