The inversion of NMR relaxation time is very important to study object’s molecular dynamics. The inversion is to solve the Fredholm integral equation of the first kind with non-negative constraints, which is known as an ill-posed problem. In this paper, a novel method is presented for NMR inversion based on the regularization method. The proposed objective function can transform the minimization regularization with nonnegative constrains into unconstrained maximization problem, of which the objective function is piecewise, quadratic and differentiable. The generalized Quasi-Newton algorithm is applied to solve the problem and an optimized method to automatically choose regularization parameter is described combining L-curve method with GVS method. The numerical simulations results show that this proposed method is capable of well inversing both 1D and 2D NMR data and obtaining the reliable NMR inversion spectrum even at a low SNR. At last, the proposed method is employed to inverse 2D NMR data from Chinese lacustrine Qingshankou shales with different saturated states. After inversion, the regions on the T1-T2 maps from native, imbibed and dry states chunk samples that are corresponding to water, oil and viscose organic matters can be distinguished accurately.