CN115509578A - System upgrading method and device, electronic equipment and storage medium - Google Patents

System upgrading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115509578A
CN115509578A CN202211192270.8A CN202211192270A CN115509578A CN 115509578 A CN115509578 A CN 115509578A CN 202211192270 A CN202211192270 A CN 202211192270A CN 115509578 A CN115509578 A CN 115509578A
Authority
CN
China
Prior art keywords
partition
version
operating system
upgrade
response
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211192270.8A
Other languages
Chinese (zh)
Inventor
姜元山
陈礼波
王运付
刘霞
张光伟
陈德进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
China Information Technology Designing and Consulting Institute Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
China Information Technology Designing and Consulting Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd, China Information Technology Designing and Consulting Institute Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202211192270.8A priority Critical patent/CN115509578A/en
Publication of CN115509578A publication Critical patent/CN115509578A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a system upgrading method, a system upgrading device, electronic equipment and a storage medium, relates to the technical field of computers, and solves the technical problem that in the related technology, when an abnormal condition occurs in the upgrading process of an operating system, the upgrading version of the operating system is possibly damaged, so that the operating system cannot be started normally. The method comprises the following steps: determining a current operation partition of an operation system of the electronic equipment; in response to the current running partition being a first partition, upgrading an operating system in a second partition, the electronic device including at least two partitions, the first partition being one of the at least two partitions, the second partition being one of the at least two partitions other than the first partition; and in response to the successful upgrade of the operating system and the successful upgrade of the communication module of the electronic equipment, upgrading a preset text file in the second partition, wherein the preset text file is used for starting a kernel of the operating system.

Description

System upgrading method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for upgrading a system, an electronic device, and a storage medium.
Background
Currently, an operating system in a computer can be upgraded to meet the operational or operational needs of the computer.
However, in the related art, when an abnormal condition (for example, an abnormal power failure or a computer restart) occurs during the upgrade of the operating system, the upgraded version of the operating system may be damaged, so that the operating system cannot be normally started.
Disclosure of Invention
The invention provides a system upgrading method, a system upgrading device, electronic equipment and a storage medium, and solves the technical problem that in the related art, when an abnormal condition occurs in the upgrading process of an operating system, the upgrading version of the operating system may be damaged, so that the operating system cannot be normally started.
In a first aspect, the present invention provides a system upgrade method, including: determining a current operation partition of an operation system of the electronic equipment; in response to the current running partition being a first partition, upgrading an operating system in a second partition, the electronic device including at least two partitions, the first partition being one of the at least two partitions, the second partition being one of the at least two partitions other than the first partition; and in response to the successful upgrade of the operating system and the successful upgrade of the communication module of the electronic equipment, upgrading a preset text file in the second partition, wherein the preset text file is used for starting a kernel of the operating system.
Optionally, the system upgrading method further includes: determining the starting failure times of the running system; in response to the number of failed starts being greater than or equal to a number threshold, determining a last run partition of the running system; in response to the last running partition being the first partition, the operating system is started in the second partition.
Optionally, the system upgrading method further includes: in response to the number of failed boots being less than the number threshold, booting the operating system in the first partition.
Optionally, the system upgrading method further includes: determining whether a first version of a configuration file stored in a preset storage area is the same as a version of an operating system included in the first partition, wherein the first version is the highest version of the configuration file; in response to that the first version is different from the version of the operating system included in the first partition, acquiring a configuration file of a second version from the preset storage area, wherein the second version is the same as the version of the operating system included in the first partition; and starting the running system based on the second version of the configuration file.
Optionally, the system upgrading method further includes: acquiring a configuration file from a preset storage area; responding to the upgrade failure identification in the configuration file, and acquiring the version identification of the communication module upgraded last time from the preset storage area; and performing upgrading operation on the communication module based on the version of the communication module upgraded last time.
In a second aspect, the present invention provides a system upgrade apparatus, including: a determining module and a processing module;
the determining module is used for determining the current running partition of the running system of the electronic equipment;
the processing module is configured to upgrade an operating system in a second partition in response to the currently running partition being a first partition, where the electronic device includes at least two partitions, the first partition is one of the at least two partitions, and the second partition is one of the at least two partitions other than the first partition;
the processing module is further configured to upgrade a preset text file in the second partition in response to a successful upgrade of the operating system and a successful upgrade of the communication module of the electronic device, where the preset text file is used to start a kernel of the operating system.
Optionally, the determining module is further configured to determine the number of failed start-up times of the operating system;
the determining module is further used for determining the last running partition of the running system in response to the number of failed starting times being greater than or equal to a number threshold;
the processing module is further configured to start the operating system in the second partition in response to the last running partition being the first partition.
Optionally, the processing module is further configured to start the operating system in the first partition in response to the number of start failures being less than the number threshold.
Optionally, the system upgrading apparatus further includes an obtaining module;
the determining module is further configured to determine whether a first version of the configuration file stored in the preset storage area is the same as a version of an operating system included in the first partition, where the first version is a highest version of the configuration file;
the obtaining module is configured to obtain, from the preset storage area, a configuration file of a second version in response to that the first version is different from the version of the operating system included in the first partition, where the second version is the same as the version of the operating system included in the first partition;
the processing module is further configured to start the operating system based on the configuration file of the second version.
Optionally, the obtaining module is configured to obtain the configuration file from a preset storage area;
the obtaining module is further configured to obtain, in response to the upgrade failure identifier existing in the configuration file, a version identifier of the communication module that was upgraded last time from the preset storage area;
the processing module is further configured to perform an upgrade operation on the communication module based on the version of the communication module that was upgraded last time.
In a third aspect, the present invention provides an electronic device comprising: a processor and a memory configured to store processor-executable instructions; wherein the processor is configured to execute the instructions to implement any one of the above-described optional system upgrade methods of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium having instructions stored thereon, which, when executed by an electronic device, enable the electronic device to perform any one of the above-mentioned optional system upgrade methods of the first aspect.
According to the system upgrading method, the system upgrading device, the electronic equipment and the storage medium, the electronic equipment can determine the current operation partition of the operation system of the electronic equipment; in response to the current running partition being the first partition, the electronic device may upgrade the operating system in the second partition; and in response to the operating system being successfully upgraded and the communication module of the electronic device being successfully upgraded, the electronic device may upgrade the preset text file in the second partition. In the present disclosure, in response to that an operating system for operating an electronic device is a partition (e.g., a first partition) in the electronic device, the electronic device may perform an upgrade process of the operating system in another partition (i.e., a second partition) of the electronic device, where the upgrade process includes upgrading an operating system, upgrading a communication module, and upgrading a preset text file, so that a situation that the operating system cannot be normally started when an abnormal situation occurs in the upgrade process may be avoided, and normal upgrade and normal start of the system may be ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic diagram of an internal structure of an electronic device according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an internal structure of another electronic device according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a system upgrade method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of another system upgrading method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of another system upgrading method according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of another system upgrading method according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of a start-up process of an operating system according to an embodiment of the present invention;
fig. 8 is a schematic flowchart of another system upgrading method according to an embodiment of the present invention;
fig. 9 is a schematic flowchart of an upgrade process of an operating system according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a system upgrade apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of another system upgrading apparatus according to an embodiment of the present invention.
Detailed Description
The following describes a system upgrade method, an apparatus, an electronic device, and a storage medium according to embodiments of the present invention in detail with reference to the accompanying drawings.
The terms "first" and "second" etc. in the description and drawings of the present application are used to distinguish different objects and not to describe a particular order of objects, e.g. a first partition and a second partition etc. are used to distinguish different partitions and not to describe a particular order of partitions.
Furthermore, the terms "including" and "having," and any variations thereof, as referred to in the description of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "such as" in an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present relevant concepts in a concrete fashion.
The term "and/or" as used herein includes the use of either or both of the two methods.
In the description of the present application, the meaning of "a plurality" means two or more unless otherwise specified.
Based on the description in the background art, in the related art, when an abnormal condition (such as an abnormal power failure or a computer restart) occurs during the upgrade of the operating system, the upgraded version of the operating system may be damaged, so that the operating system cannot be normally started. Based on this, embodiments of the present invention provide a system upgrade method, apparatus, electronic device, and storage medium, where in response to that an operating system running the electronic device is a partition (e.g., a first partition) in the electronic device, the electronic device may execute an upgrade process of the operating system in another partition (i.e., a second partition) of the electronic device, where the upgrade process includes upgrading an operating system, upgrading a communication module, and upgrading a preset text file, so that a situation that the operating system cannot be normally started when an abnormal situation occurs in the upgrade process can be avoided, and normal upgrade and normal start of the system can be ensured.
The system upgrading method and device, the electronic equipment and the storage medium provided by the embodiment of the invention are applied to the upgrading scene of the operating system of the electronic equipment. In the embodiment of the present invention, in response to determining, by an electronic device, a current operating partition of a current operating system of the electronic device, an operating system, a communication module, and a preset text file of the electronic device may be upgraded based on the system upgrading method provided in the embodiment of the present invention.
Exemplary electronic devices implementing the log storage method provided by the embodiments of the present invention may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) \ Virtual Reality (VR) device, and the like. The specific form of the electronic device is not particularly limited in the present disclosure, and the electronic device may perform human-computer interaction with a user through one or more modes of a keyboard, a touch pad, a touch screen, a remote controller, voice interaction or handwriting equipment.
As shown in fig. 1, in an implementation manner of the embodiment of the present invention, the electronic device may include a watchdog module, a main routing CPU, a 5G module, a norflash, and a nandflash.
The watchdog module can be understood as a monitoring module and is used for sending out a restart signal.
And a high-speed data bus can be adopted between the main route CPU and the 5G module for reading and writing.
Both the norflash and the nandflash can be understood as a storage area (or a memory), wherein the reliability of the norflash is high, and the capacity of the nandflash is large.
Specifically, the norflash is used for storing versions of the uboot (including uboot and uboot) and upgrade start parameters (including an upgrade success flag, an upgrade failure flag, the number of start failures, and the like).
The nandflash is used for storing an operating partition (comprising an openwrt operating area A and an openwrt operating area B) of an operating system and a file system partition, wherein the file system partition comprises a log storage area and an openwrt configuration file storage area, the log storage area is used for storing an upgrade log and a start log of the electronic equipment, and the openwrt configuration file storage area is used for storing an openwrt configuration file comprising openwrt configuration files of different versions.
As shown in fig. 2, in another implementation manner of the embodiment of the present invention, the electronic device may include an upgrade system and a system boot loader system. The upgrading system comprises a version checking module, an upgrading parameter configuration module, a routing system double-partition upgrading module, a 5G module upgrading module, an upgrading log recording module and an upgrading backspacing module.
Specifically, the version check module is configured to perform hash check on the version of the operating system, the version of the communication module, and the version of the preset text file.
The upgrade parameter configuration module is used for configuring upgrade parameters including an upgrade success identifier, an upgrade failure identifier and the like, and backing up the parameters.
And the routing system dual-partition upgrading module is used for writing the version of the operating system into a preset storage area for upgrading.
The 5G module upgrading module is used for upgrading the version of the communication module (namely the 5G module) to the 5G module.
The upgrading log recording module is used for recording log information in the upgrading process.
The upgrade rollback module is used for rolling back the version of the 5G module and keeping the consistency of the version.
The system starting and loading system comprises a starting parameter configuration module, a partition switching module, an openwrt dual-partition system loading module, an openwrt configuration parameter recovery module and a watchdog reset module.
The starting parameter configuration module is used for acquiring parameters from a preset storage area or configuring starting parameters including starting failure times and the like.
The partition switching module is used for switching the operation partitions of the operation system.
The openwrt dual-partition system loading module is used for loading a kernel version, a rootfs version and a dtb version on a selected partition (such as a first partition).
The openwrt configuration parameter recovery module is used for recovering the updated last parameter, so that the consistency of the system parameter is ensured.
The watchdog reset module is used for restarting the system when the system is abnormal.
As shown in fig. 3, the system upgrading method provided by the embodiment of the present invention may include S101 to S103.
S101, the electronic equipment determines the current operation partition of the operation system of the electronic equipment.
It should be understood that the currently running partition is a partition in which the running system is currently running or a partition in the electronic device that runs the running system.
In an implementation manner of the embodiment of the present invention, the electronic device may include a preset storage area, where an identifier of a current running partition is stored in the preset storage area. The electronic device may determine a current running partition of the running system based on the identification of the current running partition.
For example, the predetermined storage area may be a flash.
And S102, in response to the fact that the current running partition is the first partition, the electronic equipment upgrades the operating system in the second partition.
The electronic device comprises at least two partitions, the first partition is one of the at least two partitions, and the second partition is one of the at least two partitions except the first partition.
It should be understood that in response to the currently running partition being the first partition, the partition currently running by the above-mentioned running system is described as the first partition, and at this time, the electronic device may determine to upgrade the operating system in another partition (e.g., the second partition) of the electronic device. The operating system can not be normally started when an abnormal condition (such as abnormal power failure or computer restart) occurs in the upgrading process of the operating system.
Illustratively, the operating system may be a linux system, and specifically may be an openwrt system.
In an alternative implementation, in response to the current running partition being the second partition, the electronic device may upgrade the operating system in the first partition.
S103, responding to the successful upgrading of the operating system and the successful upgrading of the communication module of the electronic equipment, and upgrading the preset text file in the second partition by the electronic equipment.
And the preset text file is used for starting the kernel of the operating system.
Specifically, the electronic device may upgrade the communication module in the second partition.
It should be understood that the electronic device may upgrade the communication module at the same time as the operating system is upgraded, and determine whether the operating system is successfully upgraded and whether the communication module is successfully upgraded, respectively.
In response to the operating system being successfully upgraded and the communication module being successfully upgraded, the electronic device may upgrade the preset text file in the second partition. In response to the success of the upgrade of the preset text file, the electronic device may determine that the upgrade of the operating system of the electronic device is successful.
Optionally, in response to the successful upgrade of the operating system, the electronic device may configure an upgrade success identifier, where the upgrade success identifier is used to characterize that the upgrade of the operating system is successful. And the electronic equipment can also transfer the upgrade log to the preset storage area.
For example, the communication module may be a 5G module, and the preset text file may be an uboot.
In the embodiment of the present invention, before the electronic device upgrades the operating system, the communication module, and the preset text file, hash check may be performed on the version of the operating system, the version of the communication module, and the version of the preset text file to verify the integrity of the versions, thereby determining whether to perform a subsequent upgrade process.
In an optional implementation manner, in response to the upgrade failure of the operating system, the upgrade failure of the communication module, or the upgrade failure of the preset text, the electronic device may configure an upgrade failure identifier, where the upgrade failure identifier is used to represent the upgrade failure of the operating system.
In another alternative implementation, after the electronic device configures the upgrade success identifier or the upgrade failure identifier, the electronic device may restart the operating system.
The technical scheme provided by the embodiment can at least bring the following beneficial effects: as known from S101-S103, the electronic device may determine a current running partition of a running system of the electronic device; in response to the current running partition being the first partition, the electronic device may upgrade the operating system in the second partition; and in response to the operating system being successfully upgraded and the communication module of the electronic device being successfully upgraded, the electronic device may upgrade the preset text file in the second partition. In the embodiment of the present disclosure, in response to that an operating system for operating an electronic device is a partition (e.g., a first partition) in the electronic device, the electronic device may execute an upgrade process of the operating system in another partition (i.e., a second partition) of the electronic device, where the upgrade process includes upgrading an operating system, upgrading a communication module, and upgrading a preset text file, so that a situation that the operating system cannot be normally started when an abnormal situation occurs in the upgrade process may be avoided, and normal upgrade and normal start of the system may be ensured.
With reference to fig. 3, as shown in fig. 4, the system upgrading method provided in the embodiment of the present invention may further include S104-S106.
S104, the electronic equipment determines the starting failure times of the running system.
In an implementation manner of the embodiment of the present invention, the electronic device may first obtain a hardware start identifier of the operating system, then determine a start partition of the preset text file according to the hardware start identifier, and start the preset text file in the start partition, thereby completing a start process of the operating system.
And S105, in response to the fact that the starting failure times of the running system are larger than or equal to the time threshold value, the electronic equipment determines the last running partition of the running system.
It should be appreciated that in response to the number of failed starts being greater than or equal to the number threshold, indicating that the number of failed starts of the operating system is greater, the electronic device may determine the last run partition of the operating system based on the fact that the currently running partition of the operating system may not be able to successfully start the operating system.
Illustratively, the number threshold may be 3.
And S106, responding to the fact that the last running partition is the first partition, and starting the operating system in the second partition by the electronic equipment.
It will be appreciated that the last run partition is the last run partition of the running system.
In the embodiment of the present invention, in response to that the last running partition is the first partition, it is described that the last running partition of the running system is the first partition, and at this time, the electronic device may start the operating system in another partition (that is, the second partition) of the electronic device.
In one implementation manner of the embodiment of the present invention, in response to that the first-time running partition is the second partition, the electronic device may start the operating system in the first partition.
With reference to fig. 4, as shown in fig. 5, the system upgrading method provided in the embodiment of the present invention further includes S107.
S107, in response to the fact that the starting failure times of the running system are smaller than the time threshold value, the electronic device starts the operating system in the first partition.
It should be appreciated that in response to the number of failed start-ups being less than the number threshold, indicating that the number of failed start-ups of the operating system is low, the start-up process of the operating system may be completed based on the currently running partition of the operating system. At this point, the electronic device may determine the current running partition of the running system.
In conjunction with the above description of the embodiments, it should be understood that the electronic device determines that the currently running partition of the operating system is the first partition. At this point, the electronic device may determine to boot the operating system in the first partition.
In an alternative implementation, in response to the number of times the operating system is started being less than the number threshold and the currently running partition of the electronic device being the second partition, the electronic device may start the operating system in the second partition.
With reference to fig. 4, as shown in fig. 6, the system upgrading method provided in the embodiment of the present invention may further include S108-S110.
S108, the electronic equipment determines whether the first version of the configuration file stored in the preset storage area and the version of the operating system included in the first partition are the same.
Wherein the first version is a highest version of the configuration file.
It should be appreciated that the configuration file is used to start the operating system of the electronic device.
Illustratively, the configuration file may be an openwrt configuration file.
And S109, in response to the first version being different from the version of the operating system included in the first partition, the electronic device acquires the configuration file of the second version from the preset storage area.
Wherein the second version is the same as a version of an operating system included in the first partition.
It should be understood that the preset storage area may store a plurality of versions (including a first version and a second version) of the configuration file, where the second version is lower than the first version.
It should be understood that, in response to the first version being different from the version of the operating system included in the first partition, it indicates that an upgrade operation (specifically, an upgraded operating system) has been performed in another partition (e.g., the second partition) of the at least two partitions, a new or higher version (i.e., the first version) of the configuration file has been stored in the preset storage area, but the upgrade operation has not been performed in the first partition. If the operating system of the electronic device is started based on the configuration file of the first version (specifically, the operating system is started in the first partition), the starting of the operating system may fail due to version mismatch. At this time, the electronic device may acquire a configuration file of a lower version (specifically, a version identical to the version of the operating system included in the first partition) from the preset area.
In the embodiment of the present invention, the process of acquiring, by the electronic device, the second version of the configuration file from the preset storage area may also be understood as a recovery process of the configuration file (specifically, the second version of the configuration file), that is, the electronic device may recover and use the second version of the configuration file.
Optionally, the electronic device may also delete the first version of the configuration file.
And S110, starting the operating system by the electronic equipment based on the configuration file of the second version.
In an implementation manner of the embodiment of the present invention, in response to that the first version is the same as the version of the operating system included in the first partition, it is described whether the other partition performs the upgrade operation and whether the first partition performs the upgrade operation are consistent, that is, the other partition and the first partition do not perform the upgrade operation, or the other partition and the first partition both perform the upgrade operation. At this time, the electronic device may boot the operating system based on the configuration file of the first version (i.e., the same version as the version of the operating system included in the first partition).
The following describes an example of a starting process of an operating system of an electronic device according to an embodiment of the present invention.
As shown in fig. 7, the start-up process may include S201-S218.
S201, the electronic equipment obtains a hardware starting identifier.
S202, responding to the fact that the starting partition of the uboot is the partition A, and starting the uboot in the partition A by the electronic equipment.
It should be understood that uboot is the preset text file in the above embodiment, and the partition a may be understood as the first partition.
S203, responding to the situation that the starting partition of the uboot is the partition B, and starting the uboot in the partition B by the electronic equipment.
The partition B may be the second partition in the above embodiment.
And S204, the electronic equipment increases the starting failure times of the running system by a preset value.
Wherein the preset value may be 1.
S205, the electronic equipment determines whether the starting failure times are larger than or equal to a time threshold value.
S206, in response to the fact that the number of times of the starting failure is larger than or equal to the number threshold, the electronic equipment determines the last running partition of the running system.
And S207, responding to the fact that the last running partition is the partition A, and starting the openwrt system in the partition B by the electronic equipment.
It should be understood that the openwrt system is an operating system of the electronic device in the above embodiments.
And S208, responding to the fact that the last running partition is the partition B, and starting the openwrt system in the partition A by the electronic equipment.
S209, in response to the number of failed start-up times being less than the number threshold, the electronic device determines a current running partition of the running system.
And S210, responding to the fact that the current running partition is the partition A, and starting an openwrt system in the partition A by the electronic equipment.
And S211, responding to the fact that the current running partition is the partition B, and starting the openwrt system in the partition B by the electronic equipment.
S212, the electronic device determines whether the first version of the configuration file stored in the flash is the same as the version of the operating system included in the partition A.
The flash may be understood as the preset storage area.
S213, in response to that the first version is different from the version of the operating system included in the partition A, the electronic device acquires the configuration file of the second version from the flash.
Wherein the configuration file of the second version is the same as the version of the operating system included in the first partition.
S214, in response to the first version being the same as the version of the operating system included in the partition A, the electronic equipment determines whether the upgrade is performed.
S215, if the upgrade is carried out, configuring an upgrade success identifier for the electronic equipment;
s216, if the upgrading is not carried out, the electronic equipment determines whether the running system is started successfully or not.
S217, if the starting fails, the system is abnormal, and the electronic equipment resets and restarts the running system based on the watchdog.
And S218, if the starting is successful, clearing the starting failure times by the electronic equipment.
With reference to fig. 3, as shown in fig. 8, the system upgrading method provided in the embodiment of the present invention may further include S111-S113. System upgrade
S111, the electronic equipment acquires the configuration file from the preset storage area.
And S112, responding to the upgrade failure identification in the configuration file, and acquiring the version identification of the communication module upgraded last time from the preset storage area by the electronic equipment.
It should be appreciated that in response to the presence of the upgrade failure flag in the configuration file, a failure to run the system upgrade is declared. Specifically, the upgrade of the operating system may fail, the upgrade of the communication module may fail, or the upgrade of the preset text file may fail. At this time, the electronic device may obtain the version of the communication module that was last upgraded.
S113, the electronic equipment executes upgrading operation on the communication module based on the version of the communication module which is upgraded last time.
In the embodiment of the invention, the electronic equipment can determine that the communication module is successfully upgraded in the last upgrading process, namely, the electronic equipment executes upgrading operation on the communication module based on the version of the last upgrading communication module, so that the successful upgrading of the communication module can be ensured, and further, the successful upgrading of the running system of the electronic equipment is ensured.
In an optional implementation manner, in response to the upgrade failure identifier existing in the configuration file, the electronic device may also obtain a version identifier of the last operating system upgraded from a preset storage area, and perform an upgrade operation on the operating system based on the version of the last operating system upgraded.
In another optional implementation manner, in response to the presence of the upgrade failure identifier in the configuration file, the electronic device may further obtain, from the preset storage area, a version identifier of the preset text file that is upgraded last time, and perform an upgrade operation on the preset text file based on the version of the preset text file that is upgraded last time.
The following describes an upgrade process of an operating system of an electronic device according to an embodiment of the present invention.
As shown in FIG. 9, the upgrade process may include S301-S314.
S301, the electronic equipment obtains and verifies the upgrade version.
Specifically, the electronic device may obtain a version of the operating system, a version of the communication module, and a version of the preset text file, and perform hash check on the versions.
S302, the electronic equipment sets upgrading parameters.
The upgrade parameters include an upgrade failure identifier and an upgrade success identifier.
S303, the electronic equipment determines the current operation partition of the electronic equipment.
S304, in response to that the current operation partition is the partition A, the electronic equipment upgrades the openwrt system in the partition B.
The partition a may be understood as the first partition, the partition B may be understood as the second partition, and openwrt is an operating system of the electronic device.
And S305, in response to that the current running partition is the partition B, the electronic equipment upgrades the openwrt system in the partition A.
S306, upgrading the 5G module of the electronic equipment.
It should be understood that the 5G module is a communication module of the electronic device in the above embodiments.
S307, the electronic equipment determines whether the upgrading time of the 5G module is larger than or equal to a time threshold.
It can be understood that the electronic device determines whether the upgrade duration of the 5G module is greater than or equal to the duration threshold, that is, determines whether the upgrade process of the 5G module is overtime.
S308, in response to the fact that the upgrading time of the 5G module is larger than or equal to the time threshold, the electronic equipment configures upgrading failure identification.
S309, responding to the situation that the upgrading duration of the 5G module is smaller than the duration threshold, and determining the running partition of the uboot by the electronic equipment.
Wherein, the uboot can be understood as the preset text file.
And S310, responding to the running partition of the uboot as a partition A, and upgrading the uboot in the partition B by the electronic equipment.
And S311, responding to the running partition of the uboot as a partition B, and upgrading the uboot in the partition A by the electronic equipment.
And S312, the electronic equipment sets upgrading parameters.
The upgrade parameters comprise upgrade failure identifiers and upgrade success identifiers.
S313, the electronic equipment transfers the upgrade log to the flash.
It should be understood that the flash is a preset storage area in the above embodiment.
And S314, restarting the running system by the electronic equipment.
In the embodiment of the present invention, the electronic device and the like may be divided into functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
In the case of dividing each functional module by corresponding functions, fig. 10 shows a schematic diagram of a possible structure of the system upgrading apparatus according to the foregoing embodiment, and as shown in fig. 10, the system upgrading apparatus 40 may include: a determination module 401 and a processing module 402.
The determining module 401 is configured to determine a current running partition of a running system of the electronic device.
A processing module 402, configured to, in response to the currently running partition being a first partition, upgrade an operating system in a second partition, where the electronic device includes at least two partitions, the first partition is one of the at least two partitions, and the second partition is one of the at least two partitions other than the first partition.
The processing module 402 is further configured to, in response to the operating system being successfully upgraded and the communication module of the electronic device being successfully upgraded, upgrade a preset text file in the second partition, where the preset text file is used to start the kernel of the operating system.
Optionally, the determining module 401 is further configured to determine the number of failed start-up times of the running system.
The determining module 401 is further configured to determine, in response to the number of failed boot times being greater than or equal to the number threshold, a last running partition of the running system.
The processing module 402 is further configured to start the operating system in the second partition in response to the last running partition being the first partition.
Optionally, the processing module 402 is further configured to, in response to the number of failed starts being less than the number threshold, start the operating system in the first partition.
Optionally, the system upgrading apparatus 20 further includes an obtaining module 403.
The determining module 401 is further configured to determine whether a first version of the configuration file stored in the preset storage area is the same as a version of an operating system included in the first partition, where the first version is a highest version of the configuration file.
An obtaining module 403, configured to, in response to that the first version is different from the version of the operating system included in the first partition, obtain a second version of the configuration file from the preset storage area, where the second version is the same as the version of the operating system included in the first partition.
The processing module 402 is further configured to start the operating system based on the second version of the configuration file.
Optionally, the obtaining module 403 is configured to obtain the configuration file from a preset storage area.
The obtaining module 403 is further configured to, in response to the upgrade failure identifier existing in the configuration file, obtain a version identifier of the communication module that was upgraded last time from the preset storage area.
The processing module 402 is further configured to perform an upgrade operation on the communication module based on the version of the communication module that was upgraded last time.
Fig. 11 shows a schematic diagram of a possible structure of the system upgrading device in the above embodiment, in the case of an integrated unit. As shown in fig. 11, the system upgrading apparatus 50 may include: a processing module 501 and a communication module 502. The processing module 501 may be used to control and manage the actions of the system upgrade apparatus 50. The communication module 502 may be used to support communication of the system upgrade apparatus 50 with other entities. Optionally, as shown in fig. 11, the system upgrading apparatus 50 may further include a storage module 503 for storing program codes and data of the system upgrading apparatus 50.
The processing module 501 may be a processor or a controller. The communication module 502 may be a transceiver, a transceiving circuit or a communication interface, etc. The storage module 503 may be a memory.
When the processing module 501 is a processor, the communication module 502 is a transceiver, and the storage module 503 is a memory, the processor, the transceiver, and the memory may be connected by a bus. The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
It should be understood that, in various embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented using a software program, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the invention are all or partially effected when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optics, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or can comprise one or more data storage devices, such as servers, data centers, and the like, that can be integrated with the medium. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present invention, and shall cover the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method for system upgrade, comprising:
determining a current operation partition of an operation system of the electronic equipment;
in response to that the current running partition is a first partition, upgrading an operating system in a second partition, wherein the electronic device comprises at least two partitions, the first partition is one of the at least two partitions, and the second partition is one of the at least two partitions except the first partition;
and in response to the successful upgrade of the operating system and the successful upgrade of the communication module of the electronic equipment, upgrading a preset text file in the second partition, wherein the preset text file is used for starting a kernel of the operating system.
2. The method of claim 1, further comprising:
determining the starting failure times of the running system;
in response to the number of failed boot times being greater than or equal to a time threshold, determining a last run partition of the running system;
in response to the last run partition being the first partition, starting the operating system in the second partition.
3. The method of claim 2, further comprising:
in response to the number of failed boots being less than the number threshold, booting the operating system in the first partition.
4. The method of claim 2, further comprising:
determining whether a first version of a configuration file stored in a preset storage area is the same as a version of an operating system included in the first partition, wherein the first version is the highest version of the configuration file;
in response to that the first version is different from the version of the operating system included in the first partition, acquiring a configuration file of a second version from the preset storage area, wherein the second version is the same as the version of the operating system included in the first partition;
and starting the running system based on the second version of the configuration file.
5. The method according to any one of claims 1-4, further comprising:
acquiring a configuration file from a preset storage area;
responding to the upgrade failure identification in the configuration file, and acquiring the version identification of the communication module upgraded last time from the preset storage area;
and performing upgrading operation on the communication module based on the version of the communication module upgraded last time.
6. A system upgrade apparatus, comprising: a determining module and a processing module;
the determining module is used for determining the current running partition of the running system of the electronic equipment;
the processing module is configured to upgrade an operating system in a second partition in response to that the currently running partition is a first partition, where the electronic device includes at least two partitions, the first partition is one of the at least two partitions, and the second partition is one of the at least two partitions except the first partition;
the processing module is further configured to upgrade a preset text file in the second partition in response to the operating system being successfully upgraded and the communication module of the electronic device being successfully upgraded, where the preset text file is used to start a kernel of the operating system.
7. The apparatus of claim 6,
the determining module is further configured to determine the number of failed start-up times of the operating system;
the determining module is further configured to determine a last running partition of the running system in response to the number of failed start-ups being greater than or equal to a number threshold;
the processing module is further configured to start the operating system in the second partition in response to the last running partition being the first partition.
8. The apparatus of claim 7,
the processing module is further configured to start the operating system in the first partition in response to the number of failed start-ups being less than the number threshold.
9. The apparatus of claim 7, further comprising an acquisition module;
the determining module is further configured to determine whether a first version of a configuration file stored in a preset storage area is the same as a version of an operating system included in the first partition, where the first version is a highest version of the configuration file;
the obtaining module is configured to obtain, from the preset storage area, a configuration file of a second version in response to that the first version is different from the version of the operating system included in the first partition, where the second version is the same as the version of the operating system included in the first partition;
the processing module is further configured to start the operating system based on the configuration file of the second version.
10. The apparatus according to any one of claims 6-9, wherein the apparatus further comprises an acquisition module;
the acquisition module is used for acquiring a configuration file from a preset storage area;
the obtaining module is further configured to obtain, in response to an upgrade failure identifier existing in the configuration file, a version identifier of the communication module that is upgraded last time from the preset storage area;
the processing module is further configured to perform an upgrade operation on the communication module based on the last upgrade of the version of the communication module.
11. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory configured to store the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the system upgrade method of any one of claims 1-5.
12. A computer-readable storage medium having instructions stored thereon, wherein the instructions in the computer-readable storage medium, when executed by an electronic device, enable the electronic device to perform the system upgrade method of any one of claims 1-5.
CN202211192270.8A 2022-09-28 2022-09-28 System upgrading method and device, electronic equipment and storage medium Pending CN115509578A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211192270.8A CN115509578A (en) 2022-09-28 2022-09-28 System upgrading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211192270.8A CN115509578A (en) 2022-09-28 2022-09-28 System upgrading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115509578A true CN115509578A (en) 2022-12-23

Family

ID=84506681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211192270.8A Pending CN115509578A (en) 2022-09-28 2022-09-28 System upgrading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115509578A (en)

Similar Documents

Publication Publication Date Title
CN110825563B (en) System recovery method and device and electronic equipment
CN106020875B (en) Firmware update management method and device of embedded terminal
CN103150231A (en) Computer booting method and computer system
CN108432219A (en) The restoration methods and terminal device of terminal device boot failure
CN104834575A (en) Firmware recovery method and device
CN105094927A (en) Equipment firmware updating method and device
CN115794257B (en) System starting method, device, electronic equipment and storage medium
US9594899B2 (en) Apparatus and method for managing operation of a mobile device
CN111078469A (en) Data processing method and data processing equipment
CN113032183A (en) System management method, device, computer equipment and storage medium
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN113396391B (en) Application program starting method and device, electronic equipment and storage medium
TW202131170A (en) Firmware corruption recovery
CN110908722B (en) Method and device applied to starting of operating system, electronic equipment and storage medium
EP3876101B1 (en) Abnormality processing method, terminal device and storage medium
RU2600101C1 (en) Assembly control module and method of firmware updating for this control module
EP3291092B1 (en) Data recovery method, device and terminal
CN115509578A (en) System upgrading method and device, electronic equipment and storage medium
CN110928726A (en) Embedded system self-recovery method and system based on watchdog and PXE
CN115658152A (en) Firmware upgrading method, firmware, electronic device and computer readable storage medium
CN114153503A (en) BIOS control method, device and medium
CN113515291A (en) Equipment online upgrading method and device
CN113127029A (en) Firmware updating method and device, electronic equipment and storage medium
CN110858148B (en) Updating method and device of storage medium preset application program and electronic equipment
CN114139168B (en) TPCM measuring method, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination