CN117311764A - Firmware upgrading and restoring method, device, equipment and storage medium - Google Patents

Firmware upgrading and restoring method, device, equipment and storage medium Download PDF

Info

Publication number
CN117311764A
CN117311764A CN202311385084.0A CN202311385084A CN117311764A CN 117311764 A CN117311764 A CN 117311764A CN 202311385084 A CN202311385084 A CN 202311385084A CN 117311764 A CN117311764 A CN 117311764A
Authority
CN
China
Prior art keywords
file
firmware
upgraded
program
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311385084.0A
Other languages
Chinese (zh)
Inventor
周于
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Shuncom Smart Technology Co ltd
Original Assignee
Shanghai Shuncom Smart Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Shuncom Smart Technology Co ltd filed Critical Shanghai Shuncom Smart Technology Co ltd
Priority to CN202311385084.0A priority Critical patent/CN117311764A/en
Publication of CN117311764A publication Critical patent/CN117311764A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a firmware upgrading and restoring method, a device, equipment and a storage medium. Comprising the following steps: acquiring a file to be upgraded of a current system, and calling a bootstrap program according to the file to be upgraded; generating a current firmware file based on the bootstrap program; and upgrading and restoring the system firmware according to the current firmware file and the file to be upgraded. The method comprises the steps that an operation program obtains a file to be upgraded and stores the file to be upgraded to a first designated address, an upgrading mark is generated to call a guide program, when the guide program determines that the detection condition of the upgrading state is to be upgraded, current firmware information of a designated position of the operation program is extracted and stored to a second designated address to generate a current firmware file, finally, the system firmware is upgraded according to the file to be upgraded, normal operation of the system is ensured, firmware restoration is carried out through a current estimation file when the operation is abnormal, the whole upgrading process is effectively managed, the condition that the system is halted due to abnormal operation is avoided, the safety of the upgrading process is ensured, and the system performance is improved.

Description

Firmware upgrading and restoring method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for firmware upgrade and restoration.
Background
As technology develops, embedded systems become more complex, and upgrades and maintenance for the systems are also more frequent. For a monolithic microcomputer with application programming capability, space download technology upgrades are supported, which are typically done by a bootstrap program and an operating program.
In the prior art, the internal false of a single chip microcomputer is divided into 3 areas, and a bootstrap program, an operation program and a code temporary storage area are respectively stored. The running program is used for receiving the code temporary storage area of the firmware stored in the false, writing an upgrading mark after finishing, jumping to the guiding program, judging whether the updating is needed or not by the guiding program, covering the old firmware with the new firmware of the code temporary storage area if the updating is needed, clearing the upgrading mark after the covering is successful, and jumping to the new firmware for running.
In the prior art, the system is often directly upgraded according to the obtained upgrade data packet when the system is upgraded, once the new firmware has problems, the system cannot normally run and crash after the upgrade is successful, and the new firmware can only be burned in a wired mode, so that the whole upgrade process is lack of effective management, the safety degree of the whole upgrade process is low, and the performance of the system is affected.
Disclosure of Invention
The invention provides a firmware upgrading and restoring method, a device, equipment and a storage medium, which are used for avoiding the condition that equipment crashes after upgrading due to abnormal firmware upgrading.
According to an aspect of the present invention, there is provided a firmware upgrade and restore method, the method including:
acquiring a file to be upgraded of a current system, and calling a guide program according to the file to be upgraded, wherein the file to be upgraded comprises firmware information to be upgraded;
generating a current firmware file based on the bootstrap program;
and upgrading and restoring the system firmware according to the current firmware file and the file to be upgraded.
Optionally, obtaining the file to be upgraded of the current system includes: acquiring an upgrade instruction input by a user, and calling an operation program of a current system based on the upgrade instruction; receiving firmware information to be upgraded through an operating program, and sending the firmware information to be upgraded to a first designated address; and reading the first designated address to acquire the file to be upgraded.
Optionally, invoking the bootstrap program according to the file to be upgraded, including: generating an upgrading mark according to the file to be upgraded by an operating program; and calling a designated interface according to the upgrading mark to jump to the bootstrap program so as to call the bootstrap program.
Optionally, generating the current firmware file based on the bootstrap program includes: acquiring an upgrade state detection condition through a bootstrap program, wherein the upgrade state detection condition comprises to-be-upgraded and no need of upgrading; when the upgrade state detection condition is detected to be upgraded, extracting current firmware information of a designated position of an operating program; the current firmware information is copied to the second designated address to generate a current firmware file.
Optionally, the system firmware upgrading and restoring is performed according to the current firmware file and the file to be upgraded, including: upgrading the system firmware through the file to be upgraded, and generating a new version mark to replace the upgrading mark; acquiring the running state of the current system, wherein the running state comprises normal running and abnormal running; judging whether the running state is normal, if so, deleting the new version mark and generating an upgrade completion prompt; otherwise, restoring the system firmware according to the current firmware file and generating an upgrade abnormality prompt.
Optionally, the updating of the system firmware by the file to be updated includes: taking the current firmware information of the designated position as first target information; and replacing the first target information by the file to be upgraded to upgrade the system firmware.
Optionally, performing system firmware restoration according to the current firmware file includes: taking the file to be upgraded at the designated position as second target information; and replacing the second target information by the current firmware file to restore the system firmware.
According to another aspect of the present invention, there is provided a firmware upgrade and restore apparatus, the apparatus comprising:
the system comprises a file to be upgraded obtaining and guiding program calling module, a guiding program calling module and a guiding program updating module, wherein the file to be upgraded is used for obtaining the file to be upgraded of the current system and calling the guiding program according to the file to be upgraded, and the file to be upgraded comprises firmware information to be upgraded;
the current firmware file generation module is used for generating a current firmware file based on the bootstrap program;
and the firmware upgrading protection module is used for upgrading and restoring the system firmware according to the current firmware file and the file to be upgraded.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform a firmware upgrade and restore method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement a firmware upgrade and restore method according to any one of the embodiments of the present invention when executed.
According to the technical scheme, the file to be upgraded is obtained through the running program and stored in the first designated address, the upgrading mark is generated to call the guiding program, when the guiding program determines that the upgrading state detection condition is to be upgraded, the current firmware information of the designated position of the running program is extracted and stored in the second designated address to generate the current firmware file, finally, the system firmware is upgraded according to the file to be upgraded, normal running of the system is ensured, firmware restoration is performed through the current estimated file when the running is abnormal, the whole upgrading process is effectively managed, the condition that the system is halted due to abnormal running is avoided, the safety of the upgrading process is ensured, and the system performance is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a firmware upgrade and restore method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of another firmware upgrade and restore method according to a first embodiment of the present invention;
FIG. 3 is a flowchart of another firmware upgrade and restore method according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram of a firmware upgrade and restore apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing a firmware upgrade and restore method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a firmware upgrading and restoring method according to an embodiment of the present invention, where the method may be performed by a firmware upgrading and restoring device, and the firmware upgrading and restoring device may be implemented in hardware and/or software, and the firmware upgrading and restoring device may be configured in a chip. As shown in fig. 1, the method includes:
s110, acquiring a file to be upgraded of the current system, and calling a guide program according to the file to be upgraded, wherein the file to be upgraded comprises firmware information to be upgraded.
The current system refers to a single-chip microcomputer (Micro Control Unit, MCU) system, in particular to an MCU with application programming (InApplicationProgramming, IAP) capability, and the IAP is a program of a user to burn a partial area of the UserFlash in the running process, so that the firmware program in the product can be updated and upgraded conveniently through a reserved communication port after the product is released. The bootstrap program is a bootloader program for booting an operating system, and it should be noted that, in this embodiment, the internal false of the MCU is divided into 4 areas, and "bootloader", "running APP", "code register 1", and "code register 2" are stored respectively. For an MCU with IAP self-programming capability, support space download Technology (OTA) upgrade, OTA upgrade code is typically composed of a bootstrap Bootloader and an application program APP. OTA upgrading refers to downloading and upgrading files (such as problem repairing and version updating) needed by a system through a wireless network, and the files are directly downloaded through a wireless environment without downloading and upgrading through wired connection. The system can be improved in function by upgrading the firmware of the system, the stability of the system is enhanced, and the system loopholes are repaired.
Optionally, obtaining the file to be upgraded of the current system includes: acquiring an upgrade instruction input by a user, and calling an operation program of a current system based on the upgrade instruction; receiving firmware information to be upgraded through an operating program, and sending the firmware information to be upgraded to a first designated address; and reading the first designated address to acquire the file to be upgraded.
Specifically, when a user needs to perform firmware upgrade, the system can call an operation program of the current system based on an upgrade instruction and the firmware information to be upgraded, wherein the operation program is used for receiving the firmware information to be upgraded and sending the firmware information to be upgraded to a first designated address, the first designated address refers to a code temporary storage area 1 in a flash, and the system can take the firmware information to be upgraded in the code temporary storage area 1 as a file to be upgraded. It should be noted that, the code temporary storage area 1 only stores the firmware information to be upgraded which is upgraded once, and when new firmware information to be upgraded is written, the previously written firmware information is automatically deleted.
Optionally, invoking the bootstrap program according to the file to be upgraded, including: generating an upgrading mark according to the file to be upgraded by an operating program; and calling a designated interface according to the upgrading mark to jump to the bootstrap program so as to call the bootstrap program.
Specifically, after the running program stores the firmware information to be upgraded in the code temporary storage area 1, an upgrade flag is written, and at the moment, the system jumps to the boot program, i.e. a designated interface is called according to the upgrade flag, and the boot program is called through the designated interface.
S120, generating a current firmware file based on the bootstrap program.
Specifically, the bootstrap program is used for judging whether the system needs to be upgraded, and if the system needs to be upgraded, the old firmware copy is stored in the code temporary storage area 2 to generate the current firmware file.
S130, upgrading and restoring the system firmware according to the current firmware file and the file to be upgraded.
Fig. 2 is a flowchart of a firmware upgrading and restoring method according to an embodiment of the present invention, and step S130 mainly includes steps S131 to S135 as follows:
s131, upgrading the system firmware through the file to be upgraded, and generating a new version mark to replace the upgrading mark.
Optionally, the updating of the system firmware by the file to be updated includes: taking the current firmware information of the designated position as first target information; and replacing the first target information by the file to be upgraded to upgrade the system firmware.
Specifically, when firmware is updated, the boot program uses the file to be updated in the code temporary storage area 1 to cover the firmware information of the old version, then clears the update flag, writes a new version flag, and then calls the designated interface to make the system jump from the boot program to the operating program.
S132, acquiring the running state of the current system, wherein the running state comprises normal running and abnormal running.
S133, judging whether the operation state is normal, if so, executing S134, otherwise, executing S135.
S134, deleting the new version mark and generating an upgrade completion prompt.
Specifically, since the APP is running normally, the new version flag needs to be cleared. Therefore, the system can judge the running state after the firmware is upgraded, the running state of the system can be obtained to be normal running or abnormal running, when the running state is normal running, the new version mark can be cleared, an upgrade completion prompt is generated, then the upgrade completion prompt is displayed to a user, the user can normally use the system after receiving the upgrade completion prompt, the running problem of the system is avoided, the user is ensured to normally use the system, and meanwhile, the stability of the system upgrading process is also ensured.
S135, restoring the system firmware according to the current firmware file, and generating an upgrade abnormality prompt.
Optionally, performing system firmware restoration according to the current firmware file includes: taking the file to be upgraded at the designated position as second target information; and replacing the second target information by the current firmware file to restore the system firmware.
Specifically, firmware restoration refers to removing new version firmware information and restoring old version firmware information to restore the system under the condition of abnormal upgrading. When the running state of the system is abnormal, the system can restore the system firmware according to the current firmware file (old version firmware information) of the code temporary storage area 2 and generate an upgrade abnormal prompt to prompt a user, so that the user can conveniently grasp the situation of the upgrade abnormal in time, and the user can check and adjust the input firmware information to be upgraded, thereby ensuring the subsequent system firmware upgrade and normal running. The specified mode includes voice or image, the voice can be broadcast through a speaker connected with the controller, for example, the voice content can be: firmware upgrade is abnormal. The image can be displayed through a user terminal connected with the system so as to prompt the user. Further, when firmware restoration is performed, the system uses the file to be updated at the designated position of the running program as second target information, and then replaces the current firmware file stored in the code temporary storage area 2 to implement firmware restoration.
For example, when the updated program is found to be hung up, the system detects that the running state is abnormal, at this time, the device may perform a restart operation to restart, and if the bootstrap program detects that the new version flag is not cleared, copies a current firmware file from the code temporary storage area 2 to cover the file to be updated at the designated position of the running area, clears the new version flag, and jumps to the running program, so that problems occur and re-burning can be avoided.
According to the technical scheme, the file to be upgraded is obtained through the running program and stored in the first designated address, the upgrading mark is generated to call the guiding program, when the guiding program determines that the upgrading state detection condition is to be upgraded, the current firmware information of the designated position of the running program is extracted and stored in the second designated address to generate the current firmware file, finally, the system firmware is upgraded according to the file to be upgraded, normal running of the system is ensured, firmware restoration is performed through the current estimated file when the running is abnormal, the whole upgrading process is effectively managed, the condition that the system is halted due to abnormal running is avoided, the safety of the upgrading process is ensured, and the system performance is improved.
Example two
Fig. 3 is a flowchart of a firmware upgrading and restoring method according to a second embodiment of the present invention, where a specific process of generating a current firmware file based on a boot strap program is added on the basis of the first embodiment. The specific contents of steps S210 and S250 are substantially the same as steps S110 and S130 in the first embodiment, so that a detailed description is omitted in this embodiment. As shown in fig. 3, the method includes:
s210, acquiring a file to be upgraded of the current system, and calling a guide program according to the file to be upgraded, wherein the file to be upgraded comprises firmware information to be upgraded.
Optionally, obtaining the file to be upgraded of the current system includes: acquiring an upgrade instruction input by a user, and calling an operation program of a current system based on the upgrade instruction; receiving firmware information to be upgraded through an operating program, and sending the firmware information to be upgraded to a first designated address; and reading the first designated address to acquire the file to be upgraded.
Optionally, invoking the bootstrap program according to the file to be upgraded, including: generating an upgrading mark according to the file to be upgraded by an operating program; and calling a designated interface according to the upgrading mark to jump to the bootstrap program so as to call the bootstrap program.
S220, acquiring an upgrade state detection condition through a bootstrap program, wherein the upgrade state detection condition comprises to-be-upgraded and no need of upgrade.
Specifically, whether the updating is needed or not can be judged through the bootstrap program, if the updating is needed, the new firmware in the code temporary storage area is covered with the old firmware, after the covering is successful, the updating mark is cleared, and the operation is skipped to the new firmware. The embodiment of the invention is suitable for firmware upgrade of the MCU in the embedded system. When the MCU of the user equipment is powered on or the software is reset, a program pointer of the MCU points to a reset vector, at the moment, whether the effective identification of the equipment application program exists in a memory of the MCU or not can be detected by a guide program to judge the upgrade state detection condition of the system, the effective identification of the equipment application program is the identification for judging whether the application program in the user equipment is effective, when the effective identification of the equipment application program exists, the application program in the user equipment is in an effective state, at the moment, the upgrade state detection condition is that the application program on the user equipment is not required to be upgraded, and the application program on the user equipment can be directly operated, otherwise, the upgrade state detection condition is that the upgrade is required to be upgraded, and firmware upgrade is required to be carried out on the MCU to repair the application program control loophole or defect of the user equipment. The MCU is powered on, namely the MCU is powered on, the MCU software resets, namely the MCU program pointer points to the reset vector through the program instruction, and the memory of the MCU is the Flash memory of the MCU.
And S230, when the upgrade state detection condition is detected to be upgraded, extracting the current firmware information of the appointed position of the running program.
Specifically, when it is detected that the upgrade status is to be upgraded, current firmware information of a designated position in an operating program needs to be extracted before upgrading system firmware, that is, when it is detected that no effective identifier of an application program of a device exists on the MCU, it is indicated that the application program in the user equipment is in a failure status, and at this time, firmware upgrading needs to be performed on the MCU. And, the current firmware information of the designated location in the running program needs to be extracted before the system is firmware upgraded.
S240, copying the current firmware information to the second designated address to generate a current firmware file.
Specifically, the current firmware information, namely the estimation information of the running version of the current system, is copied to the second designated address by the bootstrap program to generate the current firmware file, so that the current estimation information is stored, the restoration of the system firmware can be realized by extracting the current firmware file under the condition of abnormal estimation and upgrading, the re-burning of the system is avoided, and the stability of the system is ensured.
S250, upgrading and restoring the system firmware according to the current firmware file and the file to be upgraded.
Optionally, the system firmware upgrading and restoring is performed according to the current firmware file and the file to be upgraded, including: upgrading the system firmware through the file to be upgraded, and generating a new version mark to replace the upgrading mark; acquiring the running state of the current system, wherein the running state comprises normal running and abnormal running; judging whether the running state is normal, if so, deleting the new version mark and generating an upgrade completion prompt; otherwise, restoring the system firmware according to the current firmware file and generating an upgrade abnormality prompt.
Optionally, the updating of the system firmware by the file to be updated includes: taking the current firmware information of the designated position as first target information; and replacing the first target information by the file to be upgraded to upgrade the system firmware.
Optionally, performing system firmware restoration according to the current firmware file includes: taking the file to be upgraded at the designated position as second target information; and replacing the second target information by the current firmware file to restore the system firmware.
According to the technical scheme, the file to be upgraded is obtained through the running program and stored in the first designated address, the upgrading mark is generated to call the guiding program, when the guiding program determines that the upgrading state detection condition is to be upgraded, the current firmware information of the designated position of the running program is extracted and stored in the second designated address to generate the current firmware file, finally, the system firmware is upgraded according to the file to be upgraded, normal running of the system is ensured, firmware restoration is performed through the current estimated file when the running is abnormal, the whole upgrading process is effectively managed, the condition that the system is halted due to abnormal running is avoided, the safety of the upgrading process is ensured, and the system performance is improved.
Example III
Fig. 4 is a schematic structural diagram of a firmware upgrading and restoring device according to a third embodiment of the present invention. As shown in fig. 4, the apparatus includes: a file to be upgraded obtaining and guiding program calling module 310, configured to obtain a file to be upgraded of the current system, and call a guiding program according to the file to be upgraded, where the file to be upgraded includes firmware information to be upgraded;
a current firmware file generation module 320, configured to generate a current firmware file based on the bootstrap;
the firmware upgrade protection module 330 is configured to upgrade and restore the system firmware according to the current firmware file and the file to be upgraded.
Optionally, the file obtaining and guiding procedure calling module 310 to be upgraded specifically includes: the file to be upgraded acquisition unit is used for: acquiring an upgrade instruction input by a user, and calling an operation program of a current system based on the upgrade instruction; receiving firmware information to be upgraded through an operating program, and sending the firmware information to be upgraded to a first designated address; and reading the first designated address to acquire the file to be upgraded.
Optionally, the file obtaining and guiding procedure calling module 310 to be upgraded specifically includes: a bootstrap calling unit for: generating an upgrading mark according to the file to be upgraded by an operating program; and calling a designated interface according to the upgrading mark to jump to the bootstrap program so as to call the bootstrap program.
Optionally, the current firmware file generation module 320 is specifically configured to: acquiring an upgrade state detection condition through a bootstrap program, wherein the upgrade state detection condition comprises to-be-upgraded and no need of upgrading; when the upgrade state detection condition is detected to be upgraded, extracting current firmware information of a designated position of an operating program; the current firmware information is copied to the second designated address to generate a current firmware file.
Optionally, the firmware upgrade protection module 330 specifically includes: firmware upgrade unit for: upgrading the system firmware through the file to be upgraded, and generating a new version mark to replace the upgrading mark; an operation state acquisition unit configured to: acquiring the running state of the current system, wherein the running state comprises normal running and abnormal running; an operation state judgment unit configured to: judging whether the running state is normal running or not; the upgrade completion unit is used for deleting the new version mark and generating an upgrade completion prompt when the running state is normal; and the firmware restoration unit is used for restoring the system firmware according to the current firmware file and generating an upgrade abnormality prompt when the running state is abnormal.
Optionally, the firmware upgrade unit is specifically configured to: taking the current firmware information of the designated position as first target information; and replacing the first target information by the file to be upgraded to upgrade the system firmware.
Optionally, the firmware restoring unit is specifically configured to: taking the file to be upgraded at the designated position as second target information; and replacing the second target information by the current firmware file to restore the system firmware.
According to the technical scheme, the file to be upgraded is obtained through the running program and stored in the first designated address, the upgrading mark is generated to call the guiding program, when the guiding program determines that the upgrading state detection condition is to be upgraded, the current firmware information of the designated position of the running program is extracted and stored in the second designated address to generate the current firmware file, finally, the system firmware is upgraded according to the file to be upgraded, normal running of the system is ensured, firmware restoration is performed through the current estimated file when the running is abnormal, the whole upgrading process is effectively managed, the condition that the system is halted due to abnormal running is avoided, the safety of the upgrading process is ensured, and the system performance is improved.
The firmware upgrading and restoring device provided by the embodiment of the invention can execute the firmware upgrading and restoring method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example IV
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a firmware upgrade and restore method. Namely: acquiring a file to be upgraded of a current system, and calling a guide program according to the file to be upgraded, wherein the file to be upgraded comprises firmware information to be upgraded; generating a current firmware file based on the bootstrap program; and upgrading and restoring the system firmware according to the current firmware file and the file to be upgraded.
In some embodiments, a firmware upgrade and restore method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of a firmware upgrade and restore method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a firmware upgrade and restore method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A firmware upgrade and restore method, comprising:
acquiring a file to be upgraded of a current system, and calling a guide program according to the file to be upgraded, wherein the file to be upgraded comprises firmware information to be upgraded;
generating a current firmware file based on the bootstrap;
and upgrading and restoring the system firmware according to the current firmware file and the file to be upgraded.
2. The method of claim 1, wherein the obtaining the file to be upgraded of the current system comprises:
acquiring an upgrade instruction input by a user, and calling an operation program of a current system based on the upgrade instruction;
receiving firmware information to be upgraded through the running program, and sending the firmware information to be upgraded to a first designated address;
and reading the first designated address to acquire the file to be upgraded.
3. The method of claim 2, wherein the invoking the bootstrap program from the file to be upgraded comprises:
generating an upgrading mark according to the file to be upgraded through the running program;
and calling a designated interface according to the upgrading mark so as to jump to the bootstrap program to call the bootstrap program.
4. The method of claim 3, wherein the generating a current firmware file based on the boot strap program comprises:
acquiring an upgrade state detection condition through the bootstrap program, wherein the upgrade state detection condition comprises to-be-upgraded and no need of upgrade;
when the upgrade state detection condition is detected to be upgraded, extracting current firmware information of a designated position in the running program;
copying the current firmware information to a second designated address to generate the current firmware file.
5. The method of claim 4, wherein the performing system firmware upgrade and restore according to the current firmware file and the file to be upgraded comprises:
upgrading the system firmware through the file to be upgraded, and generating a new version mark to replace the upgrading mark;
acquiring the running state of a current system, wherein the running state comprises normal running and abnormal running;
judging whether the running state is normal, if so, deleting the new version mark and generating an upgrade completion prompt;
otherwise, restoring the system firmware according to the current firmware file and generating an upgrade abnormality prompt.
6. The method of claim 5, wherein the system firmware upgrade via the file to be upgraded comprises:
taking the current firmware information of the designated position as first target information;
and replacing the first target information by the file to be upgraded so as to upgrade the system firmware.
7. The method of claim 5, wherein said performing a system firmware restore from said current firmware file comprises:
taking the file to be upgraded at the appointed position as second target information;
and replacing the second target information by the current firmware file to restore the system firmware.
8. A firmware upgrade and restore apparatus, comprising:
the system comprises a file to be upgraded obtaining and guiding program calling module, a guiding program calling module and a guiding program updating module, wherein the file to be upgraded is used for obtaining the file to be upgraded of the current system and calling the guiding program according to the file to be upgraded, and the file to be upgraded comprises firmware information to be upgraded;
the current firmware file generation module is used for generating a current firmware file based on the bootstrap program;
and the firmware upgrading protection module is used for upgrading and restoring the system firmware according to the current firmware file and the file to be upgraded.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer storage medium storing computer instructions for causing a processor to perform the method of any one of claims 1-7 when executed.
CN202311385084.0A 2023-10-24 2023-10-24 Firmware upgrading and restoring method, device, equipment and storage medium Pending CN117311764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311385084.0A CN117311764A (en) 2023-10-24 2023-10-24 Firmware upgrading and restoring method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311385084.0A CN117311764A (en) 2023-10-24 2023-10-24 Firmware upgrading and restoring method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117311764A true CN117311764A (en) 2023-12-29

Family

ID=89237164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311385084.0A Pending CN117311764A (en) 2023-10-24 2023-10-24 Firmware upgrading and restoring method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117311764A (en)

Similar Documents

Publication Publication Date Title
KR20100066576A (en) Firmware image update and management
CN110162429B (en) System repair method, server and storage medium
CN115794257B (en) System starting method, device, electronic equipment and storage medium
CN108563472B (en) Service plug-in loading method and device based on multi-open application
CN115202686A (en) Virtualization system upgrading method and device, electronic equipment and storage medium
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN112612498A (en) Embedded equipment upgrading method and embedded equipment
CN112286559A (en) Upgrading method and device for vehicle-mounted intelligent terminal
CN117311764A (en) Firmware upgrading and restoring method, device, equipment and storage medium
CN114640709B (en) Edge node processing method, device and medium
CN115454515A (en) System processing method and device and electronic equipment
CN115344289A (en) Client upgrading method and device, terminal equipment and storage medium
CN112925675B (en) Recovery method and device for applet
CN114816482A (en) Method and device for upgrading block storage service, computer equipment and storage medium
CN114995854A (en) Application program online upgrading method and device, terminal and operation machine
CN115080382A (en) Code testing method, device, equipment and medium
CN110659052B (en) Method and system for updating system software in network equipment and readable storage medium
CN113515291A (en) Equipment online upgrading method and device
CN114153503A (en) BIOS control method, device and medium
CN116627439A (en) System upgrading method, device, equipment and storage medium
CN105487847A (en) Function release method and apparatus
CN105282614B (en) A kind of upgrade method of module TV, module TV and upgrade-system
CN117492799A (en) Software upgrading method and device, terminal equipment and storage medium
GB2471480A (en) Preventing boot crashes due to new files
CN117112002A (en) Drive upgrading method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination