An optical signal processing method, comprising: receiving, by an input port i of an optical cross-connect apparatus, a first optical signal, wherein the input port i is connected to a transmit-end signal processing module i of the optical cross-connect apparatus, the transmit-end signal processing module i is connected to a transmit-end antenna i and a controller of the optical cross-connect apparatus, an output port j of the optical cross-connect apparatus is connected to a receive-end signal processing module j of the optical cross-connect apparatus, the receive-end signal processing module j is connected to a receive-end antenna j and the controller of the optical cross-connect apparatus, N input ports of the optical cross-connect apparatus comprise the input port i, M output ports of the optical cross-connect apparatus comprise the output port j, and N and M are positive integers; performing, based on the first optical signal by the transmit-end signal processing module i of the optical cross-connect apparatus, first phase modulation processing and first frequency mixing processing to obtain a terahertz, THz, signal that carries signal information of the first optical signal, wherein phase adjustment information used during first phase modulation processing comprises first phase adjustment information that matches routing information and that is from the controller, and the routing information comprises port information of the input port i and the output port j; transmitting, by the transmit-end antenna i of the optical cross-connect apparatus, the THz signal; receiving, by the receive-end antenna j of the optical cross-connect apparatus, the THz signal; performing, based on the THz signal by the receive-end signal processing module j of the optical cross-connect apparatus, second phase modulation processing and second frequency mixing processing to obtain a second optical signal that carries the signal information, wherein phase adjustment information used during second phase modulation processing comprises second phase adjustment information that matches the routing information and that is from the controller; and outputting, by the output port j of the optical cross-connect apparatus, the second optical signal. receiving, by an input port i of an optical cross-connect apparatus, a first optical signal, wherein the input port i is connected to a transmit-end signal processing module i of the optical cross-connect apparatus, the transmit-end signal processing module i is connected to a transmit-end antenna i and a controller of the optical cross-connect apparatus, an output port j of the optical cross-connect apparatus is connected to a receive-end signal processing module j of the optical cross-connect apparatus, the receive-end signal processing module j is connected to a receive-end antenna j and the controller of the optical cross-connect apparatus, N input ports of the optical cross-connect apparatus comprise the input port i, M output ports of the optical cross-connect apparatus comprise the output port j, and N and M are positive integers; performing, based on the first optical signal by the transmit-end signal processing module i of the optical cross-connect apparatus, first phase modulation processing and first frequency mixing processing to obtain a terahertz, THz, signal that carries signal information of the first optical signal, wherein phase adjustment information used during first phase modulation processing comprises first phase adjustment information that matches routing information and that is from the controller, and the routing information comprises port information of the input port i and the output port j; transmitting, by the transmit-end antenna i of the optical cross-connect apparatus, the THz signal; receiving, by the receive-end antenna j of the optical cross-connect apparatus, the THz signal; performing, based on the THz signal by the receive-end signal processing module j of the optical cross-connect apparatus, second phase modulation processing and second frequency mixing processing to obtain a second optical signal that carries the signal information, wherein phase adjustment information used during second phase modulation processing comprises second phase adjustment information that matches the routing information and that is from the controller; and outputting, by the output port j of the optical cross-connect apparatus, the second optical signal.