Cloud computing and mobile edge computing address the growing demand for computing power driven by the rise in data-intensive applications, but they are prone to creating computing silos, resulting in unbalanced resource utilization. To address this issue, the Computing Power Network (CPN) has been introduced to enable the centralized management and scheduling of resources across the entire network. However, task scheduling in the CPN requires joint selection of computation nodes and routing paths, which greatly increases the complexity of scheduling problem. In existing studies, heuristic methods are difficult to satisfy real-time requirements, whereas deep reinforcement learning methods ignore the collaborative optimization of network resources, making them difficult to adapt to complex CPN scenarios. To this end, we propose a task scheduling method for the CPN, called TS-DQNF. First, the method uses the Deep Q-Network (DQN) to determine the computation node for computation task. Then, it introduces a dynamic congestion-aware mechanism to determine the shortest routing path. Finally, it gradually obtains the optimal task scheduling scheme through multiple rounds of alternating iterations. Simulation results show that the TS-DQNF achieves good performance and good convergence performance under different scenarios and scales.