A method for processing optical signals, comprising: performing, by a frequency mixer, frequency mixing on received input optical signals; performing, by a photoelectric detector, photoelectric detection on optical signals output by the frequency mixer; performing, by an analog/digital converter, analog/digital conversion on electrical signals output by the photoelectric detector; performing, by a dispersion compensator, dispersion compensation on digital signals output from the analog/digital converter, to obtain first-path electrical signals and second-path electrical signals; performing an initialization update process on filter coefficients of a polarization compensator, and performing, by the polarization compensator, polarization compensation on the first-path electrical signals and the second-path electrical signals by using the filter coefficients on which the initialization update is performed, to obtain initialized x-path electrical signals and initialized y-path electrical signals; wherein the initialization update process refers to update of the filter coefficients in an initialization state; and characterized in that the method further comprises: synchronizing preset x-path training sequences and y-path training sequences by using the initialized x-path electrical signals and the initialized y-path electrical signals; and if a synchronization result indicates that polarization swapping occurs, rectifying the polarization swapping; wherein the rectifying the polarization swapping comprises: exchanging the filter coefficients of the x-path filter for the filter coefficients of the y-path filter. performing, by a frequency mixer, frequency mixing on received input optical signals; performing, by a photoelectric detector, photoelectric detection on optical signals output by the frequency mixer; performing, by an analog/digital converter, analog/digital conversion on electrical signals output by the photoelectric detector; performing, by a dispersion compensator, dispersion compensation on digital signals output from the analog/digital converter, to obtain first-path electrical signals and second-path electrical signals; performing an initialization update process on filter coefficients of a polarization compensator, and performing, by the polarization compensator, polarization compensation on the first-path electrical signals and the second-path electrical signals by using the filter coefficients on which the initialization update is performed, to obtain initialized x-path electrical signals and initialized y-path electrical signals; wherein the initialization update process refers to update of the filter coefficients in an initialization state; and characterized in that the method further comprises: synchronizing preset x-path training sequences and y-path training sequences by using the initialized x-path electrical signals and the initialized y-path electrical signals; and if a synchronization result indicates that polarization swapping occurs, rectifying the polarization swapping; wherein the rectifying the polarization swapping comprises: exchanging the filter coefficients of the x-path filter for the filter coefficients of the y-path filter. synchronizing preset x-path training sequences and y-path training sequences by using the initialized x-path electrical signals and the initialized y-path electrical signals; and if a synchronization result indicates that polarization swapping occurs, rectifying the polarization swapping; wherein the rectifying the polarization swapping comprises: exchanging the filter coefficients of the x-path filter for the filter coefficients of the y-path filter.