An optical switch, wherein the optical switch is disposed on a substrate, and the optical switch comprises a first waveguide, a second waveguide, and a movable waveguide; the first waveguide is immovable relative to the substrate, the first waveguide comprises a first input section and a first output section, a first input port IP1 of the first waveguide is located at one end of the first input section, a first output port OP1 of the first waveguide is located at one end of the first output section, and the other end of the first input section is connected to the other end of the first output section; the second waveguide is immovable relative to the substrate, the second waveguide comprises a second input section and a second output section, a second input port IP2 of the second waveguide is located at one end of the second input section, a second output port OP2 of the second waveguide is located at one end of the second output section, the other end of the second input section is connected to the other end of the second output section, both the first waveguide and the second waveguide are located in a first plane, and an optical coupling relationship exists between the first waveguide and the second waveguide; along a transmission direction of an optical signal, both an effective refractive index of the first input section and an effective refractive index of the first output section gradually decrease, and both an effective refractive index of the second input section and an effective refractive index of the second output section gradually increase, and the effective refractive indexes of the first waveguide and the second waveguide are adjusted by changing the cross-section structures of the first waveguide and the second waveguide; the movable waveguide is movable relative to the substrate; when the movable waveguide is located at a first location, the movable waveguide is optically decoupled from the first waveguide, an effective refractive index at a junction of the first input section and the first output section is equal to an effective refractive index at a junction of the second input section and the second output section; and the IP1 and the OP2 are optically connected, the IP2 and the OP1 are optically connected, the IP1 and the OP1 are optically blocked, and the IP2 and the OP2 are optically blocked; and when the movable waveguide is located at a second location, the movable waveguide is optically coupled to the first output section, the effective refractive index of the first output section and the movable waveguide that are considered as a whole is greater than the effective refractive index of the second output section; and the IP1 and the OP1 are optically connected, the IP2 and the OP2 are optically connected, the IP1 and the OP2 are optically blocked, and the IP2 and the OP1 are optically blocked. the first waveguide is immovable relative to the substrate, the first waveguide comprises a first input section and a first output section, a first input port IP1 of the first waveguide is located at one end of the first input section, a first output port OP1 of the first waveguide is located at one end of the first output section, and the other end of the first input section is connected to the other end of the first output section; the second waveguide is immovable relative to the substrate, the second waveguide comprises a second input section and a second output section, a second input port IP2 of the second waveguide is located at one end of the second input section, a second output port OP2 of the second waveguide is located at one end of the second output section, the other end of the second input section is connected to the other end of the second output section, both the first waveguide and the second waveguide are located in a first plane, and an optical coupling relationship exists between the first waveguide and the second waveguide; along a transmission direction of an optical signal, both an effective refractive index of the first input section and an effective refractive index of the first output section gradually decrease, and both an effective refractive index of the second input section and an effective refractive index of the second output section gradually increase, and the effective refractive indexes of the first waveguide and the second waveguide are adjusted by changing the cross-section structures of the first waveguide and the second waveguide; the movable waveguide is movable relative to the substrate; when the movable waveguide is located at a first location, the movable waveguide is optically decoupled from the first waveguide, an effective refractive index at a junction of the first input section and the first output section is equal to an effective refractive index at a junction of the second input section and the second output section; and the IP1 and the OP2 are optically connected, the IP2 and the OP1 are optically connected, the IP1 and the OP1 are optically blocked, and the IP2 and the OP2 are optically blocked; and when the movable waveguide is located at a second location, the movable waveguide is optically coupled to the first output section, the effective refractive index of the first output section and the movable waveguide that are considered as a whole is greater than the effective refractive index of the second output section; and the IP1 and the OP1 are optically connected, the IP2 and the OP2 are optically connected, the IP1 and the OP2 are optically blocked, and the IP2 and the OP1 are optically blocked.