An optical switch, comprising a first optical waveguide, a second optical waveguide, and a first heater, wherein a place at which a distance between the first optical waveguide and the second optical waveguide is the smallest is a junction, the first optical waveguide comprises a first optical sub-waveguide and a third optical sub-waveguide, and the second optical waveguide comprises a second optical sub-waveguide and a fourth optical sub-waveguide; the first heater is adjacent to the third optical sub-waveguide; and there is a first dielectric material between the first heater and the third optical sub-waveguide, and there is a second dielectric material between the third optical sub-waveguide and the fourth optical sub-waveguide, wherein a thermal conductivity of the first dielectric material is greater than a thermal conductivity of the second dielectric material, wherein when the first heater is operating, a temperature of the third optical sub-waveguide at a place that is at a distance from the junction is higher than a temperature of the third optical sub-waveguide at a place that is near the junction, wherein the optical switch further comprises: a second heater, wherein the second heater is adjacent to the third optical sub-waveguide, there is the first dielectric material between the second heater and the third optical sub-waveguide, a distance between the second heater and the junction is greater than a distance between the first heater and the junction such that the second heater is farther away from the junction than the first heater, and a heating power of the second heater is greater than a heating power of the first heater, wherein being adjacent to the third optical sub-waveguide specifically comprises: being on an outer side of the third optical sub-waveguide, wherein the outer side of the third optical sub-waveguide is a side not adjacent to the fourth optical sub-waveguide; and wherein a temperature difference between the third optical sub-waveguide and the fourth optical sub-waveguide gradually increases from the junction; when the first heater and the second heater are located on the outer side of the third optical sub-waveguide, so that the first heater and the second heater are farther away from the fourth optical sub-waveguide and the temperature difference between the third optical sub-waveguide and the fourth optical sub-waveguide is larger. a place at which a distance between the first optical waveguide and the second optical waveguide is the smallest is a junction, the first optical waveguide comprises a first optical sub-waveguide and a third optical sub-waveguide, and the second optical waveguide comprises a second optical sub-waveguide and a fourth optical sub-waveguide; the first heater is adjacent to the third optical sub-waveguide; and there is a first dielectric material between the first heater and the third optical sub-waveguide, and there is a second dielectric material between the third optical sub-waveguide and the fourth optical sub-waveguide, wherein a thermal conductivity of the first dielectric material is greater than a thermal conductivity of the second dielectric material, wherein when the first heater is operating, a temperature of the third optical sub-waveguide at a place that is at a distance from the junction is higher than a temperature of the third optical sub-waveguide at a place that is near the junction, wherein the optical switch further comprises: a second heater, wherein the second heater is adjacent to the third optical sub-waveguide, there is the first dielectric material between the second heater and the third optical sub-waveguide, a distance between the second heater and the junction is greater than a distance between the first heater and the junction such that the second heater is farther away from the junction than the first heater, and a heating power of the second heater is greater than a heating power of the first heater, wherein being adjacent to the third optical sub-waveguide specifically comprises: being on an outer side of the third optical sub-waveguide, wherein the outer side of the third optical sub-waveguide is a side not adjacent to the fourth optical sub-waveguide; and wherein a temperature difference between the third optical sub-waveguide and the fourth optical sub-waveguide gradually increases from the junction; when the first heater and the second heater are located on the outer side of the third optical sub-waveguide, so that the first heater and the second heater are farther away from the fourth optical sub-waveguide and the temperature difference between the third optical sub-waveguide and the fourth optical sub-waveguide is larger. being on an outer side of the third optical sub-waveguide, wherein the outer side of the third optical sub-waveguide is a side not adjacent to the fourth optical sub-waveguide; and wherein a temperature difference between the third optical sub-waveguide and the fourth optical sub-waveguide gradually increases from the junction; when the first heater and the second heater are located on the outer side of the third optical sub-waveguide, so that the first heater and the second heater are farther away from the fourth optical sub-waveguide and the temperature difference between the third optical sub-waveguide and the fourth optical sub-waveguide is larger.