The study of Internet of Vehicle (IoV) based on Fog Computing (FC) and Artificial Intelligent (AI) has attracted more and more attention. However, there are still many problems require to investigate such as time-critical, scalability, load-balancing, energy consumption, and so on. Focusing on these problems, we proposed an AI-based Vehicle-to-Everything (V2X) model for tasks and resource offloading model for IoVs network, which ensures reliable low-latency communication efficient tasks offloading in IoV network by using Software Defined Vehicular based FC (SDV-F) architecture. To fit to time-critical data transmission task distribution, the proposed model reduces unnecessary task allocation at the fog computing layer by proposing an AI-based task-allocation algorithm in IoV layer to implement task allocation of each vehicle. By applying AI technologies of Reinforcement Learning (RL), Markov decision process, and Deep Learning (DL), the proposed model intelligently makes decision on maximizing resource utilization at the fog layer, and minimizing the average end-to-end delay of time-critical IoV applications. The experiment demonstrates the proposed model can efficiently distribute the fog layer tasks while minimizing the delay.