To solve the permutation flow shop scheduling problem(PFSP), a mathematical model aiming at minimizing the maximum completion time is established, and a real-time scheduling method based on deep reinforcement learning is proposed. Firstly, the problem framework of PFSP is established by using the Markov decision process (MDP). According to the characteristics of the scheduling model and reinforcement learning algorithm framework, the environmental state of production scheduling based on PFSP is designed. This state extracts the completion process index of each machine in PFSP, which has a lower dimension and higher discrimination Aiming at the state and optimization objectives, an action space composed of three scheduling rules is proposed. Secondly, the double deep Q network (DDQN) is used as the agent, and the label generated in the interaction between the agent and the environment is used as the input to fit the nonlinear relationship between the state and the action value, so the agent can select the optimal behavior under different states for the system. The agent can be trained by small-scale problems to solve large-scale problems. Finally, through simulation experiments and comparison of algorithms for different test problems, it is verified that the algorithm can effectively solve the PFSP problem.