The differential absorption lidar (DIAL) can help us to obtain the vertical distribution of the atmospheric CO2 concentration, which is important to the study of carbon sources and carbon sinks. We design a seeder injected pulsed laser system, working as the laser source of the CO2 DIAL. Unlike the other CO2 DIALs, our laser source is the result of difference frequency of two lasers at the wavelengths of 1064 nm and 634 nm, respectively. It should be pointed out that the high frequency (wavelength) accuracy and stability of the emission laser, especially the on-line one, are greatly required in the CO2 DIAL system. However, the mechanical properties of the dye laser (634 nm) and the application of laser difference frequency technique make the wavelength drift constantly; besides, the extremely unstable energy of the pulsed laser increases the difficulty in identifying and stabilizing the on-line wavelength. Hence, a fast and efficient frequency (wavelength) stabilization method is needed to achieve a stable emission wavelength. Aiming at the research gap of the high precision requirements of on-line laser for this kind of pulsed DIAL, we propose a frequency stabilization method based on matching algorithm. The basic idea is to utilize the saturable absorption of CO2 molecule, by measuring the differential residual-intensity after the laser passing through dual absorption cells to calculate the optical depth (OD) and obtain the so-called pseudo CO2 absorption spectrum, which can be used to identify the on-line laser accurately. Finally, based on the matching algorithm of one-dimensional image, treating the OD as the gray value in the image, we implement the OD matching as a most important part in the process of frequency stabilization, and determine the exact position of the real-time output laser in the measured pseudo absorption spectrum. Thus, when some errors happen to the monitored ODs, by continuously adjusting the wavelength of the laser, the proposed method can fulfill the wavelength adjustment and accomplish the continuous frequency stabilization for on-line laser. Experimental results show that the frequency stabilization algorithm based on OD matching can satisfy the requirements for pulsed on-line laser frequency stabilization, and the sum of squares of deviation method is the optimal one in this application, with a stabilization accuracy of 0.3 pm. Besides, the proposed method can also be introduced in other laser frequency stabilization.