The invention discloses a fluorescent probe: a benzothiazole-terpyridine compound used for distinguishing and detecting zinc ions and cadmium ions. The probe has a structural formula as shown in (I). The compound is prepared by using bromobenzaldehyde and O-aminothiophenol as raw materials, and performing a dehydration cyclization reaction, a coupling reaction and a terpyridine derivative reaction. According to the invention, the raw materials are cheap and easily available, a synthesis route is simple, a yield is relatively high, and the fluorescent probe is high in fluorescence quantum efficiency, and relatively high in heat stability and dissolvability. The probe uses a photoinduced charge transfer mechanism, has different luminescence response for the zinc ions and the cadmium ions, has characteristics of rapid response, high sensitivity and high selectivity, is suitable for food safety inspection, laboratory safety inspection, and especially industrial wastewater monitoring, and has a wide application prospect in environment monitoring, ecological protection, disease diagnosis, industrial production and sewage inspection.