With the continuous development of distributed optical fiber sensing technology, the Brillouin Optical Time Domain Reflectometry (BOTDR) system, due to its single-ended monitoring characteristics, electromagnetic interference immunity, and real-time sensing capabilities for temperature/ strain changes, has become increasingly applied in structural health monitoring fields, particularly in large infrastructures such as bridges, dams, and subway tunnels. However, the weak spontaneous Brillouin scattering limits the performance of the BOTDR system. Increasing the input optical pulse energy enhances the scattering effect; however, if the energy exceeds a certain threshold, stimulated Brillouin scattering can deplete the pulse energy rapidly, reducing the sensing distance and impacting the system's performance. Factors such as the length, type, and condition of the distributed sensing fiber, as well as the linewidth and power of the light source in the BOTDR system, affect the stimulated Brillouin scattering threshold. Therefore, how to optimize the system's detection performance under varying stimulated threshold conditions is a key issue for compact and cost-effective BOTDR systems in practical engineering applications. This paper presents an automated detection method for identifying stimulated Brillouin scattering in optical fibers. The technique leverages Short-Time Fourier Transform (STFT)-based optoelectronic demodulation and advanced signal processing. Its primary goal is to optimize the sensing distance for localized Stimulated Brillouin Optical Time-Domain Reflectometry (BOTDR) systems. The method uses an optoelectronic demodulation device to collect the raw time-domain Brillouin scattering signal along the fiber to be tested, applying STFT processing to obtain the Brillouin Gain Spectrum (BGS). By analyzing the peak intensity distribution of the BGS, a Brillouin peak intensity map along the fiber is plotted. A moving average method is used to remove random noise, followed by polynomial fitting to obtain the first-and second-order derivative curves. The zero-crossings of the second-order derivative are identified to locate the potential stimulated Brillouin scattering points. The first-order derivative values at these points are compared with a preset threshold 6 to confirm the actual location of stimulated Brillouin scattering. To improve accuracy, the RMSE of the Brillouin peak intensity distribution in the denoised fiber section is calculated. The difference between the maximum and minimum values is computed and then divided by the window length h to derive the error threshold 6 for linear fitting. In a 2 000 m fiber with a 20 ns pulse width and 20 kHz frequency, when the EDFA1 output power is 0.69 mW, stimulated Brillouin scattering occurred at a specific location of 1 230.2 m. The root mean square error of the Brillouin Frequency Shift (BFS) along the fiber indicated a deterioration in the signal-to-noise ratio after stimulated scattering, validating the effectiveness of the proposed signal processing method. The study further investigated the effects of pulse width, frequency, and fiber length on the location of stimulated scattering. Using a 2 000 m fiber with a 50 ns pulse width and 20 kHz frequency, with EDFA1 output power at 0.876 mW, the stimulated scattering occurred at 1 500.2 m. For a 2 000 m fiber with a 20 ns pulse width and 10 kHz frequency, with EDFA1 output power at 1.197 mW, the stimulated scattering occurred at 1 090.2 m. For a 1 009 m fiber with a 20 ns pulse width and 20 kHz frequency, with EDFA1 output power at 0.69 mW, the stimulated scattering occurred at 780.2 m. The results indicate that reducing pulse width or frequency advances the stimulated scattering position. Additionally, temperature experiments were conducted with a 2 000 m fiber, heating it to 50 degrees C in a water bath at 300 m and 800 m locations. The specific location of stimulated scattering was found to be 1 170.2 m. Using this method, it is possible to further determine the optimal sensing distance for low-cost BOTDR systems that utilize localized stimulated scattering, specifically for applications at construction sites. It can guide the configuration of the optimal sensing fiber length, determine the stimulated scattering threshold for the system, and fully leverage the performance of low-cost BOTDR systems. It overcomes the cost and applicability limitations of traditional technologies in practical applications, providing an economic, efficient, and adaptable monitoring solution for Brillouin fiber sensing technology in engineering applications. This method meets the needs of various standard construction monitoring applications.