The utility model belongs to the field of mechanical automation engineering, and particularly relates to a pipeline moving mechanism of a variable structure. A plurality of motor transmission mechanisms are evenly distributed in the circumferential direction of a center fixing base, each motor transmission mechanism is connected with the center fixing base through a spring retracting mechanism, and the two sides of each motor transmission mechanism are each provided with a driving mechanism; the radial distance between each motor transmission mechanism and the center fixing base changes along with stretching and retracting of the spring retracting mechanism so as to be self-adaptive to pipelines with different diameters. The pipeline moving mechanism moves in the pipelines with different diameters or variable-diameter pipelines under the driving of the motor transmission mechanisms, and the driving mechanisms on the two sides of at least two motor transmission mechanisms abut against with the inner walls of the pipelines all the time in the moving process. The pipeline moving mechanism is simple and compact in structure, the amount of corollary equipment is small, operation is easy, the mechanism can be self-adaptive to the pipelines with different diameters, and the mechanism can move forwards or backwards in the pipelines and can swerve along with bending of the pipelines.