This invention discloses a method, apparatus, electronic device, and storage medium for storing and loading PLC programs, relating to the field of PLC technology. The method includes the following steps: opening and decrypting the PLC program's
database file; the PLC program's
database is an SQLite
database, and the
database file includes a
system information table recording the original version information and modifiable version information of the PLC program's database; detecting the version of the modifiable version information and comparing it with the latest version compatible with the PLC
programming software; if the version of the modifiable version information is not lower than the latest version compatible with the PLC
programming software, then loading the PLC program. According to the PLC program storage and loading method of this invention, the loading speed of PLC programs can be significantly increased; moreover, when updating versions, the code for loading the PLC program does not need to include a version switch, making the code easier to maintain.