Due to the rapid development of the IoT and data-driven applications, low-latency task scheduling methods that quickly respond to user tasks has become a significant challenge for edge servers. However, the existing task scheduling strategies do not overcome the impact of factors such as task characteristics, resource availability, and network conditions on delays. Meanwhile, the cross-regional maldistribution of edge servers is obvious, and the edge servers are either idle or overloaded. To address these issues, we propose a low-latency edge scheduling strategy based on the Hard Attention Mechanism and Advantage Actor-Critic (HA-A2C). The core element of this method is the adoption of a hard attention mechanism, which reduces computing complexity and increases efficiency. Effective attention allocation during the resource allocation process further reduces job completion time. Additionally, the deep reinforcement learning method is employed to enhance task dynamic scheduling capabilities, thereby reducing scheduling delays. The HA-A2C approach reduces task latency by approximately 40% compared to the DQN method. Consequently, the intelligent allocation of task resources achieved by integrating the hard attention technique significantly reduces task scheduling time in edge environments.