The rapid growth of the Internet of Vehicles applications leads to unreasonable resource allocation, task computing delay, and large energy consumption. To solve this problem, this paper proposes a computing resource allocation strategy based on mobile edge computing in the Internet of Vehicles environment. Firstly, we analyze the process of mobile edge computing network and resource allocation. Then, it is improved by introducing the Halton sequence into the traditional genetic algorithm, and the difference between populations is reduced by canceling the randomness to generate an initial population with smaller individual differences. Furthermore, by optimizing the parameter setting method of traditional genetic algorithm, the crossover probability and mutation probability that change dynamically with fitness value are given, which improves the accuracy of the algorithm. Finally, the simulation results show that under the premise of the same number of tasks, the average delay and total cost of the proposed strategy are also the smallest. When the number of tasks is 45, the average delay of the proposed method is 0.32 s and the total cost is 0.34, which are better than the comparison method. Simulation results show that the improved algorithm has more advantages in delay and overhead.