This study presents an innovative crude oil heating technology by introducing environmentally friendly solar energy into the petroleum industry. By integrating novel combination methods into traditional crude oil heating systems, a versatile and efficient crude oil heating system has been formed. The system was implemented in a refinery and its thermodynamic and economic performance was analyzed. The thermodynamic analysis, employing the exergy analysis method, reveals that among the considered parameters, compressor pressure ratio and Rankine cycle fluid flow rate exert the most significant influence on system efficiency. Overall, the system achieves energy efficiency, exergy efficiency, and waste heat recovery efficiency of 75.99%, 74.13%, and 31.21%, respectively. Within the system, solar collectors, TES tank, and compressor exhibit the highest exergy destruction rates, while pumps demonstrate the lowest exergy destruction rate. The economic analysis, using the annualized cost method, revealed that electricity prices have a significant impact on the economic performance of the system. The variation in system economic parameters is related to the annualized operating cost of the system. The system generates a net annual benefit of 0.591 million US$, with a 4.124-year investment return period. Moreover, Sensitivity analysis explores various factors affecting the crude oil heating system's performance.