The objective of utilizing mmWave/subTHz bands in next-generation wireless communications is to be achieved. Despite this, since reconfigurable intelligent surface (RIS)-assisted systems depend on the transmission channel configuration, the system architecture design, and the methods used to derive channel state information (CSI) on a base station (BS) and RIS, channel estimation continues to be the main problem with these systems. This research proposes an innovative RIS-based and compressed sensing-based channel estimation technique for the internet of vehicles. To obtain the best phase shift matrix, the communication model must first be constructed, and the angle-of-arrival and departure are utilized. Channel estimation is then performed based on the perception matrix. The training overhead and complexity of the channel estimation are reduced by considering the position information of the vehicles in the optimal phase shift matrix. Simulation results show that the proposed algorithm exhibits better channel estimation and low complexity performance compared with existing algorithms.