The SXFEL has stringent restrictions on beam emittance growth, and the traditional optical alignment can no longer meet its requirements, but the beam-based alignment(BBA) method allows more precise alignment, further reducing the linac errors to meet SXFEL requirements. In undulator sections, orbit changes are not only caused by misalignments of quadrupole magnet position, but also the errors of undulator magnet. In order to achieve alignment accuracy over long distance, the quadrupole magnet errors and beam position monitor (BPM) offset are obtained by measuring. BPM data under different conditions and using SVD algorithm for calculation and analysis,With the method above, software based on Matlab has been designed and comparedwith other software simulation results demonstrate that the orbit offset could be reduced by one order.