Cloud computing is an Internet-based service that is used in various industries such as media, research, business, big data analysis, etc. Meanwhile, task scheduling is one of the most important concerns in this subject, which has been raised in a variety of fields such as operating systems, cluster computing, and data center management. The task scheduling method analyses the current condition of each host (server or physical machine) in the cloud environment to develop algorithms for better virtual resource allocation, decreasing energy consumption and expenses. Various algorithms and optimization strategies are now being presented to handle the work scheduling problem in the cloud environment. In this research, a proposal for load-balanced cloud scheduling using neural network learning method for task clustering and also using PSO algorithm for allocation is presented. For this purpose, requests are first clustered by the SOM neural network method, and the delay-sensitive and non-delay-sensitive clusters are mapped to cloud servers or run locally according to the objective function considered in the proposed PSO algorithm. The goal of the proposed system is to balance the load on the entire system while reducing the time to perform a set of tasks.