An operating system upgrade method, applied to an electronic device, wherein the electronic device comprises a processor and a memory, the memory comprises a basic partition, a first static partition, a second static partition, a dynamic partition, and a user data partition, and the method comprises: loading data in the basic partition, the first static partition, and the dynamic partition to run a first operating system; obtaining a first system upgrade installation package and a second system upgrade installation package, wherein the first system upgrade installation package comprises first update data for updating data in the dynamic partition, the first system upgrade installation package is used to upgrade the first operating system to a second operating system, the second system upgrade installation package comprises second update data for updating the data in the dynamic partition, and the second system upgrade installation package is used to upgrade the second operating system to a third operating system; creating a virtual dynamic partition in the user data partition, and storing the first update data and the second update data in the virtual dynamic partition; restarting the electronic device, loading data in the basic partition, loading data in the second static partition, loading first dynamic partition data to run the third operating system, wherein the first dynamic partition data is all or a part of second dynamic partition data, the second dynamic partition data corresponds to a result of superposition of third dynamic partition data and the second update data, and the third dynamic partition data corresponds to a result of superposition of the data in the dynamic partition and the first update data; merging the first update data into the dynamic partition in response to successfully running the third operating system, and merging the second update data into the dynamic partition, wherein the creating the virtual dynamic partition in the user data partition, and storing the first update data and the second update data in the virtual dynamic partition comprises: storing the first update data and the second update data in the user data partition in a form of Copy-On-Write COW files; and the loading first dynamic partition data to run the third operating system comprises: loading the data in the dynamic partition, a COW file of the first update data, and a COW file of the second update data based on a snapshot technology. loading data in the basic partition, the first static partition, and the dynamic partition to run a first operating system; obtaining a first system upgrade installation package and a second system upgrade installation package, wherein the first system upgrade installation package comprises first update data for updating data in the dynamic partition, the first system upgrade installation package is used to upgrade the first operating system to a second operating system, the second system upgrade installation package comprises second update data for updating the data in the dynamic partition, and the second system upgrade installation package is used to upgrade the second operating system to a third operating system; creating a virtual dynamic partition in the user data partition, and storing the first update data and the second update data in the virtual dynamic partition; restarting the electronic device, loading data in the basic partition, loading data in the second static partition, loading first dynamic partition data to run the third operating system, wherein the first dynamic partition data is all or a part of second dynamic partition data, the second dynamic partition data corresponds to a result of superposition of third dynamic partition data and the second update data, and the third dynamic partition data corresponds to a result of superposition of the data in the dynamic partition and the first update data; merging the first update data into the dynamic partition in response to successfully running the third operating system, and merging the second update data into the dynamic partition, wherein the creating the virtual dynamic partition in the user data partition, and storing the first update data and the second update data in the virtual dynamic partition comprises: storing the first update data and the second update data in the user data partition in a form of Copy-On-Write COW files; and the loading first dynamic partition data to run the third operating system comprises: loading the data in the dynamic partition, a COW file of the first update data, and a COW file of the second update data based on a snapshot technology.