Objective The traditional focusing device is restricted by the Abbe diffraction limit. This means that the spatial resolution cannot exceed its theoretical minimum value of 0.5λ/NA, where λ is the working wavelength and NA is the numerical aperture. Existing methods to break the diffraction limit require a nearfield environment, which is insufficient for farfield superresolution imaging in the optical sense. The principle of optical superoscillation states that it is theoretically possible to produce a superresolution spot of arbitrary smallness by rationally modulating the wavefront of incident light. Optical superoscillation has been extensively studied by researchers in superresolution optical lenses, and this principle enables the experimental realization of farfield superresolution focusing. However, the optical field regulation of the superoscillation lens depends on precise nanoprocessing technology. Additionally, the fabrication cost and complexity limit the device to a small size. Thus, we propose a method to generate the farfield superresolution optical field based on the spatial light modulator. The design of the farfield superresolution focusing device is based on the superoscillation principle, with the binary particle swarm optimization algorithm and the angular spectrum diffraction theory combined. The generated focal spot full width at half maximum (FWHM) is smaller than the diffraction limit, which can be employed to construct the farfield superresolution optical field.