The invention relates to a method based on edge computing and an Actor-Critic algorithm. The specific steps are as follows: in the vehicle networking communication system, the user sequence is {1, 2,..., k,..., K}, and there are K users; the subchannel sequence is {1, 2,..., n,..., N} with N subchannels; fog access node sequence {1, 2,..., m,... M}, total M access nodes, computing power sequence of incoming nodes {1, 2,... Cm,..., cM}; task sequence {1, 2,... tk,..., tK} uploaded by user, total tK tasks; a non-orthogonal multiple access (NOMA) mode is adopted to connect the user to the vehiclenetworking communication system. The task uploaded by the user carries out edge calculation and returns the calculation result to the user; taking advantage of actor-Critic algorithm to optimize theresource allocation method and get the best resource allocation method. The invention combines the non-orthogonal multiple access, the edge calculation and the reinforcement learning, effectively solves the problem of huge access quantity existing in the vehicle networking, simultaneously reduces the time delay in the whole communication process, obtains the best resource distribution mode under different environments, and improves the energy utilization efficiency.