Firmware recovery method, device, computer equipment and storage medium

By obtaining firmware version number rule information under abnormal state and restoring to the corresponding version, the problem of low recovery accuracy in traditional firmware upgrades is solved, and the efficiency and accuracy of firmware recovery is improved.

CN112214353BActive Publication Date: 2024-11-29FIBOCOM WIRELESS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011111452.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-16
Publication Date
2024-11-29
Estimated Expiration
2040-10-16

AI Technical Summary

Technical Problem

Traditional firmware upgrade methods can easily lead to low accuracy of firmware recovery in abnormal states, requiring cumbersome conversion processes, affecting efficiency and accuracy.

Method used

By detecting the abnormal state and starting the timing, when the timing reaches the preset time, the identification information in the firmware version number rule information is obtained, and directly restored to the corresponding firmware version based on the identification information, avoiding the cumbersome conversion process.

Benefits of technology

Improves the accuracy and efficiency of firmware recovery, saves processing time, and realizes direct recovery to the version used by the current user.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112214353B_ABST
    Figure CN112214353B_ABST
Patent Text Reader

Abstract

The present application relates to a firmware recovery method, device, computer equipment and storage medium. The method comprises: when an abnormal state is detected, starting a timer; when the timer reaches a preset time, obtaining identification information in the version number rule information corresponding to the firmware; according to the identification information, restoring the firmware to the firmware version corresponding to the identification information. The use of this method can directly restore the firmware to the version currently used by the user, avoiding the tedious conversion process, effectively saving processing time, not only improving the efficiency of firmware recovery, but also effectively improving the accuracy of firmware recovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a firmware recovery method, apparatus, computer device and storage medium. Background Art

[0002] With the development of computer technology and the advent of the 5G era, the emergence of the Internet has brought great convenience to modern life. More and more users can handle various services online by using terminal devices. When traditional terminal devices perform firmware upgrades, the module may be interfered by external factors during the upgrade process, resulting in upgrade failure. For example, the system unexpectedly loses power during the upgrade process, thus entering an abnormal state, so the firmware needs to be restored.

[0003] However, in the current firmware upgrade method, when the firmware is automatically restored, the firmware package will eventually be restored to the universal version, so a firmware conversion process is required to switch to the correct firmware version currently used by the user, which easily leads to low accuracy of firmware recovery. Summary of the invention

[0004] Based on this, it is necessary to provide a firmware recovery method, apparatus, computer device and storage medium that can improve the accuracy of firmware recovery in response to the above technical problems.

[0005] A firmware recovery method, the method comprising:

[0006] When an abnormal state is detected, the timing is started;

[0007] When the timing reaches a preset time, obtaining identification information in the version number rule information corresponding to the firmware;

[0008] According to the identification information, the firmware is restored to a firmware version corresponding to the identification information.

[0009] In one embodiment, before the abnormal state is detected, the method further includes:

[0010] Get the identification information corresponding to the currently running firmware;

[0011] storing the identification information in a non-volatile manner;

[0012] The obtaining of identification information in the version number rule information corresponding to the firmware includes:

[0013] The identification information in the version number rule information corresponding to the firmware is obtained from the non-volatile storage.

[0014] In one embodiment, the method further comprises:

[0015] When the firmware package is switched due to the change of the SIM card, the identification information corresponding to the switched firmware package is obtained;

[0016] The identification information is synchronously updated to the non-volatile storage, and the non-volatile storage is used to record the changed identification information.

[0017] In one embodiment, before the abnormal state is detected, the method further includes:

[0018] Get the identification information corresponding to the currently running firmware;

[0019] Storing the identification information in a built-in data folder;

[0020] The obtaining of identification information in the version number rule information corresponding to the firmware includes:

[0021] The identification information in the version number rule information corresponding to the firmware is obtained from the built-in data folder.

[0022] In one embodiment, the method further comprises:

[0023] When the firmware package is switched due to the change of the SIM card, the identification information corresponding to the switched firmware package is obtained;

[0024] The identification information is synchronously updated to the built-in data folder, and the built-in data folder is used to record the changed identification information.

[0025] In one embodiment, detecting an abnormal state includes:

[0026] After booting up, if only the OACC port is detected, it indicates that the system has entered an abnormal state.

[0027] A firmware recovery device, the device comprising:

[0028] A detection module, used to start timing when an abnormal state is detected;

[0029] An acquisition module, used for acquiring identification information in the version number rule information corresponding to the firmware when the timing reaches a preset time length;

[0030] A recovery module is used to restore the firmware to a firmware version corresponding to the identification information according to the identification information.

[0031] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0032] When an abnormal state is detected, the timing is started;

[0033] When the timing reaches a preset time, obtaining identification information in the version number rule information corresponding to the firmware;

[0034] According to the identification information, the firmware is restored to a firmware version corresponding to the identification information.

[0035] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0036] When an abnormal state is detected, the timing is started;

[0037] When the timing reaches a preset time, obtaining identification information in the version number rule information corresponding to the firmware;

[0038] According to the identification information, the firmware is restored to a firmware version corresponding to the identification information.

[0039] The above-mentioned firmware recovery method, device, computer equipment and storage medium start timing when an abnormal state is detected. When the timing reaches a preset time, the identification information in the version number rule information corresponding to the firmware is obtained, and the firmware is restored to the firmware version corresponding to the identification information according to the identification information. As a result, it is possible to directly restore the firmware to the version currently used by the user, avoiding a tedious conversion process, effectively saving processing time, and not only improving the efficiency of firmware recovery, but also effectively improving the accuracy of firmware recovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A flowchart of a firmware recovery method in one embodiment;

[0041] Figure 2 A flowchart of steps when changing a SIM card results in a firmware package switch in one embodiment;

[0042] Figure 3 A flowchart of steps when changing a SIM card causes a firmware package switch in another embodiment;

[0043] Figure 4 is a flowchart of a firmware recovery method in another embodiment;

[0044] Figure 5 is a structural block diagram of a firmware recovery device in an embodiment;

[0045] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] In one embodiment, Figure 1 As shown, a firmware recovery method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0048] Step 102, when an abnormal state is detected, start timing.

[0049] Terminals are a type of embedded computer system devices, and their software structure can be divided into system software and application software. In the software structure of terminals, system software mainly consists of operating systems and middleware. Common terminal operating systems include IOS, Android, WebOS, open source MeeGo, and Windows. User terminals using different operating systems can obtain new versions of firmware packages from the server for firmware upgrades. For example, users can use smartphones to download the latest version of firmware packages from the server for upgrades. Among them, firmware refers to programs written into EROM (Erasable Read-Only Memory) or EEPROM (Electrically Erasable Programmable Read-Only Memory). Firmware serves as the most basic and lowest-level software for a system. In hardware devices, some hardware devices have no other software components except firmware, so firmware determines the functions and performance of the hardware devices. Firmware is generally stored in the electrically erasable read-only memory EEPROM (Electrically Erasable Programmable ROM) or FLASH chip in the device, and is generally a program that can be upgraded by users through a specific refresh program. Generally speaking, the software that performs the most basic and lowest-level work of a digital product can be called firmware, such as the basic input / output system BIOS (Basic Input / output System) on the computer motherboard. Usually, the programs stored in these hardware cannot be directly read or modified by users. With the continuous development of technology, modifying the firmware to adapt to the constantly updated hardware environment has become an urgent requirement of users. Therefore, the emergence of rewritable programmable and erasable read-only memory EPROM (Erasable Programmable ROM) and flash chips, which can be repeatedly rewritten, enables the firmware to be modified and upgraded. The terminal in this application may include multiple types, such as mobile terminals and PC terminals (personal computers). In the application software of the terminal, developers can create applications with different business functions around business domain components. These applications can be developed, managed and updated independently, which can make deployment, management and service function delivery simpler. Among them, embedded terminal products are common acquisition and data transmission devices, and product functions are realized by executing firmware stored in storage chips. The firmware can be burned into the chip and then fixed in the product. The more common way is to fix the chip on the circuit board.

[0050] Since the firmware in the terminal product needs to be upgraded during use to improve the product. The firmware can be upgraded by burning the firmware on the chip. For example, IAP (In Application Programming) is an application field programming technology. This technology does not require special equipment and chip disassembly, saves labor and is widely used in firmware upgrades. IAP is the acronym for In Application Programming. IAP is the user's own program that burns part of the User Flash chip during operation. The purpose is to easily update and upgrade the firmware program in the product through the reserved communication port after the product is released. However, if the terminal is powered off or the upgrade file is wrong during the application field upgrade of remote IAP technology, the terminal will not work properly. For example, when upgrading the firmware, the new version of the firmware has not been completely written into the chip, and a power outage occurs. At this time, the product will not work properly, and the terminal will not work properly. Specifically, during the firmware upgrade process, when the terminal detects an abnormal state, the start timer starts counting. Among them, the abnormal state refers to the state in which the firmware may be interfered by external factors during the upgrade process, causing the firmware upgrade to fail, thereby causing the terminal to fail to work properly, that is, the abnormal state. For example, the system unexpectedly loses power during the upgrade process, causing the terminal to fail to work normally.

[0051] Step 104: When the timing reaches a preset time, the identification information in the version number rule information corresponding to the firmware is obtained.

[0052] When the terminal detects an abnormal state, the timing is started. When the terminal detects that the timing reaches the preset duration, the terminal can obtain the identification information in the version number rule information corresponding to the firmware. Among them, the preset duration refers to the waiting time pre-configured in the system. For example, the preset duration can be set to 2 minutes. The version number rule information refers to the pre-set version rules corresponding to different firmware. For example, the firmware version number rule information can be customized to ABCDD.ZZZZ.HH.KK.NN.SS, where HH represents operator ID, that is, operator identification or firmware identification; KK represents the main version number. For example, when the operatorID value is 01, the firmware package corresponds to AT&T (AT&T is the US operator); when the operator ID value is 09, the firmware package corresponds to DT (DT is the Japanese operator); when the operator ID value is 00, the firmware package corresponds to the universal version. Specifically, when the terminal detects that the timing reaches a preset time, the terminal can obtain the identification information in the version number rule information corresponding to the firmware from the default folder, or the terminal can also obtain the identification information in the version number rule information corresponding to the firmware from the NV value, where NV is the abbreviation of NVRAM, and the English name is Nonvolatile Random Access Memory, which is non-volatile random access memory. Once the data is written to the NV value, it will not be lost even if the power is off, and the original settings will still be retained when it is restarted next time. Usually NV is a dedicated file system for mobile phones to save basic configurations and radio frequency parameters. When the phone is turned off, the data saved in NV will not be lost. Therefore, NV can be used to save important parameters of mobile phone terminals.

[0053] Step 106: based on the identification information, restore the firmware to a firmware version corresponding to the identification information.

[0054] After the terminal obtains the identification information in the version number rule information corresponding to the firmware, the terminal can restore the firmware to the firmware version corresponding to the identification information according to the identification information. Wherein, the identification information refers to the operator identification or the firmware identification. For example, when the identification information corresponding to a certain firmware is 00, the identification firmware package corresponds to the general version. Specifically, when the terminal detection timing reaches the preset duration, the terminal can obtain the identification information in the version number rule information corresponding to the firmware from the NV value or the preset default folder. For example, when the terminal obtains the identification information in the version number rule information corresponding to the firmware from the NV value as 01, that is, the operator ID value is 01, then the terminal restores the firmware to the firmware version corresponding to the identification information according to the identification information 01, that is, the firmware version corresponding to the firmware package is the AT&T package (AT&T is the US operator). When the terminal obtains the identification information in the version number rule information corresponding to the firmware from the preset default folder as 09, that is, the operator ID value is 09, then the terminal restores the firmware to the firmware version corresponding to the identification information according to the identification information 09, that is, the firmware version corresponding to the firmware package is the DT package (DT is the Japanese operator). The firmware package refers to the firmware for a certain operator. Different operators can produce different firmware, and each firmware carries corresponding firmware identification information.

[0055] In the traditional firmware recovery method, when the firmware is automatically restored, no matter which version of the firmware was previously running, it will eventually be restored to the universal version. Therefore, it is necessary to perform the firmware conversion process for different user terminals in order to switch to the correct firmware version currently used by the user, resulting in poor accuracy of firmware recovery and failure to provide users with targeted, fast and convenient firmware recovery. In this embodiment, when the terminal detects an abnormal state, the terminal starts the timer to start timing. When the terminal detects that the timing reaches a preset time, the terminal can obtain the identification information in the version number rule information corresponding to the firmware, and the terminal restores the firmware to the firmware version corresponding to the identification information based on the obtained identification information. As a result, it is possible to directly restore the firmware to the version currently used by the user, avoiding the cumbersome conversion process, effectively saving processing time, and not only improving the efficiency of firmware recovery, but also effectively improving the accuracy of firmware recovery.

[0056] In one embodiment, before the abnormal state is detected, the method further includes the step of obtaining identification information corresponding to the currently running firmware, specifically including:

[0057] Get the identification information corresponding to the currently running firmware.

[0058] The identification information is stored in a non-volatile manner.

[0059] Before the terminal detects an abnormal state, that is, the terminal is in a normal working state, or before the terminal upgrades the firmware, the terminal can obtain the identification information corresponding to the currently running firmware, that is, the terminal obtains the firmware identification information corresponding to normal operation, and stores the identification information corresponding to the currently running firmware in a non-volatile manner. For example, after the terminal obtains the identification information corresponding to the currently running firmware, the terminal can write the obtained identification information into the NV value, and the terminal can directly read the identification information corresponding to the firmware in the NV value when the firmware is restored. Once the data is written into the NV value, it will not be lost even if the power is off, and the original settings will still be retained when it is restarted next time. Usually NV is a dedicated file system for mobile phones to save basic configurations and radio frequency parameters. When the mobile phone is turned off, the data stored in NV will not be lost. Therefore, NV can be used to save important parameters of the mobile phone terminal. As a result, even if there is an unexpected power outage or other unpredictable situation during the upgrade process, the terminal can obtain the firmware identification information matching the user terminal from the non-volatile memory after booting up and when the firmware needs to be restored, and automatically restore the firmware, which effectively improves the accuracy of firmware recovery.

[0060] In one embodiment, Figure 2 As shown, the method also includes steps when changing the SIM card causes the firmware package to switch, specifically including:

[0061] Step 202: When the firmware package is switched due to the change of the SIM card, the identification information corresponding to the switched firmware package is obtained.

[0062] Step 204: Synchronously update the identification information to the non-volatile storage, where the non-volatile storage is used to record the changed identification information.

[0063] When the user changes the SIM card, that is, when the terminal detects the firmware package switching caused by the SIM card change operation, the terminal can obtain the identification information corresponding to the switched firmware package. Further, the terminal will synchronously update the obtained identification information to the non-volatile storage, and the non-volatile storage is used to record the changed identification information. For example, the terminal detects that the identification information corresponding to the currently running firmware is 01. When the user changes the SIM card, that is, when the terminal detects the firmware package switching caused by the SIM card change operation, the terminal can obtain the identification information corresponding to the switched firmware package as 09. Further, the terminal will synchronously update the obtained identification information 09 to the non-volatile storage, and the non-volatile storage is used to record the changed identification information, that is, the terminal can synchronously update the identification information 01 corresponding to the original firmware in the NV value to the identification information 09 corresponding to the switched firmware package. In addition, a custom firmware version number rule can be pre-set, for example, the firmware version number rule information can be custom set to ABCDD.ZZZZ.HH.KK.NN.SS, where HH represents operator ID, that is, operator ID or firmware ID; KK represents the main version number. That is, the third byte in the version number rule information can be set to represent the operator ID, and the initial value is 00, that is, the operator ID of 00 indicates that the firmware package corresponds to the universal version. When the user changes the SIM card operation and causes the firmware package to switch, the terminal can synchronously update the non-volatile storage according to the dynamically changing firmware package identification information, and the non-volatile storage is used to record the changed identification information. As a result, it is possible to directly restore the firmware to the version currently used by the user terminal, avoiding the tedious conversion process, effectively saving processing time, and not only improving the efficiency of firmware recovery, but also effectively improving the accuracy of firmware recovery.

[0064] In one embodiment, before the abnormal state is detected, the method further includes the step of obtaining identification information corresponding to the currently running firmware, specifically including:

[0065] Get the identification information corresponding to the currently running firmware.

[0066] Stores identification information in the built-in data folder.

[0067] Before the terminal detects an abnormal state, that is, the terminal is in a normal working state, or before the terminal upgrades the firmware, the terminal can obtain the identification information corresponding to the currently running firmware, that is, the terminal obtains the firmware identification information corresponding to normal operation, and stores the identification information corresponding to the currently running firmware in the built-in data folder. For example, after the terminal obtains the identification information corresponding to the currently running firmware, the terminal can store the obtained identification information in the built-in data folder, and the terminal can directly read the identification information corresponding to the firmware in the built-in data folder when the firmware is restored. As a result, when the OACC state appears due to an unexpected power outage during the upgrade process, when the terminal automatically executes the firmware recovery process after a preset time, by first reading the data in the built-in data folder, after obtaining the operator ID value corresponding to the current terminal device, the firmware can be directly restored to the firmware version that matches the current user terminal, avoiding the cumbersome conversion process, effectively saving processing time, not only improving the efficiency of firmware recovery, but also effectively improving the accuracy of firmware recovery.

[0068] In one embodiment, Figure 3 As shown, the method also includes steps when changing the SIM card causes the firmware package to switch, specifically including:

[0069] Step 302: When the firmware package is switched due to the change of the SIM card, the identification information corresponding to the switched firmware package is obtained.

[0070] Step 304: Synchronously update the identification information to the built-in data folder, where the built-in data folder is used to record the changed identification information.

[0071] When the user changes the SIM card, that is, when the terminal detects the firmware package switching caused by the SIM card change operation, the terminal can obtain the identification information corresponding to the switched firmware package. The terminal will synchronously update the obtained identification information to the built-in data folder, and the built-in data folder is used to record the changed identification information. For example, the terminal detects that the identification information corresponding to the currently running firmware is 01. When the user changes the SIM card, that is, when the terminal detects the firmware package switching, the terminal can obtain the identification information corresponding to the switched firmware package, that is, the terminal obtains the identification information corresponding to the switched firmware package as 09. Further, the terminal will synchronously update the obtained identification information 09 to the built-in data folder, and the built-in data folder is used to record the changed identification information, that is, the terminal can synchronously update the identification information 01 corresponding to the original firmware in the built-in data folder to the identification information 09 corresponding to the switched firmware package. As a result, when an abnormal state occurs due to an unexpected power outage during the upgrade process, the terminal automatically executes the firmware recovery process after a preset period of time. By first reading the data in the built-in data folder and obtaining the operator ID value of 09 corresponding to the updated terminal device, the firmware can be directly restored to the firmware version that matches the current user terminal, that is, the terminal restores the firmware to the DT (DT represents the Japanese operator) firmware version corresponding to the identification information 09, thereby avoiding the tedious conversion process and effectively saving processing time. It not only improves the efficiency of firmware recovery, but also effectively improves the accuracy of firmware recovery.

[0072] In one embodiment, after booting up, when only the OACC port is detected, it indicates that the system has entered an abnormal state.

[0073] During the firmware upgrade process, external factors may interfere with the firmware upgrade, causing the firmware upgrade to fail, resulting in a state where the terminal cannot work normally, such as an unexpected power outage during the upgrade process, which causes the terminal to not work normally. When the terminal is accidentally powered off during the upgrade process, after restarting, when the terminal detects that there is only an OACC port, it indicates that the system has entered an abnormal state. For example, when the terminal encounters a power outage or forced shutdown during the upgrade process, after restarting, the user can open the device manager interface through a trigger operation. From the device manager interface, it can be seen that the only port related to the system is the OACC port, that is, the terminal has entered the OACC state, indicating that the system has entered an abnormal state and requires firmware recovery. During the firmware upgrade process, a variety of external factors may cause the firmware upgrade to fail, causing the terminal to enter an abnormal state. Therefore, when the user cannot determine whether the current terminal device is in an abnormal state and requires firmware recovery, the user can check the ports running in the background in the device manager, that is, check whether there is only an OACC port. If the user determines that the current terminal device has completed the firmware upgrade and does not need to recover the firmware, the user can cancel the firmware upgrade through a trigger operation when the system timer has not reached the preset duration. Figure 4 The figure shows a flowchart of the firmware recovery corresponding to a mobile terminal device. When the terminal detects that there is only an OACC port, that is, when the terminal enters the OACC state, the terminal starts the timer to start timing. When the timing reaches the preset duration, the terminal triggers the activation of the firmware recovery process. The terminal reads data from the preset built-in data folder and obtains the identification information corresponding to the firmware, that is, the operator ID value. The terminal restores the firmware to the firmware version corresponding to the operator ID value based on the obtained identification information, that is, the operator ID value. As a result, the user can quickly and conveniently determine whether the terminal device needs to perform firmware recovery based on the port parameters in the device manager, avoiding some cumbersome processes, effectively improving the efficiency of firmware recovery, and also bringing convenience to the user.

[0074] In one embodiment, when the terminal system is unexpectedly powered off during the upgrade process, after restarting, when the terminal detects that there is only an OACC port, it indicates that the system has entered an abnormal state. For example, when the terminal encounters a power outage or forced shutdown during the upgrade process, after restarting, the user can open the device manager interface through a trigger operation, and it can be seen from the device manager interface that only the OACC port is left of the system-related port, that is, the terminal has entered the OACC state, indicating that the system has entered an abnormal state and needs to perform firmware recovery. During the firmware upgrade process, a variety of external factors may cause the firmware upgrade to fail, causing the terminal to enter an abnormal state. Therefore, when the user cannot determine whether the current terminal device is in an abnormal state and needs to perform firmware recovery, the user can check the ports running in the background in the device manager, that is, check whether there is only an OACC port. If the user determines that the current terminal device has completed the firmware upgrade and does not need to perform firmware recovery, the user can cancel the firmware upgrade through a trigger operation when the system timer does not reach the preset time. When the terminal detects that only the OACC port currently exists, that is, when the terminal detects an abnormal state, the terminal starts the timer to start timing. When the timing reaches the preset duration, the terminal triggers the activation of the firmware recovery process. The terminal reads data from the preset built-in data folder or NV value to obtain the identification information corresponding to the firmware, that is, the operator ID value. The terminal restores the firmware to the firmware version corresponding to the operator ID value based on the obtained identification information, that is, the operator ID value. As a result, it is possible to directly restore the firmware to the version currently used by the user, avoiding the cumbersome conversion process, effectively saving processing time, and not only improving the efficiency of firmware recovery, but also effectively improving the accuracy of firmware recovery.

[0075] It should be understood that although Figure 1-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0076] In one embodiment, Figure 5 As shown, a firmware recovery device is provided, including: a detection module 502, an acquisition module 504 and a recovery module 506, wherein:

[0077] The detection module 502 is used to start timing when an abnormal state is detected.

[0078] The acquisition module 504 is used to acquire the identification information in the version number rule information corresponding to the firmware when the timing reaches a preset time.

[0079] The recovery module 506 is used to recover the firmware to a firmware version corresponding to the identification information according to the identification information.

[0080] In one embodiment, the device further includes: a storage module.

[0081] The storage module is used to obtain identification information corresponding to the currently running firmware and store the identification information in a non-volatile manner.

[0082] In one embodiment, the device further includes: an updating module.

[0083] The update module is used to obtain the identification information corresponding to the switched firmware package when the firmware package is switched due to the change of the SIM card, and to synchronously update the identification information to the non-volatile storage, which is used to record the changed identification information.

[0084] In one embodiment, the storage module is further used to obtain identification information corresponding to the currently running firmware, and store the identification information in a built-in data folder.

[0085] In one embodiment, the update module is also used to obtain identification information corresponding to the switched firmware package when changing the SIM card causes the firmware package to switch, and synchronously update the identification information to the built-in data folder, and the built-in data folder is used to record the changed identification information.

[0086] In one embodiment, the detection module is further configured to indicate that the system has entered an abnormal state when it is detected that only the OACC port is present after the system is powered on.

[0087] For the specific definition of the firmware recovery device, please refer to the definition of the firmware recovery method above, which will not be repeated here. Each module in the above-mentioned firmware recovery device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0088] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile 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 the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a firmware recovery method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0089] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0090] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.

[0091] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0092] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0093] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A firmware recovery method, the method include: When the system is unexpectedly powered off during the firmware upgrade process and is restarted and an abnormal state is detected, the timer is started; The abnormal state refers to a state where the terminal cannot work normally; When the timing reaches a preset time, the identification information in the version number rule information corresponding to the firmware is obtained from the NV value or the preset built-in data folder; wherein the identification information includes the operator identification and the main version number; the version number rule information refers to the pre-set version rules corresponding to different firmware; the data in the NV value still retains the original settings after the next restart; According to the operator identifier in the identification information, restoring the firmware to a firmware version corresponding to the operator identifier in the identification information; wherein the firmware version corresponding to the operator identifier in the identification information includes a general version and other versions; When detecting a firmware package switch caused by a SIM card change operation, obtaining identification information corresponding to the switched firmware package, and synchronously updating the identification information to the built-in data folder; In the case that the timing does not reach the preset time, the processing flow of canceling the firmware upgrade is responded to the triggering operation.

2. The method according to claim 1, It is characterized in that The method further comprises: Get the identification information corresponding to the currently running firmware; storing the identification information in a non-volatile manner; The obtaining of identification information in the version number rule information corresponding to the firmware includes: The identification information in the version number rule information corresponding to the firmware is obtained from the non-volatile storage.

3. The method according to claim 2, It is characterized in that The method further comprises: When the firmware package is switched due to the change of the SIM card, the identification information corresponding to the switched firmware package is obtained; The identification information is synchronously updated to the non-volatile storage, and the non-volatile storage is used to record the changed identification information.

4. The method according to claim 1, It is characterized in that The method further comprises: Get the identification information corresponding to the currently running firmware; Storing the identification information in a built-in data folder; The obtaining of identification information in the version number rule information corresponding to the firmware includes: The identification information in the version number rule information corresponding to the firmware is obtained from the built-in data folder.

5. The method according to claim 4, It is characterized in that The built-in data folder is used to record the changed identification information.

6. The method according to claim 1, It is characterized in that The abnormal state detected includes: After booting up, if only the OACC port is detected, it indicates that the system has entered an abnormal state.

7. A firmware recovery device, It is characterized in that The device comprises: A detection module, used for starting a timer when an abnormal state is detected after the system is restarted after an unexpected power outage during the firmware upgrade process; the abnormal state refers to a state in which the terminal cannot work normally; An acquisition module, used for acquiring identification information in the version number rule information corresponding to the firmware from the NV value or a preset built-in data folder when the timing reaches a preset time; wherein the identification information includes an operator identifier and a major version number; the version number rule information refers to the pre-set version rules corresponding to different firmware; the data in the NV value still retains the original settings after the next restart; a recovery module, configured to restore the firmware to a firmware version corresponding to the operator identifier in the identification information according to the operator identifier in the identification information; wherein the firmware version corresponding to the operator identifier in the identification information includes a general version and other versions; An update module, configured to, when detecting a firmware package switch caused by a SIM card change operation, obtain identification information corresponding to the switched firmware package, and synchronously update the identification information to the built-in data folder; In the case that the timing does not reach the preset time, the processing flow of canceling the firmware upgrade is responded to the triggering operation.

8. The firmware recovery device according to claim 7, It is characterized in that The device also includes: The storage module is used to obtain the identification information corresponding to the currently running firmware and store the identification information in a non-volatile manner; and obtain the identification information in the version number rule information corresponding to the firmware from the non-volatile storage.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • A firmware stable upgrading method and device, a computer device and a storage medium

    CN109814908A

  • Multi-firmware upgrading method and device

    CN110119280A