The invention discloses an indoor positioning method based on four-dimensional code mapping, and the method comprises the steps: (S100), carrying out the Kronecker product of a horizontal-dimensionalfeature vector matrix and a vertical-dimensional feature vector matrix, generating a feature vector matrix of an antenna group, mapping the feature vector matrix into a four-dimensional code, carryingout the matching, obtaining an approximate code word four-dimensional code, and obtaining a pre-coding matrix; (S200), performing beam forming on the base station transmitting signal according to theprecoding matrix of the mobile terminal; and (S300), forming a virtual cell taking the mobile terminal by the to-be-positioned mobile terminal and the antenna group as the center; and forming a van virtual cell taking the mobile middle end as the center with surrounding mobile terminals, constructing an estimation function to obtain a positioning target function, solving the positioning target function by adopting a nonlinear least square algorithm, and taking the coordinate when the positioning target function takes the minimum value as the coordinate of the to-be-positioned mobile terminal.According to the method, beam matching of four-dimensional code mapping is combined with a virtual cell cooperation mode, and indoor real-time space positioning is achieved.