In this paper, a nondestructive cavity-based scheme is proposed to achieve high-resolution bunch length measurement in the Super Tau-Charm Facility (STCF) transport line. By extracting the TM010 and TM020 mode signals excited by the beam within a single pillbox cavity, a beam spectrum can be obtained to deduce the Root-Mean-Square (RMS) bunch length. This scheme is more spatially compact compared to the traditional method using double cavities. In this study, the basic principles of the cavity-based bunch length measurement method are explained, the monitor layout is introduced, and the design methods for the cavity and electronics are described. A prototype cavity was machined. Offline tests demonstrate that the eigenmodes in the cavity meet the design requirements and can be used for the bunch length measurements. Based on the online signal characteristics of the Cavity Beam Position Monitors (CBPMs) and the beam parameters of the STCF, the performance of this measurement method is evaluated. For picosecond-level bunches in the STCF transport line, this scheme can provide a bunch length measurement resolution of 233.5 fs at 1.5 nC.