A pilot locking apparatus, comprising: a first determining unit, configured to determine a pilot operating point of an optical modulator that is currently on a response curve, wherein the optical modulator is configured to modulate, a transmitted electrical signal into which an electrical pilot signal is loaded, onto an optical signal, to generate a transmitted optical signal; and a second determining unit, configured to: if a value of the pilot operating point is less than a first threshold, determine a target initial amplitude of the electrical pilot signal based on a correspondence between a modulation depth of a first harmonic frequency component of an optical pilot signal that is output after the electrical pilot signal is modulated by the optical modulator and an initial amplitude of the electrical pilot signal, and a target modulation depth of the optical pilot signal, wherein the correspondence between the modulation depth of the first harmonic frequency component of the optical pilot signal that is output after the electrical pilot signal is modulated by the optical modulator and the initial amplitude of the electrical pilot signal is determined according to a transfer function of the optical modulator, or is determined by emulating or testing the optical modulator; and a third determining unit, configured to: if a value of the pilot operating point is greater than or equal to a first threshold, determine a target initial amplitude of the electrical pilot signal based on a correspondence between a modulation depth of a second harmonic frequency component of the optical pilot signal that is output after the electrical pilot signal is modulated by the optical modulator and the initial amplitude of the electrical pilot signal, and a target modulation depth of the optical pilot signal, wherein the correspondence between the modulation depth of the second harmonic frequency component of the optical pilot signal that is output after the electrical pilot signal is modulated by the optical modulator and the initial amplitude of the electrical pilot signal is determined according to a transfer function of the optical modulator, or is determined by emulating or testing the optical modulator. a first determining unit, configured to determine a pilot operating point of an optical modulator that is currently on a response curve, wherein the optical modulator is configured to modulate, a transmitted electrical signal into which an electrical pilot signal is loaded, onto an optical signal, to generate a transmitted optical signal; and a second determining unit, configured to: if a value of the pilot operating point is less than a first threshold, determine a target initial amplitude of the electrical pilot signal based on a correspondence between a modulation depth of a first harmonic frequency component of an optical pilot signal that is output after the electrical pilot signal is modulated by the optical modulator and an initial amplitude of the electrical pilot signal, and a target modulation depth of the optical pilot signal, wherein the correspondence between the modulation depth of the first harmonic frequency component of the optical pilot signal that is output after the electrical pilot signal is modulated by the optical modulator and the initial amplitude of the electrical pilot signal is determined according to a transfer function of the optical modulator, or is determined by emulating or testing the optical modulator; and a third determining unit, configured to: if a value of the pilot operating point is greater than or equal to a first threshold, determine a target initial amplitude of the electrical pilot signal based on a correspondence between a modulation depth of a second harmonic frequency component of the optical pilot signal that is output after the electrical pilot signal is modulated by the optical modulator and the initial amplitude of the electrical pilot signal, and a target modulation depth of the optical pilot signal, wherein the correspondence between the modulation depth of the second harmonic frequency component of the optical pilot signal that is output after the electrical pilot signal is modulated by the optical modulator and the initial amplitude of the electrical pilot signal is determined according to a transfer function of the optical modulator, or is determined by emulating or testing the optical modulator.