Efficient truck dispatching is crucial for container port operations. Dynamic container port truck dispatching, a complex online optimization problem, poses significant challenges due to its uncertain and non-linear nature. This paper presents a novel neural network assisted genetic programming (NN-GP) approach, which combines the global search of genetic programming (GP) and the local search of recurrent neural network (RNN). In this framework, the RNN further refines GP individuals after genetic operations (crossovers and mutations), enhancing solution adaptability and precision in response to dynamic and uncertain scenarios. The proposed method leverages RNN's understanding of temporal dynamics and GP's robust exploration of the solution space, effectively addressing the dynamic container truck dispatching problem. Experiments using real-world container port data demonstrate that the RNN-GP model outperforms traditional heuristic methods and standalone GP algorithms, reducing dispatching time and increasing port efficiency. This research highlights the potential of hybridizing machine learning techniques with GP in solving complex real-world optimization problems.