Curved crystal technology is a key technology in the field of X-ray fluorescence trace detection. To detect trace sulfur, chlorine, and silicon in oil, the key parameters of Johann-type graphite curved crystal design were calculated based on geometrical optics theory and mathematical modeling, and a curved crystal optical system was designed. Subsequently, the hardware, firmware, software, and mechanical structure were designed according to specific requirements. Following the development of the relevant equipment, laboratory tests were performed on standard petroleum samples. Experimental results show that technology based on bent crystals can significantly reduce the detection limit of the instrument, and the detection limit of sulfur, chlorine, and silicon can reach below 1 ppm. In accordance with the experimental results, possible interference factors were analyzed, and suitable solutions were proposed. The performance of the proposed system was thus directly verified, showcasing its applicability in detecting trace elements.