The present invention relates to a class of thienodiazepine derivatives and an application thereof in the preparation of a drug for the treatment of diseases associated with bromodomain and extra-terminal (BET) Bromodomain inhibitors. Specifically, the present invention relates to compounds represented by formulas (I) and (II), as well as pharmaceutically acceptable salts thereof.