In the petroleum industry, accurately identifying downhole fluid is crucial for understanding fluid composition and estimating crude oil contamination and other properties. Near-infrared (NIR) spectrum analysis technology has achieved successful fluid identification applications due to its non-destructive nature and high efficiency. However, for real-time downhole fluid analysis, the NIR spectrometer faces challenges such as miniaturization and cost effectiveness. To address these issues, we construct a real-time downhole fluid identification system in this work. First, we propose a lightweight and deployable fluid identification model by integrating the successive projections algorithm (SPA) and a quadratic neural network (QNN). The SPA allows for spectral feature selection, and the QNN acts as an efficient identification model. Consequently, we use only four specific wavelengths with a one-hidden-layer QNN to achieve high identification accuracy. Second, we devise a hardware deployment scheme for real-time identification. We use four laser diodes to replace conventional light sources, further saving space. The QNN is then deployed to the STM32 MCU to implement real-time identification. Computational and online experiments demonstrate that our system functions well in real-time fluid identification and can further estimate the oil contamination rate with acceptable error.