The invention provides a technology and a system for treating petrochemical wastewater. The technology is characterized in that a treatment method combining primary treatment, secondary treatment, biochemical treatment and deep treatment is adopted, the previous petroleum removal effect is enhanced, and the deep treatment type novel technology combination of 'ozone contact and aeration biologicalfilter tank' is additionally adopted, so that the contents of COD (chemical oxygen demand) and petroleum in the wastewater can be reduced, and the removal effect of petroleum and COD is enhanced; mostof NH3-N, TN, sulfide, volatile phenol and SS (suspended solids) can be removed, the drainage requirement is met, the petrochemical wastewater is effectively treated, and the drained water can stablyreach the standard. The treatment system comprises an adjusting petroleum removal tank, a loading and coagulation petroleum removal device, a coagulation and flocculation air floatation tank, an A/O(anoxic/oxic) biochemical tank, a secondary precipitation tank, a front ozone contact tank, an aeration biological filter tank, a clean water tank and the like. The system has the advantages that according to the conditions, the system can be newly built, or be modified on the original treatment system; the running is stable, the construction cost is effectively reduced, and the running cost is reduced.