A method for generating a two-dimensional barcode picture having a dynamic effect, performed by a terminal device comprising a processor and a memory, the memory storing instructions capable of being executed by the processor, and the method is characterized by comprising: receiving a character string, and encoding the character string into a barcode sequence comprising a plurality of feature bits, each of the feature bits is corresponding to a feature area in a two-dimensional barcode, a feature area is an area depicted in a color different from a background color of the two-dimensional barcode; calculating relative coordinates of the feature bits in a two-dimensional matrix, each element in the two-dimensional matrix is corresponding to a preset area in a preset drawing area; mapping the feature bits to feature areas in the drawing area according to the relative coordinates of the feature bits in the two-dimensional matrix drawing a dynamic picture comprising a plurality of frames which present an animation by using a canvas component according to a preset animation effect definition, the animation comprising a motion effect of pixels whose grayscale value is a pre-determined grayscale value in the drawing area, wherein a frame at an end or a periodic end of the animation is an image having the feature areas in the drawing area filled with pixels whose grayscale value is the pre-determined grayscale value; detecting a long press operation on a display area in which the generated dynamic picture is located; and if such a long press operation is detected generating a cover layer on top of the dynamic picture by using the canvas component, and drawing, by using the canvas component on the cover layer, the feature areas filled with pixels whose grayscale value is the pre-determined grayscale value in the drawing area. receiving a character string, and encoding the character string into a barcode sequence comprising a plurality of feature bits, each of the feature bits is corresponding to a feature area in a two-dimensional barcode, a feature area is an area depicted in a color different from a background color of the two-dimensional barcode; calculating relative coordinates of the feature bits in a two-dimensional matrix, each element in the two-dimensional matrix is corresponding to a preset area in a preset drawing area; mapping the feature bits to feature areas in the drawing area according to the relative coordinates of the feature bits in the two-dimensional matrix drawing a dynamic picture comprising a plurality of frames which present an animation by using a canvas component according to a preset animation effect definition, the animation comprising a motion effect of pixels whose grayscale value is a pre-determined grayscale value in the drawing area, wherein a frame at an end or a periodic end of the animation is an image having the feature areas in the drawing area filled with pixels whose grayscale value is the pre-determined grayscale value; detecting a long press operation on a display area in which the generated dynamic picture is located; and if such a long press operation is detected generating a cover layer on top of the dynamic picture by using the canvas component, and drawing, by using the canvas component on the cover layer, the feature areas filled with pixels whose grayscale value is the pre-determined grayscale value in the drawing area.