The invention provides a class of compounds represented by formula (I), having bifunctional active quaternary ammonium salt structure of a β2-adrenoreceptor agonist and an M receptor antagonist, a pharmaceutically acceptable salt, solvate, and optical isomer thereof. A pharmaceutical composition comprising such a compound with quaternary ammonium salt structure, a method for preparing such a compound with quaternary ammonium salt structure and an intermediate thereof, and uses thereof in treating pulmonary disorders are also provided. The compounds of the invention have high selectivity to the M receptor subtype, and have less adverse reaction and lower toxic and side effects in the treatment of pulmonary diseases such as COPD and asthma.