The invention relates to a production line design and optimization method based on digital twinning. The production line design and optimization method comprises the following steps: performing digital process design on a product, integrally planning a production line, constructing and integrating a digital twinning model of the production line, performing simulation verification on a virtual production line, constructing and implementing a physical production line, and performing virtual-real mapping and optimization on the production lines. According to the invention, the digital twinning model is constructed according to three levels of elements, behaviors and rules, and has production line evaluation, evolution and reasoning capabilities; a virtual production line model is established,virtual debugging and simulation operation of the virtual production line are achieved, the production line does not need to be constructed firstly, design risks are avoided, and debugging time is saved; and a virtual-real mapping relationship and an interaction mechanism between the virtual production line and the physical production line are established, statistical analysis is performed on theoperation data of the virtual production line, and optimization and management and control on the physical production line are realized.