Records of the Three Kingdoms
Zhang He, courtesy name Junyi, was from Mo in Hejian. He served Han Fu and then Yuan Shao. After the defeat at Guandu he and Gao Lan burned their camp and surrendered to Cao Cao. He later helped settle Hebei, campaigned against Zhang Lu, and served in Hanzhong. When Xiahou Yuan was killed there, Zhang He rallied the remnants and steadied the front. Cao Cao gave him authority to act.
In 228, during Zhuge Liang’s first northern campaign, Zhang He defeated Ma Su at Jieting and the Shu army withdrew. In 231 Zhuge Liang came out again at Qishan and retreated when the grain failed. Zhang He pursued. Sima Yi had warned him not to go in deep. At Mumen a flying arrow struck him and he died of the wound. Chen Shou says he was known for skill in changing a plan, for reading the state of a battle, and for handling camps.
Romance of the Three Kingdoms
In the novel Zhang He is a famous Wei general. At Jieting he sees the weakness of Ma Su’s camp on the hill. At Mumen the book makes the death a trap Zhuge Liang has already set: Zhang He ignores Sima Yi and pursues, and a storm of arrows kills him.
The histories say only that a flying arrow hit him during the pursuit. That planned ambush is not the fire at Shangfang Gorge. Shangfang Gorge is a separate novel scene aimed at Sima Yi.
Reference: Wikipedia · Zhang He