Intelligent reflecting surface(IRS)-assisted device-to-device(D2D)communications in heterogeneous cloud radio access network(H-CRAN)were investigated as research background.Resource allocation and Rieman-nian conjugate gradient(RCG)beamforming optimization were studied,with the objective of system sum rate maxi-mization.System sum rate was formulated as the optimization objective,which was subject to several constraint con-ditions such as sub-channel reuse coefficient,transmit power threshold,as well as the modulus of the IRS reflection coefficient.To solve the formulated mixed-integer non-linear programming problem,a channel-strength-based de-ferred acceptance algorithm was proposed to obtain channel reuse indicators.The problem was then decomposed into two subproblems.For transmit power optimization subproblem,successive convex approximation(SCA)was used to solve it.For IRS beamforming optimization subproblem,the beamforming vector constraint was transformed into a complex circular manifold and Riemannian conjugate gradient(RCG)algorithm was implemented to solve it.Simula-tion results show that,when IRS reflecting elements is 50 and base station maximum transmit power is 46 dBm,com-pared with the existing channel allocation scheme and random channel allocation scheme,the proposed scheme en-hances sum rate performance 5.2 bit/(s·Hz)and 14.6 bit/(s·Hz)respectively.Compared with the communication sce-nario without IRS,sum rate performance significantly promotes nearly 31.2 bit/(s·Hz)with the deployment of IRS.