Firmware upgrading method and device, equipment, storage medium and program product

By using the new version tool in the upgrade package during the firmware upgrade process, the problem in the existing technology that the upgrade script and upgrade program need to be upgraded first is solved, thereby improving the firmware upgrade efficiency and user experience.

CN120803490APending Publication Date: 2025-10-17BEIJING SPREADTRUM HI TECH COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510821113.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In the prior art, during the firmware upgrade process, the upgrade script and the upgrade program need to be upgraded first, resulting in low firmware upgrade efficiency and affecting user experience.

Method used

Package the new version of the upgrade tool into the upgrade package and directly use the new version of the tool in the upgrade package to upgrade the firmware. This avoids the need to upgrade the upgrade tool first before upgrading the firmware.

Benefits of technology

The firmware upgrade process is simplified, the number of upgrades and strict upgrade sequence requirements are reduced, and the firmware upgrade efficiency and user experience are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803490A_ABST
    Figure CN120803490A_ABST
Patent Text Reader

Abstract

According to the firmware upgrading method and device, the equipment, the storage medium and the program product provided by the invention, the electronic equipment can obtain the upgrading package, and the upgrading package comprises the new version file of the to-be-upgraded firmware. And then, according to the upgrade package, determining a target upgrade tool, the target upgrade tool comprising a target upgrade script and / or a target upgrade program, and according to the target upgrade tool, upgrading the to-be-upgraded firmware to a version corresponding to the new version file. According to the embodiment of the invention, when the firmware is upgraded, if the upgrading tool needs to be upgraded, the firmware can be upgraded without upgrading the upgrading tool firstly, so that the firmware upgrading process is simplified, necessary upgrading times or strict upgrading sequence requirements in the firmware upgrading process are reduced, the firmware upgrading efficiency is improved, and the firmware upgrading cost is reduced. And the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and in particular to a firmware upgrade method and device, an electronic device, a storage medium, and a program product. BACKGROUND

[0002] Based on the security of firmware upgrade, the basic logic of firmware upgrade is generally to upgrade one system in another system, and during the upgrade process, the upgrade script and / or upgrade program need to be run to achieve firmware upgrade.

[0003] However, when performing firmware upgrade, if the upgrade script and / or upgrade program need to be upgraded, the upgrade script and / or upgrade program need to be upgraded first, and then firmware upgrade is performed based on the upgraded upgrade program and / or upgrade script, which results in low firmware upgrade efficiency. SUMMARY

[0004] The present application provides a firmware upgrade method, device, electronic device, storage medium, and program product to solve the problem of low firmware upgrade efficiency in related technologies.

[0005] In a first aspect, the present application provides a firmware upgrade method applied to an electronic device, and the method comprises:

[0006] obtaining an upgrade package, wherein the upgrade package comprises a new version file of a firmware to be upgraded;

[0007] determining a target upgrade tool according to the upgrade package, wherein the target upgrade tool comprises a target upgrade script and / or a target upgrade program;

[0008] upgrading the firmware to be upgraded to a version corresponding to the new version file according to the target upgrade tool.

[0009] In a possible implementation manner, the electronic device comprises a first system and a second system; the first system and the second system each store a first upgrade tool; if the electronic device is a single-partition device, the first system is a main running system, and the second system is a non-main running system; if the electronic device is a dual-partition device, the first system is in a running state, and the second system is in an idle state.

[0010] determining a target upgrade tool according to the upgrade package comprises:

[0011] decompressing the upgrade package through the second system, and determining whether the second upgrade tool is included in the decompressed upgrade package, wherein the second upgrade tool comprises a new version of the upgrade script and / or a new version of the upgrade program;

[0012] If yes, extracting the second upgrade tool from the upgrade package through a first upgrade tool of the second system, and determining the target upgrade tool according to the second upgrade tool;

[0013] If no, determining the target upgrade tool as the first upgrade tool, and the first upgrade tool including an old version of an upgrade script and / or an old version of an upgrade program.

[0014] In a possible implementation, the target upgrade tool is not the first upgrade tool, and the target upgrade tool includes a target upgrade script and a target upgrade program; and upgrading the to-be-upgraded firmware to a version corresponding to the new version file according to the target upgrade tool includes:

[0015] running the target upgrade script through the second system;

[0016] executing the target upgrade program through the target upgrade script to upgrade the to-be-upgraded firmware of the first system, so that the to-be-upgraded firmware is upgraded to the version corresponding to the new version file.

[0017] In a possible implementation, the method further includes:

[0018] executing the target upgrade program through the target upgrade script to upgrade the first upgrade tool of the first system to a third upgrade tool;

[0019] The third upgrade tool includes any one of the following:

[0020] an old version of an upgrade script and a new version of an upgrade program;

[0021] a new version of an upgrade program and an old version of an upgrade script;

[0022] a new version of an upgrade script and a new version of an upgrade program;

[0023] a new version of an upgrade script;

[0024] a new version of an upgrade program.

[0025] In a possible implementation, the method further includes:

[0026] after the electronic device is restarted, upgrading the first upgrade tool of the second system through the third upgrade tool of the first system.

[0027] In a possible implementation, the target upgrade tool is the first upgrade tool, the first upgrade tool includes an old version of an upgrade script and an old version of an upgrade program, and upgrading the to-be-upgraded firmware to a version corresponding to the new version file according to the target upgrade tool includes:

[0028] Running the upgrade script of the old version through the second system;

[0029] The upgrade program of the old version is executed through the upgrade script of the old version to upgrade the firmware to be upgraded of the first system, so that the firmware to be upgraded is upgraded to the version corresponding to the new version file.

[0030] In a second aspect, the present application provides a firmware upgrade device for use in an electronic device, comprising:

[0031] An acquisition module, configured to acquire an upgrade package, wherein the upgrade package includes a new version file of the firmware to be upgraded;

[0032] a determination module, configured to determine a target upgrade tool based on the upgrade package, wherein the target upgrade tool includes a target upgrade script and / or a target upgrade program;

[0033] An upgrading module is used to upgrade the firmware to be upgraded to a version corresponding to the new version file according to the target upgrading tool.

[0034] In one possible implementation, the electronic device includes a first system and a second system; a first upgrade tool is stored in both the first system and the second system; if the electronic device is a single-partition device, the first system is a primary operating system, and the second system is a non-primary operating system; if the electronic device is a dual-partition device, the first system is in a running state, and the second system is in an idle state; the determining module is specifically configured to:

[0035] decompressing the upgrade package through the second system and determining whether the decompressed upgrade package includes a second upgrade tool, wherein the second upgrade tool includes a new version of the upgrade script and / or a new version of the upgrade program;

[0036] If so, extracting the second upgrade tool from the upgrade package using the first upgrade tool of the second system, and determining the target upgrade tool based on the second upgrade tool;

[0037] If not, it is determined that the target upgrade tool is a first upgrade tool, and the first upgrade tool includes an old version of the upgrade script and / or an old version of the upgrade program.

[0038] In a possible implementation, the target upgrade tool is not the first upgrade tool, and the target upgrade tool includes a target upgrade script and a target upgrade program; the upgrade module is specifically configured to:

[0039] running the target upgrade script through the second system;

[0040] The target upgrade procedure is executed by the target upgrade script, and the to-be-upgraded firmware of the first system is upgraded, so that the to-be-upgraded firmware is upgraded to a version corresponding to the new version file.

[0041] In a possible implementation, the upgrade module is further configured to:

[0042] The first upgrade tool of the first system is upgraded to a third upgrade tool by executing the target upgrade procedure by the target upgrade script.

[0043] The third upgrade tool includes any one of the following:

[0044] The new version of the upgrade script and the old version of the upgrade procedure;

[0045] The new version of the upgrade procedure and the old version of the upgrade script;

[0046] The new version of the upgrade script and the new version of the upgrade procedure;

[0047] The new version of the upgrade script;

[0048] The new version of the upgrade procedure.

[0049] In a possible implementation, the upgrade module is further configured to:

[0050] After the electronic device is restarted, the first upgrade tool of the second system is upgraded by the third upgrade tool of the first system.

[0051] In a possible implementation, the target upgrade tool is the first upgrade tool, and the first upgrade tool includes an old version of an upgrade script and an old version of an upgrade procedure; the upgrade module is specifically configured to:

[0052] The old version of the upgrade script is run by the second system;

[0053] The old version of the upgrade procedure is executed by the old version of the upgrade script, and the to-be-upgraded firmware of the first system is upgraded, so that the to-be-upgraded firmware is upgraded to a version corresponding to the new version file.

[0054] In a third aspect, the present application provides an electronic device, comprising a processor and a memory connected with the processor in communication;

[0055] The memory stores computer execution instructions;

[0056] The processor executes the computer execution instructions stored in the memory to implement the method of the first aspect.

[0057] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are used to implement the method in the first aspect when executed by a computer.

[0058] In a fifth aspect, the present application provides a computer program product, comprising a computer program, and the computer program is used to implement the method in the first aspect when executed by a computer.

[0059] In a sixth aspect, the present application provides a chip, comprising at least one processor and an interface circuit, wherein the interface circuit is connected to the at least one processor, and the processor executes a program instruction to implement the method in any one of the first aspect to the third aspect.

[0060] In a possible implementation, the chip is a chip in a chip module.

[0061] In a seventh aspect, the present application provides a module device, comprising a power module, a storage module and a chip module.

[0062] The power module is configured to provide power for the module device.

[0063] The storage module is configured to store data and instructions.

[0064] The chip module is configured to implement the method in the first aspect.

[0065] The firmware upgrading method, device, equipment, storage medium and program product provided by the present application can obtain an upgrading package, and the upgrading package comprises a new version file of a firmware to be upgraded. Then, a target upgrading tool is determined according to the upgrading package, the target upgrading tool comprises a target upgrading script and / or a target upgrading program, and the firmware to be upgraded is upgraded to a version corresponding to the new version file according to the target upgrading tool. In the present application, if the upgrading tool needs to be upgraded when the firmware is upgraded, the firmware does not need to be upgraded after the upgrading tool is upgraded, which simplifies the firmware upgrading process, reduces the necessary upgrading times or strict upgrading sequence requirements in the firmware upgrading, thereby improving the firmware upgrading efficiency and improving the user experience. BRIEF DESCRIPTION OF DRAWINGS

[0066] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0067] Figure 1 FIG. 1 is a structural schematic diagram of an electronic device according to an example of the present application;

[0068] Figure 2A flowchart of a firmware upgrading method provided by an embodiment of the present application is shown in FIG. 1.

[0069] Figure 3 A flowchart of another firmware upgrading method provided by an embodiment of the present application is shown in FIG. 2.

[0070] Figure 4 A flowchart of still another firmware upgrading method provided by an embodiment of the present application is shown in FIG. 3.

[0071] Figure 5 A flowchart of still another firmware upgrading method provided by an embodiment of the present application is shown in FIG. 4.

[0072] Figure 6 A flowchart of still another firmware upgrading method provided by an embodiment of the present application is shown in FIG. 5.

[0073] Figure 7 A structural diagram of a firmware upgrading device provided by an embodiment of the present application is shown in FIG. 6.

[0074] Figure 8 A structural diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 7.

[0075] The specific embodiments of the present application have been shown in the above-described drawings, and will be described in more detail hereinafter. These drawings and the following description are not intended to limit the scope of the present application in any way, but are merely intended to illustrate the concept of the present application to one of ordinary skill in the art by reference to a particular embodiment. DETAILED DESCRIPTION

[0076] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The same reference numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.

[0077] In the related art, the basic logic of firmware upgrading is generally to upgrade one system in another system, and in the upgrading process, a corresponding upgrading program needs to be invoked by running an upgrading script, so as to realize firmware upgrading by running the upgrading program.

[0078] Exemplarily, taking a single-partition device as an example, the single-partition device includes a Normal system and a recovery system, the Normal system includes a boot partition, a kernel partition, a file system partition and the like, and as a whole, the Normal system can be understood as a normally running system. The recovery system has two functions: factory resetting and upgrading. At this time, the Normal system can be considered as a main running system, and the recovery system can be considered as a non-main running system. The file system partitions of the two systems both store an upgrade script and an upgrade program.

[0079] During firmware upgrading, if the upgrade script and / or the upgrade program need to be upgraded, the upgrade script and the upgrade program under the recovery system need to be upgraded through the Normal system, so that the recovery system can use the latest upgrade script and upgrade program to upgrade other partitions (other partitions under the Normal system or the recovery system); or the upgrade script and the upgrade program under the Normal system need to be upgraded through the recovery system, so that the Normal system can use the latest upgrade script and upgrade program to upgrade other partitions (other partitions under the recovery system or the Normal system), that is, there is a dependence of the upgrade tool, so that the firmware upgrading has strict upgrade sequence requirements.

[0080] In another example, taking a dual-partition device as an example, for example, AB partition (A / B Seamless Updates) is a dual-system partition device, which allows the device to remain available during background upgrading, and after the upgrading is completed, the new system is started by switching the partition, wherein the system of the A partition and the system of the B partition are both main running systems, only one system is in a running state and the other system is in an idle state. For example, the system of the A partition is in a running state, and the system of the B partition is in an idle state. Since the system of the A partition is in a running state, the system of the B partition can be upgraded in the A partition, so that the device remains available during background upgrading, and after the upgrading of the system of the B partition is completed, the upgraded system of the B partition can be started by switching the partition. It can be understood that the file system partitions of the two systems both store an upgrade script and an upgrade program.

[0081] When the firmware is upgraded, if the upgrade script and the upgrade program need to be upgraded, the electronic device needs to be restarted after the upgrade script and the upgrade program of the B partition are upgraded in the A partition, enter the system of the B partition, and use the upgraded upgrade script and upgrade program to upgrade the upgrade program and the upgrade script in the system of the A partition, so that the firmware in the system of the B partition is upgraded using the latest upgrade script and upgrade program in the A partition, or the firmware in the A partition is upgraded using the latest upgrade script and upgrade program in the system of the B partition, resulting in a large number of upgrade times.

[0082] Therefore, if the upgrade script and the upgrade program need to be upgraded when the firmware is upgraded, the upgrade process is too complex, the firmware upgrade efficiency is low, and the user experience is affected.

[0083] Therefore, the application provides a firmware upgrade method. The new version of the upgrade tool (including the new version of the upgrade script and the upgrade program) is packaged into an upgrade package, the new version of the upgrade tool in the upgrade package can be used for firmware upgrade when the firmware is upgraded, the firmware is upgraded after the upgrade tool is upgraded, the firmware upgrade process is simplified, the necessary upgrade times or strict upgrade sequence requirements in the firmware upgrade are reduced, the firmware upgrade efficiency is improved, and the user experience is improved.

[0084] In order to facilitate understanding, the following describes an electronic device of an embodiment of the application. Figure 1 The electronic device of the embodiment of the application is described.

[0085] Figure 1 FIG. 1 is a structural schematic diagram of an electronic device according to an embodiment of the application. The electronic device 10 includes a first system 101 and a second system 102.

[0086] If the electronic device 10 is a single-partition device, the first system 101 is a main running system, and the second system 102 is a non-main running system. If the electronic device 10 is a dual-partition device, the first system 101 and the second system 102 are both main running systems, the first system 101 is in a running state, and the second system 102 is in an idle state. The first upgrade tool is stored in the first system 101 and the second system 102.

[0087] Specifically, the first system 101 can include a file system, and the second system 102 also includes a file system. The first upgrade tool is stored in the file system of the first system 101 and the file system of the second system 102.

[0088] It can be understood that the upgrade script of the old version and the upgrade program of the old version herein refer to the upgrade script of the current version and the upgrade program of the current version stored in the file system of the first system 101 and the file system of the second system 102.

[0089] In a possible implementation, if the electronic device 10 is a single-partition device, the first system 101 can be a Normal system, and the second system 102 can be a recovery system. Since the electronic device 10 is a single-partition device, the first system 101 and the second system 102 are in the same storage area. The Normal system and the recovery system can refer to the description above, and will not be described herein again.

[0090] In a possible implementation, if the electronic device 10 is a dual-partition device, the first system 101 can be a system in an A partition, and the second system 102 can be a system in a B partition. The A partition and the B partition are two isolated storage areas in the electronic device 10. The A partition and the B partition can refer to the description above, and will not be described herein again.

[0091] In the embodiments of the present application, the electronic device can be a device providing voice / data connectivity to a user, for example, a handheld device with wireless connection function, a vehicle-mounted device, etc. Exemplarily, the electronic device can be a mobile phone, a pad, a computer (such as a notebook computer, a palm computer, etc.) with wireless transceiver function, a mobile internet device (MID), a virtual reality (VR) device, an augmented reality (AR) device, an extended reality (XR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a 5G network, or a terminal device in a future evolved public land mobile network (PLMN), etc.

[0092] Among them, the wearable device can also be called a wearable smart device, which is a general term for devices that can be worn by applying wearable technology to the smart design and development of daily wear, such as glasses, gloves, watches, clothing, and shoes. The wearable device is a portable device that can be directly worn on the body or integrated into the user's clothes or accessories. The wearable device is not only a hardware device, but also a powerful function realized through software support and data interaction, cloud interaction. The general wearable smart device includes functions, large size, and can realize complete or partial functions without relying on a smart phone, such as smart watches or smart glasses, and focuses on a certain application function and needs to cooperate with other devices such as a smart phone, such as various smart wristbands and smart jewelry for monitoring vital signs.

[0093] In addition, the electronic device 10 can also be a terminal device in an Internet of Things (IoT) system.

[0094] The technical solutions of the present application and how the technical solutions solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can exist independently or in combination. For the same or similar concepts or processes, some embodiments may not be described again. The embodiments of the present application will be described below with reference to the drawings.

[0095] Figure 2 A flowchart of a firmware upgrade method provided by the embodiments of the present application is shown. The method can be executed by an electronic device or a firmware upgrade device provided in the electronic device. The device can be a chip, a chip module, an integrated development environment (IDE), or the like. Referring to Figure 2 The method includes the following steps:

[0096] S201, obtaining an upgrade package, the upgrade package including a new version file of a firmware to be upgraded.

[0097] In a possible implementation, the electronic device can download the upgrade package based on Over-the-Air Technology (OTA). Specifically, the electronic device can pull the upgrade package from a cloud server through a specific protocol, for example, Message Queuing Telemetry Transport (MQTT) protocol or Hypertext Transfer Protocol Secure (HTTPs).

[0098] The cloud server can be a server corresponding to the electronic device, configured to provide support for firmware upgrade in the electronic device.

[0099] It can be understood that when generating the upgrade package, the cloud server can determine whether the upgrade tool used in the electronic device needs to be upgraded. If yes, the new version of the upgrade tool can be packaged into the upgrade package.

[0100] S202, determining a target upgrade tool according to the upgrade package, the target upgrade tool including a target upgrade script and / or a target upgrade program.

[0101] The electronic device can determine the target upgrade tool according to the obtained upgrade package, so that the firmware to be upgraded can be upgraded according to the target upgrade tool.

[0102] The target upgrade tool includes a target upgrade script and / or a target upgrade program. The target upgrade script refers to a set of instructions describing specific steps of firmware upgrade (for example, including erasing a partition, writing, performing a verification, etc.), and is used to define the order of the specific steps of the upgrade. The target upgrade program refers to a binary tool that performs the upgrade operation, and is responsible for parsing the target upgrade script and executing the instructions of the target upgrade script.

[0103] It should be noted that in some scenarios, the electronic device can also achieve firmware upgrade through the target upgrade script or the target upgrade program.

[0104] For example, the electronic device can determine the target upgrade tool according to whether the new version of the upgrade tool is included in the upgrade package.

[0105] S203, upgrade the to-be-upgraded firmware to the version corresponding to the new version file according to the target upgrade tool.

[0106] After determining the target upgrade tool, the electronic device can upgrade the to-be-upgraded firmware according to the target upgrade tool, that is, upgrade the old version of the to-be-upgraded firmware to the new version according to the new version file of the to-be-upgraded firmware included in the upgrade package.

[0107] For example, the electronic device can perform a write operation on the new version file of the to-be-upgraded firmware, for example, for a dual-partition device, the new version file of the to-be-upgraded firmware can be written to the B partition, so as to upgrade the old version of the to-be-upgraded firmware in the B partition to the new version.

[0108] In this embodiment, the electronic device can obtain an upgrade package, and the upgrade package includes a new version file of to-be-upgraded firmware. Then, according to the upgrade package, the target upgrade tool is determined, and the target upgrade tool includes a target upgrade script and / or a target upgrade program. The to-be-upgraded firmware is upgraded to the version corresponding to the new version file according to the target upgrade tool. The embodiment of the present application can simplify the firmware upgrade process and reduce the necessary upgrade times or strict upgrade order requirements in firmware upgrade, thereby improving the firmware upgrade efficiency and improving the user experience.

[0109] Next, based on the foregoing Figure 1 The electronic device is exemplified to explain in detail how the electronic device obtains the target upgrade tool according to the upgrade package.

[0110] Figure 3Another flowchart of the firmware upgrading method provided by the embodiments of the present application is shown in FIG. 3, which can be executed by the electronic device or a firmware upgrading apparatus provided in the electronic device. The apparatus can be a chip, a chip module, an IDE, or the like. The method comprises the following steps: Figure 3

[0111] S301: decompressing the upgrading package by the second system.

[0112] In a possible implementation, the first system can obtain the upgrading package, and then the electronic device can store the upgrading package, for example, in a user partition, an external storage, or a storage area accessible by the second system, so that the second system can obtain the upgrading package and perform decompression processing and the like on the upgrading package.

[0113] S302: determining whether the decompressed upgrading package comprises a second upgrading tool, the second upgrading tool comprising a new version of an upgrading script and / or a new version of an upgrading program.

[0114] If yes, S303 is performed; if no, S304 is performed.

[0115] The electronic device can decompress the upgrading package by the second system, and then determine whether the decompressed upgrading package comprises a second upgrading tool, the second upgrading tool comprising a new version of an upgrading script and / or a new version of an upgrading program. If yes, it indicates that the upgrading script and / or the upgrading program in the file system of the second system need to be upgraded, and need to be upgraded to the new version of the upgrading script and / or the new version of the upgrading program.

[0116] S303: extracting the second upgrading tool from the upgrading package by the first upgrading tool of the second system, and determining the target upgrading tool as the second upgrading tool.

[0117] If the decompressed upgrading package comprises the second upgrading tool, the electronic device can extract the second upgrading tool from the upgrading package by the first upgrading tool of the second system, that is, extract the second upgrading tool from the upgrading package by the old version of the upgrading tool of the second system, and determine the target upgrading tool according to the second upgrading tool.

[0118] It can be understood that if the upgrading package comprises the second upgrading tool:

[0119] If the target upgrading tool comprises a target upgrading script and a target upgrading program, the second upgrading tool in the upgrading package can comprise a new version of an upgrading script and / or a new version of an upgrading program; if the target upgrading tool comprises a target upgrading script, the second upgrading tool in the upgrading package can comprise a new version of an upgrading script; if the target upgrading tool comprises a target upgrading program, the second upgrading tool in the upgrading package can comprise a new version of an upgrading program.​

[0120] Based on this, the target upgrade tool determined above has the following cases:

[0121] Case 1: The target upgrade tool includes a target upgrade script and a target upgrade program

[0122] (1) If the second upgrade tool includes a new version of the upgrade script, that is, there is no new version of the upgrade program, it indicates that the upgrade program does not need to be updated, so the target upgrade script can be determined as the new version of the upgrade script, and the target upgrade program is the old version of the upgrade program.

[0123] (2) If the second upgrade tool includes a new version of the upgrade program, that is, there is no new version of the upgrade script, it indicates that the upgrade script does not need to be updated, so the target upgrade program can be determined as the new version of the upgrade script, and the target upgrade script is the old version of the upgrade script.

[0124] (3) If the second upgrade tool includes a new version of the upgrade script and a new version of the upgrade program, it indicates that both the upgrade script and the upgrade program need to be upgraded, so the new version of the upgrade script can be determined as the target upgrade script, and the new version of the upgrade program is determined as the target upgrade program.

[0125] Case 2: The target upgrade tool includes a target upgrade script, which can be determined as a new version of the upgrade script.

[0126] Case 3: The target upgrade tool includes a target upgrade program, which can be determined as a new version of the upgrade program.

[0127] S304, determine that the target upgrade tool is the first upgrade tool, and the first upgrade tool includes an old version of the upgrade script and / or an old version of the upgrade program.

[0128] If the second upgrade tool is not included in the decompressed upgrade package, it indicates that the upgrade script and the upgrade program in the file system of the second system do not need to be upgraded, and the electronic device can determine that the target upgrade tool is the first upgrade tool, that is, the old version of the upgrade script is determined as the target upgrade script and / or the old version of the upgrade program is determined as the target upgrade program, that is, the old version of the upgrade script and / or the old version of the upgrade program can be used for firmware upgrade.

[0129] In the embodiment, the electronic device can decompress the upgrade package through the second system, and determine whether the decompressed upgrade package includes the second upgrade tool. If yes, the second upgrade tool is extracted from the upgrade package through the first upgrade tool of the second system, and the target upgrade tool is determined according to the second upgrade tool. If no, the target upgrade tool is determined as the first upgrade tool. Thus, when the upgrade package includes the new version of the upgrade script and / or the new version of the upgrade program, the firmware upgrade is directly performed based on the new version of the upgrade script and / or the new version of the upgrade program.

[0130] In the following, the target upgrade tool includes the target upgrade script and the target upgrade program as an example, the firmware upgrade is performed based on Figure 1 The electronic device of the example is used to illustrate the firmware upgrade of the electronic device based on the target upgrade tool.

[0131] In a possible implementation, if the target upgrade tool is the first upgrade tool, and the first upgrade tool includes the old version of the upgrade script and the old version of the upgrade program, the electronic device can run the old version of the upgrade script through the second system, execute the old version of the upgrade program through the old version of the upgrade script, and upgrade the to-be-upgraded firmware of the first system, so that the to-be-upgraded firmware is upgraded to the version corresponding to the new version file.

[0132] Taking the electronic device as a single-partition device and the to-be-upgraded firmware as the firmware in the Normal system as an example, after the electronic device obtains the upgrade package through the Normal system, the electronic device enters the recovery system, can run the old version of the upgrade script through the recovery system, execute the old version of the upgrade program through the old version of the upgrade script, and upgrade the to-be-upgraded firmware of the Normal system.

[0133] Taking the electronic device as a dual-partition device and the to-be-upgraded firmware as the firmware of the system in the A partition as an example, the electronic device can enter the system of the B partition, run the old version of the upgrade script through the system of the B partition, execute the old version of the upgrade program through the old version of the upgrade script, and upgrade the to-be-upgraded firmware of the system in the A partition, that is, the firmware upgrade of the system in the B partition is realized in the system in the A partition. It can be understood that the firmware upgrade of the system in the A partition can also be realized in the system in the B partition.

[0134] In a possible implementation, taking the target upgrade tool including the target upgrade script and the target upgrade program as an example, if the target upgrade tool is not the first upgrade tool, that is, the target upgrade tool includes the target upgrade script and the target upgrade program, the above three cases (1), (2) and (3) in case 1 exist, the electronic device can run the old version of the upgrade script through the second system, execute the old version of the upgrade program through the old version of the upgrade script, and upgrade the to-be-upgraded firmware of the first system. Figure 4 The corresponding embodiments are used for firmware upgrade, and the old version of the upgrade script and / or the old version of the upgrade program is upgraded through Figure 5 the corresponding embodiments.

[0135] Figure 4 A flowchart of another firmware upgrading method provided by the embodiments of the present application is shown in FIG. 4. The method can be executed by an electronic device or a firmware upgrading device provided in the electronic device. The device can be a chip, a chip module, an IDE, or the like. The method includes the following steps. Figure 4

[0136] S401: Running a target upgrading script through a second system.

[0137] The electronic device can run the target upgrading script through the second system.

[0138] If the target upgrading script is a new version of the upgrading script, the firmware upgrading can be performed without the upgrading script upgrading, that is, the firmware upgrading can be performed through the new version of the upgrading script.

[0139] S402: Executing a target upgrading program through the target upgrading script to upgrade the firmware to be upgraded of the first system, so that the firmware to be upgraded is upgraded to a version corresponding to a new version file.

[0140] After running the target upgrading script, the target upgrading program can be executed through the instructions in the target upgrading script, so that the firmware to be upgraded of the first system is upgraded, and the firmware to be upgraded is upgraded to a version corresponding to a new version file.

[0141] It can be understood that if the target upgrading program is a new version of the upgrading program, the firmware upgrading can be performed without the upgrading script upgrading, that is, the firmware upgrading can be performed through the new version of the upgrading script.

[0142] In the embodiment, if it is determined that the target upgrading tool includes a new version of the upgrading script and / or a new version of the upgrading program, that is, the upgrading script and / or the upgrading program needs to be upgraded, the new version of the upgrading script and / or the new version of the upgrading program can be directly run through the second system, and the upgrading of the upgrading script and the upgrading program can be performed, that is, the firmware upgrading can be performed through the new version of the upgrading script and / or the new version of the upgrading program, and the firmware upgrading efficiency is improved.

[0143] In a possible implementation, when the target upgrading script is run through the second system and the target upgrading program is executed through the target upgrading script to upgrade the firmware to be upgraded of the first system, the target upgrading program can also be executed through the target upgrading script to upgrade the first upgrading tool of the first system, and the first upgrading tool of the first system is upgraded to a third upgrading tool.

[0144] Specifically, the third upgrading tool includes any one of the following: ​

[0145] the new version of the upgrade script and the old version of the upgrade procedure;

[0146] the new version of the upgrade procedure and the old version of the upgrade script;

[0147] the new version of the upgrade script and the new version of the upgrade procedure;

[0148] the new version of the upgrade script;

[0149] the new version of the upgrade procedure.

[0150] If the third upgrade tool includes the new version of the upgrade script and the old version of the upgrade procedure, it indicates that the second upgrade tool includes the new version of the upgrade script, that is, there is no new version of the upgrade script, and the upgrade procedure does not need to be updated, so the third upgrade tool can include the new version of the upgrade script and the old version of the upgrade procedure.

[0151] The third upgrade tool includes the new version of the upgrade script, which indicates that the electronic device only implements firmware upgrade through the upgrade script, and at this time, the third upgrade tool includes the new version of the upgrade script.

[0152] The third upgrade tool includes the new version of the upgrade procedure and the old version of the upgrade script, which indicates that the second upgrade tool includes the new version of the upgrade procedure, that is, there is no new version of the upgrade script, and the upgrade script does not need to be updated, so the third upgrade tool can include the new version of the upgrade procedure and the old version of the upgrade script.

[0153] The third upgrade tool includes the new version of the upgrade procedure, which indicates that the electronic device only implements firmware upgrade through the upgrade procedure, and at this time, the third upgrade tool includes the new version of the upgrade procedure.

[0154] The third upgrade tool includes the new version of the upgrade script and the new version of the upgrade procedure, which indicates that the second upgrade tool includes the new version of the upgrade script and the new version of the upgrade procedure, that is, the upgrade script and the upgrade procedure both need to be upgraded, so the third upgrade tool can include the new version of the upgrade script and the new version of the upgrade procedure.

[0155] The following takes the target upgrade tool including the target upgrade script and the target upgrade procedure as an example to illustrate the upgrade of the upgrade tool and the firmware. Figure 5

[0156] Figure 5 The following takes the target upgrade tool including the target upgrade script and the target upgrade procedure as an example to illustrate the upgrade of the upgrade tool and the firmware. Figure 5 The method includes the following steps:

[0157] ​S501, the electronic device acquires the upgrade package through the first system.

[0158] S502, the electronic device stores the upgrade package in a preset storage area.

[0159] For example, the preset storage area can be a user partition, an external storage, or other storage area accessible by the second system, so that the second system can acquire the upgrade package.

[0160] S503, the second system acquires the upgrade package in the preset storage area.

[0161] S504, the second system runs the target upgrade script.

[0162] S505, the target upgrade script executes the target upgrade program to upgrade the to-be-upgraded firmware of the first system, so that the to-be-upgraded firmware is upgraded to the version corresponding to the new version file.

[0163] S506, the target upgrade script executes the target upgrade program to upgrade the first upgrade tool of the first system, and upgrades the first upgrade tool of the first system to the third upgrade tool.

[0164] In this embodiment, when the electronic device upgrades the firmware of the first system through the second system, the upgrade tool of the first system can be upgraded at the same time, without the need to upgrade the upgrade tool first and then upgrade the firmware, which simplifies the firmware upgrade process, reduces the necessary upgrade times or strict upgrade sequence requirements in firmware upgrade, thereby improving the firmware upgrade efficiency and improving the user experience.

[0165] In a possible implementation, after the first upgrade tool of the first system and the to-be-upgraded firmware are upgraded, the electronic device is restarted to enter the first system, and the first upgrade tool of the second system is upgraded through the third upgrade tool of the first system. Specifically, after the first upgrade tool of the second system is upgraded, it is the same as the third upgrade tool, and the description of the third upgrade tool can be referred to, which will not be described here.

[0166] Next, taking the electronic device as a single-partition device and a dual-partition device as an example, and taking the second upgrade tool as an example including a new version of the upgrade script and a new version of the upgrade program, the Figure 5 The corresponding embodiments are exemplified as follows:

[0167] Taking an electronic device as a single-partition example, for example, the electronic device is a mobile phone, after the electronic device is powered off, the electronic device can take the example of upgrading the Normal system in the recovery system, the Normal system can acquire an upgrade package, and store the upgrade package in a user partition (a storage area independent of the recovery system and the Normal system, an area for storing user data and application programs), an external storage, or other storage areas accessible by the recovery system, a user can press a key (for example, a volume key + and a power key) or use other methods to make the electronic device enter the recovery system. The recovery system can acquire the upgrade package and perform operations such as verification and decompression on the upgrade package, if the upgrade package contains a new version of the upgrade tool, the recovery system can run the new upgrade tool in the memory, that is, run the new version of the upgrade script in the memory, so that the new version of the upgrade script is executed to perform the new version of the upgrade program, and the to-be-upgraded firmware of the Normal system is upgraded. At the same time, the recovery system can run the new upgrade tool in the memory to upgrade the old version of the upgrade tool of the Normal system, so that the upgrade tool in the recovery system is the new version of the upgrade tool.

[0168] After the electronic device is restarted after the to-be-upgraded firmware of the Normal system and the upgrade tool are upgraded, the electronic device can use the new version of the upgrade tool in the Normal system to upgrade the old version of the upgrade tool of the recovery system, so that the upgrade tool in the recovery system is also the latest version of the upgrade tool. Then the electronic device is restarted, and the electronic device enters the Normal system to run the upgraded firmware.

[0169] In a possible implementation, in a single-partition device, if the recovery system is upgraded in the Normal system, since the Normal system can acquire the upgrade package and perform operations such as verification and decompression on the upgrade package, if the upgrade package contains a new version of the upgrade tool (that is, the second upgrade tool), the Normal system can run the new upgrade tool in the memory, that is, run the new version of the upgrade script in the memory, so that the new version of the upgrade program is executed through the new version of the upgrade script, and the to-be-upgraded firmware of the recovery system is upgraded. At the same time, the Normal system can run the new upgrade tool in the memory to upgrade the old version of the upgrade tool of the recovery system. After the to-be-upgraded firmware and the upgrade tool of the recovery system are upgraded, the electronic device is restarted, and the user can press a key (for example, the volume + key and the power key) or use other methods to make the electronic device enter the recovery system. The recovery system can run the new version of the upgrade tool in the memory, that is, run the new version of the upgrade script in the memory, so that the new version of the upgrade program is executed through the new version of the upgrade script, and the old version of the upgrade tool of the Normal system is upgraded.

[0170] Taking the electronic device as a dual-partition example and taking the system in the B partition as an example, the electronic device acquires the upgrade package through the system in the A partition, and stores the upgrade package in a user partition (a storage area independent of the system in the A partition and the system in the B partition, an area used to store user data and application programs), an external storage, or another storage area accessible by the system in the B partition. The system in the B partition verifies and decompresses the upgrade package, and if the upgrade package contains a new version of the upgrade tool, the system in the B partition runs the new version of the upgrade tool in the upgrade package to upgrade the to-be-upgraded firmware of the system in the A partition. At the same time, the new version of the upgrade tool in the upgrade package can be run in the system in the B partition to upgrade the old version of the upgrade tool of the system in the A partition, and the to-be-upgraded firmware and the upgrade tool of the system in the A partition are upgraded after the electronic device is restarted.

[0171] The electronic device is restarted to enter the system in the A partition, for example, the to-be-upgraded firmware of the system in the A partition is firmware 1, whether the firmware 1 in the system in the B partition is upgraded can be determined according to user needs, that is, the firmware upgrade is synchronized with the system in the A partition, or the synchronization is not maintained. If synchronization is needed, a synchronization process (without performing an upgrade process) is performed, so that the system in the A partition and the system in the B partition both maintain the same firmware version. The new version of the upgrade tool can be run in the system in the A partition to upgrade the old version of the upgrade tool of the system in the B partition, so that the upgrade tool of the system in the B partition is the new version.

[0172] If the system in the A partition is upgraded, the electronic device acquires the upgrade package through the system in the A partition, the system in the A partition checks and decompresses the upgrade package, if the upgrade package contains the new version of the upgrade tool, the upgrade tool in the upgrade package is run in the system in the A partition to upgrade the to-be-upgraded firmware of the system in the B partition. At the same time, the upgrade tool in the upgrade package is run in the system in the A partition to upgrade the old version of the upgrade tool of the system in the B partition, so that the old version of the upgrade tool of the system in the B partition is upgraded to the new version of the upgrade tool in the upgrade package.

[0173] After the to-be-upgraded firmware and the old version of the upgrade tool of the system in the B partition are upgraded, the electronic device waits for the user to trigger the restart of the electronic device, the electronic device enters the system in the B partition after restarting, for example, the to-be-upgraded firmware of the system in the B partition is firmware 1, whether the firmware 1 in the system in the A partition is upgraded can be determined according to the user demand, that is, the firmware upgrade is synchronized with the system in the B partition, or not. If synchronization is needed, a synchronization process is performed, so that the system in the A partition and the system in the B partition both maintain the same firmware version. The new version of the upgrade tool can be run in the system in the B partition to upgrade the old version of the upgrade tool of the system in the A partition, so that the upgrade tool of the system in the A partition is the new version.

[0174] Based on the above example, when upgrading the firmware, if the upgrade tool is upgraded, when the firmware of one system 1 is upgraded to another system 2, the upgrade tool of the system 1 does not need to be upgraded, and the firmware of the system 2 can also be upgraded, avoiding the need to upgrade the upgrade tool first and then upgrade the firmware, simplifying the firmware upgrade process, reducing the necessary upgrade times or strict upgrade sequence requirements, thereby improving the firmware upgrade efficiency and improving the user experience.

[0175] Next, taking the second upgrade tool including the new version of the upgrade script and the new version of the upgrade program as an example, Figure 6 A flowchart of another firmware upgrade method provided by the embodiments of the present application is provided, which can be executed by the electronic device or the firmware upgrade device provided in the electronic device, which can be a chip, a chip module, an IDE, etc., and the like, please refer to Figure 6 The method comprises the following steps:

[0176] S601, acquiring an upgrade package.

[0177] S602, decompressing the upgrade package.

[0178] S603, judging whether the second upgrade tool in the upgrade package includes a new version of an upgrade script and a new version of an upgrade program.

[0179] If yes, S604 is performed; if no, S606 is performed.

[0180] S604, running the upgrade script of the new version in the upgrade package.

[0181] S605, calling the upgrade program of the new version in the upgrade package to perform the firmware upgrade.

[0182] S606, running the upgrade script of the old version in the file system.

[0183] S607, calling the upgrade program of the old version in the file system to perform the firmware upgrade.

[0184] S608, the upgrade is completed.

[0185] It can be understood that the file system can be a file system in a system performing the firmware upgrade, for example, the firmware in the Normal system is upgraded in the recovery system, and the file system herein is the file system in the recovery system.

[0186] In this embodiment, the upgrade tool of the new version (including the upgrade script and the upgrade program of the new version) is packaged into the upgrade package, and the upgrade tool of the new version in the upgrade package can be used to perform the firmware upgrade when the firmware is upgraded, so that the firmware can be upgraded without first upgrading the upgrade tool, the firmware upgrade process is simplified, the necessary upgrade times or strict upgrade sequence requirements are reduced, the firmware upgrade efficiency is improved, and the user experience is improved.

[0187] Figure 7 A structural schematic diagram of a firmware upgrade device provided by the embodiment of the present application is provided. The device 70 is applied to an electronic device, and the device 70 includes an acquisition module 701, a determination module 702, and an upgrade module 703.

[0188] The acquisition module 701 is configured to acquire an upgrade package, and the upgrade package includes a new version file of a firmware to be upgraded.

[0189] The determination module 702 is configured to determine a target upgrade tool according to the upgrade package, and the target upgrade tool includes a target upgrade script and / or a target upgrade program.

[0190] The upgrade module 703 is configured to upgrade the firmware to be upgraded to a version corresponding to the new version file according to the target upgrade tool.

[0191] In a possible implementation, the electronic device includes a first system and a second system; the first system and the second system each store a first upgrade tool; if the electronic device is a single-partition device, the first system is a main running system, and the second system is a non-main running system; if the electronic device is a dual-partition device, the first system is in a running state, and the second system is in an idle state; the determining module 702 is specifically configured to:

[0192] decompress the upgrade package through the second system, and determine whether the second upgrade tool is included in the decompressed upgrade package, the second upgrade tool including a new version of an upgrade script and / or a new version of an upgrade program;

[0193] if yes, extract the second upgrade tool from the upgrade package through the first upgrade tool of the second system, and determine the target upgrade tool according to the second upgrade tool;

[0194] if no, determine that the target upgrade tool is the first upgrade tool, and the first upgrade tool includes an old version of an upgrade script and / or an old version of an upgrade program.

[0195] In a possible implementation, the target upgrade tool is not the first upgrade tool, and the target upgrade tool includes a target upgrade script and a target upgrade program; the upgrading module 703 is specifically configured to:

[0196] run the target upgrade script through the second system;

[0197] execute the target upgrade program through the target upgrade script, and upgrade the to-be-upgraded firmware of the first system, so that the to-be-upgraded firmware is upgraded to a version corresponding to the new version file.

[0198] In a possible implementation, the upgrading module 703 is further configured to:

[0199] execute the target upgrade program through the target upgrade script, and upgrade the first upgrade tool of the first system to a third upgrade tool;

[0200] The third upgrade tool includes any one of the following:

[0201] a new version of an upgrade script and an old version of an upgrade program;

[0202] a new version of an upgrade program and an old version of an upgrade script;

[0203] a new version of an upgrade script and a new version of an upgrade program;

[0204] a new version of an upgrade script;

[0205] a new version of an upgrade program.

[0206] In a possible implementation, the upgrading module 703 is further configured to:

[0207] After the electronic device is restarted, the first upgrade tool of the second system is upgraded by the third upgrade tool of the first system.

[0208] In a possible implementation, the target upgrade tool is the first upgrade tool, the first upgrade tool includes an old version of an upgrade script and an old version of an upgrade program, and the upgrade module 703 is specifically configured to:

[0209] run the old version of the upgrade script through the second system;

[0210] execute the old version of the upgrade program through the old version of the upgrade script to upgrade the to-be-upgraded firmware of the first system, so that the to-be-upgraded firmware is upgraded to a version corresponding to the new version file.

[0211] The apparatus of the embodiment can be used to execute the steps of the firmware upgrade method in the above-described embodiments, and the specific implementation manners and technical effects are similar, which will not be described here again.

[0212] Figure 8 A structural schematic diagram of an electronic device provided in the embodiment of the present application is shown in FIG. 8. Figure 8 As shown in FIG. 8, the electronic device 80 can include at least one processor 801 and a memory 802.

[0213] The memory 802 is configured to store a program. Specifically, the program can include program code, and the program code includes computer execution instructions.

[0214] The memory 802 can include a random access memory (RAM) and can also include a non-volatile memory such as at least one disk memory.

[0215] The processor 801 is configured to execute the computer execution instructions stored in the memory 802 to implement the method described in the foregoing method embodiments. The processor 801 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0216] Optionally, the electronic device 80 can further include a communication interface 803. In a specific implementation, if the communication interface 803, the memory 802, and the processor 801 are independently implemented, the communication interface 803, the memory 802, and the processor 801 can be connected with each other through a bus and complete communication therebetween. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.

[0217] Optionally, in a specific implementation, if the communication interface 803, the memory 802, and the processor 801 are integrated on a chip, the communication interface 803, the memory 802, and the processor 801 can complete communication through an internal interface.

[0218] The electronic device 80 can be a chip, a chip module, a smart home device, a smart wearable device, a smart vehicle, etc.

[0219] The electronic device of the embodiment can be used to execute the technical solutions of the method embodiments, and the specific implementation manners and technical effects are similar, which will not be described here.

[0220] The embodiment of the present application provides a computer readable storage medium, which can include: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a RAM, a magnetic disk or an optical disk, and various media that can store computer execution instructions, specifically, the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a computer to execute the technical solutions shown in the above method embodiments, and the specific implementation manners and technical effects are similar, which will not be described here.

[0221] The embodiment of the present application provides a computer program product, including a computer program, and the computer program is executed by a computer to execute the technical solutions shown in the above method embodiments, and the specific implementation manners and technical effects are similar, which will not be described here.

[0222] The embodiment of the present application provides a chip, which includes at least one processor and an interface circuit, the interface circuit is connected with the at least one processor, and the processor executes the technical solutions shown in the above method embodiments by running program instructions.

[0223] In a possible implementation, the chip can also be a chip module.

[0224] The chip of the embodiment can be used to execute the technical solutions shown in the method embodiments, and the specific implementation manners and technical effects are similar, which will not be described here again

[0225] The embodiment of the application provides a module device, which comprises a power module, a storage module and a chip module.

[0226] The power module is configured to provide power for the module device.

[0227] The storage module is configured to store data and instructions.

[0228] The chip module of the embodiment can be used to execute the technical solutions shown in the method embodiments, and the specific implementation manners and technical effects are similar, which will not be described here again.

[0229] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The specification and examples given are exemplary only and the true scope and spirit of the application is indicated by the following claims. The true scope and spirit of the application is indicated by the following claims.

[0230] It should be understood that the application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the appended claims.

[0231] In the present application, "and / or" is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in this paper represents an "or" relationship between the associated objects before and after it.

[0232] "at least one of" or the like means any combination of these items, including single item (one) or any combination of multiple items. For example, at least one of a, b or c can mean a, b, c, a and b, a and c, b and c, or a, b and c, wherein each of a, b and c can be an element or a set containing one or more elements.

[0233] At least one in the present application refers to one or more. Multiple refers to two or more. The first, second and the like appearing in the embodiments of the present application are only for the purpose of description and distinction of the description objects, and do not have the order, nor represent the special limitation of the number of devices in the embodiments of the present application, and cannot constitute any limitation on the embodiments of the present application. For example, the first threshold and the second threshold are only used to distinguish different thresholds, and do not represent the difference of the size, priority or importance of the two thresholds.

[0234] In the present application, "example", "in some embodiments", "in another embodiment" and the like are used to represent as an example, illustration or description. Any embodiment or design scheme described as "example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the use of the word example is intended to present the concept in a specific way.

[0235] In the present application, "of", "corresponding", "corresponding", "relevant" and "corresponding" can be used interchangeably. It should be pointed out that when the distinction is not emphasized, the meaning expressed is consistent. In the embodiments of the present application, communication and transmission can be used interchangeably. It should be pointed out that when the distinction is not emphasized, the meaning expressed is consistent. For example, transmission can include sending and / or receiving, and can be a noun or a verb.

Claims

1. A firmware upgrade method, characterized in that: Applied to electronic equipment, the method includes: Obtain an upgrade package, wherein the upgrade package includes a new version file of the firmware to be upgraded; Determining a target upgrade tool based on the upgrade package, wherein the target upgrade tool includes a target upgrade script and / or a target upgrade program; According to the target upgrade tool, the firmware to be upgraded is upgraded to the version corresponding to the new version file.

2. The method according to claim 1, characterized in that The electronic device includes a first system and a second system; a first upgrade tool is stored in both the first system and the second system; if the electronic device is a single-partition device, the first system is a primary operating system and the second system is a non-primary operating system; if the electronic device is a dual-partition device, the first system is in a running state and the second system is in an idle state; Determine the target upgrade tool based on the upgrade package, including: decompressing the upgrade package through the second system and determining whether the decompressed upgrade package includes a second upgrade tool, wherein the second upgrade tool includes a new version of the upgrade script and / or a new version of the upgrade program; If so, extracting the second upgrade tool from the upgrade package using the first upgrade tool of the second system, and determining the target upgrade tool based on the second upgrade tool; If not, it is determined that the target upgrade tool is a first upgrade tool, and the first upgrade tool includes an old version of the upgrade script and / or an old version of the upgrade program.

3. The method according to claim 2, characterized in that The target upgrade tool is not the first upgrade tool, and the target upgrade tool includes a target upgrade script and a target upgrade program; Upgrading the firmware to be upgraded to a version corresponding to the new version file according to the target upgrade tool includes: running the target upgrade script through the second system; The target upgrade program is executed through the target upgrade script to upgrade the firmware to be upgraded of the first system, so that the firmware to be upgraded is upgraded to the version corresponding to the new version file.

4. The method according to claim 3, characterized in that The method further comprises: Executing the target upgrade program through the target upgrade script to upgrade the first upgrade tool of the first system to a third upgrade tool; The third upgrade tool includes any one of the following: Upgrade scripts for new versions and upgrade programs for old versions; Upgrade program for new version and upgrade script for old version; New version upgrade script and new version upgrade program; New version upgrade script; New version upgrade program.

5. The method according to claim 4, characterized in that The method further comprises: After the electronic device is restarted, the first upgrading tool of the second system is upgraded by the third upgrading tool of the first system.

6. The method according to claim 2, characterized in that The target upgrade tool is the first upgrade tool, which includes an upgrade script of an old version and an upgrade program of an old version; Upgrading the firmware to be upgraded to a version corresponding to the new version file according to the target upgrade tool includes: Running the upgrade script of the old version through the second system; The upgrade program of the old version is executed through the upgrade script of the old version to upgrade the firmware to be upgraded of the first system, so that the firmware to be upgraded is upgraded to the version corresponding to the new version file.

7. A firmware upgrade device, characterized in that: Used in electronic equipment, including: An acquisition module, configured to acquire an upgrade package, wherein the upgrade package includes a new version file of the firmware to be upgraded; a determination module, configured to determine a target upgrade tool based on the upgrade package, wherein the target upgrade tool includes a target upgrade script and / or a target upgrade program; An upgrading module is used to upgrade the firmware to be upgraded to a version corresponding to the new version file according to the target upgrading tool.

8. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.