The invention relates to a lock that uses a mobile phone to scan the corresponding function of a two-dimensional code to obtain a variable code, a two-dimensional code mark, and a combination lock power supply module, and belongs to the technical field of electronic information and shared locks. The present invention consists of 4 cipher disks, 4 cipher knobs, two-dimensional code signs, two-dimensional code built-in holes, elastic pressing keys, keyboard conductive rubber, etc.; each two-dimensional code corresponds to an independent function Fn, and this function exists As long as there is the same initial value in the memory of the variable password lock (8) and in the function library of the background management server, the same calculation result will be obtained. Scan and send the QR code with the mobile phone to obtain the input password for unlocking. The variable password function is realized; when the wrong password is entered more than three times in a row, a warning is issued; self-charging can be completed. Scan the QR code of the lock with the mobile phone to realize the function of the logistics network, which greatly reduces the cost of the lock and the development of the lock management program in the early stage, and only needs to develop the background management program.