SUMMARYWith the rapid development of intelligent transportation, vehicle terminals generate a large number of data messages that need to be processed in real time, and the required computing and storage resources far exceed the load capacity of vehicle terminals. Mobile edge computing enables data resources to be processed near device terminals, and provides low‐latency and high‐reliability computing services to meet the power and service quality requirements of terminal devices. Therefore, in order to achieve better data resource management, this paper introduces mobile edge computing technology, and mainly researches secure message transmission optimization algorithms based on mobile edge computing. Firstly, we prioritize secure messages through the analytic hierarchy process. This can guarantee that the most urgent messages get the highest transmission level. Secondly, we establish an optimal task offloading model of delay and energy loss by assigning different weight factors to delay and energy loss. The Lagrangian relaxation method is used to transform the nonconvex problem into a convex problem. We use greedy algorithm to solve the main problem. Finally, the vehicle transmits secure messages through the topology of the local network within its defined communication range. Performance evaluation results show that the scheme not only reduces the redundant transmission of messages, but also improves the performance of end‐to‐end delay and message deliver success ratio of secure messages.