The invention provides an anti-counterfeit and traceability two-dimensional code generation method, a terminal and a medium. The method includes the following steps: receiving an operation instructionof a user, and opening WeChat; receiving a login instruction of the user, and entering a registration and login interface; receiving identity information input by the user, and completing user registration and login; receiving product information and product packaging level information entered by the user, saving the product information and the product packaging level information to a database, and generating two-dimensional code data according to the product packaging level information, the product information and a selected code file level; saving the two-dimensional code data to the database; and generating a downloading address corresponding to the two-dimensional code data, and sharing the downloading address to the user. Thus, special two-dimensional code data can be generated for entered product information, and an anti-counterfeit effect can be achieved based on the unique nature of the two-dimensional code. In addition, there is only the need to share the downloading addressof the two-dimensional code data through WeChat, the operation is simple, and the cost is low.