The invention discloses an electronic lock, and belongs to the field of safety technology protection. The electronic lock solves the problems that in the prior art, the electronic lock is complex in structure, high in cost, inconvenient to use. The electronic lock comprises a lock body provided with a cavity, a lock cover, a drive motor, a power supply system, a coded lock device, a first lock tongue, combined type lock core, a first lock core, a second lock tongue, a second lock core and a heaven and earth rod mechanism. The power supply system supplies power for the drive motor, and the coded lock device is electrically connected with the power supply system. The first lock tongue is arranged on the upper end of the lock body and can penetrate through the side face of the lock body, and the combined type lock core can rotate around the lock body and is used for dragging the first lock tongue back into the lock body. The first lock core is used for pushing the combined type lock core and is meshed with an output shaft of the drive motor. The second lock tongue is arranged on the lower end of the lock body and can penetrate through the side face of the lock body, and the second lock core is meshed with the combined type lock core and driven by the combined type lock core and is used for dragging the second lock tongue back into the lock body. The second lock core is fixedly arranged on one side, opposite to the first lock tongue and the second lock tongue, of the lock body, and achieves contracting through the combined type lock core and the second lock core. The heaven and earth rod mechanism achieves popping-up through a first springing control mechanism and a second springing control mechanism.