System upgrade starting method, electronic equipment and computer readable storage medium

By automatically switching to the backup system when the processor is powered on and keeping the version consistent when the anti-rollback function is not supported, the problem of low efficiency of active-standby switching and poor user experience during the system upgrade process is solved, and an efficient and reliable system is achieved. Upgrades and security improvements.

CN118567753AInactive Publication Date: 2024-08-30CLOURNEY SEMICONDUCTOR (NANJING) +1

Patent Information

Application Number
CN202411054453.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the system upgrade process, the switching of the active and backup systems in the existing technology requires manual intervention and is inefficient, resulting in high risks of data loss and downtime when the system fails. In addition, when the anti-rollback function is not supported, the user experience is poor and the system security is poor. insufficient.

Method used

By starting the system from the preset first partition when the processor is powered on, and after detecting the system upgrade request, the upgrade version file is stored in the first target area or the second target area in an overwriting manner to achieve automatic switching to The backup system reduces the identification time of the primary and secondary partitions, and when the system supports the anti-rollback function, ensures that the two partition versions are consistent, improving user experience and system security.

Benefits of technology

It achieves efficient automatic switching under abnormal system upgrade conditions, improves system reliability and security, improves user experience and system performance, simplifies the startup process, and increases system flexibility and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567753A
    Figure CN118567753A
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of system upgrading, and discloses a system upgrading starting method, electronic equipment and a computer readable storage medium. In the system upgrading starting method, when a processor is powered on, a system is started from a preset first partition; after a system upgrading request is detected, an upgrading version file of the system is stored in a first target area in a covering mode; restarting the system from the first target area; when the system restarting from the first target area fails, the system is restarted from the second target area, and when the system of the upgraded version fails to start, namely abnormal conditions such as system file damage or data loss occur, a standby system does not need to be appointed for restarting after main and standby partition and system detection distinguishing are carried out, so that the system restarting efficiency is improved. And the system can be restarted from the second target area directly and automatically, so that the restarting efficiency is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of system upgrade, and in particular to a system upgrade startup method, an electronic device and a computer-readable storage medium. Background Art

[0002] When performing a system upgrade, abnormal situations such as system file corruption or data loss may occur due to various reasons. In the prior art, in order to avoid abnormalities during system upgrades, a master-slave architecture is usually established in the computer. When a problem occurs during the upgrade of the main system, the backup system is run through specific instructions to avoid data loss and downtime caused by failure of the main system.

[0003] However, since the switching of the active and standby systems in the active and standby system architecture requires specific instructions to first detect the active and standby systems and then complete the switching of the active and standby systems, and even requires external manual intervention, the startup efficiency is not high. Summary of the invention

[0004] The object of the present invention is to provide a system upgrade startup method, an electronic device and a computer-readable storage medium, so that when an abnormality occurs during system upgrade, a backup system can be enabled more flexibly and efficiently.

[0005] To solve the above technical problems, the present invention provides a system upgrade startup method, comprising: starting the system from a preset first partition when a processor is powered on; after detecting a system upgrade request, storing the system upgrade version file in a first target area in an overwritten manner; wherein the first target area is the first partition or the preset second partition; the second partition stores a preset system version file; restarting the system from the first target area; when restarting the system from the first target area fails, restarting the system from the second target area; wherein the first target area is the first partition and the second target area is the second partition, or the first target area is the second partition and the second target area is the first partition.

[0006] The present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the system upgrade startup method as described above.

[0007] The present invention also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the system upgrade startup method described above is implemented.

[0008] In the present invention, the upgraded version file of the system is stored in the first target area in an overwritten manner, and the first target area is either the first partition or the preset second partition. The partitions are not distinguished between the primary and backup partitions, which saves the time for identifying the primary and backup partitions. When the upgraded version of the system fails to start, that is, when abnormal situations such as system file damage or data loss occur, there is no need to perform detection and distinction between the primary and backup partitions and the system and then specify the backup system to restart. It is sufficient to directly and automatically select to restart the system from the second target area. This is because the upgraded version of the system is only stored in one of the two target areas. When the upgraded version of the system cannot be started, the primary and backup switching can be achieved by directly starting the preset system in the other target area. Therefore, the efficiency of restarting in case of failure is higher.

[0009] In addition, when the system does not support the anti-rollback function, the version of the system started from the preset first partition when the processor is powered on is different from the preset system version, the first target area is the first partition and the second target area is the second partition; the preset system version is the user-specified version. In the scenario where the system does not support the anti-rollback function, the system upgrade version file is stored in the first target area, i.e., the first partition, in an overwritten manner to reduce the gap between the two versions of the system used by the user before and after, thereby improving the user experience, and the preset system version is set to the user-specified version to allow the user to return to the system version they choose to roll back to when the system upgrade version fails to restart, thereby further improving the user experience.

[0010] In addition, when the system supports the anti-rollback function, the version of the system started from the preset first partition when the processor is powered on is the same as the preset system version, the first target area is the second partition and the second target area is the first partition. In the scenario where the system supports the version anti-rollback function, the system version files stored in the two partitions are the same. In this case, no matter which partition the system is upgraded, the difference between the two versions of the system can be small and the user experience can be high. In order to further improve the user experience, the upgraded version file of the system is stored in the first target area, i.e., the second partition, in an overwritten manner. This ensures that when the upgrade is unsuccessful, the user can continue to use the current system of the first partition, and the data and operating instructions remain unchanged, making it smoother to use.

[0011] In addition, in the scenario where the system supports anti-rollback, when the system is successfully restarted from the first target area, the version of the system in the first partition is overwritten and refreshed to the upgraded version. This ensures that the systems in the first partition and the second partition are upgraded versions, preventing users from rolling back versions, because lower-version systems generally have more vulnerabilities than the latest versions, and attackers can exploit vulnerabilities to infiltrate the software system, so preventing users from rolling back versions can improve system security.

[0012] In addition, after the system is successfully restarted from the first target area, before a subsequent version upgrade request is detected, any partition of the first partition and the second partition is selected as the partition for the next system startup according to the user instruction. After the system version upgrade is successful, the next startup partition can be arbitrarily selected, which increases the flexibility of system startup.

[0013] In addition, restarting includes: restarting using a hardware reset circuit, wherein the hardware reset circuit includes a reset gate or a reset pin, or using software to trigger a restart instruction, and the system hardware completes the restart according to the instruction. Restarting through a hardware circuit allows the system to self-recover in the face of abnormal conditions, thereby increasing the reliability of the system.

[0014] The present invention does not distinguish between the primary and backup partitions, which can save the time of identifying the primary and backup partitions. When the system startup of the upgraded version fails, that is, when abnormal situations such as system file damage or data loss occur, it is not necessary to detect and distinguish the primary and backup partitions and the system and then specify the backup system to restart. The primary and backup switching can be achieved by directly and automatically selecting to restart the system from the second target area, which reduces the steps of conventional partition detection and selection, and can improve the efficiency of restarting in the event of a fault. The present invention can also achieve the following beneficial effects: the dual-partition startup method automatically controlled by hardware allows the system to self-recover in the face of abnormal situations, thereby increasing the reliability of the system; the dual-partition system that backs up each other supports version rollback prevention and increases system security; the dual-partition system that backs up each other normalizes the startup process, saves software overhead, and improves system performance; the software-controllable dual-partition startup method increases the flexibility of use. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0016] Figure 1 is a flow chart of a system upgrade startup method according to an embodiment of the present invention; Figure 2 is a schematic diagram of an electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0017] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0018] An embodiment of the present invention relates to a system upgrade startup method, which can be applied to terminal devices such as mobile phones and computers. In this embodiment, when the processor is powered on, the system is started from a preset first partition; after detecting a system upgrade request, the system upgrade version file is stored in a first target area in an overwritten manner; wherein the first target area is the first partition or the preset second partition; the second partition stores a preset system version file; the system is restarted from the first target area; when the system fails to be restarted from the first target area, the system is restarted from the second target area; wherein the first target area is the first partition and the second target area is the second partition, or the first target area is the second partition and the second target area is the first partition. The upgraded version file of the system is stored in the first target area in an overwritten manner, and the first target area is either the first partition or the preset second partition. The partitions are not distinguished between the primary and backup partitions, which saves the time of identifying the primary and backup partitions. When the upgraded version of the system fails to start, that is, when abnormal situations such as system file damage or data loss occur, there is no need to perform detection and distinction between the primary and backup partitions and the system and then specify the backup system to restart. The system can be directly and automatically restarted from the second target area. This is because the upgraded version of the system is only stored in one of the two target areas. When the upgraded version of the system cannot be started, the preset system in the other target area can be directly started to achieve the primary and backup switching, so the efficiency of restarting in case of failure is higher. The implementation details of the system upgrade startup method of this embodiment are specifically described below. The following content is only the implementation details provided for the convenience of understanding and is not necessary for the implementation of this solution.

[0019] like Figure 1 As shown, in step 101, the system is started from a preset first partition when the processor is powered on.

[0020] In one example, the processor may be a CPU (Central Processing Unit) in a terminal such as a mobile phone or a computer, and the system may be an operating system, such as an Android operating system in a mobile phone or a Windows operating system in a computer. The operating system here is stored in a logical partition of a storage medium of the terminal. In this embodiment, the storage medium has two logical partitions. In a specific implementation, the number of logical partitions of the storage medium is not limited, as long as it is greater than or equal to two. Before the system is powered on, a partition in the storage medium storing the system is designated as the preset first partition, and then the system is started from the preset first partition when the system is powered on.

[0021] In step 102, after a system upgrade request is detected, the system upgrade version file is stored in a first target area in an overwritten manner; wherein the first target area is the first partition or a preset second partition; the second partition stores a preset system version file.

[0022] In one example, the system does not support the anti-rollback function at this time. The anti-rollback function here means that when the system software package is updated through upgrading, when the new version of the system has an error during operation, the version of the current system software package can be rolled back to the previous version. In this case, after detecting the system upgrade request, step 102 will store the system upgrade version file, that is, the software package, in the first target area in an overwriting manner; the first target area at this time is the first partition; and the version corresponding to the preset system version file stored in the second partition is the user-specified version. In this embodiment, the storage medium, such as a hard disk, is divided into two logical partitions, partition 0 and partition 1, partition 0 corresponds to the first partition, and partition 1 corresponds to the second partition. The system version file is stored in partition 0, and the system version file of the user-specified version is stored in partition 1. When the processor is powered on, the boot partition indicates that the system version file stored in partition 0 is fixed to run the system. At this time, when the system upgrade request is received, the system upgrade version file will be stored in partition 0 in an overwriting manner.

[0023] After the upgraded version file of the system is overwritten and upgraded on the system version file in partition 0, step 103 is performed to restart the system from the first target area. In this embodiment, the upgraded version file of the system is restarted from partition 0. In the scenario where the system does not support the anti-rollback function, the upgraded version file of the system is stored in the first partition in an overwritten manner and restarted to make the gap between the current system used by the user and the two versions used after the update smaller, reduce the content that the user needs to learn and adapt, and improve the user experience.

[0024] After restarting in step 103, enter step 104, and when the system fails to be restarted from the first target area, restart the system from the second target area; wherein, the first target area is the first partition and the second target area is the second partition, or, the first target area is the second partition and the second target area is the first partition. In this embodiment, when the system fails to be restarted from the first target area, restarting the system from the second target area includes triggering a system reset, automatically flipping the boot partition indication, and restarting the user-specified version of the system version file from partition 1 when the upgraded version file of the system fails to be restarted from partition 0. By automatically flipping the boot indication to start from partition 1 when the system fails to start in partition 0, there is no need to detect and distinguish the primary and backup partitions and the system before specifying a backup system to restart, and the preset system version is set to the user-specified version in order to allow the user to return to the system version of their choice when the upgraded version of the system fails to restart, which can further improve the user experience.

[0025] In one example, the system is a system that supports the anti-rollback function. The anti-rollback support here means that when the system software package is updated through upgrading, when the new version of the system does not have an error in operation, the version of the current system software package cannot be rolled back to the previous version; when an error occurs in the operation of the new version of the system, the previous version of the system without an error needs to be used. In this case, after detecting the system upgrade request, step 102 will store the system upgrade version file, that is, the software package, in the first target area in an overwriting manner; the first target area at this time is the second partition; and the version corresponding to the system version file stored in the second partition is the version system of the system in the first partition. In this embodiment, the storage medium, such as a hard disk, is divided into two logical partitions, partition 0 and partition 1, partition 0 corresponds to the first partition, and partition 1 corresponds to the second partition. The system version file is stored in partition 0, and the same system version file is stored in partition 1. When the processor is powered on, the boot partition indicates that the system version file stored in partition 0 is fixed to run the system. At this time, when the system upgrade request is received, the system upgrade version file will be stored in partition 1 in an overwriting manner.

[0026] After the upgrade of the system version file is completed in partition 1, step 103 is performed to restart the system from the first target area. In this embodiment, the system is restarted from partition 1. In the scenario where the system supports the anti-rollback function, the system upgrade file is stored in the second partition in an overwritten manner and restarted because when the system supports the anti-rollback function, the system version files stored in partition 1 and partition 0 are the same. At this time, it does not matter which partition the system is upgraded. In order to further improve the user experience, the system upgrade file is stored in partition 1 in an overwritten manner, which can ensure that when the upgrade is unsuccessful, the user can continue to use the system in the current partition 1, and the data and operation instructions will not change, making it smoother to use.

[0027] After the restart in step 103, the process proceeds to step 104. When the system fails to be restarted from the first target area, the system is restarted from the second target area; wherein the first target area is the first partition and the second target area is the second partition, or the first target area is the second partition and the second target area is the first partition. In this embodiment, when the system fails to be restarted from the first target area, restarting the system from the second target area includes triggering a system reset when the upgraded version file of the system fails to be restarted from partition 1, automatically flipping the boot partition indication, and restarting the user-specified version of the system version file from partition 0. When the system fails to be started in partition 1, the boot indication is automatically flipped directly to start from partition 0, and there is no need to detect and distinguish the primary and backup partitions and the system before specifying the backup system to restart, thereby improving efficiency.

[0028] In this embodiment, in the scenario where the system supports anti-rollback, when the system is successfully restarted from the first target area, i.e., partition 1, the version of the system in the first partition, i.e., partition 0, will be overwritten and refreshed to the upgraded version. This ensures that the systems in the first partition and the second partition are both upgraded versions, preventing users from rolling back versions, because lower-version systems generally have more vulnerabilities than the latest versions, and attackers can exploit the vulnerabilities to infiltrate the software system, so preventing users from rolling back versions can improve system security.

[0029] In one example, after the system is successfully restarted from the first target area (which may be partition 0 or partition 1 for systems with different functions), before a subsequent version upgrade request is detected, any partition of the first partition and the second partition is selected as the partition for the next system startup according to a user instruction. That is, after the system version upgrade is successful and before a subsequent version upgrade request is received, the user can arbitrarily select the next startup partition, which increases the flexibility of system startup.

[0030] In one example, the above restart includes: restarting using a hardware reset circuit, wherein the hardware reset circuit includes a reset gate or a reset pin. Restarting through a hardware circuit allows the system to self-recover in the face of abnormal conditions, thereby increasing the reliability of the system.

[0031] The steps of the above method are divided only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of the present invention. Adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the protection scope of the invention.

[0032] Another embodiment of the present invention relates to an electronic device, such as Figure 2 As shown, it includes at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the system upgrade startup method as described above.

[0033] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.

[0034] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0035] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.

[0036] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0037] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.

Claims

1. A system upgrade startup method, characterized in that: include: When the processor is powered on, the system is started from the preset first partition; After detecting a system upgrade request, the system upgrade version file is stored in a first target area in an overwritten manner; wherein the first target area is the first partition or a preset second partition; the second partition stores a preset system version file; Restarting the system from the first target area; When restarting the system from the first target area fails, restarting the system from the second target area; wherein the first target area is the first partition and the second target area is the second partition, or the first target area is the second partition and the second target area is the first partition.

2. The system upgrade startup method according to claim 1, characterized in that: When the system does not support the anti-rollback function, the version of the system started from the preset first partition when the processor is powered on is different from the version of the preset system, the first target area is the first partition and the second target area is the second partition; The preset system version is a version specified by the user.

3. The system upgrade startup method according to claim 2, characterized in that: The user-specified version includes an initial version.

4. The system upgrade startup method according to claim 1, characterized in that: When the system supports the anti-rollback function, the version of the system started from the preset first partition when the processor is powered on is the same as the version of the preset system, the first target area is the second partition and the second target area is the first partition.

5. The system upgrade startup method according to claim 4, characterized in that: Also includes: When the system is successfully restarted from the first target area, the version of the system in the first partition is overwritten and updated to the upgraded version.

6. The system upgrade startup method according to any one of claims 1 to 5, characterized in that: Also includes: After the system is successfully restarted from the first target area and before a subsequent version upgrade request is detected, any one of the first partition and the second partition is selected as the partition for next system startup according to a user instruction.

7. The system upgrade startup method according to any one of claims 1 to 5, characterized in that: The restart includes: Restarting using a hardware reset circuit, wherein the hardware reset circuit includes a reset gate or a reset pin; Alternatively, software is used to trigger a restart instruction, and the system hardware completes the restart according to the instruction.

8. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the system upgrade startup method as described in any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the system upgrade startup method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • A software starting method and a software upgrading method

    CN109408153A

  • Automobile combination instrument rollback starting method, device and equipment and storage medium

    CN111638999A

  • Firmware upgrading method

    CN112433739A

  • Software upgrading method, terminal equipment and storage medium

    CN114064097A

  • System upgrading method and device based on asymmetric partition and electronic equipment

    CN114265603A

Cited By

  • Linux system starting method and device, electronic equipment and storage medium

    CN120469725A