With the development of cloud computing and data intelligence, datacenters have become an important part of ensuring service quality and production efficiency in intelligent applications. However, datacenters are also facing increasingly complex and heavy task processing requirements currently, and more efficient scheduling methods are urgently needed. Therefore, this paper proposes a multi-swarm particle swarm optimization task scheduling method based on load balancing, aiming at reducing the maximum completion time (makespan) and response time in task scheduling. The proposed method designs a new fitness function for particles, and promotes the load balance of the cluster during the scheduling process by optimizing the combination of makespan and machine completion time variance. And a novel inertia weight is designed to dynamically adjust the particle search performance. The new initialization method and multi-swarm search design are used to improve the quality and diversity of solutions and avoid particles falling into local optimum. Finally, the proposed algorithm is verified experimentally using the task dataset released by Alibaba datacenter, and compared with other benchmark algorithms. The results show that the algorithm can improve the task scheduling performance of datacenters in supply chain management when dealing with different workloads and changes in the number of machines.