The origin of ancient door-keeper culture in China is very long, and the earliest record comes from Shan Hai Jing. According to legend, in the period of the Yellow Emperor before Xia, Shang and Zhou Dynasties, there were two people with special functions in the world, Shen Tu and Lei Yu. The difference between these two men is that they are good at catching ghosts, especially evil spirits that endanger the world. Once you meet them, you will be caught and become a monster's dish.
Later, in order to get rid of sneaking around, people carved a fascinating and stagnant look on mahogany to ward off evil spirits and hung it at home. Later, in the process of development, wood carving became too complicated, and Shen Tu and Lei Yu began to be painted as images and pasted on the left and right sides of the gate, which was called the door god by the people. Zong Yi in the Southern Dynasties recorded this custom and legend in detail in the Chronicle of Jingchu.
The legend that Qin Qiong and Weichi Gong became door gods.
As can be seen from the above, the original image of the gatekeeper is not with Weichi Gong, but with, catching ghosts and killing insects for the people. Qin Qiong and Weichi Gong became door gods, but there is no exact record in official historical materials. Now there are three versions of related legends.
The first one is from the Sui and Tang Dynasties.
Legend has it that in the early Tang Dynasty, Emperor Taizong Li Shimin often couldn't sleep at night, which led to insomnia. Later, with weapons, Weichi Gong led soldiers to guard the bedroom of Emperor Taizong at night, and all kinds of monsters that troubled Emperor Taizong suddenly disappeared without a trace.
After that, they kept vigil every day, but it was not a long-term solution. After all, they not only have other important affairs, but in the long run, everyone will be exhausted. Soon, someone had a good idea to hang the portraits of Qin Qiong and Weichi Gong on the door, and the result could have the same effect. So it spread to the people and everyone followed suit. Over time, people formed the custom that Qin Qiong and Weichi Gong were door gods.
The second version happened earlier, but it is the same as the first story. Before Li Shimin unified the world, in order to keep Weichi Gong for his own use, he took a portrait of Liu Wu, the most hated person in Weichi Gong, and made him look at Weichi Gong to show that he had got rid of Liu Wu. Since then, he has been troubled by the ghost of an impostor Liu Daxia. Under the guidance of experts, he hung the portrait of Weichi Gong at the door and drove away the ghost of Liu Wu.
So is Qin Qiong. Portrait was used to drive away the ghost of an old man who was haunting Emperor Taizong, and then it spread slowly and evolved into a very popular folk custom.
The third version is related to Journey to the West. It is said that the Dragon King, who lives in a big river near Chang 'an, violated the dogma, was sentenced to death by the Jade Emperor of Tiangong, and ordered Wei Zhi to be beheaded. The sleek dragon king quietly asked Taizong to intercede, and Li Shimin asked Wei Zhi to play chess in the palace with the intention of obstructing the execution. As a result, this guy Wei Zhi is more cunning, dreaming of execution while taking a nap.