With the development of technology, the total extent of global pipeline transportation is also increased. However, the traditional long-distance optical fiber prewarning system has poor real-time performance and high false alarm rate when recognizing events threatening pipeline safety. The same vibration signal would vary greatly when collected in different soil environments and this problem would reduce the signal recognition accuracy of the prewarning system. In this paper, we studied this effect theoretically and analyzed soil vibration signals under different soil conditions. Then we studied the signal acquisition problem of long-distance gas and oil pipeline prewarning system in real soil environment. Ultimately, an improved high-intelligence method was proposed for optimization. This method is based on the real application environment, which is more suitable for the recognition of optical fiber vibration signals. Through experiments, the method yielded high recognition accuracy of above 95%. The results indicate that the method can significantly improve signal acquisition and recognition and has good adaptability and real-time performance in the real soil environment.