An optical switching apparatus, comprising an input collimator and an output collimator, and further comprising an input polarization beam splitter, an input quarter-wave plate, an output quarter-wave plate, an output polarization beam splitter, and an N×N liquid crystal grating array, wherein N is an integer greater than or equal to 2; the input polarization beam splitter is disposed between the input collimator and the input quarter-wave plate, and is configured to: split an input optical signal from the input collimator into two optical signals having different polarization directions, and output, to the input quarter-wave plate, the two optical signals having different polarization directions; the input quarter-wave plate is disposed between the input polarization beam splitter and the N×N liquid crystal grating array, and is configured to: receive the two optical signals having different polarization directions from the input polarization beam splitter, couple the two optical signals having different polarization directions into circularly polarized light, and output the circularly polarized light to the N×N liquid crystal grating array; the N×N liquid crystal grating array is disposed between the input quarter-wave plate and the output quarter-wave plate, and is configured to: receive the circularly polarized light from the input quarter-wave plate by using a liquid crystal grating that is in the N×N liquid crystal grating array and that is corresponding to the input quarter-wave plate, and output the circularly polarized light to the selected output quarter-wave plate through a selected transmission path, wherein the selected transmission path is selected by setting a voltage for a liquid crystal grating in the N×N liquid crystal grating array; the output quarter-wave plate is disposed between the N×N liquid crystal grating array and the output polarization beam splitter, and is configured to: split the circularly polarized light from the N×N liquid crystal grating array into two optical signals having different polarization directions, and output, to the output polarization beam splitter, the two optical signals having different polarization directions; and the output polarization beam splitter is disposed between the output quarter-wave plate and the output collimator, and is configured to couple, into the output collimator, the two optical signals having different polarization directions from the output quarter-wave plate, wherein: the liquid crystal gratings in the N×N liquid crystal grating array comprise N×N switchable polarization gratings; for any switchable polarization grating in the N×N switchable polarization gratings, when a voltage applied between both ends of the any switchable polarization grating is less than a first threshold voltage, liquid crystal molecules in the any switchable polarization grating form a liquid crystal grating to diffract incident light; or when a voltage between both ends of the any switchable polarization grating is greater than or equal to a first threshold voltage, the liquid crystal molecules deflect toward a direction of an electric field caused by the voltage between both ends of the any switchable polarization grating, and a grating effect disappears; and in the N×N switchable polarization gratings, a voltage between both ends of a switchable polarization grating that does not need to deflect the incident light is set to being greater than or equal to the first threshold voltage, and a voltage between both ends of a switchable polarization grating that needs to deflect the incident light is set to being less than the first threshold voltage, wherein the switchable polarization grating that needs to deflect the incident light is a switchable polarization grating that is corresponding to the input quarter-wave plate and corresponding to the output quarter-wave plate, and the switchable polarization grating that does not need to deflect the incident light is a switchable polarization grating, except the switchable polarization grating that needs to deflect the incident light, in an N×N switchable polarization grating array, wherein the liquid crystal gratings in the N×N liquid crystal grating array further comprise N×N liquid crystal plates, each liquid crystal plate is corresponding to each switchable polarization grating to form a switchable polarization grating/liquid crystal plate combination, and each liquid crystal plate is configured to control a polarized state of an optical signal incident into the liquid crystal plate, so that after signal light and cross-talk light from a switchable polarization grating corresponding to the liquid crystal plate pass the liquid crystal plate, a circularly polarized state of output signal light is opposite to a circularly polarized state of output cross-talk light, wherein the polarized state of the optical signal incident into the liquid crystal plate is controlled by setting a voltage between both ends of the liquid crystal plate.