If you pick up a scanner and look at the scan head, you can see a "little mirror" shaking, which is a 1D laser barcode scanner.
The laser emits a laser beam, which is refracted to the swing mirror through the mirror, and then refracted out of the scanner through the swing mirror. The irradiated laser beam appears as a red dot on the medium. The laser point will move extremely fast between points A and B, and what we see with the naked eye is a slender red laser line.
When the laser beam irradiates the barcode, the reflected light will be received by the receiver in the scanning head, and after parsing, it will be displayed in the computer as text information.