###### Abstract  
Faced with a complex working environment, pipelines are prone to nonuniform temperature variations, which cause nonuniform phase changes in the guided wave signals during structural health monitoring, thereby increasing the difficulty of monitoring. To address this, a simulation model is established in this paper to analyze the effects of temperature on material parameters and the variation patterns of guided wave signals. A nonuniform temperature compensation method based on local phase matching is proposed. The algorithm first uses cosine similarity to find the locally best-matched signal segments between the monitoring signal and the baseline signal. Then, an indicator is introduced to quantify the differences between these best-matched signal segments, with the maximum difference considered to be the damage index. Three heating experiments on pipelines with nonuniform temperature fields ranging from 24 \"C to 80 \"  
UGW SHM uses signals from the initial healthy state as a baseline to compare with real-time signals, allowing the detection of damage with higher accuracy than traditional UGW testing. However, this method is highly sensitive to temperature changes, which can alter material geometry and properties like the density, Young's modulus, and Poisson's ratio. These changes affect the wave velocity and particle vibration amplitude, leading to variations in the signal travel time. They also cause the stretching, shifting, and attenuation of the received signals. Ultimately, these effects result in false positives and missed detections, impacting monitoring accuracy [16]. For uniform temperature changes, the optimal baseline subtraction (OBS) [17; 18] and baseline signal stretch (BSS) [19; 20] are the classical temperature compensation methods. The BSS method primarily uses a global stretching factor to scale the entire signal, thereby compensating for phase changes caused by temperature variations. Building on these, researchers have developed numerous improved methods, such as a combination of OBS and BSS, and various enhanced BSS algorithms [14; 18; 19; 21; 22; 23]. With advancements in data and signal processing, algorithms based on orthogonal matching pursuit (OMP) have become widely used in temperature compensation for GUW. [PERSON] et al. [24] developed a method based on matching pursuit (MP) signal analysis and reconstruction schemes. [PERSON] et al. [25] utilized the Hilbert transform to compensate for phase and OMP to compensate for the amplitude of Lamb waves. [PERSON] et al. [26] employed the Hilbert transform and the least squares method. [PERSON] et al. [27] considered the influence of both load and temperature changes, proposing a signal compensation technology based on MP. However, these algorithms either rely on an over-complete signal library or use a single stretching factor, limiting their application to scenarios with uniform temperature changes. In practice, environmental conditions are often complex. When pipelines are shaded by bridges, buildings, vegetation, or hills, uneven sunlight exposure creates nonuniform temperature fields [28]. In such cases, conventional temperature compensation methods struggle to account for the resulting signal variations, significantly restricting their applicability. Research reports on temperature compensation algorithms for nonuniform variations are relatively limited. Dynamic time warping (DTW) [29; 30] algorithms, when compensating for nonuniform temperature changes, are prone to signal overcompensation. This can potentially mask defect information. Additionally, DTW algorithms often require significant computational power, making improvements necessary during implementation [28]. Data-driven compensation algorithms [31], variational autoencoder-based algorithms [32], and neural network-based algorithms [33] are used for nonuniform temperature compensation. These methods require large amounts of data to mitigate the effects of uneven temperature changes.