In order to investigate the relationships between the biotoxicity reduction effect of a typical refinery wastewater treatment system (hereafter referred to as system), the types of main toxic substances and the response of functional microorganisms, Vibrio fischeri
and Salmonella Typhimurium
were used as test organisms to examine the acute toxicity and genotoxicity along with the process of the system. Using the toxicity identification evaluations (TIE), we identified the main toxic substances in the system; and using the high-throughput sequencing, we explored the relationship between the microbial functional structure and the main toxic substances. The results showed that ① the biological toxicity showed a decreasing trend along with the process in the system. The influent water of the biochemical treatment unit was slightly toxic in acute toxicity and positive in genotoxicity. The total reduction rate of acute toxicity was 86.514% and the total reduction rate of genotoxicity was 96.221% in oil refinery wastewater. The total reduction rate of acute toxicity was 53.281% and the total reduction rate of genotoxicity was 62.273% in chemical wastewater. ② The TIE results suggested that the main toxic substances in oil refinery wastewater might be cationic metals and non-polar organic substances, and the main toxic substances in chemical wastewater might be cationic metals. ③ Canonical correlation analysis showed that the concentrations of ammonia (r
=0.001), Cr (r
=0.002) and total petroleum hydrocarbon (r
=0.002) were positively correlated with the microbial community structure before the biochemical treatment and negatively correlated with the microbial community structure after the biochemical treatment. ④ Microbial functions changed significantly during the biochemical treatment phases (all p values were ≤ 0.01). The FAPROTAX database predicted a high abundance of microorganisms involved in carbon and nitrogen cycling in seven categories: chemoheterotrophy, aerobic chemoheterotrophy, aromatic compound degradation, nitrite respiration, nitrate reduction, nitrate respiration and nitrogen respiration. The study showed that although the biological toxicity along with the processes in the system decreased, the influent water of the biochemical treatment unit was still slightly toxic in acute toxicity and positive in genotoxicity. The characterization of the toxicity suggested that the main toxic substances in oil refinery wastewater were cationic metals and non-polar organic substances, and the main toxic substances in chemical wastewater were cationic metals. The abundance of functional microorganisms involved in carbon and nitrogen cycling in the biochemical treatment unit was high, indicating potential toxic risk in the biochemical treatment unit.