A nitrogen-containing compound, wherein the structural general formula of the nitrogen-containing compound is as shown in a Formula 1: wherein, represents a chemical bond, A is selected from substituted or unsubstituted aryl with 6 to 30 carbon atoms, and substituted or unsubstituted heteroaryl with 3 to 30 carbon atoms, B is selected from a structure shown in a Formula 2-1 or a structure shown in a Formula 2-2; U 1, U 2 and U 3 are selected from N; each of R 1, R 2, R 3, R 4 and R 5 is respectively and independently selected from hydrogen, deuterium, a halogen group, cyano, aryl with 6 to 12 carbon atoms, heteroaryl with 5 to 12 carbon atoms, alkyl with 1 to 5 carbon atoms, haloalkyl with 1 to 5 carbon atoms, and cycloalkyl with 3 to 10 carbon atoms; n 1 represents the number of a substituent R 1, n 1 is selected from 1, 2 or 3, and when n 1 is greater than 1, any two R 1 are the same or different; n 2 represents the number of a substituent R 2, n 2 is selected from 1, 2, 3 or 4, when n 2 is greater than 1, any two R 2 are the same or different, and alternatively, any two adjacent R 2 form a ring; n 3 represents the number of a substituent R 3, n 3 is selected from 1, 2, 3 or 4, and when n 3 is greater than 1, any two R 3 are the same or different; n 4 represents the number of a substituent R 4, n 4 is selected from 1 or 2, and when n 4 is greater than 1, any two R 4 are the same or different; n 5 represents the number of a substituent R 5, n 5 is selected from 1, 2, 3 or 4, and when n 5 is greater than 1, any two R 5 are the same or different; X is selected from S or O; L, L 1, L 2, L 3 and L 4 are the same or different, and are each independently selected from a single bond, substituted or unsubstituted arylene with 6 to 30 carbon atoms, and substituted or unsubstituted heteroarylene with 3 to 30 carbon atoms; An and Ar 2 are the same or different, and are each independently selected from substituted or unsubstituted aryl with 6 to 30 carbon atoms, and substituted or unsubstituted heteroaryl with 3 to 30 carbon atoms; substituents in the A, L, L 1, L 2, L 3, L 4, An and Ar 2 are the same or different, and are each independently selected from deuterium, a halogen group, cyano, heteroaryl with 3 to 20 carbon atoms, aryl with 6-20 carbon atoms, trialkylsilyl with 3-12 carbon atoms, alkyl with 1 to 10 carbon atoms, haloalkyl with 1 to 10, cycloalkyl with 3 to 10 carbon atoms, heterocycloalkyl with 2 to 10 carbon atoms, and alkoxy with 1 to 10 carbon atoms; alternatively, in An and Ar 2, any two adjacent substituents form a ring. B is selected from a structure shown in a Formula 2-1 or a structure shown in a Formula 2-2; U 1, U 2 and U 3 are selected from N; each of R 1, R 2, R 3, R 4 and R 5 is respectively and independently selected from hydrogen, deuterium, a halogen group, cyano, aryl with 6 to 12 carbon atoms, heteroaryl with 5 to 12 carbon atoms, alkyl with 1 to 5 carbon atoms, haloalkyl with 1 to 5 carbon atoms, and cycloalkyl with 3 to 10 carbon atoms; n 1 represents the number of a substituent R 1, n 1 is selected from 1, 2 or 3, and when n 1 is greater than 1, any two R 1 are the same or different; n 2 represents the number of a substituent R 2, n 2 is selected from 1, 2, 3 or 4, when n 2 is greater than 1, any two R 2 are the same or different, and alternatively, any two adjacent R 2 form a ring; n 3 represents the number of a substituent R 3, n 3 is selected from 1, 2, 3 or 4, and when n 3 is greater than 1, any two R 3 are the same or different; n 4 represents the number of a substituent R 4, n 4 is selected from 1 or 2, and when n 4 is greater than 1, any two R 4 are the same or different; n 5 represents the number of a substituent R 5, n 5 is selected from 1, 2, 3 or 4, and when n 5 is greater than 1, any two R 5 are the same or different; X is selected from S or O; L, L 1, L 2, L 3 and L 4 are the same or different, and are each independently selected from a single bond, substituted or unsubstituted arylene with 6 to 30 carbon atoms, and substituted or unsubstituted heteroarylene with 3 to 30 carbon atoms; An and Ar 2 are the same or different, and are each independently selected from substituted or unsubstituted aryl with 6 to 30 carbon atoms, and substituted or unsubstituted heteroaryl with 3 to 30 carbon atoms; substituents in the A, L, L 1, L 2, L 3, L 4, An and Ar 2 are the same or different, and are each independently selected from deuterium, a halogen group, cyano, heteroaryl with 3 to 20 carbon atoms, aryl with 6-20 carbon atoms, trialkylsilyl with 3-12 carbon atoms, alkyl with 1 to 10 carbon atoms, haloalkyl with 1 to 10, cycloalkyl with 3 to 10 carbon atoms, heterocycloalkyl with 2 to 10 carbon atoms, and alkoxy with 1 to 10 carbon atoms; alternatively, in An and Ar 2, any two adjacent substituents form a ring.