CN112214353B - Firmware recovery method, device, computer equipment and storage medium - Google Patents
- ️Fri Nov 29 2024
CN112214353B - Firmware recovery method, device, computer equipment and storage medium - Google Patents
Firmware recovery method, device, computer equipment and storage medium Download PDFInfo
-
Publication number
- CN112214353B CN112214353B CN202011111452.9A CN202011111452A CN112214353B CN 112214353 B CN112214353 B CN 112214353B CN 202011111452 A CN202011111452 A CN 202011111452A CN 112214353 B CN112214353 B CN 112214353B Authority
- CN
- China Prior art keywords
- firmware
- identification information
- version
- information corresponding
- terminal Prior art date
- 2020-10-16 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 75
- 238000011084 recovery Methods 0.000 title claims abstract description 35
- 230000002159 abnormal effect Effects 0.000 claims abstract description 40
- 230000008569 process Effects 0.000 claims abstract description 31
- 238000012545 processing Methods 0.000 claims abstract description 9
- 238000004590 computer program Methods 0.000 claims description 13
- 238000001514 detection method Methods 0.000 claims description 6
- 230000004044 response Effects 0.000 claims 2
- 238000006243 chemical reaction Methods 0.000 abstract description 8
- 238000004891 communication Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- RWSOTUBLDIXVET-UHFFFAOYSA-N Dihydrogen sulfide Chemical compound S RWSOTUBLDIXVET-UHFFFAOYSA-N 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/142—Reconfiguring to eliminate the error
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
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.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a firmware recovery method, apparatus, computer device, and storage medium.
Background
With the development of computer technology, the advent of the 5G era has brought great convenience to modern life, and more users can transact various services online by using terminal devices. When the conventional terminal equipment performs firmware upgrading, the module may be interfered by external factors in the upgrading process, so that the upgrading is failed, for example, the system is accidentally powered off in the upgrading process, so that the system enters an abnormal state, and therefore, the firmware needs to be recovered.
However, in the current firmware upgrading method, when the firmware is automatically recovered, the firmware package is finally recovered to the general version, so that a process of firmware conversion is also required to be performed once, and the current firmware version used by the user can be switched to, which easily results in lower accuracy of firmware recovery.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a firmware restoration method, apparatus, computer device, and storage medium that can improve firmware restoration accuracy.
A firmware recovery method, the method comprising:
when an abnormal state is detected, starting timing;
When the timing reaches a preset duration, acquiring identification information in version number rule information corresponding to the firmware;
and restoring the firmware to the firmware version corresponding to the identification information according to the identification information.
In one embodiment, before the abnormal state is detected, the method further includes:
acquiring identification information corresponding to the current running firmware;
non-volatile storage is carried out on the identification information;
The obtaining the identification information in the version number rule information corresponding to the firmware includes:
and acquiring the identification information in the version number rule information corresponding to the firmware from the nonvolatile storage.
In one embodiment, the method further comprises:
when the SIM card is changed to cause the switching of the firmware package, acquiring identification information corresponding to the switched firmware package;
And synchronously updating the identification information into the nonvolatile storage, wherein the nonvolatile storage is used for recording the changed identification information.
In one embodiment, before the abnormal state is detected, the method further includes:
acquiring identification information corresponding to the current running firmware;
storing the identification information into a built-in data folder;
The obtaining the identification information in the version number rule information corresponding to the firmware includes:
and acquiring the identification information in the version number rule information corresponding to the firmware from the built-in data folder.
In one embodiment, the method further comprises:
when the SIM card is changed to cause the switching of the firmware package, acquiring identification information corresponding to the switched firmware package;
And synchronously updating the identification information into the built-in data folder, wherein the built-in data folder is used for recording the changed identification information.
In one embodiment, detecting the abnormal state includes:
After the power-on, when only OACC ports are detected, the system is indicated to enter an abnormal state.
A firmware restoration device, the device comprising:
The detection module is used for starting timing when an abnormal state is detected;
The acquisition module is used for acquiring the identification information in the version number rule information corresponding to the firmware when the timing reaches the preset duration;
And the recovery module is used for recovering the firmware to the firmware version corresponding to the identification information according to the identification information.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
when an abnormal state is detected, starting timing;
When the timing reaches a preset duration, acquiring identification information in version number rule information corresponding to the firmware;
and restoring the firmware to the firmware version corresponding to the identification information according to the identification information.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
when an abnormal state is detected, starting timing;
When the timing reaches a preset duration, acquiring identification information in version number rule information corresponding to the firmware;
and restoring the firmware to the firmware version corresponding to the identification information according to the identification information.
The firmware recovery method, the firmware recovery device, the computer equipment and the storage medium start timing when an abnormal state is detected. When the timing reaches the preset duration, 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. Therefore, the firmware can be directly restored to the version used by the current user, the complicated conversion process is avoided, the processing time is effectively saved, the firmware restoration efficiency is improved, and the firmware restoration accuracy is effectively improved.
Drawings
FIG. 1 is a flow chart of a firmware restoration method according to an embodiment;
FIG. 2 is a flowchart illustrating steps performed when a SIM card is changed to cause a firmware package to switch according to one embodiment;
FIG. 3 is a flowchart illustrating steps performed when a SIM card is changed to cause a firmware package to be switched according to another embodiment;
FIG. 4 is a flowchart of a firmware restoration method according to another embodiment;
FIG. 5 is a block diagram of a firmware restoration device in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In one embodiment, as shown in fig. 1, a firmware recovery method is provided, where this embodiment is applied to a terminal to illustrate the method, and it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step 102, when an abnormal state is detected, a timer is started.
Terminals are a type of embedded computer system device, and software structures can be divided into system software and application software. In the software structure of the terminal, the system software mainly comprises an operating system and middleware, and a common terminal operating system comprises IOS, android, webOS, open source MeeGo, windows and the like. User terminals using different operating systems can acquire new versions of firmware packages from the server to perform firmware upgrading, for example, a user can use a smart phone to download the latest versions of firmware packages from the server to perform upgrading. The Firmware (Firmware) refers to a program written in an EROM (erasable read only memory) or an EEPROM (electrically erasable programmable read only memory). The firmware acts as the software for the bottommost operation of the system. In a hardware device, some hardware devices have no other software components than firmware, so the firmware determines the functions and performances of the hardware devices. Firmware is typically stored in an electrically erasable read-only memory EEPROM (Electrically Erasable Programmable ROM) or FLASH chip in the device, a program that can be upgraded by a user, typically by a specific refresh program. Generally, software that is the most Basic and bottom-level of a digital product can be called firmware, such as Basic Input/output System (BIOS) on a computer motherboard. Typically, the programs stored in these hardware are not directly readable or modifiable by the user. With the development of technology, it is urgent for users to modify firmware to adapt to the continuously updated hardware environment, so that the rewritable programmable erasable read-only memory EPROM (Erasable Programmable ROM) and flash chips appear, and these chips can be repeatedly written and brushed, so that the firmware can be modified and upgraded. The terminals in the present application may include various types such as mobile terminals and PC terminals (personal computer). In the application software of the terminal, a developer can create applications of different service functions around the service field component, and the applications can be independently developed, managed and updated, so that the deployment, management and service function delivery can be simpler. The embedded terminal product is common acquisition and data transmission equipment, and the product functions are realized by executing firmware stored in a memory chip. The firmware can be programmed into the chip and then the chip is fixed in the product, and the more common way is to fix the chip on the circuit board.
Because the firmware in the terminal product needs to be upgraded in the using process of the terminal product, the product is perfected. Firmware upgrade can be performed by burning firmware on a chip. For example IAP (In Application Programming) applies field programming techniques, which are widely used for firmware upgrades without requiring special equipment and chip removal, saving labor. IAP is In Application Programming's acronym, and IAP is that the User's own procedure burns the partial region of User Flash chip in the operation process, and the purpose is in order to be convenient to update the firmware program in the product through the communication port of reserving after the product is released. However, if the remote IAP technology fails in the process of upgrading the application field, or the upgrade file is wrong, the terminal cannot work normally. For example, when firmware is upgraded, a new version of firmware is not completely written into the chip, and power failure occurs, so that the product cannot work normally at this time, and the terminal cannot work normally. Specifically, in the firmware upgrading process, when the terminal detects an abnormal state, a timer is started to start timing. The abnormal state is a state that the firmware may be interfered by external factors in the upgrading process, so that the firmware is failed to be upgraded, and the terminal cannot work normally, namely the abnormal state. For example, the system is accidentally powered off in the upgrading process, so that the terminal cannot work normally.
And 104, when the timing reaches the preset duration, acquiring the identification information in the version number rule information corresponding to the firmware.
When the terminal detects an abnormal state, a timer is started. When the terminal detects that the timing reaches the preset duration, the terminal can acquire the identification information in the version number rule information corresponding to the firmware. The preset duration refers to a preset waiting duration in the system, for example, the preset duration may be set to 2 minutes. The version number rule information refers to preset version rules corresponding to different firmware. For example, the firmware version number rule information may be custom set to abcd.zzzz.hh.kk.nn.ss, where HH represents operater ID, i.e., the vendor identification or firmware identification, and KK represents the major version number. For example, when the operator ID value is 01, the firmware package corresponds to AT & T (AT & T is us operator), when the operator ID value is 09, the firmware package corresponds to DT (DT is japan operator), and when the operator ID value is 00, the firmware package corresponds to a general version. Specifically, when the terminal detects that the timing reaches the preset duration, the terminal may acquire the identification information in the version number rule information corresponding to the firmware from a default folder, or the terminal may also acquire the identification information in the version number rule information corresponding to the firmware from the NV value, where NV is short for NVRAM, and english name Nonvolatile Random Access Memory is a nonvolatile random access memory. Once the data is written into the NV value, the data is not lost even if power is lost, and the original setting can be still reserved after the next restart. Typically, NV is a proprietary file system that holds basic configuration and radio frequency parameters for the handset. When the mobile phone is turned off, the data stored in the NV cannot be lost. NV can thus be employed to save important parameters of the handset terminal.
And 106, recovering the firmware to the firmware version corresponding to the identification information according to the identification information.
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. The identification information refers to an operator identification or a firmware identification, for example, when the identification information corresponding to a certain firmware is 00, the identification firmware package corresponds to a general version. Specifically, when the terminal detection timer reaches the preset duration, the terminal may 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 that the identification information in the version number rule information corresponding to the firmware is 01, that is, the operator ID value is 01, the terminal restores the firmware to the firmware version corresponding to the identification information, that is, the firmware version corresponding to the firmware package is an AT & T package (AT & T is the american operator) according to the identification information 01. When the terminal obtains the identification information in the version number rule information corresponding to the firmware from the preset default folder as 09, namely, the operator ID value is 09, the terminal restores the firmware to the firmware version corresponding to the identification information according to the identification information 09, namely, the firmware version corresponding to the firmware package is a DT package (DT is a japan operator). The firmware package is a firmware of a certain operator, different operators can produce and manufacture different firmware, and each firmware carries corresponding firmware identification information.
In the traditional firmware recovery mode, when the firmware is recovered automatically, no matter which version the previously operated firmware is, the firmware is recovered to the general version finally, so that the process of converting the firmware is required to be carried out for different user terminals, the current correct firmware version used by the user can be switched, the accuracy of the firmware recovery is poor, and the targeted quick and convenient firmware recovery can not be provided for the user. In this embodiment, when the terminal detects the abnormal state, the terminal starts the timer to start counting. When the terminal detects that the timing reaches the preset duration, the terminal can acquire 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 according to the acquired identification information. Therefore, the firmware can be directly restored to the version used by the current user, the complicated conversion process is avoided, the processing time is effectively saved, the firmware restoration efficiency is improved, and the firmware restoration accuracy is effectively improved.
In one embodiment, before the abnormal state is detected, the method further includes a step of acquiring identification information corresponding to the currently running firmware, and specifically includes:
and acquiring the identification information corresponding to the currently running firmware.
The identification information is stored in a nonvolatile manner.
Before the terminal detects the abnormal state, i.e. the terminal is in a normal working state, or before the terminal is in firmware upgrading, the terminal can acquire the identification information corresponding to the currently operated firmware, i.e. the terminal acquires the firmware identification information corresponding to the normal working state, and the identification information corresponding to the currently operated firmware is stored in a nonvolatile manner. For example, after the terminal acquires the identification information corresponding to the currently running firmware, the terminal may write the acquired identification information into the NV value, and when the firmware is recovered, the terminal may directly read the identification information corresponding to the firmware in the NV value. Once the data is written into the NV value, the data is not lost even if power is lost, and the original setting can be still reserved after the next restart. Typically, NV is a proprietary file system that holds basic configuration and radio frequency parameters for the handset. When the mobile phone is turned off, the data stored in the NV cannot be lost. NV can thus be employed to save important parameters of the handset terminal. Therefore, even if unexpected situations such as unexpected power failure occur in the upgrading process, the terminal can acquire the firmware identification information matched with the user terminal from the nonvolatile memory after the terminal is started and when the firmware is required to be recovered, the firmware is recovered automatically, and the accuracy of the firmware recovery is improved effectively.
In one embodiment, as shown in fig. 2, the method further includes a step when changing the SIM card to cause the firmware package to be switched, specifically including:
step 202, when the SIM card is changed to cause the switching of the firmware package, the identification information corresponding to the switched firmware package is obtained.
Step 204, synchronously updating the identification information into a nonvolatile storage, wherein the nonvolatile storage is used for recording the changed identification information.
When the user changes the SIM card, namely when the terminal detects that the firmware package is switched caused by the operation of changing the SIM card, the terminal can acquire the identification information corresponding to the switched firmware package. Further, the terminal synchronously updates the acquired identification information into a nonvolatile memory, and the nonvolatile memory is used for recording the changed identification information. For example, when the terminal detects that the identification information corresponding to the currently running firmware is 01, and when the user changes the SIM card, that is, when the terminal detects that the firmware package is switched due to the operation of changing the SIM card, the terminal may acquire that the identification information corresponding to the switched firmware package is 09. Further, the terminal synchronously updates the acquired identification information 09 to the nonvolatile storage, and the nonvolatile storage is used for recording the changed identification information, that is, the terminal can synchronously update the identification information corresponding to the original firmware in the NV value to the identification information 09 corresponding to the switched firmware package when the identification information corresponding to the original firmware in the NV value is 01. In addition, a customized firmware version number rule may be preset, for example, the firmware version number rule information may be customized to abcd.zzz.hh.kk.nn.ss, where HH represents operater ID, i.e., a vendor identifier or a firmware identifier, and KK represents a major version number. The third byte in the version number rule information can be set to represent an operator ID, and an initial value of 00, i.e., an operator ID of 00 indicates that the firmware packet corresponds to a general version. When the user changes the SIM card operation to cause the switching of the firmware package, the terminal can synchronously update the firmware package identification information to the nonvolatile storage according to the dynamically changed firmware package identification information, and the nonvolatile storage is used for recording the changed identification information. Therefore, the firmware can be directly restored to the version used by the current user terminal, the complicated conversion process is avoided, the processing time is effectively saved, the firmware restoration efficiency is improved, and the firmware restoration accuracy is effectively improved.
In one embodiment, before the abnormal state is detected, the method further includes a step of acquiring identification information corresponding to the currently running firmware, and specifically includes:
and acquiring the identification information corresponding to the currently running firmware.
The identification information is stored in a built-in data folder.
Before the terminal detects the abnormal state, i.e. the terminal is in a normal working state, or before the terminal is in firmware upgrading, the terminal can acquire the identification information corresponding to the currently operated firmware, i.e. the terminal acquires the firmware identification information corresponding to the normal working state, and stores the identification information corresponding to the currently operated firmware into the built-in data folder. For example, after the terminal acquires the identification information corresponding to the currently running firmware, the terminal may store the acquired identification information in the built-in data folder, and when the firmware is recovered, the terminal may directly read the identification information corresponding to the firmware in the built-in data folder. Therefore, when the OACC state occurs due to unexpected power failure in the upgrading process, the terminal automatically executes the firmware recovery flow after the preset time length, and the firmware can be directly recovered to the firmware version matched with the current user terminal after the operator ID value corresponding to the current terminal equipment is acquired by firstly reading the data in the built-in data folder, so that the complicated conversion process is avoided, the processing time is effectively saved, the firmware recovery efficiency is improved, and the firmware recovery accuracy is also effectively improved.
In one embodiment, as shown in fig. 3, the method further includes a step when changing the SIM card to cause the firmware package to be switched, specifically including:
Step 302, when the SIM card is changed to cause the switching of the firmware package, the identification information corresponding to the switched firmware package is obtained.
Step 304, synchronously updating the identification information into a built-in data folder, wherein the built-in data folder is used for recording the changed identification information.
When the user changes the SIM card, namely when the terminal detects that the firmware package is switched caused by the operation of changing the SIM card, the terminal can acquire the identification information corresponding to the switched firmware package. The terminal synchronously updates the acquired identification information into a built-in data folder, wherein the built-in data folder is used for recording the changed identification information. For example, when the terminal detects that the identification information corresponding to the currently running firmware is 01, after the user changes the SIM card, that is, when the terminal detects that the firmware package is switched, the terminal may acquire the identification information corresponding to the switched firmware package, that is, the terminal acquires the identification information corresponding to the switched firmware package as 09. Further, the terminal synchronously updates the acquired identification information 09 to the built-in data folder, where the built-in data folder is used for recording the changed identification information, that is, the terminal can synchronously update the identification information corresponding to the original firmware in the built-in data folder to the identification information 09 corresponding to the switched firmware package with 01. Therefore, when the abnormal state occurs due to unexpected power failure in the upgrading process, the terminal automatically executes the firmware recovery flow after the preset time length, and the firmware can be directly recovered to the firmware version matched with the current user terminal after the updated operator ID value corresponding to the terminal equipment is 09 by firstly reading the data in the built-in data folder, namely, the terminal recovers the firmware to the DT (DT represents Japanese operator) firmware version corresponding to the identification information 09, so that the complicated conversion process is avoided, the processing time is effectively saved, the firmware recovery efficiency is improved, and the firmware recovery accuracy is also effectively improved.
In one embodiment, after power-on, when only OACC ports are detected, the system is indicated as entering an abnormal state.
In the process of upgrading the firmware, the firmware may be interfered by external factors, so that the firmware is failed to upgrade, and the terminal cannot normally work, for example, the system is accidentally powered off in the process of upgrading, so that the terminal cannot normally work. When the terminal detects that only OACC ports are needed after the system is powered off accidentally in the upgrading process and is restarted, the system is indicated to enter an abnormal state. For example, when the terminal encounters power-off or forced power-off in the upgrading process, after restarting, the user can open the device manager interface by triggering operation, and only OACC ports are left in the ports related to the system from the device manager interface, i.e. the terminal enters OACC state, which indicates that the system enters an abnormal state and firmware recovery is required. In the firmware upgrading process, various external factors may cause firmware upgrading failure, so that the terminal enters an abnormal state, therefore, when a user cannot judge whether the current terminal equipment is in the abnormal state or not and needs firmware recovery, the user can check whether only OACC ports exist through checking ports operated in the background in the equipment manager, if the user judges that the current terminal equipment has completed firmware upgrading and does not need firmware recovery, the user can cancel the firmware upgrading through triggering operation when the system timer does not reach the preset duration. Fig. 4 is a schematic flow chart of firmware recovery corresponding to a certain mobile terminal device. When the terminal detects that only OACC ports exist currently, namely the terminal enters OACC state, the terminal starts a timer to start timing, when the timing reaches a preset duration, the terminal triggers and activates a firmware recovery process, the terminal reads data from a preset built-in data folder, and identification information corresponding to firmware, namely an operator ID value is obtained. And the terminal restores the firmware to the firmware version corresponding to the operator ID value according to the acquired identifier information, namely the operator ID value. Therefore, a user can quickly and conveniently judge whether the terminal equipment needs firmware recovery according to the port parameters in the equipment manager, a few complicated processes are avoided, the firmware recovery efficiency is effectively improved, and convenience is brought to the user.
In one embodiment, when the terminal detects that only OACC ports are available after the system is powered off accidentally during the upgrade process and is restarted, the system is indicated to enter an abnormal state. For example, when the terminal encounters power-off or forced power-off in the upgrading process, after restarting, the user can open the device manager interface by triggering operation, and only OACC ports are left in the ports related to the system from the device manager interface, i.e. the terminal enters OACC state, which indicates that the system enters an abnormal state and firmware recovery is required. In the firmware upgrading process, various external factors may cause firmware upgrading failure, so that the terminal enters an abnormal state, therefore, when a user cannot judge whether the current terminal equipment is in the abnormal state or not and needs firmware recovery, the user can check whether only OACC ports exist through checking ports operated in the background in the equipment manager, if the user judges that the current terminal equipment has completed firmware upgrading and does not need firmware recovery, the user can cancel the firmware upgrading through triggering operation when the system timer does not reach the preset duration. When the terminal detects that only OACC ports exist currently, namely the terminal detects an abnormal state, the terminal starts a timer to start timing, when the timing reaches a preset duration, the terminal triggers and activates a firmware recovery process, the terminal reads data from a preset built-in data folder or NV value, and identification information corresponding to firmware, namely an operator ID value is obtained. And the terminal restores the firmware to the firmware version corresponding to the operator ID value according to the acquired identifier information, namely the operator ID value. Therefore, the firmware can be directly restored to the version used by the current user, the complicated conversion process is avoided, the processing time is effectively saved, the firmware restoration efficiency is improved, and the firmware restoration accuracy is effectively improved.
It should be understood that, although the steps in the flowcharts of fig. 1-4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in FIGS. 1-4 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in FIG. 5, a firmware restoration device is provided, including a detection module 502, an acquisition module 504, and a restoration module 506, wherein:
the detection module 502 is configured to start timing when an abnormal state is detected.
And the obtaining module 504 is configured to obtain the identification information in the version number rule information corresponding to the firmware when the timing reaches the preset duration.
And a restoration module 506, configured to restore the firmware to a firmware version corresponding to the identification information according to the identification information.
In one embodiment, the apparatus further comprises a memory module.
The storage module is used for acquiring the identification information corresponding to the currently running firmware and carrying out nonvolatile storage on the identification information.
In one embodiment, the apparatus further comprises an update module.
The updating module is used for acquiring the identification information corresponding to the switched firmware package when the SIM card is changed to cause the firmware package to be switched, synchronously updating the identification information into the nonvolatile memory, and recording the changed identification information by the nonvolatile memory.
In one embodiment, the storage module is further configured to obtain identification information corresponding to the currently running firmware, and store the identification information in the built-in data folder.
In one embodiment, the updating module is further configured to, when the change of the SIM card causes the firmware package to be switched, obtain identification information corresponding to the switched firmware package, and update the identification information to a built-in data folder synchronously, where the built-in data folder is used to record the changed identification information.
In one embodiment, the detecting module is further configured to, after power-on, indicate that the system enters an abnormal state when only OACC ports are detected.
For specific limitations of the firmware restoration device, reference may be made to the above limitation of the firmware restoration method, and the description thereof will not be repeated here. The respective modules in the firmware restoring apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured 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 computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a firmware restoration method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the various method embodiments described above when the computer program is executed.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.
Claims (10)
1. A firmware recovery method, the method comprising:
Starting a timer to count when restarting is started after the system is accidentally powered off in the firmware upgrading process and an abnormal state is detected, wherein the abnormal state refers to a state that a terminal cannot work normally;
When the timing reaches a preset duration, acquiring identification information in version number rule information corresponding to the firmware from an NV value or a preset built-in data folder, wherein the identification information comprises an operator identification and a main version number, the version number rule information refers to preset version rules corresponding to different firmware, and the data in the NV value still remains original settings after being restarted next time;
Restoring 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 comprises a general version and other versions;
when detecting that the firmware package is switched caused by the operation of changing the SIM card, acquiring the identification information corresponding to the switched firmware package, and synchronously updating the identification information into the built-in data folder;
And under the condition that the timing does not reach the preset duration, canceling the processing flow of firmware upgrading in response to the triggering operation.
2. The method according to claim 1, wherein the method further comprises:
acquiring identification information corresponding to the current running firmware;
non-volatile storage is carried out on the identification information;
The obtaining the identification information in the version number rule information corresponding to the firmware includes:
and acquiring the identification information in the version number rule information corresponding to the firmware from the nonvolatile storage.
3. The method according to claim 2, wherein the method further comprises:
when the SIM card is changed to cause the switching of the firmware package, acquiring identification information corresponding to the switched firmware package;
And synchronously updating the identification information into the nonvolatile storage, wherein the nonvolatile storage is used for recording the changed identification information.
4. The method according to claim 1, wherein the method further comprises:
acquiring identification information corresponding to the current running firmware;
storing the identification information into a built-in data folder;
The obtaining the identification information in the version number rule information corresponding to the firmware includes:
and acquiring the identification information in the version number rule information corresponding to the firmware from the built-in data folder.
5. The method of claim 4, wherein the built-in data folder is used to record changed identification information.
6. The method of claim 1, wherein the detecting an abnormal state comprises:
After the power-on, when only OACC ports are detected, the system is indicated to enter an abnormal state.
7. A firmware restoration apparatus, the apparatus comprising:
the system comprises a detection module, a control module and a control module, wherein the detection module is used for restarting and starting after the system is accidentally powered off in the firmware upgrading process, and starting a timer for timing when an abnormal state is detected, wherein the abnormal state is a state that a terminal cannot work normally;
The system comprises an acquisition module, a storage module and a control module, wherein the acquisition module is used for acquiring identification information in version number rule information corresponding to firmware from an NV value or a preset built-in data folder when the timing reaches a preset duration, wherein the identification information comprises an operator identification and a main version number;
The recovery module is used for recovering 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 comprises a general version and other versions;
The updating module is used for acquiring the identification information corresponding to the switched firmware package when the firmware package switching caused by the SIM card changing operation is detected, and synchronously updating the identification information into the built-in data folder;
And under the condition that the timing does not reach the preset duration, canceling the processing flow of firmware upgrading in response to the triggering operation.
8. The firmware restoration apparatus as recited in claim 7, wherein said apparatus further comprises:
The storage module is used for acquiring the identification information corresponding to the currently running firmware, carrying out nonvolatile storage on the identification information, and acquiring the identification information in the version number rule information corresponding to the firmware from the nonvolatile storage.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011111452.9A CN112214353B (en) | 2020-10-16 | 2020-10-16 | Firmware recovery method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011111452.9A CN112214353B (en) | 2020-10-16 | 2020-10-16 | Firmware recovery method, device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112214353A CN112214353A (en) | 2021-01-12 |
CN112214353B true CN112214353B (en) | 2024-11-29 |
Family
ID=74055532
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011111452.9A Active CN112214353B (en) | 2020-10-16 | 2020-10-16 | Firmware recovery method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112214353B (en) |
Families Citing this family (2)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113157309B (en) * | 2021-01-26 | 2024-02-13 | 上海商米科技集团股份有限公司 | Software design method for storing activation files by utilizing NVRAM |
CN113127883B (en) * | 2021-04-26 | 2022-05-24 | 山东英信计算机技术有限公司 | Locking method, device, equipment and medium for platform firmware protection recovery |
Citations (2)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109814908A (en) * | 2019-01-17 | 2019-05-28 | 深圳忆联信息系统有限公司 | Firmware stablizes method, apparatus, computer equipment and the storage medium of upgrading |
CN110119280A (en) * | 2018-02-06 | 2019-08-13 | 深圳市帝迈生物技术有限公司 | The method and device of more firmware upgrades |
Family Cites Families (6)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060131096A (en) * | 2005-06-15 | 2006-12-20 | 엘지엔시스(주) | Automatic recovery method of firmware through version comparison and recording medium storing program using the method |
CN102136934B (en) * | 2010-10-21 | 2015-01-21 | 华为技术有限公司 | Method, device and network system for realizing remote upgrading of Zigbee equipment |
CN105653299A (en) * | 2014-11-12 | 2016-06-08 | 杭州华三通信技术有限公司 | Firmware upgrade method device |
CN104834575B (en) * | 2015-05-07 | 2018-04-06 | 紫光华山信息技术有限公司 | A kind of firmware restoration method and device |
CN109634631A (en) * | 2018-11-01 | 2019-04-16 | 北京锦鸿希电信息技术股份有限公司 | Firmware restoration method, apparatus, electronic equipment and firmware restoration system |
CN111510909B (en) * | 2020-03-10 | 2023-03-10 | 深圳市广和通无线股份有限公司 | Communication module configuration processing method and device, computer equipment and storage medium |
-
2020
- 2020-10-16 CN CN202011111452.9A patent/CN112214353B/en active Active
Patent Citations (2)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110119280A (en) * | 2018-02-06 | 2019-08-13 | 深圳市帝迈生物技术有限公司 | The method and device of more firmware upgrades |
CN109814908A (en) * | 2019-01-17 | 2019-05-28 | 深圳忆联信息系统有限公司 | Firmware stablizes method, apparatus, computer equipment and the storage medium of upgrading |
Also Published As
Publication number | Publication date |
---|---|
CN112214353A (en) | 2021-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20170039075A1 (en) | 2017-02-09 | Rapid start up method for electronic equipment |
US20110004871A1 (en) | 2011-01-06 | Embedded electronic device and firmware updating method thereof |
US20100325622A1 (en) | 2010-12-23 | Updating Firmware of an Electronic Device |
CN110333891A (en) | 2019-10-15 | The method of enhanced OTA upgrading based on Internet of Things |
CN111813428A (en) | 2020-10-23 | Method and device for upgrading terminal firmware, electronic equipment and storage medium |
CN112214353B (en) | 2024-11-29 | Firmware recovery method, device, computer equipment and storage medium |
CN116932010B (en) | 2024-01-19 | System firmware upgrading method, device and server |
CN113138791B (en) | 2025-02-14 | Upgrade processing method, device and electronic equipment based on embedded system |
CN108153548A (en) | 2018-06-12 | A kind of EMMC firmware upgrade methods and device |
CN117130672A (en) | 2023-11-28 | Server start flow control method, system, terminal and storage medium |
CN110764799A (en) | 2020-02-07 | Method, equipment and medium for optimizing and remotely updating FPGA (field programmable Gate array) accelerator card |
CN112433739B (en) | 2022-04-19 | Firmware upgrading method |
CN107766177A (en) | 2018-03-06 | Boot optimization method, device, storage medium and terminal equipment |
CN108874459B (en) | 2021-06-29 | Quick start method and device based on virtualization technology |
US20050010914A1 (en) | 2005-01-13 | Method for upgrading firmware |
CN109871334B (en) | 2021-04-09 | Cable modem and method of operation |
CN114995852A (en) | 2022-09-02 | Equipment upgrading method, equipment and computer readable storage medium |
JP2003216511A (en) | 2003-07-31 | Non-volatile memory device, data updating method, data updating program and computer readable recording medium with recorded program |
CN113867807A (en) | 2021-12-31 | Method, device, equipment and storage medium for shortening power-on time of server |
CN113050887A (en) | 2021-06-29 | Flash partition data processing method and device, computer equipment and storage medium |
CN117762455A (en) | 2024-03-26 | Updating method and device of BIOS firmware file, storage medium and electronic equipment |
CN108595292B (en) | 2021-03-26 | System optimization method, mobile terminal and computer storage medium |
CN113778485A (en) | 2021-12-10 | System operation method, device, electronic chip and storage medium of electronic chip |
CN115951949A (en) | 2023-04-11 | Recovery method and device for configuration parameters of BIOS (basic input output System) and computing equipment |
CN100394392C (en) | 2008-06-11 | Automatic starting control method and system for computer program recovery mode |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
2021-01-12 | PB01 | Publication | |
2021-01-12 | PB01 | Publication | |
2021-01-29 | SE01 | Entry into force of request for substantive examination | |
2021-01-29 | SE01 | Entry into force of request for substantive examination | |
2024-11-29 | GR01 | Patent grant | |
2024-11-29 | GR01 | Patent grant |