Network failures are unavoidable and can easily cause huge losses. The occurrence of failures typically results in a number of changes that have to be made to recovery and keep operating the network in a normal manner. Restoration is a common method of network failure recovery. However, the traditional methods of Path Restoration and Link Restoration will be effective only when there are resources that can satisfy the condition in the network. And the resource utilization is not high enough. We propose a network failure recovery method based on reinforcement learning, integrated Path Restoration and Link Restoration. The protection channel of the damaged service flow and the channel of the normal service flow share the bandwidth resource. A simulation is designed to evaluate the performance of the proposed algorithm. Simulation shows that whether there is only one input service flow or multiple input service flows, when the final switched flow cannot find a suitable path in the idle resource, the traffic of the best situation will be the minimal of all possible cases. The scheme of this paper can effectively improve the success rate of network failure recovery with high utilization of physical resources. It is more extensive than traditional methods.