CN115237647A - Firmware abnormity repairing method and device, electronic equipment and computer storage medium - Google Patents

Firmware abnormity repairing method and device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN115237647A
CN115237647A CN202210814591.0A CN202210814591A CN115237647A CN 115237647 A CN115237647 A CN 115237647A CN 202210814591 A CN202210814591 A CN 202210814591A CN 115237647 A CN115237647 A CN 115237647A
Authority
CN
China
Prior art keywords
firmware
abnormal
strategy
exception
information
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
CN202210814591.0A
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.)
Ecoflow Technology Ltd
Original Assignee
Ecoflow Technology 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 Ecoflow Technology Ltd filed Critical Ecoflow Technology Ltd
Priority to CN202210814591.0A priority Critical patent/CN115237647A/en
Publication of CN115237647A publication Critical patent/CN115237647A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs

Abstract

The invention belongs to the technical field of electronic equipment, and relates to a firmware abnormity repairing method and device, electronic equipment and a computer storage medium. The method comprises the following steps: after a boot loader is operated, a system reset identifier is obtained; when the system reset identification is detected to be a watchdog reset identification, judging that the firmware is in an abnormal state; acquiring the current version information of the firmware, generating a firmware abnormal repair request according to the version information and the abnormal state, and outputting the firmware abnormal repair request to target equipment; and when strategy information returned by the target equipment based on the firmware exception repair request is received, executing exception repair operation on the firmware according to the strategy information. Therefore, the invention can avoid the condition that the system is abnormal again or the program flies away after the system is abnormal, and further improve the stability of the system.

Description

Firmware abnormity repairing method and device, electronic equipment and computer storage medium
Technical Field
The present application belongs to the technical field of electronic devices, and in particular, to a firmware exception recovery method and apparatus, an electronic device, and a computer storage medium.
Background
Generally, there is a need for a mechanism for a device to operate for a long time: it is guaranteed that even in case of an anomaly of the device, there is still at least one way to recover the anomaly. The common implementation is to trigger a system reset restart when an exception occurs in the program.
However, simply restarting the system is only a palliative and non-fundamental in nature, and if a bug exists in the program itself, there is still a risk of failure occurring again after the system is restarted. Therefore, a person skilled in the art needs to solve the problem of avoiding the occurrence of the system abnormality or program runaway again after the system abnormality occurs.
The foregoing description is provided for general background information and is not admitted to be prior art.
Disclosure of Invention
The technical problem to be solved by the present application is how to avoid the situation that the system is abnormal again or the program runs away, and therefore, a firmware abnormality repairing method, a firmware abnormality repairing apparatus, an electronic device, and a computer-readable storage medium are provided.
The technical problem to be solved by the application is solved by adopting the following technical scheme.
A firmware exception repairing method comprises the following steps:
after a boot loader is operated, a system reset identifier is obtained;
when the system reset identification is detected to be a watchdog reset identification, judging that the firmware is in an abnormal state;
acquiring the current version information of the firmware, generating a firmware abnormal repair request according to the version information and the abnormal state, and outputting the firmware abnormal repair request to target equipment;
and when strategy information returned by the target equipment based on the firmware exception repair request is received, executing exception repair operation on the firmware according to the strategy information.
Further, the performing an exception repair operation according to the policy information includes:
and when the strategy in the strategy information is to ignore abnormal operation, ignoring the abnormal state of the firmware.
Further, the performing an exception repair operation according to the policy information includes:
when the strategy in the strategy information is a firmware restoration operation, acquiring backup firmware;
and updating the current firmware into the backup firmware.
Further, the executing the exception repair operation according to the policy information includes:
when the strategy in the strategy information is firmware upgrading operation, obtaining upgraded firmware, wherein the version information of the upgraded firmware is higher than the current version information of the firmware;
and updating the current firmware into the upgraded firmware.
Further, performing an exception recovery operation according to the policy information, including:
when the received strategy information comprises a plurality of strategies, acquiring the priority of each strategy, determining a target strategy according to the priority of each strategy, and executing the abnormal repairing operation according to the target strategy; wherein the policy includes at least one of a firmware upgrade operation, a firmware restore operation, and an ignore exception operation.
Further, after the firmware exception recovery request is generated according to the version information and the exception state and then output to the target device, the firmware exception recovery method further includes:
and if the strategy information sent back by the target equipment is not acquired within the preset time, ignoring the abnormal state and operating the current firmware.
Further, the firmware exception recovery method further comprises the following steps:
after a boot loader is operated, starting the watchdog to start timing; the watchdog triggers a reset signal when the timing exceeds a preset threshold value, and performs zero clearing and timing anew when receiving a zero clearing instruction sent by the firmware;
when a reset signal triggered by the watchdog is detected, the system reset identification is marked as the watchdog reset identification.
The present application further provides a firmware exception recovery apparatus, including:
the reset identification acquisition module is used for acquiring a system reset identification after the boot loader is operated;
the abnormal response module is used for judging that the firmware is in an abnormal state when the system reset identifier is detected to be a watchdog reset identifier;
the request sending module is used for acquiring the current version information of the firmware, generating a firmware abnormal repair request according to the version information and the abnormal state and outputting the firmware abnormal repair request to target equipment;
and the strategy acquisition module is used for executing the abnormal repair operation on the firmware according to the strategy information when the strategy information returned by the target equipment based on the firmware abnormal repair request is received.
The present application further provides an electronic device, comprising a processor and a memory:
the processor is configured to execute the computer program stored in the memory to implement the steps of the firmware exception recovery method as described above.
The present application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the firmware exception recovery method as described above.
Therefore, the firmware abnormal state can be detected after the program is loaded, when the firmware is determined to be in the abnormal state, the corresponding strategy information is determined from the target device based on the firmware version information and the firmware abnormal repair request, then the firmware in the abnormal state is repaired by utilizing the strategy information, the situation that the system is abnormal again or the program is run away after the system is abnormal is avoided, and the stability of the system is further improved.
The foregoing description is only an overview of the technical solutions of the present application, and in order to make the technical means of the present application more clearly understood, the present application may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present application more clearly understood, the following preferred embodiments are specifically described in detail with reference to the accompanying drawings. It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings without inventive labor.
Fig. 1 is a flowchart illustrating a firmware exception recovery method according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of steps S41 to S42 in a firmware exception recovery method according to an alternative embodiment of the present application.
Fig. 3 is a schematic flowchart of steps S43 to S44 in a firmware exception recovery method according to an alternative embodiment of the present application.
Fig. 4 is a schematic flowchart of steps S431 to S432 in a firmware exception recovery method according to an alternative embodiment of the present disclosure.
Fig. 5 is a flowchart illustrating a firmware exception recovery method according to an alternative embodiment of the present application.
Fig. 6 is a schematic structural diagram of a firmware exception recovery apparatus according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Reference numerals
1-a reset identification acquisition module;
2-an exception response module;
3-a request sending module;
4-a policy acquisition module;
5-a processor;
6-memory.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The firmware abnormity repairing method provided by the embodiment of the application can be applied to electronic equipment to detect the abnormal condition of the application program in the electronic equipment, prevent the condition that the electronic equipment is abnormal again or the program flies away, and further improve the running stability of the electronic equipment. Fig. 1 is a flowchart illustrating a firmware exception recovery method according to an embodiment of the present application. In the embodiment of the present application, for convenience of understanding, a single chip microcomputer is taken as an example for introduction, but in practical application, implementation hardware of the firmware exception recovery method provided by the present application may also be a device with a programming control capability, for example: and (5) FPGA. For clearly describing the firmware exception recovery method provided in the embodiment of the present application, please refer to fig. 1, the firmware exception recovery method in the embodiment of the present application includes steps S1 to S4, which will be described in detail below.
S1, after a boot loader is operated, a system reset identifier is obtained.
And S2, when the system reset identifier is detected to be the watchdog reset identifier, judging that the firmware is in an abnormal state.
And S3, acquiring the current version information of the firmware, generating a firmware abnormal repair request according to the version information and the abnormal state, and outputting the firmware abnormal repair request to the target equipment.
And S4, when strategy information returned by the target equipment based on the firmware abnormal repair request is received, executing abnormal repair operation on the firmware according to the strategy information.
The single chip microcomputer needs to be reset when being started every time, and the reset operation can be power-on reset, and can also be software reset or hardware reset, for example, reset triggered by a watchdog or manual reset through a button.
After the single chip microcomputer is powered on or reset each time, a boot loader BootLoader is started, a hardware environment, memory mapping and the like are initialized and an embedded system is loaded, and then a watchdog is started. And after the system reset identification and the integrity of the application program are checked, if the upgrading program is not required to be entered. The single chip microcomputer jumps to the application program storage address to run the application program, and different application programs execute corresponding operations. Wherein, the back is opened to the watchdog, and application program operation can regularly send the instruction for the watchdog to refresh the watchdog, if the watchdog is not refreshed in a period of time, then the watchdog can think the procedure runs away, and the firmware is in abnormal state, and at this moment, the watchdog can trigger the system and reset, and the singlechip restarts the bootstrap loader to get into each inspection step according to normal flow, including the current system of inspection sign that resets, wherein, the system sign that resets can be used to the trigger reason or the trigger source that the sign resets at every turn, for example: the system reset flag may be triggered by a watchdog reset signal or, in an embedded system, by a control signal that performs a reset function.
When the reset is triggered by the watchdog function, it is determined that an application program exception, that is, a firmware exception, occurs, and the firmware needs to be automatically entered into an upgrade process to upgrade the firmware.
It is understood that in the present application, the watchdog may be implemented by software or hardware. The watchdog is used for regularly checking the internal state of the singlechip, and the watchdog can send a reset signal to the singlechip once the firmware is abnormal, so that when the singlechip detects that the system reset identifier is the watchdog reset identifier, the current firmware can be determined to be in the abnormal state.
In the embodiment of the application, the current version information of the firmware is acquired from the storage chip of the single chip microcomputer, the abnormal firmware repair request is generated according to the abnormal state of the firmware and the current version information of the firmware, the abnormal firmware repair request is sent to the target equipment, the target equipment selects a corresponding repair strategy from the strategy information according to the abnormal firmware repair request and sends the repair strategy to the single chip microcomputer, and the single chip microcomputer receives the corresponding repair strategy and carries out repair operation on the abnormal firmware, so that the abnormal firmware is repaired, the equipment stably runs, and the application program after reset is prevented from being in the abnormal state.
In addition, in this embodiment, when a firmware anomaly is found, the current device and firmware states are reported to the target device, so that the target device is convenient to allocate a solution policy, and can find a problem and solve the device anomaly in time, thereby realizing active repair of the firmware anomaly.
Optionally, the target device may be an upper computer, for example: the upper computer is communicated with the single chip microcomputer in a wired or wireless mode to receive the current version information of the firmware and the abnormal firmware repair request, and the single chip microcomputer and the upper computer can be in data communication in WiFi, bluetooth, serial port and other modes.
Optionally, the policy information includes at least one of a firmware upgrade operation, a firmware restore operation, and an ignore exception operation.
Optionally, the policy information is a combination of one or more policies, and when the received policy information includes multiple policies, the priority of each policy may be obtained, and after a target policy is determined according to the priority of each policy, an exception recovery operation is performed according to the target policy.
In the embodiment of the application, after the boot loader is operated, the firmware abnormal state is detected, when the firmware is determined to be in the abnormal state, corresponding strategy information is determined from the target device based on the firmware version information and the firmware abnormal repair request, and then the firmware in the abnormal state is repaired by utilizing the strategy information, so that the situation that the system is abnormal again or the program runs away after the system is abnormal is avoided, and the stability of the device is further improved.
Optionally, the firmware provided in this embodiment may be an application program that is stored in the single chip microcomputer and is solidified. For a single chip or an embedded system, the firmware stored in the single chip or the embedded system generally has two types, i.e. system firmware and application firmware, for example: the system firmware is a solidified boot loader (bootloader) and is stored in the initial position of the flash memory of the single chip microcomputer, and the system firmware is automatically loaded and operated after being reset by the single chip microcomputer; the application firmware is one or more solidified application programs, after the boot loader is operated, the application firmware is jumped to, and the corresponding application programs in the application firmware execute different operations. The system firmware and the application firmware are usually stored as two pieces of firmware, and the storage spaces of the system firmware and the application firmware are not crossed, but may be integrated into one piece of firmware. In the present application, firmware exception recovery refers to performing exception recovery on an application program solidified in firmware, where the firmware may include only a solidified application program, or may include both a solidified boot loader and an application program.
Specifically, when the firmware of the single chip microcomputer is abnormal, the watchdog reset is triggered, and after the single chip microcomputer is reset, the boot loader is loaded, wherein the single chip microcomputer can check the system reset identifier, when the single chip microcomputer finds that the system reset identifier is set as the watchdog reset identifier, it can be determined that the firmware of the current version is abnormal, and at the moment, the single chip microcomputer enters the upgrading process.
After entering the upgrading process, the single chip sends a firmware abnormal repair request including information such as an abnormal state (for example, abnormal reset of a watchdog), current version information of the firmware and the like to the target device at regular time. When the target equipment receives the firmware abnormity repair request, the abnormity can be selected to be ignored, the original firmware is kept not to be operated, or the firmware can be selected to be upgraded, and the original firmware is replaced by an upgraded firmware; or else, the singlechip calculates the time-out without responding, and if the counted time length exceeds the preset time-out threshold value, the singlechip forces to exit the upgrading process and continuously jumps to the corresponding process before entering the upgrading process to be continuously executed.
The firmware exception recovery method provided in an alternative embodiment of the present application includes the foregoing steps S1 to S4, and is different from the foregoing step in that, in step S4, when a policy in the policy information is to ignore an exception operation, an exception state of the firmware is ignored.
In this embodiment, in order to save data processing resources and prevent the occurrence of the situation where the waiting time is too long, when the policy is to ignore the abnormal operation, the single chip microcomputer exits the firmware abnormal recovery mode and performs other actions. Such as: the single chip microcomputer executes firmware upgrading operation and enters an upgrading mode, and when the target strategy provides a strategy for ignoring the exception, the single chip microcomputer exits the upgrading mode and reenters a corresponding process, for example, whether an application program in the current firmware is complete or not is checked, or the application program in the firmware is executed.
Fig. 2 is a schematic flowchart of steps S41 to S42 in a firmware exception recovery method according to an alternative embodiment of the present application. As shown in fig. 2, the firmware exception recovery method provided in the present application includes the foregoing steps S1 to S4, and the difference therebetween is that the step S4 includes:
s41, when the strategy in the strategy information is the firmware restoration operation, the backup firmware is obtained.
And S42, updating the current firmware into backup firmware.
In this embodiment, when the policy information acquired by the single chip microcomputer is a firmware recovery operation, the single chip microcomputer acquires a preset backup firmware from a flash memory or a memory chip connected to the single chip microcomputer, and the current abnormal firmware is covered by the backup firmware, so that the stability of the device or the system is realized.
Fig. 3 is a schematic flowchart of steps S43 to S44 in a firmware exception recovery method according to an alternative embodiment of the present application. As shown in fig. 3, the firmware exception recovery method provided in the present application includes the above steps S43 to S44, and the difference therebetween is that step S4 includes:
s43, when the strategy in the strategy information is firmware upgrading operation, the upgraded firmware is obtained, and the version information of the upgraded firmware is higher than the current version information of the firmware.
S44 updates the current firmware to the upgraded firmware.
In this embodiment, the obtaining of the upgrade firmware may be that the single chip microcomputer sends a firmware upgrade request to the target device, the target device searches for a firmware with a version higher than the current abnormal firmware version from a pre-stored firmware set, then sends the upgrade firmware with a high version to the single chip microcomputer, and the single chip microcomputer receives the upgrade firmware with a high version and performs a corresponding firmware update operation.
Optionally, in the target device, a plurality of versions of upgrade firmware are stored and set, and when the firmware of the single chip microcomputer needs to be upgraded, the upgrade firmware compatible with the operation of the single chip microcomputer can be selected from the target device to be updated. Preferably, the target device preferentially issues the upgrade firmware of the latest version. In an embodiment, the upgrade firmware may also be issued by the target device when issuing the policy information, and when the policy is a firmware upgrade operation, the policy information synchronously carries an upgrade data packet, where the upgrade data packet includes the upgrade firmware, version information corresponding to the upgrade firmware, size of the upgrade firmware, and so on.
In this embodiment, as shown in fig. 4, fig. 4 is a schematic flow diagram of steps S431 to S432 in a firmware exception recovery method according to an alternative embodiment of the present application. The step of obtaining the upgraded firmware may include:
s431, sending an upgrading request to the target equipment according to a preset frequency, wherein the upgrading request is used for requesting to acquire an upgrading package of the firmware;
s432, when the upgrade package returned from the target device is acquired within the preset waiting time, the upgrade firmware in the upgrade package is downloaded.
In this embodiment, the obtaining of the upgrade firmware may be performed after the target device issues the policy information, and when it is determined that the policy in the policy information is a firmware upgrade operation, the single chip sends an upgrade request to the target device according to a preset frequency, for example, the upgrade request is sent once every 1ms, and the upgrade request carries current state information of the single chip, such as watchdog abnormal reset and firmware version information, and firmware upgrade package request information. And after receiving the upgrading request, the target equipment selects upgrading firmware adapted to the single chip microcomputer from the firmware of higher version according to the version information in the upgrading request, and sends an upgrading packet to the single chip microcomputer, wherein the upgrading packet can directly carry the upgrading firmware or only carry a downloading address of the upgrading firmware. If the single chip microcomputer does not receive the upgrade package issued by the target device within the preset waiting time, the single chip microcomputer executes an exception ignoring operation, ignores the exception state of the current firmware, and exits the upgrade process. If the single chip receives an upgrade package issued by the target device within the preset waiting time, the upgrade package is analyzed to download upgrade firmware.
Fig. 5 is a flowchart illustrating a firmware exception recovery method according to an alternative embodiment of the present application. In this embodiment, after performing steps S1 to S4, that is, after performing the exception repair operation on the firmware according to the policy information, the method may further include:
and S5, carrying out integrity check on the current firmware.
And S6, running the current firmware when the integrity check passes.
And when the target equipment executes the abnormal repair according to the strategy in the strategy information issued by the target equipment, exiting the upgrading mode, actively jumping to a firmware storage area, performing integrity check on the current firmware stored in the firmware storage, and if the integrity check is passed, directly executing the current firmware in the firmware storage area. If the current firmware stored in the firmware storage area does not pass the integrity check, the integrity check is further carried out on the backup firmware in the backup area, if the backup check passes the integrity check, the backup firmware is copied from the backup area to the firmware storage area to update the current firmware, and the updated current firmware in the accessory storage area is executed.
Optionally, after step S3 is executed, the firmware exception recovery method further includes: and if the strategy information sent back by the target equipment is not acquired within the preset time, ignoring the abnormal state and running the current firmware.
In this embodiment, if the policy information sent back by the target device is not obtained within the preset time, it may be considered that the current firmware in the single chip microcomputer is not abnormal, and firmware repair is not needed, or the target device does not currently have an upgrade firmware available for upgrade, at this time, the firmware in the current single chip microcomputer may still be used, the single chip microcomputer exits the upgrade flow, and continues to execute a subsequent normal flow, for example, after integrity verification is performed on the current firmware, the current firmware is run.
Optionally, the firmware exception recovery method further includes:
and after the single chip microcomputer runs the boot loader, starting a watchdog to start timing.
And when a reset signal triggered by the watchdog is detected, marking the system reset identifier as a watchdog reset identifier.
The working principle of the watchdog is as follows: and when the timing of the watchdog exceeds a preset threshold value, triggering a reset signal, and performing zero clearing and re-timing when receiving a zero clearing instruction sent by the firmware.
In this embodiment, the watchdog may be hardware or software, and may be a watchdog built in the single chip or a reset chip.
When the watchdog is the reset chip, the single chip microcomputer is connected with the reset chip, a user can set a period in advance, when the timing of the set reset chip exceeds a preset threshold value, the reset signal is triggered, the reset signal is transmitted to a corresponding pin of the single chip microcomputer, and at the moment, the system reset identification mark is marked as the watchdog reset identification.
When the watchdog is a built-in circuit or built-in software of the single chip microcomputer, a timer in the single chip microcomputer is used for timing, when the timing exceeds a preset threshold value and a zero clearing instruction sent by firmware is still not received, a reset signal is triggered, and a system reset identification mark is marked as a watchdog reset identification.
Based on the same inventive concept, the embodiment of the application also provides a firmware abnormity repairing device. Fig. 6 is a schematic structural diagram of a firmware exception recovery apparatus according to an embodiment of the present application. As shown in fig. 6, the firmware exception recovery apparatus provided in the embodiment of the present application may include:
the reset identifier obtaining module 1 is configured to obtain a system reset identifier after the boot loader is run.
And the exception response module 2 is used for judging that the firmware is in an exception state when the system reset identifier is detected to be the watchdog reset identifier.
And the request sending module 3 is used for acquiring the current version information of the firmware, generating a firmware abnormal repair request according to the version information and the abnormal state, and outputting the firmware abnormal repair request to the target device.
And the policy obtaining module 4 is configured to, when receiving policy information returned by the target device based on the firmware exception repair request, perform an exception repair operation on the firmware according to the policy information.
Further, the policy obtaining module 4 includes a policy executing unit, and the policy executing unit is configured to ignore an abnormal state of the firmware when the policy in the policy information is to ignore an abnormal operation.
In an embodiment, the policy execution unit is configured to, when a policy in the policy information is a firmware recovery operation, acquire a backup firmware and update a current firmware to the backup firmware.
In an embodiment, the policy execution unit is configured to, when a policy in the policy information is a firmware upgrade operation, acquire upgraded firmware, where version information of the upgraded firmware is higher than current version information of the firmware, and update the current firmware to the upgraded firmware.
In an embodiment, the policy execution unit is configured to, when the received policy information includes a plurality of policies, obtain priorities of the policies, determine a target policy according to the priorities of the policies, and then execute an exception repair operation according to the target policy; wherein the policy includes at least one of a firmware upgrade operation, a firmware restore operation, and an ignore exception operation.
In an embodiment, the policy obtaining module 4 is further configured to ignore the abnormal state and run the current firmware when the policy information sent back by the target device is not obtained within a preset time.
Optionally, in this embodiment, in addition to the modules provided in the foregoing embodiment, the apparatus provided in this application may further include:
and the marking module is used for starting the watchdog to start timing after the boot loader is operated, and marking the system reset identifier as the watchdog reset identifier when a reset signal triggered by the watchdog is detected. The watchdog triggers a reset signal when the timing exceeds a preset threshold value, and performs zero clearing and timing anew when receiving a zero clearing instruction sent by the firmware.
For the specific process of implementing the firmware abnormality repairing method in each mode of the firmware abnormality repairing device, please refer to the detailed description of the firmware abnormality repairing method in the foregoing, which is not described herein again. Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. For a clear description of the electronic device provided in the embodiments of the present application, please refer to fig. 7.
The electronic equipment that this application embodiment provided includes: a processor 5 and a memory 6, wherein the processor is configured to execute a computer program stored in the memory to implement the firmware exception repair method described in the above embodiment.
In an embodiment, the electronic device provided in the present embodiment may include a plurality of memories 6 (simply referred to as storage units).
The storage unit may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a magnetic random access Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), synchronous Static Random Access Memory (SSRAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), enhanced Synchronous Dynamic Random Access Memory (ESDRAM), enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), synchronous Dynamic Random Access Memory (SLDRAM), direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory units described in the embodiments of the present application are intended to comprise, without being limited to, these and any other suitable types of memory.
An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of S1 to S4 described in the above embodiment.
In one implementation, the computer-readable storage medium provided by the present embodiments is a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
All possible combinations of the technical features of the above embodiments may not be described for the sake of brevity, but should be considered as within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
It should be noted that, in this document, 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, the recitation of a claim "comprising a" 8230a "\8230means" does not exclude the presence of additional identical elements in the process, method, article or apparatus in which the element is incorporated, and further, similarly named components, features, elements in different embodiments of the application may have the same meaning or may have different meanings, the specific meaning of which should be determined by its interpretation in the specific embodiment or by further combination with the context of the specific embodiment. As used herein, the meaning of "a plurality" or "a plurality" is two or more, unless otherwise specified.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application 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 may be performed in other orders unless otherwise indicated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or partially with other steps or at least some of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the steps of the above method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the above method embodiments. The foregoing storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A firmware exception recovery method is characterized by comprising the following steps:
after a boot loader is operated, a system reset identifier is obtained;
when the system reset identification is detected to be a watchdog reset identification, judging that the firmware is in an abnormal state;
acquiring the current version information of the firmware, generating a firmware abnormal repair request according to the version information and the abnormal state, and outputting the firmware abnormal repair request to target equipment;
and when strategy information returned by the target equipment based on the firmware exception repair request is received, executing exception repair operation on the firmware according to the strategy information.
2. The firmware exception recovery method of claim 1, wherein the performing an exception recovery operation according to the policy information comprises:
and when the strategy in the strategy information is to ignore abnormal operation, ignoring the abnormal state of the firmware.
3. The firmware exception recovery method of claim 1, wherein said performing an exception recovery operation based on said policy information comprises:
when the strategy in the strategy information is a firmware restoration operation, acquiring backup firmware;
updating the current firmware to the backup firmware.
4. The firmware exception recovery method of claim 1, wherein said performing an exception recovery operation based on said policy information comprises:
when the strategy in the strategy information is firmware upgrading operation, acquiring upgraded firmware, wherein the version information of the upgraded firmware is higher than the current version information of the firmware;
and updating the current firmware into the upgraded firmware.
5. The firmware exception recovery method of claim 2, wherein performing an exception recovery operation based on the policy information comprises:
when the received strategy information comprises a plurality of strategies, acquiring the priority of each strategy, determining a target strategy according to the priority of each strategy, and executing the abnormal repairing operation according to the target strategy; wherein the policy includes at least one of a firmware upgrade operation, a firmware restore operation, and an ignore exception operation.
6. The firmware exception recovery method according to claim 1, wherein after the firmware exception recovery request is generated according to the version information and the exception status and then output to a target device, the firmware exception recovery method further comprises:
and if the strategy information sent back by the target equipment is not acquired within the preset time, ignoring the abnormal state and running the current firmware.
7. The firmware exception recovery method of any one of claims 1-6, further comprising:
after the boot loader is operated, starting a watchdog to start timing; the watchdog triggers a reset signal when the timing exceeds a preset threshold value, and performs zero clearing and timing anew when receiving a zero clearing instruction sent by the firmware;
and when a reset signal triggered by the watchdog is detected, marking the system reset identifier as the watchdog reset identifier.
8. A firmware exception recovery apparatus, comprising:
the system comprises a reset identifier acquisition module, a system reset identifier acquisition module and a system reset identifier acquisition module, wherein the reset identifier acquisition module is used for acquiring the system reset identifier after a boot loader is operated;
the abnormal response module is used for judging that the firmware is in an abnormal state when the system reset identifier is detected to be a watchdog reset identifier;
the request sending module is used for acquiring the current version information of the firmware, generating a firmware abnormal repair request according to the version information and the abnormal state and outputting the firmware abnormal repair request to target equipment;
and the strategy acquisition module is used for executing abnormal repair operation on the firmware according to the strategy information when the strategy information returned by the target equipment based on the firmware abnormal repair request is received.
9. An electronic device, comprising a processor and a memory:
the processor is configured to execute a computer program stored in the memory to implement the firmware exception recovery method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the firmware exception repair method according to any one of claims 1 to 7.
CN202210814591.0A 2022-07-12 2022-07-12 Firmware abnormity repairing method and device, electronic equipment and computer storage medium Pending CN115237647A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210814591.0A CN115237647A (en) 2022-07-12 2022-07-12 Firmware abnormity repairing method and device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210814591.0A CN115237647A (en) 2022-07-12 2022-07-12 Firmware abnormity repairing method and device, electronic equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN115237647A true CN115237647A (en) 2022-10-25

Family

ID=83673949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210814591.0A Pending CN115237647A (en) 2022-07-12 2022-07-12 Firmware abnormity repairing method and device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN115237647A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116594803A (en) * 2023-07-17 2023-08-15 深圳软牛科技有限公司 MacOS repairing method and device based on processing chip and related medium
CN116847019A (en) * 2023-07-12 2023-10-03 荣耀终端有限公司 Communication abnormality processing method, electronic device, and computer-readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116847019A (en) * 2023-07-12 2023-10-03 荣耀终端有限公司 Communication abnormality processing method, electronic device, and computer-readable storage medium
CN116594803A (en) * 2023-07-17 2023-08-15 深圳软牛科技有限公司 MacOS repairing method and device based on processing chip and related medium
CN116594803B (en) * 2023-07-17 2023-11-07 深圳软牛科技有限公司 MacOS repairing method and device based on processing chip and related medium

Similar Documents

Publication Publication Date Title
CN115237647A (en) Firmware abnormity repairing method and device, electronic equipment and computer storage medium
WO2016206514A1 (en) Startup processing method and device
JP2009169524A (en) Network system for home appliance
CN110874237A (en) Software upgrading method, device, terminal and readable storage medium
JP2012058879A (en) Operating system boot management device
CN101807152A (en) Basic output and input system for self verification of selection read only memory and verification method thereof
CN109634781A (en) One kind is based on embedded program two-region Backup Images system and starting method
US20140258699A1 (en) Boot fault tolerant device and method thereof
CN110580167A (en) system upgrading method, intelligent device and server
WO2015184732A1 (en) Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium
US20160321057A1 (en) Electronic apparatus
JPH11514124A (en) How to load an operating system
CN113138791A (en) Upgrade processing method and device based on embedded system and electronic equipment
CN110908722B (en) Method and device applied to starting of operating system, electronic equipment and storage medium
CN112214353A (en) Firmware recovery method and device, computer equipment and storage medium
CN111651304A (en) Software recovery method and device based on double-core intelligent electric meter and computer equipment
JP5084853B2 (en) Firmware update device, communication device, electronic device, firmware update system, firmware update method, and program
JP6073710B2 (en) Information processing apparatus, automatic recovery method from startup failure, and automatic recovery program from startup failure
CN114356658A (en) Processing method of firmware upgrading exception, computer equipment and readable storage medium
EP3945417A1 (en) Software update device, update control method, non-transitory storage medium, and server
CN114741119A (en) System starting method and device, computer equipment and storage medium
JP5992029B2 (en) Basic input / output system program code writing circuit and writing method
JP2014099097A (en) Information processing device, information processing method, and computer program
CN107015827B (en) Embedded system and method for automatically operating third-party extension program thereof
JP2014099097A5 (en)

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