An optical switch, comprising: a processor (12, 53), an optical switch matrix and multiple power equalizers, wherein the processor (12, 53) is connected to the optical switch matrix by using an electric bus, the multiple power equalizers each are connected to each output port in the optical switch matrix; and the optical switch matrix comprises N input ports arranged on an input side of the optical switch matrix, wherein N is an integer greater than 2; N output ports arranged on an output side of the optical switch matrix; and multiple optical switch cells that interconnect any input port of the N input ports to any output port of the N output ports, wherein the optical signal received at one input port of the N input ports passes through one or more optical switch cells of the multiple optical switch cells, and reaches one output port of the N output ports; and the optical switch cell comprises a first input port, a first phase shifter, a first output port, a second output port, a first optical coupler, and a second optical coupler, wherein the first input port is connected to one end of the first optical coupler, the other end of the first optical coupler is connected to one end of the first phase shifter and connected to one end of the second optical coupler, the other end of the first phase shifter is connected to the one end of the second optical coupler, and the other end of the second optical coupler is connected to the first output port and the second output port; wherein the first optical coupler is configured to perform optical coupling processing on an optical signal input from the first input port, to split the optical signal into two paths of optical signals, wherein one path of optical signal is input to the first phase shifter, and the other path of optical signal is input to the second optical coupler; the first phase shifter is configured to perform phase processing on the one path of optical signal, so that a phase difference exists between the one path of optical signal on which the first phase shifter has performed phase processing and the other path of optical signal that is input to the second optical coupler; and the second optical coupler is configured to perform optical coupling processing on the two paths of optical signals between which the phase difference exists, to output an optical signal from the first output port and/or the second output port; the processor (12, 53) is configured to determine, according to each input port and a corresponding output port that are preset in the optical switch matrix, output status information of optical switch cells between each input port and the corresponding output port in the optical switch matrix; and the processor (12, 53) is further configured to calculate, according to the determined output statuses of the optical switch cells between each input port and the corresponding output port, a power loss of the path of optical signal output from each output port, generate a power equalizer control signal by means of calculation according to a value of the power loss, and send the control signal to a power equalizer connected to the corresponding output port; and the power equalizer is configured to perform power compensation according to the power loss, sent by the processor (12, 53), of the optical signal output from the output port connected to the power equalizer.