The rapid charge recombination, low selectivity for two-electron oxygen reduction reaction (ORR), and limited O2 diffusion rate hinder the practical applications of photocatalytic H2 O2 generation. Herein, a triphase photocatalytic system in which the H2 O2 generation occurs at the air-liquid-solid joint interfaces is developed, using polymeric carbon nitride (PCN). The introduction of pyrrole units and cyano group into PCN can promote the activation of oxygen molecules and facilitate the spatial separation of HOMO and LUMO orbits, hence improving the charge carrier separation efficiency and enhancing the formation of H2 O2 . Importantly, the gas-liquid-solid triphase interface system allows for the rapid transport of oxygen from the air to the reaction interface, overcoming the low solubility and slow diffusion of oxygen in the water in conventional liquid reaction systems. The triphase system shows a benchmark H2 O2 generation rate over PCN-based materials in pure water (2063.21µmol g-1 h-1 ), which is an approximate tenfold enhancement as compared to powder photocatalyst (215.44µmol g-1 h-1 ). Simulation and electrochemical tests reveal that the rapid oxygen diffusion rate of triphase interface can promote charge separation and provide more O2 to generate H2 O2 . This work provides a promising strategy for constructing an efficient and sustainable H2 O2 production system.