In order to accurately grasp the mechanical behavior of the composite beam structure and achieve its refined analysis. In this paper, the stiffness matrix of a new type of spatial grid element is derived using the principle of energy variation. Based on the spatial grid element, a finite element analysis program is written using MATLAB software. A new type of spatial grid element analysis method that can be used for the overall force analysis of composite beam structures as well as the local refined analysis of the structure is proposed. In addition, the internal force, stress and displacement of each part of the composite beam can also be directly obtained. In order to verify the accuracy and reliability of the spatial grid analysis element proposed in this paper. The composite beam in the existing references are used as the analysis object, and the analysis result of the spatial grid element is compared with the references result. The research results show that the analysis results of spatial grid elements have high accuracy and can realize the refined analysis of composite beams.