the present invention relates to a new pyrrole sulfonyl derivative , and a preparation method and medical use thereof . in particular , the present invention relates to a pyrrole sulfonyl derivative as represented by general formula , a preparation method thereof , a pharmaceutical composition comprising the derivative , and a use thereof as a therapeutic agent , in particular as a gastric acid secretion inhibitor and as potassium - competitive acid blockers , wherein each substituent group of general formula is the same as that defined in the description .