An optical transmitter, comprising: a transmitter optical, TO, base, a thermoelectric cooler, TEC, and a heat sink that are transverse and are connected sequentially from bottom to top; a first monitor photodiode, MPD,, a 10 Gigabits per second-directly modulated laser, 10 Gbps-DML, a collimation lens, and a narrowband optical filter that are disposed above the heat sink, wherein the first MPD is integrated into the 10 Gbps-DML, the collimation lens is located between the 10 Gbps-DML and the narrowband optical filter, and one side, which faces the collimation lens, of the narrowband optical filter is connected to the heat sink at a preset oblique tilt angle; a second MPD that is disposed above the narrowband optical filter and optically connected to the narrowband optical filter; and a wavelength locking monitoring circuit connected to a TO pin disposed at one side of the TO base, and a wavelength locking control circuit connected to the wavelength locking monitoring circuit, wherein a forward emitted light emitted by the 10 Gbps-DML laser is input to the narrowband optical filter through the collimation lens, and a backward emitted light emitted by the 10 Gbps-DML is input to the first MPD; and the narrowband optical filter reflects a forward transmitted light, which is split from the forward emitted output light, to the second MPD connected to the narrowband optical filter; the first MPD receives and monitors a first optical power of the backward emitted light, and the second MPD receives and monitors a second optical power of the forward transmitted light; and the wavelength locking monitoring circuit that receives the first optical power and the second optical power by using the TO pin of the TO base separately compares a variation of a wavelength locking factor K0 with a corresponding threshold based on variations of the first optical power and the second optical power, and sends a comparison result to the wavelength locking control circuit, to enable the wavelength locking control circuit to adjust, according to the comparison result and by using the TO pin, a temperature of the TEC to perform wavelength alignment. a transmitter optical, TO, base, a thermoelectric cooler, TEC, and a heat sink that are transverse and are connected sequentially from bottom to top; a first monitor photodiode, MPD,, a 10 Gigabits per second-directly modulated laser, 10 Gbps-DML, a collimation lens, and a narrowband optical filter that are disposed above the heat sink, wherein the first MPD is integrated into the 10 Gbps-DML, the collimation lens is located between the 10 Gbps-DML and the narrowband optical filter, and one side, which faces the collimation lens, of the narrowband optical filter is connected to the heat sink at a preset oblique tilt angle; a second MPD that is disposed above the narrowband optical filter and optically connected to the narrowband optical filter; and a wavelength locking monitoring circuit connected to a TO pin disposed at one side of the TO base, and a wavelength locking control circuit connected to the wavelength locking monitoring circuit, wherein a forward emitted light emitted by the 10 Gbps-DML laser is input to the narrowband optical filter through the collimation lens, and a backward emitted light emitted by the 10 Gbps-DML is input to the first MPD; and the narrowband optical filter reflects a forward transmitted light, which is split from the forward emitted output light, to the second MPD connected to the narrowband optical filter; the first MPD receives and monitors a first optical power of the backward emitted light, and the second MPD receives and monitors a second optical power of the forward transmitted light; and the wavelength locking monitoring circuit that receives the first optical power and the second optical power by using the TO pin of the TO base separately compares a variation of a wavelength locking factor K0 with a corresponding threshold based on variations of the first optical power and the second optical power, and sends a comparison result to the wavelength locking control circuit, to enable the wavelength locking control circuit to adjust, according to the comparison result and by using the TO pin, a temperature of the TEC to perform wavelength alignment.