Large eddy simulation is used to simulate flame acceleration and deflagration to detonation transition of methane-air mixtures in a small-scale 3D channel. The simulation results show the changing of the flame surface 3D structure in the stage of flame acceleration and deflagration to detonation transition. In the first stage, the flame velocity increases exponentially because of the expansion of combustion products and the wrinkle of flame surface. In the next stage, the interaction between flame and pressure wave makes flame accelerate continuously, and the acceleration rate of the flame velocity decreases first and then increases. As the pressure of the leading shock increases, the boundary layer is heated by the preheating area in front of the flame surface at the channel wall. Because the cross section of the channel is square, the ultrafast flame first appears in the boundary layer of the four inner edges between the channel wall, then it appears in the boundary layer on the channel wall. The ultrafast flame generates oblique shock waves continuously moving to the center of the channel and colliding with each other, which promote the occurrence of local explosion and the coupling of flame surface and leading shock wave.