At present, cloud data centers' high energy consumption is an urgent problem in the development of cloud computing. One reason for the high energy consumption of cloud data centers is the mismatching scheduling between tasks and resources. The existing cloud computing task scheduling algorithms assigned tasks to resource nodes by certain rules according to the task information, and they ignored that the resource nodes are also the main body of the task scheduling algorithms. This paper proposes a new task scheduling algorithm based on bilateral selection. It fully considers the task and the resource and combines the Dynamic Voltage/Frequency Scheduling (DVFS) technology to help tasks and resources to match more appropriately. It can assign tasks to resources with higher credibility. The experimental results show that the cloud computing task scheduling algorithm based on the bilateral selection can obtain better execution performance and lower execution energy consumption and solve the high energy consumption problem caused by the mismatch between tasks and resources.