## 1 Introduction  
Superconducting radio-frequency (SRF) cavity technology has become important for modern scientific equipment such as particle accelerators, free electron lasers (FELs), and medical proton therapy systems [1]. Unlike conventional copper cavities, SRF cavities operate at cryogenic temperatures (typically 2-4 K), where superconducting materials, such as niobium, exhibit near-zero resistive losses. This property allows SRF cavities to sustain extremely high accelerating gradients (up to 30 MV/m) while minimizing power dissipation, making them indispensable for modern high-energy applications [2]. The reduced power requirements and compact design enabled by SRF technology have revolutionized accelerator infrastructure, as demonstrated in large-scale projects like the European XFEL [3] and the Linac Coherent Light Source II (LCLS-II) [4]. A critical challenge in SRF cavities is achieving electric field flatness, which directly affects beam quality and acceleration efficiency. Field flatness refers to the uniformity of the axial electric field distribution across multi-cell cavities. Non-uniform fields will induce beam instabilities, increase transverse emittance, elevate the risk of field emission, and limit operational lifetimes [5]. Achieving high field flatness is particularly challenging due to manufacturing tolerances. Even minor deviations in cavity geometry (e.g., cell tilt > 0.1\({}^{\circ}\) or length errors > 0.2 mm) can reduce field flatness by more than 20%, as demonstrated in recent studies on 1.3 GHz elliptical cavities [6]. These challenges necessitate the development of advanced pre-tuning techniques to compensate for geometric imperfections. Similar challenges have driven innovation in SRF cavity tuning in various installations around the world. The 508 MHz TRISTAN cavities at KEK [7] and the 704 MHz cavities at Brookhaven National Laboratory (BNL) [8] utilize semi-automated tuning systems, but these still require significant human intervention. DESY's L-band cavity tuning platform [9] incorporates finite element analysis (FEA) to predict mechanical adjustments but still demands significant manual adjustments and iterative fine-tuning. These challenges highlight the need for a fully automated and high-precision tuning methodology to improve system adaptability and minimize human intervention. The China Spallation Neutron Source (CSNS) is a multidisciplinary research platform that supports studies in material science, physics, chemistry, and life sciences and is the first spallation neutron source independently built in China. The CSNS generates a high neutron flux by directing a 1.6 GeV proton beam at a heavy metal target. It consists of three main components: the high-current proton accelerator, the target station, and the neutron scattering spectrometers. The Phase I construction aimed for a beam power of 100 kW, with an effective pulsed neutron flux of \(2\times 10^{16}\) n/cm\({}^{2}\cdot\)s and a pulse repetition frequency of 25 Hz [10]. The CSNS linear accelerator includes an \(H^{-}\) ion source (IS), a low-energy beam transport (LEBT) line, a radio-frequency quadrupole (RFQ), a medium-energy beam transport (MEBT) line, a drift tube linac (DTL), and a linac-to-ring beam transfer (LRBT) line, and then reaches a rapid cycling synchrotron (RCS). To meet growing user demand, the CSNS-II upgrade will increase the beam power to 500 kW. It will involve adding a superconducting linear accelerator after the existing DTL to increase the injection energy from 80 MeV to 300 MeV while boosting the average beam current from 62.5 \(\mu\)A to 312.5 \(\mu\)A, as illustrated in Figure 1. This upgrade requires 24 six-cell 648 MHz elliptical SRF cavities to accelerate proton beams from 165 MeV to 300 MeV. These cavities are fabricated using niobium stamping followed by precision electron beam welding and must meet stringent mechanical tolerances. Specifically, a coaxial deviation greater than 1 mm reduces field flatness below 96%, while a 0.5 mm length error degrades the field flatness to 70% [11].