CN115113904A - Firmware upgrading processing method and device, electronic equipment and storage medium - Google Patents

Firmware upgrading processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115113904A
CN115113904A CN202211037123.3A CN202211037123A CN115113904A CN 115113904 A CN115113904 A CN 115113904A CN 202211037123 A CN202211037123 A CN 202211037123A CN 115113904 A CN115113904 A CN 115113904A
Authority
CN
China
Prior art keywords
firmware
application program
identifier
application
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.)
Pending
Application number
CN202211037123.3A
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.)
Wuxi Xinglian Xintong Technology Co ltd
Xinjiang Starlink Core Technology Co ltd
Chengdu Xinglian Xintong Technology Co ltd
Original Assignee
Wuxi Xinglian Xintong Technology Co ltd
Xinjiang Starlink Core Technology Co ltd
Chengdu Xinglian Xintong Technology 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 Wuxi Xinglian Xintong Technology Co ltd, Xinjiang Starlink Core Technology Co ltd, Chengdu Xinglian Xintong Technology Co ltd filed Critical Wuxi Xinglian Xintong Technology Co ltd
Priority to CN202211037123.3A priority Critical patent/CN115113904A/en
Publication of CN115113904A publication Critical patent/CN115113904A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The embodiment of the invention provides a firmware upgrading processing method, a firmware upgrading processing device, electronic equipment and a storage medium, and belongs to the field of embedded technology, wherein the method comprises the following steps: the method comprises the steps of after successfully receiving upgrade firmware of an application program and storing the upgrade firmware into an application partition, restarting the application program, loading the upgrade firmware in the application partition, identifying an identifier of the upgrade firmware, if the identifier is a first identifier, adding state detection in the application program, and when detecting that the application program is hung up, setting the identifier of the upgrade firmware as a second identifier to prompt an electronic device to jump and load backup firmware related to the application program in a backup partition when restarting the application program to run the application program.

Description

Firmware upgrading processing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of embedded technology, in particular to a firmware upgrading processing method and device, electronic equipment and a storage medium.
Background
The embedded system is composed of hardware and software and is a device capable of operating independently. With the development of embedded technology, embedded systems are deep into the lives of people, such as smart homes, monitoring systems, automotive electronics, and the like. In the embedded technology, the advantages of the ZYNQ-based SOC (system on chip) extensible platform structure are gradually shown, and ZYNQ products are adopted in many fields of navigation positioning, unmanned aerial vehicle remote sensing and the like.
Firmware program upgrade of the ZYNQ product is generally based on a series of software and hardware (emulator) support provided by Xilinx corporation, and adopts a remote serial port upgrade mode with CRC check. However, in this upgrading method, when the program is received completely and successfully, the successfully upgraded program is easily hung up due to problems such as code logic.
Disclosure of Invention
The invention aims to provide a firmware upgrading processing method, a firmware upgrading processing device, an electronic device and a storage medium, which can solve the problem that a program which is successfully upgraded is hung up due to problems of code logic and the like easily under the condition that the program is completely and successfully received in the conventional firmware upgrading mode.
In order to achieve the above object, the embodiments of the present invention adopt the following technical solutions.
In a first aspect, an embodiment of the present invention provides a firmware upgrade processing method, where an electronic device includes an application partition and a backup partition, and the method includes:
after successfully receiving the upgrade firmware of the application program and storing the upgrade firmware into the application partition, restarting the application program, loading the upgrade firmware in the application partition, and identifying the identifier of the upgrade firmware;
if the identifier is a first identifier, adding state detection in the application program, and setting the identifier of the upgraded firmware as a second identifier when the application program is detected to be hung up;
the second identifier is used for causing the electronic equipment to jump and load backup firmware of the application program in the backup partition when the application program is restarted so as to run the application program.
Further, the step of adding state detection to the application program includes:
setting the identifier of the upgraded firmware in the application partition as a second identifier;
calling a timing processing function adaptive to the application program, starting timing, and continuously loading the resource firmware of the application program in the application partition;
and when the timing reaches the time length set by the timing processing function, detecting whether the current operation of the application program is correct, and if not, judging that the application program is hung up.
Further, the step of detecting whether the application program runs error-free includes:
sending a detection instruction to an application program serial port of the electronic equipment, wherein the application program serial port is a communication interface of the application program;
and receiving the running information returned by the serial port of the application program, analyzing whether the running information is error warning information, if so, judging that the application program runs wrongly, and if not, judging that the application program runs wrongly.
Further, the step of detecting whether the current operation of the application program is error-free further includes:
if the application program runs without errors, setting the identifier of the upgraded firmware as a third identifier;
the third identifier is used for causing the electronic equipment to load resource firmware of the application program in the application partition after the electronic equipment is started so as to run the application program;
and if the application program is in error operation, sending out a program hang-up warning.
Further, before the step of restarting the application, the method further comprises:
receiving an upgrading firmware package related to an application program, and verifying the upgrading firmware package;
under the condition that the verification is successful, storing the upgrading firmware in the upgrading firmware package into the application partition;
and setting the identifier of the upgraded firmware in the application partition as a first identifier.
Further, the upgrade firmware further includes a bitstream, and after the step of verifying the upgrade firmware package, the method further includes:
and updating the resources related to the application program in the application partition according to the bit stream when the verification is successful.
Further, the step of verifying the upgrade firmware package includes:
after the upgrading firmware package is received, performing CRC (cyclic redundancy check) on the received upgrading firmware package to obtain a second CRC value;
and comparing the second CRC value with the first CRC value sent by the upper computer, and if the comparison result is consistent, the verification is successful.
In a second aspect, an embodiment of the present invention provides a firmware upgrade processing apparatus, which is applied to an electronic device, where the electronic device includes an application partition and a backup partition, and the firmware upgrade processing apparatus includes a loading module and a detection module:
the loading module is used for restarting the application program after successfully receiving the upgrade firmware of the application program and storing the upgrade firmware into the application partition, loading the upgrade firmware in the application partition and identifying the identifier of the upgrade firmware;
the detection module is used for adding state detection in the application program if the identifier is a first identifier, and setting the identifier of the upgraded firmware as a second identifier when the application program is detected to be hung dead;
the second identifier is used for causing the electronic equipment to jump and load backup firmware of the application program in the backup partition when the application program is restarted so as to run the application program.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the firmware upgrade processing method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the firmware upgrade processing method according to the first aspect.
The firmware upgrading processing method, the device, the electronic equipment and the storage medium provided by the embodiment of the invention, the backup firmware of the application program is stored in the backup partition, when the application program is upgraded, the upgrade firmware of the successfully received application program is stored in the application partition, therefore, when the upgrading firmware in the application partition is loaded, if the identifier of the upgrading firmware is identified as the first identifier, the state detection is added in the application program, when detecting that the application program is hung up, setting the identifier of the upgraded firmware as a second identifier so that after the electronic equipment restarts the application program, skipping to load the backup firmware of the application program in the backup partition to run the application program, and loading the backup firmware of the backup partition to run the application program when the application program is hung up due to the upgraded firmware, the method and the device can ensure that the application program can normally run, thereby improving the problem that the program is easy to hang up in the current upgrading mode.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram illustrating a firmware upgrade processing system according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a firmware upgrade processing method according to an embodiment of the present invention.
Fig. 3 is a second flowchart illustrating a firmware upgrade processing method according to an embodiment of the present invention.
Fig. 4 shows a schematic flow diagram of part of the sub-steps of step S101 in fig. 3.
Fig. 5 shows a schematic flow diagram of a part of the sub-steps of step S104 in fig. 2 or 3.
Fig. 6 shows a schematic flow diagram of part of the sub-steps of step S104-3 in fig. 5.
Fig. 7 is a block diagram illustrating a firmware upgrade processing apparatus according to an embodiment of the present invention.
Fig. 8 is a block diagram of an electronic device according to an embodiment of the present invention.
Reference numerals: 100-firmware upgrade processing system; 110-a server; 120-an electronic device; 130-application partition; 140-backup partitions; 150-firmware upgrade processing means; 160-load module; 170-detection module.
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. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the embedded technology, the advantages of the ZYNQ-based SOC (system on chip) extensible platform structure are gradually shown, and ZYNQ products are adopted in many fields of navigation positioning, unmanned aerial vehicle remote sensing and the like.
Firmware program upgrade of the ZYNQ product is generally based on a series of software and hardware (emulator) support provided by Xilinx corporation, and adopts a remote serial port upgrade mode with CRC check. Although the verification added by the upgrading mode can avoid the hanging of the development board caused by the problem of program receiving, when the program receiving is complete and successful, the hanging of the program which is successfully upgraded is still easy to occur due to the problems of code logic and the like.
Based on the above consideration, embodiments of the present invention provide a firmware upgrade processing scheme, which can optimize firmware upgrade in an embedded system, and when upgrade is improved, under the condition that program reception is complete and successful, a problem that a program that is successfully upgraded is hung up due to problems of code logic and the like is easily caused. Hereinafter, detailed description will be given.
The firmware upgrade processing method provided by the embodiment of the present invention may be applied to a firmware upgrade processing system 100 shown in fig. 1, where the firmware upgrade processing system 100 includes an electronic device 120 and a server 110, the server 110 is remotely connected to the electronic device 120 through a network, and a storage device of the electronic device 120 is divided into an application partition 130 and a backup partition 140. The backup partition 140 stores backup firmware of the application program, and the backup firmware is firmware that is a reserved program upgrading function burned onto the electronic device 120 when the electronic device 120 leaves a factory and can ensure normal operation of the application program.
During upgrading, the server 110 issues an upgrade firmware package of the application program to the electronic device 120, and after the electronic device 120 successfully receives the upgrade firmware package, the upgrade firmware is stored in the application partition 130. After the electronic device 120 is restarted, the electronic device 120 preferentially records the upgrade firmware in the application partition 130, and during loading, if it is detected that the application program is hung up, the identifier of the upgrade firmware is set as the second identifier, so that after the electronic device 120 is restarted again, the backup firmware in the backup partition 140 is jumped to load to run the application program.
Among these, the electronic device 120 includes but is not limited to: mobile terminal, smart TV, wearable equipment, personal computer and panel computer.
In one embodiment, referring to FIG. 2, a firmware upgrade processing method is provided. In the present embodiment, the firmware upgrade processing method is applied to the electronic device 120 in fig. 1 for illustration.
S102, after the upgrade firmware of the application program is successfully received and stored in the application partition, the application program is restarted, the upgrade firmware in the application partition is loaded, and the identification of the upgrade firmware is identified.
After receiving and storing the upgrade firmware of the application program issued by the server 110, the electronic device 120 stores the upgrade firmware in the application partition 130 to replace the original firmware. After the storage is finished, when the electronic device 120 automatically restarts or manually restarts the application program, the upgrade firmware in the application partition 130 is loaded, and the identifier of the upgrade firmware is identified.
The mark comprises a first mark, a second mark or a third mark. The first flag indicates "pending", the second indicates "failed", and the third flag indicates "successful".
The application program may be, but is not limited to: operating system and various application software programs. It should be understood that if the application program is an operating system or the like, the electronic device 120 needs to be restarted to restart the application program.
And S104, if the identifier is the first identifier, adding state detection in the application program, and setting the identifier of the upgraded firmware as a second identifier when the application program is detected to be hung.
Wherein the second identifier is configured to cause the electronic device 120 to jump load backup firmware for the application in the backup partition 140 to run the application when the application is restarted.
When the identifier of the upgraded firmware is the first identifier, that is, to be timed, the electronic device 120 adds state detection to the application program, and sets the identifier of the upgraded firmware as the second identifier when it is detected that the application program is hung up.
The backup firmware in the backup partition 140 is firmware that is burned to the reserved program upgrade function on the electronic device 120 when the electronic device 120 leaves a factory or when the application program is initially installed, and can ensure normal operation of the application program.
In the firmware upgrade processing method, when the electronic device 120 restarts the application program, if the identifier of the upgraded firmware is identified as the first identifier, the state of the application program is detected, and after the application program is detected to be hung, the identifier of the upgraded firmware is set as the second identifier, so that when the application program is restarted, the backup firmware in the backup partition 140 is directly jumped to load to start and run the application program. When the upgraded firmware causes the application program to be hung up, the backup firmware of the backup partition 140 is loaded to run the application program, so that the application program can run normally, and the problem that the program is hung up easily in the existing upgrading mode can be solved.
Further, referring to fig. 3, the firmware upgrade processing method further includes step S101, and step S101 is performed before step S102.
S101, receiving the upgrading firmware package, and storing the upgrading firmware package into the application partition.
Upgrading the firmware package includes upgrading the firmware.
Generally, if the upgrade firmware package passes verification, the upgrade firmware package is stored in the application partition 130, and if the verification fails, it means that the upgrade firmware package in the electronic device 120 is received incorrectly, and the upgrade firmware package is deleted.
In more detail, referring to fig. 4, a flowchart of a part of the sub-steps of step S101 is shown, which includes the following steps.
S201, receiving an upgrading firmware package related to the application program, and verifying the upgrading firmware package.
After the electronic device 120 receives the application version update information sent by the server 110, the electronic device 120 may send an upgrade request to the server 110, and after the server 110 receives the upgrade request, the upgrade firmware is packaged and the upgrade firmware package of the application is issued to the electronic device 120.
The electronic device 120 receives the upgrade firmware package delivered by the server 110, and performs verification after the reception is completed.
In order to ensure that the upgrade firmware package is received without errors, the electronic device 120 is prevented from being hung up when receiving the upgrade firmware package to some extent. In one embodiment, the check is a CRC check, and after the server 110 sends the upgrade firmware package, a first CRC value obtained after checking the upgrade firmware package may be sent to the server 110 as tail information.
In more detail, the upgrade firmware package may be verified in the following manner: after receiving the upgrade firmware package, performing CRC (cyclic redundancy check) on the received upgrade firmware package to obtain a second CRC value; and comparing the second CRC value with the first CRC value sent by the upper computer, and if the comparison result is consistent, the verification is successful.
S202, under the condition that the verification is successful, storing the upgrading firmware in the upgrading firmware package into the application partition.
If the verification is passed, it means that there is no error in reception, and the upgrade firmware package is stored in the application partition 130. If the verification indicates that the receiving is incorrect, the upgrade firmware package may be deleted and the upgrade request may be retransmitted to the server 110 until the receiving is incorrect.
S203, setting the identifier of the upgraded firmware in the application partition as a first identifier.
The method comprises the steps that the upgrade firmware which is just received cannot determine whether the upgrade firmware is hung up due to problems of code logic and the like, namely whether the upgrade firmware fails due to problems of the code logic and the like is not detected, and therefore the identifier of the upgrade firmware is set as a first identifier. So that after the upgrade is restarted, it can be detected using steps S102 to S104.
Through the steps S201 to S203, for the upgrade firmware successfully received during each upgrade, the identifier of the upgrade firmware is first set as the first identifier, so that the upgrade firmware can be subjected to state detection through the steps S102 to S104 after being restarted, and whether the upgrade firmware has problems such as code logic or not is detected, so as to facilitate normal operation of the application program after being upgraded.
In the electronic device 120 developed based on an extended processing platform such as ZYNQ, logic blocks and hardware resources of an array may be editable in the field using an FPGA or the like. Thus, at the time of upgrade, changes in logic blocks and hardware resources may be involved. Generally, the application partition 130 of the electronic device 120 further includes resources such as logic blocks and hardware resources used by the application program stored in the form of a bit stream.
When the upgraded firmware has a change in resources such as logic blocks and hardware resources compared to the original firmware, the upgraded firmware package further includes a bit stream. On the basis, please continue to refer to fig. 4, the step S101 further includes a step S204.
And S204, under the condition that the verification is successful, updating the resources related to the application program in the application partition according to the bit stream.
The bit stream of the original firmware in the application partition 130 is updated to the bit stream in the upgrade firmware package through step S204.
It should be understood that the firmware of each application program may be stored in the application partition 130 corresponding to the format address according to the format address required by the user. Thus, at load time, the upgraded firmware and bit stream may be located by applying the address of partition 130.
The manner of adding the state detection in the application program in S104 may be flexible, for example, the state detection may be performed according to a preset rule, or may be directly monitored.
In one embodiment, referring to fig. 5, which is a flow diagram of a partial sub-step of S104, adding state detection in an application is achieved by the following steps.
S104-1, setting the identifier of the upgrading firmware in the application partition as a second identifier.
And S104-2, calling a timing processing function adaptive to the application program, starting timing, and continuously loading the resource firmware of the application program in the application partition.
A plurality of timing processing functions may be stored in the electronic device 120 in advance, and each timing processing function is adapted to one or more application programs.
Alternatively, when detecting the trigger state, the electronic device 120 may automatically create a timing processing function according to the application program, call the timing processing function, and start timing.
The application adaptation means that the set duration of the timing processing function may be related to the complexity of the application, and if the application is more complex, a longer set duration may be set, whereas, a shorter set duration may be set.
The process of loading the resource firmware of the application in the application partition 130 may be: and loading the upgraded firmware in the application partition 130 corresponding to the address according to the specified address and calling the bit stream.
And S104-3, when the timing reaches the time length set by the timing processing function, detecting whether the current running of the application program is correct, and if not, judging that the application program is hung.
And if the application program runs without errors in the set time length, judging that the application program runs normally, otherwise, judging that the application program is hung up.
In more detail, referring to fig. 6, the step S104-3 can be implemented by the following steps to detect whether the application program is running without error.
S301, sending a detection instruction to an application program serial port of the electronic equipment.
The application program serial port is a communication interface of the application program.
And the application program serial port can also be a processing interface.
After receiving the detection instruction, the application serial port of the electronic device 120 obtains the running information of the application, and returns the running information.
And S302, receiving the running information returned by the serial port of the application program.
The operation information comprises error warning information and operation normal indication information.
S303, analyzing whether the operation information is error warning information. If yes, go to step S304, otherwise go to step S306.
And S304, the application program runs in error.
S306, the application program runs without errors.
Further, please continue to refer to fig. 6, steps S305 and S307 may be further included, where S305 is executed after step S304, and S307 is executed after step S306.
S305, sending out a program hang-up alarm.
The hang-up alert may be sent to the operation and maintenance platform, may also be sent to the server 110, or may be displayed on a display of the electronic device 120. Therefore, the device can prompt in time so as to facilitate timely maintenance.
S307, setting the identifier of the upgraded firmware as a third identifier.
Wherein the third identifier is used to cause the electronic device 120 to load the resource firmware of the application program in the application partition 130 after the start-up, so as to run the application program.
When the electronic device 120 loads the upgraded firmware, if it is recognized that the identifier of the upgraded firmware is the third identifier, the upgraded firmware and the bit stream in the application partition 130 are directly loaded to run the application program.
Through the steps, whether the upgraded firmware can support the normal operation of the application program or not, namely whether the code logic is normal or not, and whether the bit stream is matched with the upgraded firmware or not can be detected in time. And under the condition of error detection, setting the identifier of the upgraded firmware as a third identifier, otherwise, sending out error warning.
It should be appreciated that backup partition 140 stores backup firmware and backup bitstreams and that backup firmware may be upgraded since the backup firmware in backup partition 140 retains upgrade functionality.
The upgrade method for the backup firmware can be flexibly selected, for example, refer to the above steps S201 to S204, except that the backup firmware and the bit stream in the upgrade package are both stored in the backup firmware. The backup firmware in the backup partition 140 may also be upgraded in a close range by using a wired burn.
According to the firmware upgrading processing scheme provided by the embodiment of the invention, the identifier of the upgraded firmware is set as the first identifier when the upgraded firmware is received and checked to be correct, so that the upgraded firmware in the application partition 130 is loaded firstly when the application program is restarted, the state detection is performed on the upgraded firmware in the application partition 130 after the first identifier is identified, and if the application program is detected to be hung up, the identifier in the application partition 130 is set as the second identifier, so that the backup firmware in the backup partition 140 is directly loaded when the application program is restarted next time to normally run the application program. Therefore, program hang-up caused by unmatched code logic or resource firmware of the upgraded firmware can be avoided to a certain extent, and optimization of the remote upgraded firmware in the embedded technology is achieved.
It should be understood that although the various steps in the flowcharts of fig. 2-6 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-6 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
Based on the above-mentioned concept of the firmware upgrade processing method, in one embodiment, referring to fig. 7, a firmware upgrade processing apparatus 150 is provided, which is applied in the electronic device 120 shown in fig. 1, where the firmware upgrade processing apparatus 150 includes a loading module 160 and a detection module 170.
The loading module 160 is configured to restart the application program after the upgrade firmware of the application program is successfully received and stored in the application partition 130, load the upgrade firmware in the application partition 130, and identify an identifier of the upgrade firmware.
The detection module 170 is configured to add state detection to the application program if the identifier is the first identifier, and set the identifier of the upgraded firmware as the second identifier when detecting that the application program is hung up.
Wherein the second identifier is used to cause the electronic device 120 to jump to load the backup firmware of the backup partition 140 about the application program after restarting the application program to run the application program.
In the firmware upgrade processing apparatus 150, when the electronic device 120 loads the upgraded firmware in the application partition 130 through the loading module 160, if the first identifier is identified, the detection module 170 adds state detection to the application program, and when it is detected that the application program is hung up, the identifier of the upgraded firmware is set to the second identifier, so that after the electronic device 120 restarts the application program, the backup firmware of the application program in the backup partition 140 is jumped to load to run the application program, so that when a code logic error occurs in the upgraded firmware in the application partition 130 or the upgraded firmware is not matched with a resource, the application program can still run normally, thereby improving a problem that the program is hung up easily in a current upgrade mode.
For the specific definition of the firmware upgrade processing device 150, the above definition of the firmware upgrade processing method may be referred to, and will not be described herein again. The various modules in the firmware upgrade processing device 150 may be implemented in whole or in part by software, hardware, and a combination thereof. The modules may be embedded in a hardware form or may be independent from a processor in the firmware upgrade processing device 150, or may be stored in a memory in the edge firmware upgrade processing device 150 in a software form, so that the processor calls to execute operations corresponding to the modules.
In one embodiment, an electronic device 120 is provided, the internal structure of which may be as shown in FIG. 8. The electronic device 120 includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device 120 is configured to provide computing and control capabilities. The memory of the electronic device 120 includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the electronic device 120 is used for performing wired or wireless communication with an external terminal, and the wireless communication may be implemented through WIFI, an operator network, Near Field Communication (NFC), or other technologies. The computer program is executed by a processor to implement a firmware upgrade processing method. The display screen of the electronic device 120 may be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device 120 may be a touch layer covered on the display screen, a key, a trackball or a touch pad arranged on a housing of the electronic device 120, or an external keyboard, a touch pad or a mouse.
It will be understood by those skilled in the art that the structure shown in fig. 8 is a block diagram of only a portion of the structure associated with the inventive arrangements, and does not constitute a limitation on the electronic device 120 to which the inventive arrangements are applied, and that a particular electronic device 120 may include more or fewer components than those shown in fig. 8, or may combine certain components, or have a different arrangement of components.
In one embodiment, the firmware upgrade processing method provided by the present invention can be implemented in the form of a computer program, and the computer program can be run on the electronic device 120 shown in fig. 8. The memory of the electronic device 120 may store therein various program modules constituting the firmware upgrade process, such as the loading module 160 and the detection module 170 shown in fig. 7. The computer program constituted by the respective program modules causes the processor to execute the steps in the firmware upgrade processing method described in this specification.
For example, the electronic device 120 shown in fig. 8 may perform step S102 by the loading module 160 in the firmware upgrade processing method shown in fig. 7. The electronic device 120 may perform step S104 through the detection module 170.
In one embodiment, an electronic device 120 is provided, comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program: after the upgrade firmware of the application program is successfully received and stored in the application partition 130, restarting the application program, loading the upgrade firmware in the application partition 130, and identifying the identifier of the upgrade firmware; if the identifier is the first identifier, adding state detection in the application program, and setting the identifier of the upgraded firmware as a second identifier when detecting that the application program is hung up; wherein the second identifier is used to cause the electronic device 120 to jump to load the backup firmware of the backup partition 140 about the application program to run the application program when the application program is restarted.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: after the upgrade firmware of the application program is successfully received and stored in the application partition 130, restarting the application program, loading the upgrade firmware in the application partition 130, and identifying the identifier of the upgrade firmware; if the identifier is the first identifier, adding state detection in the application program, and setting the identifier of the upgraded firmware as a second identifier when detecting that the application program is hung up; wherein the second identifier is used to cause the electronic device 120 to jump to load the backup firmware of the backup partition 140 about the application program to run the application program when the application program is restarted.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. 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 involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules 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 above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A firmware upgrade processing method is applied to an electronic device, the electronic device comprises an application partition and a backup partition, and the method comprises the following steps:
after successfully receiving the upgrade firmware of the application program and storing the upgrade firmware into the application partition, restarting the application program, loading the upgrade firmware in the application partition, and identifying the identifier of the upgrade firmware;
if the identifier is a first identifier, adding state detection in the application program, and setting the identifier of the upgraded firmware as a second identifier when the application program is detected to be hung up;
wherein the second identifier is used for causing the electronic device to jump and load backup firmware about the application program in the backup partition when the application program is restarted, so as to run the application program.
2. The firmware upgrade processing method according to claim 1, wherein the step of adding state detection in the application program includes:
setting the identifier of the upgraded firmware in the application partition as a second identifier;
calling a timing processing function adaptive to the application program, starting timing, and continuously loading the resource firmware of the application program in the application partition;
and when the timing reaches the time length set by the timing processing function, detecting whether the current operation of the application program is correct, and if not, judging that the application program is hung up.
3. The firmware upgrade processing method according to claim 2, wherein the step of detecting whether the application program is running without error includes:
sending a detection instruction to an application program serial port of the electronic equipment, wherein the application program serial port is a communication interface of the application program;
and receiving the running information returned by the serial port of the application program, analyzing whether the running information is error warning information, if so, judging that the application program runs wrongly, and if not, judging that the application program runs wrongly.
4. The firmware upgrade processing method according to claim 2, wherein the step of detecting whether the application program is currently running without error further comprises:
if the application program runs without errors, setting the identifier of the upgraded firmware as a third identifier;
the third identifier is used for causing the electronic equipment to load resource firmware of the application program in the application partition after the electronic equipment is started so as to run the application program;
and if the application program is in error operation, sending out a program hang-up warning.
5. The firmware upgrade processing method according to claim 1, wherein, before the step of restarting the application program, the method further comprises:
receiving an upgrading firmware package related to an application program, and verifying the upgrading firmware package;
under the condition that the verification is successful, storing the upgrading firmware in the upgrading firmware package into the application partition;
and setting the identifier of the upgraded firmware in the application partition as a first identifier.
6. The firmware upgrade processing method according to claim 5, wherein the upgraded firmware further includes a bitstream, and after the step of verifying the upgraded firmware package, the method further includes:
and updating the resources related to the application program in the application partition according to the bit stream when the verification is successful.
7. The firmware upgrade processing method according to claim 5, wherein the step of verifying the upgrade firmware package includes:
after the upgrading firmware package is received, performing CRC (cyclic redundancy check) on the received upgrading firmware package to obtain a second CRC value;
and comparing the second CRC value with the first CRC value sent by the upper computer, and if the comparison result is consistent, the verification is successful.
8. The firmware upgrading processing device is applied to electronic equipment, the electronic equipment comprises an application partition and a backup partition, and the firmware upgrading processing device comprises a loading module and a detection module:
the loading module is used for restarting the application program after the upgrading firmware of the application program is successfully received and stored in the application partition, loading the upgrading firmware in the application partition and identifying the identifier of the upgrading firmware;
the detection module is used for adding state detection in the application program if the identifier is a first identifier, and setting the identifier of the upgraded firmware as a second identifier when the application program is detected to be hung dead;
the second identifier is used for causing the electronic equipment to jump and load backup firmware about the application program in the backup partition after the application program is restarted so as to run the application program.
9. An electronic device comprising a processor and a memory, the memory storing a computer program executable by the processor, the processor being operable to execute the computer program to implement the firmware upgrade processing method as claimed in any one of claims 1 to 7.
10. A storage medium on which a computer program is stored, the computer program implementing the firmware upgrade processing method according to any one of claims 1 to 7 when executed by a processor.
CN202211037123.3A 2022-08-29 2022-08-29 Firmware upgrading processing method and device, electronic equipment and storage medium Pending CN115113904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211037123.3A CN115113904A (en) 2022-08-29 2022-08-29 Firmware upgrading processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211037123.3A CN115113904A (en) 2022-08-29 2022-08-29 Firmware upgrading processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115113904A true CN115113904A (en) 2022-09-27

Family

ID=83335776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211037123.3A Pending CN115113904A (en) 2022-08-29 2022-08-29 Firmware upgrading processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115113904A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912356A (en) * 2016-03-31 2016-08-31 武汉光迅科技股份有限公司 Optical module firmware program online upgrade method supporting version fallback
CN106776122A (en) * 2016-11-23 2017-05-31 武汉光迅科技股份有限公司 A kind of method of main-apparatus protection in start-up course based on Flash
CN112925679A (en) * 2021-03-16 2021-06-08 南昌欧菲光电技术有限公司 Firmware upgrading method, nonvolatile memory, computer storage medium and terminal
CN113986308A (en) * 2021-11-25 2022-01-28 北京广利核系统工程有限公司 Method and system for updating firmware on line
DE102021209039A1 (en) * 2020-08-31 2022-03-03 Hyundai Motor Company DEVICE AND METHOD FOR MANAGING AN UPDATE OF AN ECU OF A VEHICLE
CN114268614A (en) * 2020-09-15 2022-04-01 松下家电(中国)有限公司 Equipment firmware upgrading method, device and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912356A (en) * 2016-03-31 2016-08-31 武汉光迅科技股份有限公司 Optical module firmware program online upgrade method supporting version fallback
CN106776122A (en) * 2016-11-23 2017-05-31 武汉光迅科技股份有限公司 A kind of method of main-apparatus protection in start-up course based on Flash
DE102021209039A1 (en) * 2020-08-31 2022-03-03 Hyundai Motor Company DEVICE AND METHOD FOR MANAGING AN UPDATE OF AN ECU OF A VEHICLE
CN114268614A (en) * 2020-09-15 2022-04-01 松下家电(中国)有限公司 Equipment firmware upgrading method, device and system
CN112925679A (en) * 2021-03-16 2021-06-08 南昌欧菲光电技术有限公司 Firmware upgrading method, nonvolatile memory, computer storage medium and terminal
CN113986308A (en) * 2021-11-25 2022-01-28 北京广利核系统工程有限公司 Method and system for updating firmware on line

Similar Documents

Publication Publication Date Title
CN102736978B (en) A kind of method and device detecting the installment state of application program
CN109086079B (en) Mounting management method and device for storage equipment
CN109670319B (en) Server flash safety management method and system thereof
CN108121559A (en) Configuration file method for pushing, server and storage medium
CN106775610B (en) Electronic equipment starting method and electronic equipment
US11640730B2 (en) Method and apparatus for configuring automobile diagnostic function and automobile diagnostic device
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
CN103577201B (en) The update method and system of Embedded Double system
US20170115982A1 (en) Multi-system terminal system updating method, updating device and terminal
CN103036706A (en) Local processing method of application upgrading abnormity
CN110930131A (en) Vehicle maintenance method, device, equipment and medium
CN109358827B (en) Method, system, equipment and storage medium for controlling application serial port printing
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN109002305B (en) Method and system for updating equipment program
CN111698558A (en) Television software upgrading method, television terminal and computer readable storage medium
CN110502399B (en) Fault detection method and device
CN114780019A (en) Electronic device management method and device, electronic device and storage medium
CN108196975B (en) Data verification method and device based on multiple checksums and storage medium
CN108920338A (en) A kind of method and terminal indicating file system state
CN113032183A (en) System management method, device, computer equipment and storage medium
CN106933604B (en) System upgrading method and device
CN115113904A (en) Firmware upgrading processing method and device, electronic equipment and storage medium
CN109002317B (en) PCBA firmware upgrading method and system and PCBA
CN105278993B (en) A kind of drive module upgrade method and device based on linux system
CN106951276B (en) Multi-controller software upgrading and address conflict detection method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220927

RJ01 Rejection of invention patent application after publication