With the development of technologies such as IoT and 5G, the exponential explosion in the amount of new data has put more stringent requirements on ultrareliable and low-delay communication of services. To better meet these requirements, a resource allocation strategy using deep reinforcement learning in a cloud-edge collaborative computing environment is proposed. First, a collaborative mobile edge computing (MEC) system model, which combines the core cloud center with MEC to improve the network interaction ability, is constructed. The communication model and computation model of the system are considered at the same time. Then, the goal of minimizing system delay is modeled as a Markov decision process, and it is solved by using the deep Q network (DQN) which is improved by hindsight experience replay (HER), so as to realize the resource allocation with the minimum system delay. Finally, the proposed method is analyzed based on the simulation platform. The results show that when the number of user terminals is 80, the maximum user delay is 1150 ms, which is better than other comparison strategies and can effectively reduce the system delay in complex environment.