This article proposes a large-stroke modularized moving magnet permanent magnet synchronous linear motor (MMT-PMSLM) structure and uses attention mechanism and bidirectional gated recurrent unit (Attention-BiGRU) to quickly and accurately calculate the comprehensive dynamic performance of MMT-PMSLM. The social spider colony intelligence algorithm (SSA) is introduced to optimize the structural parameters of MMT-PMSLM. First, based on the application requirements of linear motor servo system for high dynamic response capability in long stroke, the topology structure of the motor is determined, and the analytical model of motor thrust and dynamic performance is established. Second, a Monte Carlo data sampling space is constructed, and Sobol method is introduced to conduct global sensitivity analysis on structural parameters to evaluate the impact of coupling changes in multiple structural parameters on comprehensive performance and reduce the dimensionality of design variables. Third, attention mechanism is used to improve BiGRU, and sample space is trained and learned to establish a high-precision regression proxy model that maps structural parameters and performance. Based on this model, a multiobjective optimization function of MMT-PMSLM comprehensive dynamic performance is constructed, and the SSA is introduced to iteratively solve the function to obtain the optimal structural parameters. Finally, a prototype is manufactured according to the optimization results, which verifies the feasibility and effectiveness of the proposed modeling optimization method.