CN113760336A - Software upgrading method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN113760336A
CN113760336A CN202110742775.6A CN202110742775A CN113760336A CN 113760336 A CN113760336 A CN 113760336A CN 202110742775 A CN202110742775 A CN 202110742775A CN 113760336 A CN113760336 A CN 113760336A
Authority
CN
China
Prior art keywords
electronic product
upgrading
software
software upgrading
package
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
CN202110742775.6A
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.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication 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 Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN202110742775.6A priority Critical patent/CN113760336A/en
Publication of CN113760336A publication Critical patent/CN113760336A/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
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order

Landscapes

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

Abstract

The invention discloses a software upgrading method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: storing the first electronic product software upgrading package in a second electronic product, and setting a software upgrading identifier, wherein the second electronic product is electrically connected with the first electronic product; the first electronic product starts to be upgraded, and the power failure state in the upgrading process is obtained; and judging the power failure state in the upgrading process, if so, reading the software upgrading identifier when the first electronic product is electrified next time, starting uboot upgrading, downloading a software upgrading package from the second electronic product to the first electronic product, and otherwise, normally starting the first electronic product. The software upgrading is completed by storing the software upgrading package of the first electronic product in the second electronic product and downloading the upgrading package from the second electronic product when the power failure occurs in the upgrading process of the first electronic product, and the method is particularly suitable for double main control products with different FLASH sizes.

Description

Software upgrading method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of software upgrading technologies, and in particular, to a software upgrading method and apparatus, an electronic device, and a storage medium.
Background
In the whole production cycle of the electronic product, a plurality of software versions need to be iterated through the over-the-air software upgrading of the mobile terminal, so that the known problems can be repaired and the functions can be optimized. For electronic products with little flash space and no space for storing upgrade packages, when software is upgraded, if abnormal power failure occurs, a system is down and cannot be used.
Thus, significant advances in the art are needed.
Disclosure of Invention
The invention mainly aims to provide a software upgrading method, and aims to solve the technical problems that an existing electronic product with a flash space less and no space for storing an upgrading packet can cause system downtime and can not be used if abnormal power failure occurs during software upgrading.
In order to achieve the above object, the present invention provides a software upgrading method, including:
storing the first electronic product software upgrading package in a second electronic product, and setting a software upgrading identifier, wherein the second electronic product is electrically connected with the first electronic product;
the first electronic product starts to be upgraded, and the power failure state in the upgrading process is obtained;
and judging the power failure state of the first electronic product in the upgrading process, if so, reading a software upgrading identifier when the first electronic product is electrified next time, starting uboot upgrading, downloading the software upgrading package from the second electronic product to the first electronic product, and otherwise, starting the first electronic product normally.
Preferably, the starting of uboot upgrade comprises:
erasing the ROM;
updating the mirror image file;
clearing a software upgrading identifier;
the first electronic product carries out software upgrading;
and restarting after the software is upgraded.
Preferably, the second electronic product is connected with the first electronic product through a USB or a Bluetooth.
Preferably, the storing the first electronic product software upgrade package in the second electronic product comprises:
creating a mirror image file in the second electronic product;
virtualizing the mirror image file into block equipment;
formatting the block device into fat32 format;
mounting the block device in a vfat format;
and setting the USB flash disk as a first starting disk.
Preferably, the first electronic product starts to be upgraded, and acquiring the power failure state in the upgrading process includes:
and when the first electronic product starts to be upgraded, starting a thread to track the power-down state of the first electronic product.
Preferably, the first electronic product and the second electronic product are any one of a watch, a smart phone, a telephone, a television, a video disc player, a video recorder, a camcorder, a radio cassette, a combination speaker, a laser player, a computer, a game machine and a router.
Correspondingly, the invention also provides a software upgrading device, which comprises:
the first electronic product is provided with a uboot, and a software upgrading identifier is set;
the second electronic product is electrically connected with the first electronic product and stores the software upgrading package of the first electronic product;
the upgrading power-down state acquisition module is arranged on the first electronic product and used for acquiring the power-down state in the upgrading of the first electronic product;
the software upgrading module is arranged on the second electronic product and used for judging the power failure state in the upgrading process, if the power failure state is true, the software upgrading identification is read when the first electronic product is powered on next time, uboot upgrading is started, the software upgrading package is downloaded from the second electronic product to the first electronic product, and otherwise, the first electronic product is started normally;
and the storage module is arranged on the second electronic product.
Preferably, the software upgrade module includes:
the ROM erasing module is used for erasing the ROM;
the image file updating module is used for updating the image file;
the software upgrading identifier clearing module is used for clearing the software upgrading identifier;
the software upgrading execution module is used for upgrading the software of the first electronic product;
and the restarting module is used for restarting the first electronic product after the software of the first electronic product is upgraded.
In another aspect, the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the software upgrading method are implemented.
In another aspect, the present invention further provides a storage medium, which stores a computer program, and the computer program realizes the steps of the software upgrading method when being executed by a processor.
According to the software upgrading method, the device, the electronic equipment and the storage medium, the software upgrading package of the first electronic product is stored in the second electronic product, and when the power failure occurs in the upgrading process of the first electronic product, the software upgrading is completed by downloading the upgrading package from the second electronic product, so that the software upgrading method and the device are particularly suitable for double main control products with different FLASH sizes.
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, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a flowchart of an embodiment of a software upgrade method of the present invention;
FIG. 2 is a diagram of one embodiment used in FIG. 1;
FIG. 3 is a flow chart of a B master method used in FIG. 1;
FIG. 4 is a flowchart of the A master upgrade method used in FIG. 1;
FIG. 5 is a flowchart of another embodiment of a software upgrade method of the present invention;
FIG. 6 is a schematic structural diagram of a software upgrading apparatus according to an embodiment of the present invention;
fig. 7 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, if directional indications (such as up, down, left, right, front, and back … …) are involved in the embodiment of the present invention, the directional indications are only used to explain the relative positional relationship between the components, the movement situation, and the like in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indications are changed accordingly.
In addition, if there is a description of "first", "second", etc. in an embodiment of the present invention, the description of "first", "second", etc. is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
The software upgrading method provided by the embodiment of the application can be applied to various server terminals and terminals. The server-side and terminal devices include, but are not limited to, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, tablet computers, PDAs, media players, etc.), consumer electronics devices, vehicle-mounted computers, smart watches, televisions, and other terminal devices with display screens, etc.
FOTA (Firmware Over-The-Air) is a means to upgrade a mobile phone in a user's hand efficiently and reliably by Over-The-Air. In this way, mobile phone manufacturers can more quickly launch mobile phones with new functions to the market and thus improve the satisfaction of users with their mobile phones. The over-the-air software upgrading of the FOTA mobile terminal refers to that the FOTA mobile terminal is equipment with a networking function through a cloud upgrading technology: for example, a mobile phone, a tablet computer, a portable media player, a mobile internet device and the like provide firmware upgrading services, a user obtains an intelligent terminal system upgrading package in an on-demand and easily-extensible manner by using a network, and performs cloud upgrading through FOTA to complete system repair and optimization.
The essence of FOTA is firmware upgrade, including upgrade of drivers, systems, functions, applications, etc., and has no direct relationship to hardware. The applicable terminal range is wide, the upgrading service can be basically provided for all terminals in the market, and the upgrading requirements of a large number of users can be processed at the same time through cluster application, grid technology and distributed service terminals for telecom operators and terminal equipment manufacturers. The FOTA is closely related to the OS, different OS versions need to be developed, and a system upgrade package downloaded through a FOTA module needs to be closely matched with the OS, so that not only hardware-driven debugging but also version compatibility testing are required, but such upgrade package is generally provided by a terminal manufacturer, and more FOTA is required to ensure that the upgrade package is downloaded and installed to the terminal.
Example one
FIG. 1 is a flowchart of an embodiment of a software upgrading method according to the present invention. In an embodiment of the present invention, as shown in fig. 1, a software upgrading method includes the steps of:
and S1, storing the first electronic product software upgrading package in a second electronic product, setting a software upgrading identifier, and electrically connecting the second electronic product with the first electronic product.
The second electronic product is connected with the first electronic product through a USB or a Bluetooth.
Storing the first electronic product software upgrade package in the second electronic product comprises:
creating a mirror image file in a second electronic product;
virtualizing the mirror image file into block equipment;
formatting the block device into fat32 format;
mounting the block device in a vfat format;
and setting the USB flash disk as a first starting disk.
And S2, the first electronic product starts to be upgraded, and the power failure state in the upgrading process is obtained.
In specific implementation, the first electronic product starts to be upgraded, and acquiring the power failure state in the upgrading process may include: and when the first electronic product starts to be upgraded, synchronously starting the thread to track the power-down state of the first electronic product. In the first electronic product upgrading process, the system can detect the progress in the upgrading process. If the power supply environment is normal, normal upgrading can be carried out, and the upgrading progress is from 0 to 100%. If the system suddenly encounters an adverse condition and the power is cut off in the upgrading process, the upgrading progress and the power-off state in the upgrading process are detected. If the power is lost in the upgrading process, the power-down state in the upgrading process can be set to true, otherwise, false can be set. The power-down state during the upgrade process may be saved in the uboot.
S3, judging the power failure state of the first electronic product in the upgrading process, if true, reading the software upgrading identification of the first electronic product when the first electronic product is electrified next time, starting uboot upgrading, downloading the software upgrading package from the second electronic product to the first electronic product, otherwise, normally starting the first electronic product.
In specific implementation, starting the uboot upgrade may further include the steps of:
s31, erasing the ROM;
s32, updating the mirror image file;
s33, clearing the software upgrading identification;
s34, upgrading software of the first electronic product;
and S35, restarting the software after the software is upgraded.
The first electronic product is any one of a watch, a smart phone, a telephone, a television, a video disc player, a video recorder, a radio cassette recorder, a combined sound box, a laser player, a computer, a game machine and a router.
The second electronic product is any one of a watch, a smart phone, a telephone, a television, a video disc player, a video recorder, a radio cassette recorder, a combined sound box, a laser player, a computer, a game machine and a router.
The first electronic product and the second electronic product may be the same or different according to requirements. Fig. 2 is a diagram of an embodiment used in fig. 1. As shown in fig. 2, in this embodiment, both the first electronic product and the second electronic product use dual-master USB communication CPE products, such as routers, and the master control of the router a and the master control of the router B are connected through USB for description: the router A main control Flash is small, the usable space is small, the upgrading package cannot be stored, and a double system cannot be manufactured; the space of the main control Flash of the router B is enough, and the main control upgrading packet of the router A can be stored. The Flash storage threshold value can be set according to actual needs, for example, the Flash storage threshold value is set to 5M, the main control Flash of the router A is smaller than 5M, the main control Flash of the router B is larger than 5M, and enough space is provided for storing the upgrade package of the main control of the router A.
The method includes the steps that before the master control of the router A is upgraded, the upgrade package is stored in the master control of the router B, marks are made before the upgrade, after the power failure occurs during the upgrade, whether the upgrade package is downloaded from the master control of the router B to the master control update version of the router A through the USB is judged in the uboot according to the upgrade marks when the next power-on is started, and therefore the problem that the whole package of the master control equipment of the router A is upgraded and halted when the power failure occurs is solved.
And the master control of the router A uses a failload command in the uboot to download the upgrade package stored in the master control of the router B to the master control of the router A and then upgrade the upgrade package. The fatload only supports a file system in a FAT format, the router B is used for creating an img image file capable of accommodating the upgrading packet FAT32 format of the router A by main control, the img image file is sent to a directory of the current system through the loop mount, and the router A can access/dev/loop 0 equipment by main control through the mass storage.
The main control uboot of the router A needs to support a fatload command, and the upgrade package is completely stored in a flash of the main control of the router B before upgrading, so that the complete upgrade package can be downloaded in the uboot during power failure, and the incomplete upgrade package can also cause crash.
Fig. 3 is a flowchart of a B master method used in fig. 1. As shown in fig. 3, the master control flow of the router B is started, and a mirror file with enough space is created in the master control of the router B:
dd if=/dev/zero of=/forloop/fota.img bs=1M count=60z。
virtualizing the image file into a block device using a lost:
loseup/dev/loop0/forloop/fota.img。
formatted using mkdosfs to fat32 format:
mkdosfs–F 32–S 2048/dev/loop0。
mount/dev/loop 0 in vfat format:
mount-t vfat–o rw/dev/loop0/fota。
setting USB flash disk as first starting disk echo
“/dev/loop0”>/sys/class/android_usb/f_mass_storage/lun/file。
Fig. 4 is a flowchart of an a master upgrade method used in fig. 1. As shown in fig. 4, the master upgrade flow chart of the router a is as follows:
and storing the router A master control upgrading packet into the router B master control, setting an upgrading mark, and starting upgrading the router A master control. The system judges whether the master control of the router A is powered down or not, if not, the router A is normally upgraded, and if the master control of the router A is actively upgraded, the reboot is restarted; if yes, the router A master control enters the uboot module after being powered on next time, the uboot judges whether an upgrade mark exists or not, if no upgrade mark exists, the router A master control is normally upgraded, and if the upgrade mark exists, the uboot upgrade is started. And when the uboot is upgraded, resetting reset by the usb interface, downloading the router A main control upgrading packet from the B main control through the usb by the failload, erasing the ROM by the router A main control, updating the image file, clearing the upgrading mark, and restarting the A main control after upgrading.
By implementing the embodiment, the problem of power failure and crash of the first electronic product during upgrading can be effectively solved, the software upgrading package of the first electronic product is stored in the second electronic product, and when the power failure occurs in the upgrading process of the first electronic product, the software upgrading is completed by downloading the upgrading package from the second electronic product, so that the method is particularly suitable for double main control products with different FLASH sizes.
Example two
FIG. 5 is a flowchart of a software upgrading method according to another embodiment of the present invention. In another embodiment of the present invention, as shown in fig. 5, a software upgrading method, as shown in fig. 5, includes the steps of:
and S21, storing the first electronic product software upgrading package in a second electronic product, setting a software upgrading identifier, and electrically connecting the second electronic product with the first electronic product.
The second electronic product is connected with the first electronic product through a USB or a Bluetooth.
Storing the first electronic product software upgrade package in the second electronic product comprises:
creating a mirror image file in a second electronic product;
virtualizing the mirror image file into block equipment;
formatting the block device into fat32 format;
mounting the block device in a vfat format;
and setting the USB flash disk as a first starting disk.
And S22, the first electronic product starts to be upgraded, and the power failure state in the upgrading process is obtained.
In specific implementation, the first electronic product starts to be upgraded, and acquiring the power failure state in the upgrading process may include: and when the first electronic product starts to be upgraded, synchronously starting the thread to track the power-down state of the first electronic product. In the first electronic product upgrading process, the system can detect the progress in the upgrading process. If the power supply environment is normal, normal upgrading can be carried out, and the upgrading progress is from 0 to 100%. If the system suddenly encounters an adverse condition and the power is cut off in the upgrading process, the upgrading progress and the power-off state in the upgrading process are detected. Setting the initial value Flag of the power-down state in the upgrading process as false, if the power-down state is in the upgrading process, setting the power-down state in the upgrading process as true, otherwise, setting the power-down state as false. The power-down state during the upgrade process may be saved in the uboot.
S23, downloading the software upgrade package from the second electronic product to the first electronic product;
the second electronic product has enough FLASH space, and the software upgrading package of the first electronic product is stored. When the first electronic product is in a power failure condition in the software upgrading process, a software upgrading package can be provided for the first electronic product.
S24, erasing the ROM;
preparation is made for updating the image file by erasing the ROM.
S25, updating the mirror image file;
s26, clearing the software upgrading identification;
s27, upgrading software of the first electronic product;
and S28, restarting the software after the software is upgraded.
The first electronic product is any one of a watch, a smart phone, a telephone, a television, a video disc player, a video recorder, a radio cassette recorder, a combined sound box, a laser player, a computer, a game machine and a router.
The second electronic product is any one of a watch, a smart phone, a telephone, a television, a video disc player, a video recorder, a radio cassette recorder, a combined sound box, a laser player, a computer, a game machine and a router.
The first electronic product and the second electronic product may be the same or different according to requirements. Fig. 2 is a diagram of an embodiment used in fig. 1. As shown in fig. 2, in this embodiment, both the first electronic product and the second electronic product use dual-master USB communication CPE products, such as routers, and the master control of the router a and the master control of the router B are connected through USB for description: the router A main control Flash is small, the usable space is small, the upgrading package cannot be stored, and a double system cannot be manufactured; the space of the main control Flash of the router B is enough, and the main control upgrading packet of the router A can be stored. The Flash storage threshold value can be set according to actual needs, for example, the Flash storage threshold value is set to 5M, the main control Flash of the router A is smaller than 5M, the main control Flash of the router B is larger than 5M, and enough space is provided for storing the upgrade package of the main control of the router A.
The method includes the steps that before the master control of the router A is upgraded, the upgrade package is stored in the master control of the router B, marks are made before the upgrade, after the power failure occurs during the upgrade, whether the upgrade package is downloaded from the master control of the router B to the master control update version of the router A through the USB is judged in the uboot according to the upgrade marks when the next power-on is started, and therefore the problem that the whole package of the master control equipment of the router A is upgraded and halted when the power failure occurs is solved.
And the master control of the router A uses a failload command in the uboot to download the upgrade package stored in the master control of the router B to the master control of the router A and then upgrade the upgrade package. The fatload only supports a file system in a FAT format, the router B is used for creating an img image file capable of accommodating the upgrading packet FAT32 format of the router A by main control, the img image file is sent to a directory of the current system through the loop mount, and the router A can access/dev/loop 0 equipment by main control through the mass storage.
The main control uboot of the router A needs to support a fatload command, and the upgrade package is completely stored in a flash of the main control of the router B before upgrading, so that the complete upgrade package can be downloaded in the uboot during power failure, and the incomplete upgrade package can also cause crash.
Fig. 3 is a flowchart of a B master method used in fig. 1. As shown in fig. 3, the master control flow of the router B is started, and a mirror file with enough space is created in the master control of the router B:
dd if=/dev/zero of=/forloop/fota.img bs=1M count=60z。
virtualizing the image file into a block device using a lost:
loseup/dev/loop0/forloop/fota.img。
formatted using mkdosfs to fat32 format:
mkdosfs–F 32–S 2048/dev/loop0。
mount/dev/loop 0 in vfat format:
mount-t vfat–o rw/dev/loop0/fota。
setting USB flash disk as first starting disk echo
“/dev/loop0”>/sys/class/android_usb/f_mass_storage/lun/file。
Fig. 4 is a flowchart of an a master upgrade method used in fig. 1. As shown in fig. 4, the master upgrade flow chart of the router a is as follows:
and storing the router A master control upgrading packet into the router B master control, setting an upgrading mark, and starting upgrading the router A master control. The system judges whether the master control of the router A is powered down or not, if not, the router A is normally upgraded, and if the master control of the router A is actively upgraded, the reboot is restarted; if yes, the router A master control enters the uboot module after being powered on next time, the uboot judges whether an upgrade mark exists or not, if no upgrade mark exists, the router A master control is normally upgraded, and if the upgrade mark exists, the uboot upgrade is started. And when the uboot is upgraded, resetting reset by the usb interface, downloading the router A main control upgrading packet from the B main control through the usb by the failload, erasing the ROM by the router A main control, updating the image file, clearing the upgrading mark, and restarting the A main control after upgrading.
By implementing the embodiment, the problem of power failure and crash of the first electronic product during upgrading can be effectively solved, the software upgrading package of the first electronic product is stored in the second electronic product, and when the power failure occurs in the upgrading process of the first electronic product, the software upgrading is completed by downloading the upgrading package from the second electronic product, so that the method is particularly suitable for double main control products with different FLASH sizes.
EXAMPLE III
Fig. 6 is a schematic structural diagram of an embodiment of a software upgrading apparatus according to the present invention. As shown in fig. 6, a software upgrading apparatus at least includes:
the first electronic product 10 is provided with a uboot, and a software upgrading identifier is set;
the second electronic product 20 is electrically connected with the first electronic product and stores the software upgrading package of the first electronic product;
the first electronic product 10 is further provided with a first electronic product upgrade power-down state acquisition module 101, which is used for acquiring a power-down state in the upgrade of the first electronic product;
the first electronic product 10 is further provided with a software upgrading module 102, which is used for judging a power failure state in an upgrading process, if the power failure state is true, the first electronic product reads a software upgrading identifier when being powered on next time, starts uboot upgrading, downloads the software upgrading package from the second electronic product to the first electronic product, and otherwise, the first electronic product is started normally;
the storage module 201 is disposed in the second electronic product 20.
The software upgrade module 102 may further include:
the ROM erasing module is used for erasing the ROM;
the image file updating module is used for updating the image file;
the software upgrading identifier clearing module is used for clearing the software upgrading identifier;
the software upgrading execution module is used for upgrading the software of the first electronic product;
and the restarting module is used for restarting the first electronic product after the software of the first electronic product is upgraded.
The first electronic product is any one of a watch, a smart phone, a telephone, a television, a video disc player, a video recorder, a radio cassette recorder, a combined sound box, a laser player, a computer, a game machine and a router.
The second electronic product is any one of a watch, a smart phone, a telephone, a television, a video disc player, a video recorder, a radio cassette recorder, a combined sound box, a laser player, a computer, a game machine and a router.
The first electronic product and the second electronic product may be the same or different according to requirements. As shown in fig. 2, in this embodiment, both the first electronic product and the second electronic product use dual-master USB communication CPE products, such as routers, and the master control of the router a and the master control of the router B are connected through USB for description: the router A main control Flash is small, the usable space is small, an upgrade package cannot be stored, and a double system cannot be manufactured; the space of the main control Flash of the router B is enough, and the main control upgrading packet of the router A can be stored. A Flash storage threshold value can be set according to actual needs, for example, the Flash storage threshold value is set to be 5M, the main control Flash of the router A is smaller than 5M, the main control Flash of the router B is larger than 5M, and enough space is provided for storing the upgrade package of the main control of the router A. In the embodiment, the software upgrading method described in the first embodiment or the second embodiment is executed, and for a specific embodiment, reference is made to the first embodiment and the second embodiment, which are not described herein again.
By implementing the embodiment, the problem of power failure and crash of the first electronic product during upgrading can be effectively solved, the software upgrading package of the first electronic product is stored in the second electronic product, and when the power failure occurs in the upgrading process of the first electronic product, the software upgrading is completed by downloading the upgrading package from the second electronic product, so that the method is particularly suitable for double main control products with different FLASH sizes.
Example four
Fig. 7 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention. Based on the content of the above embodiment, as shown in fig. 7, the electronic device may include: a processor (processor)301, a memory (memory)302, and a bus 303; wherein, the processor 301 and the memory 302 complete the communication with each other through the bus 303; the processor 301 is configured to invoke computer program instructions stored in the memory 302 and executable on the processor 301 to perform the software upgrading methods provided by the above-described method embodiments, including, for example:
s1, storing the first electronic product software upgrading package in a second electronic product, setting a software upgrading identifier, and electrically connecting the second electronic product with the first electronic product;
s2, the first electronic product starts to be upgraded, and the power failure state in the upgrading process is obtained;
s3, judging the power failure state in the first electronic product upgrading process, if true, reading the software upgrading identification when the first electronic product is powered on next time, starting uboot upgrading, downloading the software upgrading package from the second electronic product to the first electronic product, otherwise, normally starting the first electronic product.
Furthermore, the logic instructions in the memory 302 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiments of the present invention may be substantially implemented or contributed to by the prior art, or may be implemented in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method for generating a memo based on face recognition according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media storing program codes.
By adopting the embodiment, the problem of power failure and crash of the first electronic product during upgrading can be effectively solved, the software upgrading package of the first electronic product is stored in the second electronic product, and when the power failure occurs in the upgrading process of the first electronic product, the software upgrading is completed by downloading the upgrading package from the second electronic product, so that the method is particularly suitable for double main control products with different FLASH sizes.
EXAMPLE five
Another embodiment of the present invention discloses a computer program product, the computer program product includes a computer program stored on a non-transitory computer readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer, the computer can execute the software upgrading method provided by the above embodiments, for example, the method includes the steps of:
s1, storing the first electronic product software upgrading package in a second electronic product, setting a software upgrading identifier, and electrically connecting the second electronic product with the first electronic product;
s2, the first electronic product starts to be upgraded, and the power failure state in the upgrading process is obtained;
s3, judging the power failure state in the first electronic product upgrading process, if true, reading the software upgrading identification when the first electronic product is powered on next time, starting uboot upgrading, downloading the software upgrading package from the second electronic product to the first electronic product, otherwise, normally starting the first electronic product.
By adopting the embodiment, the problem of power failure and crash of the first electronic product during upgrading can be effectively solved, the software upgrading package of the first electronic product is stored in the second electronic product, and when the power failure occurs in the upgrading process of the first electronic product, the software upgrading is completed by downloading the upgrading package from the second electronic product, so that the method is particularly suitable for double main control products with different FLASH sizes.
EXAMPLE six
Another embodiment of the present invention provides a non-transitory computer readable storage medium, which stores computer instructions, the computer instructions causing a computer to execute the software upgrading method provided by the above method embodiments, for example, the method includes the steps of:
s1, storing the first electronic product software upgrading package in a second electronic product, setting a software upgrading identifier, and electrically connecting the second electronic product with the first electronic product;
s2, the first electronic product starts to be upgraded, and the power failure state in the upgrading process is obtained;
s3, judging the power failure state in the first electronic product upgrading process, if true, reading the software upgrading identification when the first electronic product is powered on next time, starting uboot upgrading, downloading the software upgrading package from the second electronic product to the first electronic product, otherwise, normally starting the first electronic product.
By adopting the embodiment, the problem of power failure and crash of the first electronic product during upgrading can be effectively solved, the software upgrading package of the first electronic product is stored in the second electronic product, and when the power failure occurs in the upgrading process of the first electronic product, the software upgrading is completed by downloading the upgrading package from the second electronic product, so that the method is particularly suitable for double main control products with different FLASH sizes.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method of upgrading software, comprising:
storing the first electronic product software upgrading package in a second electronic product, and setting a software upgrading identifier, wherein the second electronic product is electrically connected with the first electronic product;
the first electronic product starts to be upgraded, and the power failure state in the upgrading process is obtained;
and judging the power failure state of the first electronic product in the upgrading process, if so, reading a software upgrading identifier when the first electronic product is powered on next time, starting uboot upgrading, downloading the software upgrading package from the second electronic product to the first electronic product, and otherwise, normally starting the first electronic product.
2. The software upgrade method of claim 1, wherein said initiating uboot upgrades comprises:
erasing the ROM;
updating the mirror image file;
clearing a software upgrading identifier;
the first electronic product carries out software upgrading;
and restarting after the software is upgraded.
3. The software upgrading method of claim 1, wherein the second electronic product is connected with the first electronic product through a USB connection or a bluetooth connection.
4. The software upgrading method of claim 3, wherein the storing the first electronic product software upgrade package in the second electronic product comprises:
creating a mirror image file in the second electronic product;
virtualizing the mirror image file into block equipment;
formatting the block device into fat32 format;
mounting the block device in a vfat format;
and setting the USB flash disk as a first starting disk.
5. The software upgrading method according to any one of claims 1 to 4, wherein the first electronic product starts upgrading, and acquiring the power-down state in the upgrading process comprises:
and when the first electronic product starts to be upgraded, starting a thread to track the power-down state of the first electronic product.
6. The software upgrading method of any one of claims 1 to 4, wherein the first electronic product and the second electronic product are any one of a watch, a smart phone, a telephone, a television, a video disc player, a video recorder, a camcorder, a radio cassette recorder, a combination speaker, a CD player, a computer, a game machine and a router.
7. A software upgrading apparatus, comprising:
the first electronic product is provided with a uboot, and a software upgrading identifier is set;
the second electronic product is electrically connected with the first electronic product and stores the software upgrading package of the first electronic product;
the upgrading power-down state acquisition module is arranged on the first electronic product and used for acquiring the power-down state in the upgrading of the first electronic product;
the software upgrading module is arranged on the first electronic product and used for judging the power failure state in the upgrading process, if the power failure state is true, the software upgrading identification is read when the first electronic product is powered on next time, uboot upgrading is started, the software upgrading package is downloaded from the second electronic product to the first electronic product, and otherwise, the first electronic product is started normally;
and the storage module is arranged on the second electronic product.
8. The software upgrading apparatus according to claim 7, wherein the software upgrading module includes:
the ROM erasing module is used for erasing the ROM;
the image file updating module is used for updating the image file;
the software upgrading identifier clearing module is used for clearing the software upgrading identifier;
the software upgrading execution module is used for upgrading the software of the first electronic product;
and the restarting module is used for restarting the first electronic product after the software of the first electronic product is upgraded.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the software upgrading method as claimed in any one of claims 1 to 6 are implemented when the program is executed by the processor.
10. A storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the steps of the software upgrade method according to any one of claims 1 to 6.
CN202110742775.6A 2021-06-30 2021-06-30 Software upgrading method and device, electronic equipment and storage medium Pending CN113760336A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110742775.6A CN113760336A (en) 2021-06-30 2021-06-30 Software upgrading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110742775.6A CN113760336A (en) 2021-06-30 2021-06-30 Software upgrading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113760336A true CN113760336A (en) 2021-12-07

Family

ID=78787540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110742775.6A Pending CN113760336A (en) 2021-06-30 2021-06-30 Software upgrading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113760336A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136002A (en) * 2011-11-25 2013-06-05 航天信息股份有限公司 Automatic upgrade control method based on UBoot instruction and system
CN106612192A (en) * 2015-10-22 2017-05-03 阿里巴巴集团控股有限公司 An equipment upgrading method, apparatus and system
CN107562483A (en) * 2017-07-26 2018-01-09 博为科技有限公司 A kind of method and device of carry guiding file system
CN110083375A (en) * 2019-03-27 2019-08-02 珠海全志科技股份有限公司 A kind of equipment room interaction carries out the method and device of OTA upgrading
CN111522571A (en) * 2020-03-12 2020-08-11 深圳英飞拓科技股份有限公司 Equipment upgrading method and device, terminal equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136002A (en) * 2011-11-25 2013-06-05 航天信息股份有限公司 Automatic upgrade control method based on UBoot instruction and system
CN106612192A (en) * 2015-10-22 2017-05-03 阿里巴巴集团控股有限公司 An equipment upgrading method, apparatus and system
CN107562483A (en) * 2017-07-26 2018-01-09 博为科技有限公司 A kind of method and device of carry guiding file system
CN110083375A (en) * 2019-03-27 2019-08-02 珠海全志科技股份有限公司 A kind of equipment room interaction carries out the method and device of OTA upgrading
CN111522571A (en) * 2020-03-12 2020-08-11 深圳英飞拓科技股份有限公司 Equipment upgrading method and device, terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
EP3441876B1 (en) Patch upgrade-based file processing method and device, terminal, and storage medium
CN110659046B (en) Firmware upgrading method, terminal, charging box, earphone and storage medium
JP5838527B2 (en) Method, apparatus and communication device for updating firmware
CN110825563B (en) System recovery method and device and electronic equipment
KR101007739B1 (en) Method and system for providing fota service
CN110597542B (en) Software automatic OTA (over the air) upgrading method and device and electronic equipment
EP2076834A1 (en) Program upgrade system and method for ota-capable mobile terminal
US20220100490A1 (en) Firmware updating method, and electronic apparatus and storage media for same
CN108228215B (en) OTA upgrade package pushing method and device for terminal equipment
WO2024078218A1 (en) System booting method and electronic device
CN111901142A (en) Firmware silent upgrading method and device for embedded equipment cluster
CN114443081A (en) Terminal upgrading method and terminal
CN110515671B (en) Initialization method, initialization device, terminal device and readable storage medium
CN114661322B (en) Upgrade method of operating system, electronic equipment and storage medium
WO2016082450A1 (en) Method for upgrading user terminal, and user terminal
CN112416411A (en) Upgrading method and device, equipment terminal, server and computer readable medium
US20050010914A1 (en) Method for upgrading firmware
CN112463199A (en) System upgrading method and terminal
CN113760336A (en) Software upgrading method and device, electronic equipment and storage medium
CN115951920A (en) Mobile equipment upgrading method and device, storage unit and mobile equipment
KR101461319B1 (en) Methods and device for upgrading firmware of set-top box
CN114185576A (en) Embedded equipment upgrading method and device, computer equipment and storage medium
CN114296764A (en) System upgrading method and device, storage medium and electronic equipment
CN105700895A (en) Adaptation method for terminal system, terminal and system server
CN104683594A (en) SIM card-oriented method for loading mobile phone operating system

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