In recent years, the growing Internet of Things (IoT) has generated huge amounts of data, which has put enormous pressure on infrastructures such as the network cloud. One of the obstacles to fog computing is how to allocate computing resources in a way that minimizes network resources. A heuristic-based TCC (time cost computing-power) algorithm is proposed to optimise the task scheduling problem in genetic algorithm-based “cloud-fog” computing in this heterogeneous system, including execution time, operational cost and total computing power resources. The algorithm is based on “ cloud-fog-end-net ” hybrid computing task scheduling, and uses evolutionary genetic algorithms as a research tool, combining the advantages of cloud computing, fog computing and genetic algorithms to achieve a balance between latency, cost and computing power. In the hybrid computing task scheduling, this algorithm has a better balance performance than TCaS algorithm which only considers a single metric; the adaptation value of this algorithm is 0. 93% and 26. 02% higher than BLA algorithm and RR algorithm respectively. The algorithm is also flexible enough to match the user’ s needs in terms of high performance-cost-computing power, enhancing the effectiveness of the system.