CN112732310A - Firmware upgrading method, system, equipment and medium based on embedded boot partition - Google Patents
Firmware upgrading method, system, equipment and medium based on embedded boot partition Download PDFInfo
- Publication number
- CN112732310A CN112732310A CN202110089434.3A CN202110089434A CN112732310A CN 112732310 A CN112732310 A CN 112732310A CN 202110089434 A CN202110089434 A CN 202110089434A CN 112732310 A CN112732310 A CN 112732310A
- Authority
- CN
- China
- Prior art keywords
- file
- firmware
- upgrading
- equipment
- partition
- 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.)
- Granted
Links
- 238000005192 partition Methods 0.000 title claims abstract description 64
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000011084 recovery Methods 0.000 claims description 52
- 238000012795 verification Methods 0.000 claims description 7
- 230000002093 peripheral effect Effects 0.000 claims description 5
- 238000001514 detection method Methods 0.000 claims 1
- 230000006870 function Effects 0.000 description 13
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/654—Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1417—Boot up procedures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1433—Saving, restoring, recovering or retrying at system level during software upgrading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup restoration techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a firmware upgrading method, a system, equipment and a medium based on an embedded boot partition, wherein the method comprises the following steps: after starting the equipment, entering a U-boot guide partition control state; reading a configuration file in the configuration partition, and detecting whether to perform upgrading operation according to the configuration file; after the upgrading operation is determined to be detected, a firmware upgrading file of the equipment is obtained, and the firmware of the equipment is upgraded according to the firmware upgrading file; and after the upgrading operation is finished in the control state of the U-boot partition, entering a normal starting mode of the equipment. In the invention, the device automatically acquires the firmware upgrading file in the state of the U-boot before entering the system, and the flash mirror image writing is carried out according to the firmware upgrading file to finish the firmware upgrading without entering the Linux system, thereby saving other operations of a user, leading the upgrading operation to be simple and convenient and being widely applied to the technical field of equipment upgrading.
Description
Technical Field
The invention relates to the technical field of equipment upgrading, in particular to a firmware upgrading method, system, equipment and medium based on an embedded boot partition.
Background
With the advent of the 5G and artificial intelligence era, intelligent terminal electronic products are used more and more frequently, and firmware upgrading is more and more important. Especially, the network electronic product with the deep learning algorithm needs to improve the function and intelligent performance of the product through firmware upgrading, so that better experience is provided for users.
At present, an embedded automatic firmware upgrading scheme is mainly based on a Linux system, and a firmware upgrading package is obtained through communication between a user program and a firmware background server (or a computer) to upgrade equipment. The firmware upgrading method has the following defects: (1) the equipment is easy to return to the factory for maintenance due to the crash of the equipment during the upgrading process caused by power failure or other reasons; (2) the equipment needs to enter the system, and the user needs to download the upgrade package of the equipment and then perform upgrade operation, so that the use cost of the user is increased, and the risk of equipment breakage is increased.
Disclosure of Invention
To solve at least one of the technical problems in the prior art to some extent, an object of the present invention is to provide a method, a system, a device, and a medium for upgrading firmware based on an embedded boot partition.
The technical scheme adopted by the invention is as follows:
a firmware upgrading method based on an embedded boot partition comprises the following steps:
after starting the equipment, entering a U-boot guide partition control state;
reading a configuration file in a configuration partition, and detecting whether to perform upgrading operation according to the configuration file;
after the upgrading operation is determined to be detected, a firmware upgrading file of the equipment is obtained, and the firmware of the equipment is upgraded according to the firmware upgrading file;
and after the upgrading operation is finished in the control state of the U-boot partition, entering a normal starting mode of the equipment.
Further, the reading the configuration file in the configuration partition and detecting whether to perform an upgrade operation according to the configuration file includes:
reading a configuration file in a device configuration partition to a preset memory;
analyzing configuration parameters in the configuration file, wherein the configuration parameters comprise an enabling mark of equipment upgrading;
and detecting whether the upgrading operation is carried out or not according to the enabling mark, and if the upgrading operation is not carried out, entering a normal starting mode of the equipment.
Further, the configuration file further includes an IP address of a cloud server and a port number of the cloud server, and the acquiring the firmware upgrade file of the device includes:
communicating with a cloud server according to the IP address and the port number, and detecting whether a firmware upgrade file of the equipment is stored on the cloud server;
and determining that the firmware upgrading file is detected to be stored, and downloading the firmware upgrading file.
Further, the acquiring the firmware upgrade file of the device includes:
scanning a storage device of the equipment peripheral equipment, and detecting whether a firmware upgrade file of the equipment is stored in the storage device;
determining that the firmware upgrading file is detected to be stored, and downloading the firmware upgrading file;
wherein the storage device comprises at least one of a U disk or an SD card.
Further, the firmware upgrade of the device according to the firmware upgrade file includes:
analyzing a firmware head of the firmware upgrading file, detecting whether the firmware upgrading file is complete according to the firmware head, and discarding the firmware upgrading file if the firmware upgrading file is incomplete;
reading equipment model information in the firmware upgrading file, judging whether the equipment model information is consistent with the model of the equipment, and if not, discarding the firmware upgrading file;
analyzing the firmware upgrading file, and writing the image of the analyzed firmware upgrading file into image files in a partition-by-partition manner according to the sequence of partitions, namely, erasing the image and writing the image in the image files one by one;
and finishing the upgrading operation after finishing writing the mirror image file.
Further, the method for upgrading firmware based on the embedded boot partition further comprises a step of recovering system damage, which comprises the following steps:
after entering a U-boot partition control state, detecting whether the equipment is hung with a storage device;
if the storage device is hung, detecting whether a system recovery file is stored in the storage device;
if the system recovery file is stored, acquiring the system recovery file, and performing recovery operation on the equipment according to the system recovery file;
wherein the storage device comprises at least one of a U disk or an SD card.
Further, the performing a recovery operation on the device according to the system recovery file includes:
analyzing the system recovery file to a preset memory address, and acquiring equipment model information and MD5 verification information according to the analyzed system recovery file;
detecting whether the system recovery file is matched with the equipment or not according to the equipment model information, and if not, discarding the system recovery file;
detecting whether the system recovery file is complete or not according to the MD5 verification information, and if the system recovery file is incomplete, discarding the system recovery file;
and carrying out recovery operation according to the analyzed system recovery file.
The other technical scheme adopted by the invention is as follows:
an embedded boot partition based firmware upgrade system, comprising:
the device starting module is used for entering a U-boot partition control state after starting the device;
the file reading module is used for reading the configuration file in the configuration partition and detecting whether to carry out upgrading operation according to the configuration file;
the upgrading operation module is used for acquiring a firmware upgrading file of the equipment after upgrading operation is determined to be detected, and upgrading the firmware of the equipment according to the firmware upgrading file;
and the normal starting module is used for entering a normal starting mode of the equipment after finishing the upgrading operation in the control state of the U-boot partition.
The other technical scheme adopted by the invention is as follows:
an electronic device, comprising:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the method described above.
The other technical scheme adopted by the invention is as follows:
a storage medium having stored therein processor-executable instructions for performing the method as described above when executed by a processor.
The invention has the beneficial effects that: in the invention, the device automatically acquires the firmware upgrading file in the state of the U-boot before entering the system, and the flash image is written according to the firmware upgrading file to finish the firmware upgrading without entering the Linux system, thereby saving other operations of a user, simplifying and facilitating the upgrading operation and saving the upgrading cost of the user.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description is made on the drawings of the embodiments of the present invention or the related technical solutions in the prior art, and it should be understood that the drawings in the following description are only for convenience and clarity of describing some embodiments in the technical solutions of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart illustrating steps of a method for upgrading firmware based on an embedded boot partition according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embedded boot partition-based method for automatic firmware upgrade and system corruption recovery according to an embodiment of the present invention;
fig. 3 is a block diagram of an embedded boot partition firmware upgrade system according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. The step numbers in the following embodiments are provided only for convenience of illustration, the order between the steps is not limited at all, and the execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as the upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings, and is only for convenience of description and simplification of description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality of means is one or more, the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood as excluding the number, and larger, smaller, inner, etc. are understood as including the number. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
As shown in fig. 1, the present embodiment provides an embedded boot partition-based firmware upgrade method, which includes the following steps that are automatically executed by a device:
and S1, after starting the equipment, entering a U-boot partition control state.
After the device of the embodiment is started, the device quickly enters the U-boot mode instead of the Linux system, and the following steps are completed in the U-boot partition control state.
And S2, reading the configuration file in the configuration partition, and detecting whether to perform upgrading operation according to the configuration file.
Wherein, the step S2 includes steps S21-S23:
s21, reading a configuration file in the equipment configuration partition into a preset memory;
s22, analyzing the configuration parameters in the configuration file, wherein the configuration parameters comprise an enabling sign of equipment upgrading;
and S23, detecting whether to carry out upgrading operation according to the enabling mark, and entering a normal starting mode of the equipment if not.
The configuration parameters comprise configuration parameters such as an equipment upgrading enabling mark, an IP address of a cloud server, a port number of the cloud server and the like, if the upgrading enabling mark is not enabled, the equipment does not carry out upgrading operation and enters an equipment normal starting mode; and if the upgrading zone bit is in the enabled state, carrying out upgrading operation.
And S3, after the upgrade operation is determined to be detected, acquiring a firmware upgrade file of the equipment, and upgrading the firmware of the equipment according to the firmware upgrade file.
After the upgrade operation is detected to be required, the firmware upgrade file of the device is acquired, and in this embodiment, the firmware upgrade file may be acquired in multiple ways, for example, the firmware upgrade file is acquired by performing communication connection with a cloud server, or the device acquires the firmware upgrade file in a U-boot state by automatically scanning a U disk or an SD card, or the firmware upgrade file is acquired by the cloud server first, and if the firmware upgrade file is not acquired, the firmware upgrade file is acquired by scanning the U disk or the SD card.
When the firmware upgrade file is acquired through the cloud server, the specific steps are as follows, i.e., S31a-S32 a:
s31a, communicating with the cloud server according to the IP address and the port number, and detecting whether the firmware upgrade file of the equipment is stored on the cloud server;
and S32a, determining that the firmware upgrade file is detected to be stored, and downloading the firmware upgrade file.
When the firmware upgrade file is acquired by scanning the usb disk or the SD card, the specific steps are as follows S31b-S32 b:
s31b, scanning a storage device of the equipment peripheral, and detecting whether the storage device stores the firmware upgrade file of the equipment or not;
and S32b, determining that the firmware upgrade file is detected to be stored, and downloading the firmware upgrade file.
After the firmware upgrade file is acquired, performing upgrade operation, including steps A1-A4:
a1, analyzing a firmware header of the firmware upgrade file, detecting whether the firmware upgrade file is complete according to the firmware header, and discarding the firmware upgrade file if the firmware upgrade file is incomplete;
a2, reading equipment model information in the firmware upgrade file, judging whether the equipment model information is consistent with the model of the equipment, and if not, discarding the firmware upgrade file;
a3, analyzing the firmware upgrade file, and writing the image of the analyzed firmware upgrade file into the image file in partitions one by one according to the sequence of the partitions in a mode of erasing first and then writing;
and A4, finishing the upgrading operation after finishing writing the image file.
And S4, after the upgrading operation is completed in the U-boot partition control state, entering a normal starting mode of the equipment.
Further as an optional implementation, the method also comprises a step of recovering the system damage, which comprises B1-B3:
b1, after entering a U-boot partition control state, detecting whether the equipment is hung with a storage device; wherein the storage device comprises at least one of a U disk or an SD card.
B2, if the storage device is mounted, detecting whether the system recovery file is stored in the storage device.
B3, if the system recovery file is stored, acquiring the system recovery file, and performing recovery operation on the device according to the system recovery file.
The step of performing the restore operation on the device according to the system restore file in the step B3 includes the following steps B31-B33:
b31, resolving the system recovery file into a preset memory address, and acquiring equipment model information and MD5 verification information according to the resolved system recovery file;
b32, detecting whether the system recovery file is matched with the equipment according to the equipment model information, and if not, discarding the system recovery file;
b33, checking whether the system recovery file is complete according to MD5, and if the system recovery file is incomplete, discarding the system recovery file;
and B34, performing recovery operation according to the analyzed system recovery file.
In the present embodiment, the above-mentioned system damage recovery step may be performed before step S2.
Referring to fig. 2, the above upgrading method is explained in detail with reference to specific embodiments.
The design idea of the method is that in the uboot boot stage before the device does not start the system, the firmware is upgraded and the system recovery function is performed on the damaged system device by directly operating the flash memory. The main steps are as follows:
the method comprises the following steps: power-on start-up
1. And entering a U-boot partition control state.
2. Initializing network resources, detecting whether a U disk or an SD card is mounted on the peripheral, and entering a step two if the U disk or the SD card is not detected.
3. And scanning whether the upgrade files restored by the system exist in the U disk, if so, entering a fifth step, analyzing the files in the U disk to a specified memory address, and performing equipment model verification and MD5 verification on the analyzed files to ensure that the files restored by the system are the files of the equipment and the files are complete. And if the U disk does not have the file restored by the equipment system, the step two is carried out.
Step two: reading configuration files in configuration partitions
1. And reading the configuration file in the device configuration partition to a specified memory.
2. And analyzing configuration parameters (configuration parameters such as an enabling mark of equipment upgrading, an IP address of the cloud server, a port number of the cloud server and the like) in the configuration file.
3. If the upgrade enabling flag is not enabled, the equipment does not perform upgrade operation, the step six is entered, the equipment is normally started, and if the upgrade flag bit is enabled, the step three is entered.
Step three: checking whether firmware is upgraded on cloud server
1. And communicating with the cloud server to check whether the upgrading firmware of the equipment exists on the cloud server, and entering the fourth step if the upgrading package of the equipment does not exist on the cloud server.
2. And if the upgrading firmware of the equipment model exists, entering a fifth step, and enabling the equipment to enter an automatic upgrading mode.
Step four: scanning U disk and SD card
1. Scanning whether a firmware upgrading package required by the model exists in the peripheral U disk or the SD card, if the upgrading firmware of the equipment is not found, entering a sixth step, and normally starting the equipment.
2. If the upgrade package is found, entering a fifth step, and the equipment enters a firmware upgrade state.
Step five: parsing upgraded firmware
1. And analyzing the firmware header of the upgrade package, checking the integrity of the upgrade package, and if the firmware header is not complete, discarding the upgrade package and entering a sixth step.
2. And reading the equipment model in the firmware, comparing the equipment model with the equipment model, if the equipment model is consistent, entering an upgrading process if the equipment model is consistent, and discarding an upgrading packet if the equipment model is inconsistent to enter a sixth step.
3. And erasing the images of the analyzed upgrade files one by one according to the sequence of the partitions, writing the images into the image files, entering the step six after all the files are written, and normally starting the equipment.
Step six: ending the upgrading process;
1. and (5) completing automatic upgrading of the boot partition, and entering a normal starting mode of the equipment.
In summary, compared with the prior art, the method of the embodiment has the following beneficial effects:
(1) the method can automatically acquire the upgrade file from the cloud service, a large amount of connection or erasing of the flash by using the FPGA mode is not needed, the upgrade cost is reduced, and convenience and flexibility of firmware upgrade and system recovery are embodied.
(2) The equipment automatically performs communication connection with the cloud server to obtain an image file which is required by the equipment model and is updated or recovered by the system, and then performs flash image writing; under the condition of no network, the device obtains the image file of upgrading or system recovery required by the device model in a U-boot state in a mode of automatically scanning a U disk or an SD card, and then performs flash image writing. Automatic upgrading is realized through various modes, and the applicability of the upgrading method is improved.
As shown in fig. 3, this embodiment further provides an embedded boot partition-based firmware upgrade system, including:
the device starting module is used for entering a U-boot partition control state after starting the device;
the file reading module is used for reading the configuration file in the configuration partition and detecting whether to carry out upgrading operation according to the configuration file;
the upgrading operation module is used for acquiring a firmware upgrading file of the equipment after the upgrading operation is determined to be detected, and upgrading the firmware of the equipment according to the firmware upgrading file;
and the normal starting module is used for entering a normal starting mode of the equipment after finishing the upgrading operation in the control state of the U-boot partition.
The firmware upgrading system based on the embedded boot partition, provided by the embodiment of the method, can execute any combination of implementation steps of the embodiment of the method, and has corresponding functions and beneficial effects of the method.
The present embodiment also provides an electronic device, including:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the method of fig. 1.
The electronic device of this embodiment can execute the method for upgrading firmware based on an embedded boot partition provided in the method embodiment of the present invention, can execute any combination of the implementation steps of the method embodiment, and has corresponding functions and advantages of the method.
The embodiment also provides a storage medium, which stores an instruction or a program capable of executing the embedded boot partition firmware upgrading method provided by the embodiment of the method of the invention, and when the instruction or the program is run, the method can be executed by any combination of the embodiment of the method, and the method has corresponding functions and beneficial effects.
The embodiment of the application also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and executed by the processor to cause the computer device to perform the method illustrated in fig. 1.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.
Furthermore, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and/or features may be integrated in a single physical device and/or software module, or one or more functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is defined by the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of 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 execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the foregoing description of the specification, reference to the description of "one embodiment/example," "another embodiment/example," or "certain embodiments/examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (10)
1. A firmware upgrading method based on an embedded boot partition is characterized by comprising the following steps:
after starting the equipment, entering a U-boot guide partition control state;
reading a configuration file in a configuration partition, and detecting whether to perform upgrading operation according to the configuration file;
after the upgrading operation is determined to be detected, a firmware upgrading file of the equipment is obtained, and the firmware of the equipment is upgraded according to the firmware upgrading file;
and after the upgrading operation is finished in the control state of the U-boot partition, entering a normal starting mode of the equipment.
2. The method according to claim 1, wherein the reading of the configuration file in the configuration partition and the detection of whether to perform the upgrade operation according to the configuration file comprises:
reading a configuration file in a device configuration partition to a preset memory;
analyzing configuration parameters in the configuration file, wherein the configuration parameters comprise an enabling mark of equipment upgrading;
and detecting whether the upgrading operation is carried out or not according to the enabling mark, and if the upgrading operation is not carried out, entering a normal starting mode of the equipment.
3. The method according to claim 2, wherein the configuration file further includes an IP address of a cloud server and a port number of the cloud server, and the obtaining the firmware upgrade file of the device includes:
communicating with a cloud server according to the IP address and the port number, and detecting whether a firmware upgrade file of the equipment is stored on the cloud server;
and determining that the firmware upgrading file is detected to be stored, and downloading the firmware upgrading file.
4. The method according to claim 1, wherein the obtaining of the firmware upgrade file of the device includes:
scanning a storage device of the equipment peripheral equipment, and detecting whether a firmware upgrade file of the equipment is stored in the storage device;
determining that the firmware upgrading file is detected to be stored, and downloading the firmware upgrading file;
wherein the storage device comprises at least one of a U disk or an SD card.
5. The firmware upgrade method based on the embedded boot partition according to claim 1, wherein the firmware upgrade of the device according to the firmware upgrade file includes:
analyzing a firmware head of the firmware upgrading file, detecting whether the firmware upgrading file is complete according to the firmware head, and discarding the firmware upgrading file if the firmware upgrading file is incomplete;
reading equipment model information in the firmware upgrading file, judging whether the equipment model information is consistent with the model of the equipment, and if not, discarding the firmware upgrading file;
analyzing the firmware upgrading file, and writing the image of the analyzed firmware upgrading file into image files in a partition-by-partition manner according to the sequence of partitions, namely, erasing the image and writing the image in the image files one by one;
and finishing the upgrading operation after finishing writing the mirror image file.
6. The embedded boot partition-based firmware upgrade method according to claim 1, further comprising a system corruption recovery step, comprising:
after entering a U-boot partition control state, detecting whether the equipment is hung with a storage device;
if the storage device is hung, detecting whether a system recovery file is stored in the storage device;
if the system recovery file is stored, acquiring the system recovery file, and performing recovery operation on the equipment according to the system recovery file;
wherein the storage device comprises at least one of a U disk or an SD card.
7. The method for upgrading firmware based on an embedded boot partition according to claim 6, wherein the performing recovery operation on the device according to the system recovery file comprises:
analyzing the system recovery file to a preset memory address, and acquiring equipment model information and MD5 verification information according to the analyzed system recovery file;
detecting whether the system recovery file is matched with the equipment or not according to the equipment model information, and if not, discarding the system recovery file;
detecting whether the system recovery file is complete or not according to the MD5 verification information, and if the system recovery file is incomplete, discarding the system recovery file;
and carrying out recovery operation according to the analyzed system recovery file.
8. An embedded boot partition based firmware upgrade system, comprising:
the device starting module is used for entering a U-boot partition control state after starting the device;
the file reading module is used for reading the configuration file in the configuration partition and detecting whether to carry out upgrading operation according to the configuration file;
the upgrading operation module is used for acquiring a firmware upgrading file of the equipment after upgrading operation is determined to be detected, and upgrading the firmware of the equipment according to the firmware upgrading file;
and the normal starting module is used for entering a normal starting mode of the equipment after finishing the upgrading operation in the control state of the U-boot partition.
9. An electronic device, comprising:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement an embedded boot partition-based firmware upgrade method as claimed in any one of claims 1-7.
10. A storage medium having stored therein a processor-executable program, the processor-executable program when executed by a processor being for performing an embedded boot partition based firmware upgrade method as claimed in any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110089434.3A CN112732310B (en) | 2021-01-22 | Firmware upgrading method, system, equipment and medium based on embedded guide partition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110089434.3A CN112732310B (en) | 2021-01-22 | Firmware upgrading method, system, equipment and medium based on embedded guide partition |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112732310A true CN112732310A (en) | 2021-04-30 |
CN112732310B CN112732310B (en) | 2024-08-02 |
Family
ID=
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113238789A (en) * | 2021-05-27 | 2021-08-10 | 闻泰通讯股份有限公司 | Electronic equipment, firmware upgrading method and device thereof and computer readable storage medium |
CN113672264A (en) * | 2021-05-13 | 2021-11-19 | 星汉智能科技股份有限公司 | System upgrading method and device for embedded universal integrated circuit card and electronic equipment |
CN113703818A (en) * | 2021-08-18 | 2021-11-26 | 深圳数马电子技术有限公司 | Device upgrading method and device, computer device and computer-readable storage medium |
CN113849209A (en) * | 2021-09-22 | 2021-12-28 | 北京东土科技股份有限公司 | Method, device, equipment and storage medium for updating switch software |
CN115328521A (en) * | 2022-10-10 | 2022-11-11 | 广州鲁邦通物联网科技股份有限公司 | USB automatic upgrading method and system based on embedded equipment |
CN116643782A (en) * | 2023-04-28 | 2023-08-25 | 荣耀终端有限公司 | OIS firmware upgrading method and electronic equipment |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101699398A (en) * | 2009-10-27 | 2010-04-28 | 中兴通讯股份有限公司 | RFID active tag, method for upgrading software thereof and system for upgrading software thereof |
CN102075564A (en) * | 2010-12-23 | 2011-05-25 | 李华嵩 | Remote software upgrading technique |
CN102184115A (en) * | 2011-05-20 | 2011-09-14 | 青岛海信移动通信技术股份有限公司 | Method and device for updating system software |
CN105487888A (en) * | 2015-11-26 | 2016-04-13 | 武汉光迅科技股份有限公司 | Method for generating upgrade file in system upgrade and/or application upgrade |
CN105511911A (en) * | 2015-11-27 | 2016-04-20 | 青岛海信移动通信技术股份有限公司 | System firmware upgrade package generation method and device |
CN105786510A (en) * | 2016-02-29 | 2016-07-20 | 深圳市美贝壳科技有限公司 | Upgrading and partitioning system and security upgrading method for single-chip microcomputer |
CN107122668A (en) * | 2017-04-28 | 2017-09-01 | 环球智达科技(北京)有限公司 | Firmware encrypting method |
CN108958767A (en) * | 2018-06-21 | 2018-12-07 | 厦门亿联网络技术股份有限公司 | A kind of safe mode automatically updating method realized based on minimum system backup |
CN109358894A (en) * | 2018-12-18 | 2019-02-19 | 北京四达时代软件技术股份有限公司 | A kind of Android device upgrade method and system for supporting DVB |
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101699398A (en) * | 2009-10-27 | 2010-04-28 | 中兴通讯股份有限公司 | RFID active tag, method for upgrading software thereof and system for upgrading software thereof |
CN102075564A (en) * | 2010-12-23 | 2011-05-25 | 李华嵩 | Remote software upgrading technique |
CN102184115A (en) * | 2011-05-20 | 2011-09-14 | 青岛海信移动通信技术股份有限公司 | Method and device for updating system software |
CN105487888A (en) * | 2015-11-26 | 2016-04-13 | 武汉光迅科技股份有限公司 | Method for generating upgrade file in system upgrade and/or application upgrade |
CN105511911A (en) * | 2015-11-27 | 2016-04-20 | 青岛海信移动通信技术股份有限公司 | System firmware upgrade package generation method and device |
CN105786510A (en) * | 2016-02-29 | 2016-07-20 | 深圳市美贝壳科技有限公司 | Upgrading and partitioning system and security upgrading method for single-chip microcomputer |
CN107122668A (en) * | 2017-04-28 | 2017-09-01 | 环球智达科技(北京)有限公司 | Firmware encrypting method |
CN108958767A (en) * | 2018-06-21 | 2018-12-07 | 厦门亿联网络技术股份有限公司 | A kind of safe mode automatically updating method realized based on minimum system backup |
CN109358894A (en) * | 2018-12-18 | 2019-02-19 | 北京四达时代软件技术股份有限公司 | A kind of Android device upgrade method and system for supporting DVB |
Non-Patent Citations (1)
Title |
---|
王金鹏: "《智能电网中电力电子技术的研究与应用》", 30 November 2017, 电子科技大学出版社, pages: 84 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113672264A (en) * | 2021-05-13 | 2021-11-19 | 星汉智能科技股份有限公司 | System upgrading method and device for embedded universal integrated circuit card and electronic equipment |
CN113238789A (en) * | 2021-05-27 | 2021-08-10 | 闻泰通讯股份有限公司 | Electronic equipment, firmware upgrading method and device thereof and computer readable storage medium |
CN113703818A (en) * | 2021-08-18 | 2021-11-26 | 深圳数马电子技术有限公司 | Device upgrading method and device, computer device and computer-readable storage medium |
CN113703818B (en) * | 2021-08-18 | 2024-05-17 | 深圳数马电子技术有限公司 | Device upgrade method and apparatus, computer device, and computer-readable storage medium |
CN113849209A (en) * | 2021-09-22 | 2021-12-28 | 北京东土科技股份有限公司 | Method, device, equipment and storage medium for updating switch software |
CN115328521A (en) * | 2022-10-10 | 2022-11-11 | 广州鲁邦通物联网科技股份有限公司 | USB automatic upgrading method and system based on embedded equipment |
CN116643782A (en) * | 2023-04-28 | 2023-08-25 | 荣耀终端有限公司 | OIS firmware upgrading method and electronic equipment |
CN116643782B (en) * | 2023-04-28 | 2024-05-28 | 荣耀终端有限公司 | OIS firmware upgrading method and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105094927B (en) | A kind of device firmware upgrade method and apparatus | |
CN101593083B (en) | device, computer and method for protecting and restoring computer configuration information | |
CN106020865A (en) | System upgrading method and device | |
CN101650662A (en) | Memory device of embedded system and staring method and upgrading of firmware | |
CN112506745B (en) | Memory temperature reading method and device and computer readable storage medium | |
CN109582332B (en) | System upgrading method and device for Internet camera | |
CN107908417A (en) | Firmware upgrade method and electronic equipment | |
CN115357262A (en) | Method for upgrading driver firmware in batch | |
CN107315607B (en) | Drive self-adaptation loading system | |
CN113190256B (en) | Upgrading method, device and equipment | |
CN112732310B (en) | Firmware upgrading method, system, equipment and medium based on embedded guide partition | |
CN112732310A (en) | Firmware upgrading method, system, equipment and medium based on embedded boot partition | |
CN116755735A (en) | Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium | |
CN105278993A (en) | Linux system based drive module upgrading method and apparatus | |
CN115437674A (en) | Firmware upgrading method, device, medium and electronic equipment | |
CN107506271A (en) | A kind of method of testing and device | |
CN115129384A (en) | Electronic equipment and running method of starting program of electronic equipment | |
CN102023906B (en) | Microprocessor of portable terminal as well as portable terminal and repair method thereof | |
CN112231159A (en) | Memory installation position testing method, system, terminal and storage medium | |
CN110569059A (en) | USB-based system partition upgrading method under uboot | |
CN111190627A (en) | System upgrading method and device | |
CN111124882B (en) | Method and device for realizing application test, computer storage medium and terminal | |
CN113835631B (en) | Residual platform configuration data deleting method, system, terminal and storage medium | |
CN113377421B (en) | Method, device, equipment and medium for detecting software and hardware version information | |
CN108509252A (en) | Virtual machine starter, method and host |
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 | ||
GR01 | Patent grant |