To address the problem of low cache hit ratio in edge nodes for privacy-preserving in the Internet of Vehicles (IoV), a deep deterministic policy gradient caching (DDPGC) method was proposed. First, a taxi certified by a trusted authority acted as a second-level caching edge node to acquire hotspot data and store it in the local cache. It then broadcasted this information to the neighboring service requesting vehicles (SRVs). SRVs cached the broadcasted data locally and search for service requests in the order of priority of local cache, taxi, and cloud server when such requests arise. Secondly, a neural network was deployed in taxis and SRVs to maximize the caching benefit through deep reinforcement learning for decision replacement of their cached data. Finally, when SRVs were located in vehicle sparsity and could not obtain request data from neighboring vehicles, a combination of k-anonymity and random response perturbation mechanisms generated anonymity sets to send requests to cloud servers in an anonymous manner to obtain services while protecting user location privacy. Simulation experimental results show that DDPGC can effectively improve the vehicle cache hit ratio, reduce the frequency of SRV interaction with the cloud server, and effectively protect user privacy security.