CN114035813A - Upgrading method, device, equipment and storage medium - Google Patents

Upgrading method, device, equipment and storage medium Download PDF

Info

Publication number
CN114035813A
CN114035813A CN202111310907.4A CN202111310907A CN114035813A CN 114035813 A CN114035813 A CN 114035813A CN 202111310907 A CN202111310907 A CN 202111310907A CN 114035813 A CN114035813 A CN 114035813A
Authority
CN
China
Prior art keywords
firmware
program
driver
storage unit
upgraded
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
CN202111310907.4A
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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202111310907.4A priority Critical patent/CN114035813A/en
Publication of CN114035813A publication Critical patent/CN114035813A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

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

Abstract

The embodiment of the invention relates to an upgrading method, an upgrading device, upgrading equipment and a storage medium, wherein the upgrading method comprises the following steps: acquiring a first firmware identification corresponding to a first program and a second firmware identification corresponding to a second program, wherein the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver; determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification; when the firmware is determined to need to be upgraded, acquiring the first program; writing the first program into the first storage unit to update the second program in the first storage unit to the first program. And the second program backed up in advance can be rewritten into the first storage unit when the upgrade fails. Firmware upgrading can be carried out without disassembling the driver, the situation that the driver cannot be used due to errors in upgrading through a debugging interface is avoided, and the success rate and the efficiency of firmware upgrading are improved.

Description

Upgrading method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of computers, in particular to an upgrading method, device, equipment and storage medium.
Background
With the rapid development of the field of automation equipment, software and hardware of a servo driver are rapidly updated and iterated, and the servo driver is important equipment in industrial automation and widely applied to industrial robots and digital high-precision processing equipment.
In the prior art, the driver is usually required to be detached from the electric cabinet when the firmware of the driver is upgraded, and then the driver is upgraded through the JTAG debugging interface. And the upgrading process can not be guaranteed to be successful, and once the driver with errors can not be used, the driver is only disassembled again for upgrading, so that the working efficiency is seriously influenced.
Disclosure of Invention
In view of this, in order to solve the technical problem that the firmware upgrading process for the driver is complicated, embodiments of the present invention provide an upgrading method, apparatus, device, and storage medium.
In a first aspect, an embodiment of the present invention provides an upgrade method, including:
acquiring a first firmware identification corresponding to a first program and a second firmware identification corresponding to a second program, wherein the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver;
determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification;
when the firmware is determined to need to be upgraded, acquiring the first program;
writing the first program into a first storage unit so as to update the second program in the first storage unit to the first program.
In one possible embodiment, before the obtaining the first program, the method further comprises:
reading the second program from the first storage unit;
and writing the second program into a second storage unit.
In one possible embodiment, the obtaining a first firmware identifier corresponding to the first program and a second firmware identifier corresponding to the second program includes:
and acquiring a first firmware identifier corresponding to the first program from external equipment through Ethernet, and acquiring a second firmware identifier corresponding to the second program from a Flash chip of the driver.
In one possible embodiment, the determining whether the firmware needs to be upgraded according to the first firmware identifier and the second firmware identifier includes:
comparing the first firmware identification with the second firmware identification to obtain a comparison result;
when the comparison result is that the first firmware identification and the second firmware identification are the same, determining that the firmware does not need to be upgraded;
and when the comparison result shows that the first firmware identification is different from the second firmware identification, determining that the firmware needs to be upgraded.
In one possible implementation, after writing the first program to a first storage unit to update the second program in the first storage unit to the first program, the method further includes:
acquiring a first check code corresponding to the first program from the external equipment;
judging whether the first check code is the same as a second check code in the first program;
when the first check code is the same as the second check code, determining that the firmware is successfully upgraded;
and when the first check code is different from the second check code, determining that the firmware upgrading fails.
In one possible embodiment, the second storage unit is an SOC chip of the driver, and the method further includes:
when the firmware upgrading is determined to fail, reading the second program from the second storage unit;
writing the second program into the first storage unit to update the first program in the first storage unit to the second program.
In one possible embodiment, the method further comprises:
judging whether the driver works normally or not;
when the driver works normally, the firmware upgrading step is executed;
and when the driver works abnormally, executing the firmware upgrading step after running a firmware upgrading backup program in the Flash chip.
In a second aspect, an embodiment of the present invention provides an upgrade method, including:
acquiring a first version number corresponding to a first firmware program and a second version number corresponding to a second firmware program from external equipment through Ethernet, wherein the second firmware program is stored in a Flash chip of a driver and is the firmware program currently corresponding to the driver;
determining whether the firmware needs to be upgraded according to the first version number and the second version number;
when the firmware is determined to need to be upgraded, acquiring the first firmware program;
and writing the first firmware program into the Flash chip so as to update the second firmware program in the Flash chip into the first firmware program.
In a third aspect, an embodiment of the present invention provides an upgrade apparatus, including:
the acquisition module is used for acquiring a first firmware identifier corresponding to a first program and a second firmware identifier corresponding to a second program, wherein the second program is stored in a first storage unit of the driver, and the second program is a firmware program currently corresponding to the driver;
the determining module is used for determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification;
the obtaining module is further configured to obtain the first program when it is determined that the firmware needs to be upgraded;
and the writing module is used for writing the first program into a first storage unit so as to update a second program in the first storage unit into the first program.
In a fourth aspect, an embodiment of the present invention provides an upgrade apparatus, including:
the acquisition module is used for acquiring a first version number corresponding to a first firmware program and a second version number corresponding to a second firmware program from external equipment through Ethernet, wherein the second firmware program is stored in a Flash chip of the driver, and the second firmware program is a firmware program currently corresponding to the driver;
the determining module is used for determining whether the firmware needs to be upgraded according to the first version number and the second version number;
the obtaining module is further configured to obtain the first firmware program when it is determined that the firmware needs to be upgraded;
and the writing module is used for writing the first firmware program into the Flash chip so as to update the second firmware program in the Flash chip into the first firmware program.
In a fifth aspect, an embodiment of the present invention provides an apparatus, including: a processor and a memory, the processor being configured to execute an upgrade program stored in the memory to implement the upgrade method of any one of the first and second aspects.
In a sixth aspect, an embodiment of the present invention provides a storage medium, where the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the upgrade method described in any one of the first and second aspects.
According to the upgrading scheme provided by the embodiment of the invention, a first firmware identification corresponding to a first program and a second firmware identification corresponding to a second program are obtained, the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver; determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification; when the firmware is determined to need to be upgraded, acquiring the first program; writing the first program into a first storage unit so as to update the second program in the first storage unit to the first program. And the second program stored in advance may be rewritten into the first storage unit when the firmware upgrade fails. The firmware upgrading method can realize that the firmware upgrading program is obtained from the upper computer through the Ethernet and written into the Flash chip of the driver so as to upgrade the firmware, and the original firmware program stored in advance can be rewritten into the Flash chip when the upgrading fails. The upgrading scheme does not need to disassemble the driver, avoids the condition that the driver cannot be used due to errors occurring during upgrading through the debugging interface, and improves the success rate and the efficiency of firmware upgrading.
Drawings
Fig. 1 is a schematic flowchart of an upgrading method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another upgrading method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an upgrading apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another upgrading apparatus provided in the embodiment of the present invention;
fig. 5 is a schematic structural diagram of another upgrading apparatus provided in the embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
For the convenience of understanding of the embodiments of the present invention, the following description will be further explained with reference to specific embodiments, which are not to be construed as limiting the embodiments of the present invention.
Fig. 1 is a schematic flowchart of an upgrading method according to an embodiment of the present invention, and as shown in fig. 1, the method specifically includes:
s11, acquiring a first firmware identification corresponding to the first program and a second firmware identification corresponding to the second program, wherein the second program is stored in a first storage unit of the drive, and the second program is a firmware program currently corresponding to the drive.
The upgrading method provided by the embodiment of the invention is applied to a driver, the driver can be a servo driver, and the driver is upgraded by acquiring a firmware upgrading program from external equipment in a connection mode, wherein the external equipment can be any upper computer, and the firmware upgrading program is stored in the upper computer.
In this embodiment, the first program is a firmware program stored in the external device, the second program is a firmware program currently stored in the drive, and the second program is stored in a first storage unit of the drive, where the first storage unit may be a Flash chip of the drive, the first program is used to upgrade the second program in the drive, the first firmware identifier is an identifier indicating a version of the first program and may include, but is not limited to, a firmware version number of the first program, and the second firmware identifier is an identifier indicating a version of the second program and may include, but is not limited to, a firmware version number of the second program.
Further, the driver is connected to the external device through the ethernet, and acquires a first firmware identifier corresponding to the first program from the external device, and acquires a firmware program currently used by the driver as a second program from a first storage unit of the driver, and acquires a second firmware identifier corresponding to the second program.
S12, determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification.
In this embodiment, a preset rule is preset, where the preset rule may include comparing the first firmware identifier with the second firmware identifier, and determining whether a comparison result meets a preset condition, and when the comparison result meets the preset condition, determining that the firmware needs to be upgraded, and when the comparison result does not meet the preset condition, determining that the firmware does not need to be upgraded.
In an alternative of this embodiment, the first firmware identifier and the second firmware identifier are compared; when the comparison result is that the first firmware identification is the same as the second firmware identification, determining that the firmware does not need to be upgraded; and when the comparison result shows that the first firmware identification is different from the second firmware identification, determining that the firmware needs to be upgraded.
In an alternative of this embodiment, when the first firmware identifier and the second firmware identifier are version numbers of firmware, comparing the first version number with the second version number, and when the comparison result indicates that the firmware version corresponding to the first version number is higher than the firmware version corresponding to the second version number, determining that the firmware needs to be upgraded; and when the comparison result represents that the firmware version corresponding to the first version number is lower than the firmware version corresponding to the second version number, determining that the firmware does not need to be upgraded.
And S13, when the firmware is determined to need upgrading, acquiring the first program.
In this embodiment, when it is determined that the firmware needs to be upgraded, an external device is connected through an ethernet, and a first program is acquired from the external device, where the external device may be an upper computer in which the firmware upgrade program is stored.
S14, writing the first program into the first storage unit, so that the second program in the first storage unit is updated to the first program.
In this embodiment, a first program is written into a first storage unit of a driver, where the first storage unit may be a Flash chip, and a second program in the first storage unit is replaced or overwritten by the first program, so that the second program in the first storage unit is upgraded to the first program.
For example, the upper computer is connected with the driver, the upper computer can also read the version number of a first program in a file to be burned, the version number of a second program read by the driver in the Flash chip is read, the two version numbers are compared, the program is not burned if the two version numbers are the same, the firmware of the driver is determined to be upgraded if the two version numbers are different, the first program in the upper computer is obtained through the TFTP protocol of the Ethernet, the first program is written into the Flash chip, so that the second program in the Flash chip is replaced by the first program, and the upgrading of the firmware is realized.
According to the upgrading method provided by the embodiment of the invention, a first firmware identification corresponding to a first program and a second firmware identification corresponding to a second program are obtained, the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver; determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification; when the firmware is determined to need to be upgraded, acquiring the first program; writing the first program into the first storage unit to update the second program in the first storage unit to the first program. The firmware upgrading can be carried out without disassembling the driver, and the success rate and the efficiency of the firmware upgrading are improved.
Fig. 2 is a schematic flowchart of another upgrading method according to an embodiment of the present invention.
In this embodiment, the external device is an upper computer, the first program and the second program are firmware programs, the first firmware identifier and the second firmware identifier are version numbers of firmware, the first storage unit is a Flash chip in a drive, and the second storage unit is a cache area of an SOC chip in the drive.
The upper computer is responsible for storing a firmware upgrading program, performs network communication with the driver through the Ethernet, and reads the version number of the program in the driver. The Flash chip stores the operating program of the driver, including the FPGA program, the CPU0 kernel program of the ARM, the CPU1 kernel program, the Preloader program, and the like, and is also the storage area of the firmware program file in the firmware upgrade transmission process, that is, the storage area of the firmware program corresponding to the driver at present. The SOC chip is the core of the operation of the driver, comprises an FPGA, an ARM, a CPU1 and a CUP0 and is responsible for reading and operating programs in Flash; and a cache area is reserved in the upgrading process for storing programs in Flash.
As shown in fig. 2, the method specifically includes:
s21, acquiring a first version number corresponding to a first firmware program from the upper computer through the Ethernet and acquiring a second version number corresponding to a second firmware program, wherein the second firmware program is stored in a Flash chip of the driver, and the second firmware program is a firmware program corresponding to the driver at present.
In this embodiment, the first firmware program is a program for upgrading a firmware of the drive, the first version number is used to indicate a version of the first firmware program, the second firmware program is a program to be upgraded and currently stored in the drive, and the second version number is used to indicate a version of the second firmware program.
Furthermore, the driver is connected with the upper computer through the Ethernet, a first version number corresponding to the first firmware program is obtained from the upper computer, a firmware program currently used by the driver is obtained from a Flash chip of the driver and is used as a second firmware program, and a second version number corresponding to the second firmware program is obtained.
And S22, determining whether the firmware needs to be upgraded according to the first version number and the second version number.
In this embodiment, a preset rule and a preset condition are preset, where the preset rule may include comparing the first version number with the second version number, and determining whether the comparison result meets the preset condition, when the preset condition is met, it is determined that the firmware needs to be upgraded, and when the preset condition is not met, it is determined that the firmware does not need to be upgraded, and the preset condition may include: whether the first version number and the second version number are the same.
Specifically, the first version number is compared with the second version number; obtaining a comparison result, and determining that the firmware does not need to be upgraded when the comparison result is that the first version number is the same as the second version number; and when the comparison result shows that the first version number is different from the second version number, determining that the firmware needs to be upgraded.
In an alternative of this embodiment, the first version number is compared with the second version number, and when the comparison result indicates that the firmware version corresponding to the first version number is higher than the firmware version corresponding to the second version number, it is determined that the firmware needs to be upgraded; and when the comparison result represents that the firmware version corresponding to the first version number is lower than the firmware version corresponding to the second version number, determining that the firmware does not need to be upgraded.
S23, when the firmware is determined to need to be upgraded, reading the second firmware program from a Flash chip; and writing the second firmware program into a cache region of the SOC chip.
In this embodiment, when it is determined that the firmware needs to be upgraded, the upper computer sends a write request to the driver through a TFTP protocol of the ethernet; the driver is a server side, the upper computer is a client side, information transmission is carried out through the No. 69 port, the TFTP server side of the driver monitors the No. 69 port, the TFTP client side of the upper computer sends a writing request, after the server side receives the writing request, the driver analyzes an instruction, the second firmware program is read from the Flash chip and stored in a cache region of the SOC chip, and therefore the second firmware program can be backed up.
And S24, acquiring the first firmware program.
In this embodiment, after the second firmware program is saved in the buffer of the SOC chip, the driver will respond to the upper computer after being prepared, and the responding method includes: the driver sends an instruction to the upper computer to indicate that the backup process of the second firmware program is completed. And after the upper computer receives the response, the upper computer starts to transmit the firmware program so that the driver acquires the first firmware program from the upper computer through the Ethernet.
S25, writing the first firmware program into the Flash chip so as to update the second firmware program in the Flash chip into the first firmware program.
In this embodiment, the driver receives the first firmware program and directly writes the first firmware program into the Flash chip, and this process continues until all firmware program transmission is completed, so as to replace or cover the second firmware program in the Flash chip by the first firmware program, so that the second firmware program in the Flash chip is updated to the first firmware program, thereby implementing firmware programming update operation.
S26, acquiring a first check code corresponding to the first firmware program from an upper computer; and judging whether the first check code is the same as a second check code in the first program.
In this embodiment, after the update operation is completed, the driver checks the first firmware program in the Flash chip and compares the first firmware program with the check code sent by the upper computer, and the comparison method includes: the first check code and the second check code are CRC32 bit check, the second check code is a check code obtained by a driver through CRC32 check on a first firmware program after the programming of the first firmware program is finished, the first check code is obtained by sending the CRC32 check code of the first firmware program to the driver through an upper computer after the transmission of the first firmware program is finished, the two check codes are compared, whether the two check codes are consistent or not is judged according to a comparison result, and if the two check codes are consistent, the upgrading is successful.
Specifically, a first check code is obtained from an upper computer, a second check code is obtained from a first firmware program, the first check code is the same as the second check code, it is determined that the firmware is successfully upgraded, and when the first check code is different from the second check code, it is determined that the firmware is unsuccessfully upgraded.
S27, when the first check code is different from the second check code, determining that the firmware upgrading fails, and reading the second firmware program from a cache region of the SOC chip; and writing the second firmware program into the Flash chip so as to update the first firmware program in the Flash chip into the second firmware program.
In this embodiment, when it is determined that the firmware upgrade fails, the driver reads the second firmware program from the cache area of the SOC chip, and writes the second firmware program into the Flash chip again, so as to replace or overwrite the first firmware program with the second firmware program, so that the first firmware program in the Flash chip is updated to the second firmware program, thereby ensuring that the driver can operate normally.
In an alternative of this embodiment, before the driver performs the firmware upgrading steps of S21-S27, it is determined whether the driver is operating normally; when the driver works normally, the firmware upgrading step is executed; and when the driver works abnormally, executing the firmware upgrading step after running a firmware upgrading backup program in the Flash chip.
The method for judging whether the driver works normally comprises the following steps: the method comprises the steps that a driver is powered on, a system is reset, a preloader program in a Flash chip is loaded and executed, an FPGA program in the Flash chip is loaded and checked, whether a check code is normal or not is judged, if the check code is abnormal, the driver is judged to be abnormal in work, if the check code is normal, an ARM program in the Flash chip is loaded and checked, whether the check code is normal or not is judged, if the check code is abnormal, the driver is judged to be abnormal in work, if the check code is normal, the driver is judged to be normal in work, and at the moment, the driver which is normally operated executes a firmware upgrading step; and when the driver does not work normally, executing the firmware upgrading step after operating a firmware upgrading backup program prestored in Flash. So as to realize whether the driver works normally or not, and the firmware can be upgraded.
According to the upgrading method provided by the embodiment of the invention, a first version number corresponding to a first firmware program and a second version number corresponding to a second firmware program are obtained from external equipment through Ethernet, the second firmware program is stored in a Flash chip of a driver, and the second firmware program is a firmware program currently corresponding to the driver; determining whether the firmware needs to be upgraded according to the first version number and the second version number; when the firmware is determined to need to be upgraded, acquiring the first firmware program; and writing the first firmware program into the Flash chip so as to update the second firmware program in the Flash chip into the first firmware program. And the second firmware program stored in advance can be rewritten into the first storage unit when the firmware upgrade fails. The firmware upgrading method can realize that the firmware upgrading program is obtained from the upper computer through the Ethernet and written into the Flash chip of the driver so as to upgrade the firmware, and the original firmware program stored in advance can be rewritten into the Flash chip when the upgrading fails. The scheme can upgrade the firmware when the driver works normally, the upgrading scheme does not need to disassemble the driver, the situation that the driver cannot be used due to errors when the driver is upgraded through a debugging interface is avoided, and the success rate and the efficiency of upgrading the firmware are improved.
Fig. 3 is a schematic structural diagram of an upgrading apparatus according to an embodiment of the present invention, and as shown in fig. 3, the apparatus specifically includes:
an obtaining module 31, configured to obtain a first firmware identifier corresponding to a first program and a second firmware identifier corresponding to a second program, where the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver;
a determining module 32, configured to determine whether the firmware needs to be upgraded according to the first firmware identifier and the second firmware identifier;
the obtaining module 31 is further configured to obtain the first program when it is determined that the firmware needs to be upgraded;
a writing module 33, configured to write the first program into the first storage unit, so that the second program in the first storage unit is updated to the first program.
In a possible implementation, the obtaining module 31 is specifically configured to read the second program from the first storage unit;
the writing module 33 is specifically configured to write the second program into a second storage unit.
In a possible embodiment, the obtaining module 31 is specifically configured to obtain, through an ethernet, a first firmware identifier corresponding to a first program from an external device, and obtain, from a Flash chip of a drive, a second firmware identifier corresponding to a second program.
In a possible embodiment, the determining module 32 is specifically configured to compare the first firmware identifier with the second firmware identifier; obtaining a comparison result;
when the comparison result is that the first firmware identification and the second firmware identification are the same, determining that the firmware does not need to be upgraded;
and when the comparison result shows that the first firmware identification is different from the second firmware identification, determining that the firmware needs to be upgraded.
In a possible embodiment, the obtaining module 31 is specifically configured to obtain a first check code corresponding to the first program from the external device;
the determining module 32 is specifically configured to determine whether the first check code is the same as a second check code in the first program;
when the first check code is the same as the second check code, determining that the firmware is successfully upgraded;
and when the first check code is different from the second check code, determining that the firmware upgrading fails.
In a possible implementation manner, the obtaining module 31 is specifically configured to read the second program from the second storage unit when it is determined that the firmware upgrade fails;
the writing module 33 is specifically configured to write the second program into the first storage unit, so that the first program in the first storage unit is updated to the second program.
In a possible embodiment, the determining module 32 is specifically configured to determine whether the driver is working normally;
when the driver works normally, the firmware upgrading step is executed;
and when the driver works abnormally, executing the firmware upgrading step after running a firmware upgrading backup program in the Flash chip.
The upgrade apparatus provided in this embodiment may be an apparatus as shown in fig. 3, and may perform all the steps of the upgrade method as shown in fig. 3, so as to achieve the technical effects of the upgrade method shown in fig. 1 and 2, and for brevity, it is not described herein again.
Fig. 4 is a schematic structural diagram of another upgrading apparatus provided in an embodiment of the present invention, and as shown in fig. 4, the apparatus specifically includes:
an obtaining module 41, configured to obtain, from an external device through an ethernet, a first version number corresponding to a first firmware program and a second version number corresponding to a second firmware program, where the second firmware program is stored in a Flash chip of a driver, and the second firmware program is a firmware program currently corresponding to the driver;
a determining module 42, configured to determine whether the firmware needs to be upgraded according to the first version number and the second version number;
the obtaining module 41 is further configured to obtain the first firmware program when it is determined that the firmware needs to be upgraded;
a writing module 43, configured to write the first firmware program into the Flash chip, so that the second firmware program in the Flash chip is updated to the first firmware program.
The upgrade apparatus provided in this embodiment may be the apparatus shown in fig. 4, and may perform all the steps of the upgrade method shown in fig. 4, so as to achieve the technical effect of the upgrade method shown in fig. 2.
Fig. 5 is a schematic structural diagram of another upgrading apparatus provided in an embodiment of the present invention, as shown in fig. 5:
in this embodiment, the external device is an upper computer, the upper computer is responsible for storing a firmware upgrade program, and is connected to the driver through an ethernet, the driver includes an SOC chip and a Flash chip, the second storage unit is an SOC chip, which is a core of the driver operation, and includes an FPGA, an ARM, a CPU1, and a CPU0, which are responsible for reading and operating programs in the Flash, the first storage unit is a Flash chip in the driver, and the operating programs of the driver, which include an FPGA program, a CPU0 kernel of the ARM, a CPU1 kernel, a Preloader program, and the like, are stored in the Flash chip, and are also storage areas of firmware program files in the firmware upgrade transmission process, that is, storage areas of the firmware programs currently corresponding to the driver. The Flash chip stores the operating program of the driver, including the FPGA program, the CPU0 kernel program of the ARM, the CPU1 kernel program, the Preloader program, and the like, and is also the storage area of the firmware program file in the firmware upgrade transmission process, that is, the storage area of the firmware program corresponding to the driver at present.
Fig. 6 is a schematic structural diagram of an apparatus according to an embodiment of the present invention, where the apparatus 600 shown in fig. 6 includes: at least one processor 601, memory 602, at least one network interface 604, and other user interfaces 603. The various components in the device 600 are coupled together by a bus system 605. It is understood that the bus system 605 is used to enable communications among the components. The bus system 605 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 605 in fig. 5.
The user interface 603 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, trackball, touch pad, or touch screen, among others.
It will be appreciated that the memory 602 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (ddr Data Rate SDRAM, ddr SDRAM), Enhanced Synchronous SDRAM (ESDRAM), synchlronous SDRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 602 described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an expanded set thereof: an operating system 6021 and application programs 6022.
The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application program 6022 includes various application programs such as a Media Player (Media Player), a Browser (Browser), and the like, and is used to implement various application services. A program implementing the method of an embodiment of the invention can be included in the application program 6022.
In the embodiment of the present invention, by calling a program or an instruction stored in the memory 602, specifically, a program or an instruction stored in the application program 6022, the processor 601 is configured to execute the method steps provided by the method embodiments, for example, including:
acquiring a first firmware identification corresponding to a first program and a second firmware identification corresponding to a second program, wherein the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver;
determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification;
when the firmware is determined to need to be upgraded, acquiring the first program;
writing the first program into the first storage unit to update the second program in the first storage unit to the first program.
In one possible embodiment, the second program is read from the first storage unit;
and writing the second program into a second storage unit.
In a possible embodiment, a first firmware identifier corresponding to a first program is obtained from an external device through an ethernet, and a second firmware identifier corresponding to a second program is obtained from a Flash chip of a driver.
In one possible embodiment, the first firmware identifier and the second firmware identifier are compared; obtaining a comparison result;
when the comparison result is that the first firmware identification and the second firmware identification are the same, determining that the firmware does not need to be upgraded;
and when the comparison result shows that the first firmware identification is different from the second firmware identification, determining that the firmware needs to be upgraded.
In a possible implementation manner, a first check code corresponding to the first program is acquired from the external device;
judging whether the first check code is the same as a second check code in the first program;
when the first check code is the same as the second check code, determining that the firmware is successfully upgraded;
and when the first check code is different from the second check code, determining that the firmware upgrading fails.
In a possible implementation manner, the second storage unit is an SOC chip of the driver, and when it is determined that the firmware upgrade fails, the second program is read from the second storage unit;
writing the second program into the first storage unit to update the first program in the first storage unit to the second program.
In one possible embodiment, determining whether the driver is operating properly;
when the driver works normally, the firmware upgrading step is executed;
and when the driver works abnormally, executing the firmware upgrading step after running a firmware upgrading backup program in the Flash chip.
In one possible implementation, a first version number corresponding to a first firmware program and a second version number corresponding to a second firmware program are obtained from an external device through an ethernet, the second firmware program is stored in a Flash chip of a driver, and the second firmware program is a firmware program currently corresponding to the driver;
determining whether the firmware needs to be upgraded according to the first version number and the second version number;
when the firmware is determined to need to be upgraded, acquiring the first firmware program;
and writing the first firmware program into the Flash chip so as to update the second firmware program in the Flash chip into the first firmware program.
The method disclosed by the above-mentioned embodiment of the present invention can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 601. The Processor 601 may be a general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software elements in the decoding processor. The software elements may be located in ram, flash, rom, prom, or eprom, registers, among other storage media that are well known in the art. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the method in combination with the hardware thereof.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The device provided in this embodiment may be the device shown in fig. 6, and may perform all the steps of the upgrading method shown in fig. 1 and fig. 2, so as to achieve the technical effect of the upgrading method shown in fig. 1 and fig. 2, and for brevity, it is described with reference to fig. 1 and fig. 2, which is not described herein again.
The embodiment of the invention also provides a storage medium (computer readable storage medium). The storage medium herein stores one or more programs. Among others, the storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk; the memory may also comprise a combination of memories of the kind described above.
When one or more programs in the storage medium are executable by one or more processors to implement the above-described upgrade method performed on the device side.
The processor is used for executing the upgrading program stored in the memory so as to realize the following steps of the upgrading method executed by the equipment side:
acquiring a first firmware identification corresponding to a first program and a second firmware identification corresponding to a second program, wherein the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver;
determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification;
when the firmware is determined to need to be upgraded, acquiring the first program;
writing the first program into the first storage unit to update the second program in the first storage unit to the first program.
In one possible embodiment, the second program is read from the first storage unit;
and writing the second program into a second storage unit.
In a possible embodiment, a first firmware identifier corresponding to a first program is obtained from an external device through an ethernet, and a second firmware identifier corresponding to a second program is obtained from a Flash chip of a driver.
In one possible embodiment, the first firmware identifier and the second firmware identifier are compared; obtaining a comparison result;
when the comparison result is that the first firmware identification and the second firmware identification are the same, determining that the firmware does not need to be upgraded;
and when the comparison result shows that the first firmware identification is different from the second firmware identification, determining that the firmware needs to be upgraded.
In a possible implementation manner, a first check code corresponding to the first program is acquired from the external device;
judging whether the first check code is the same as a second check code in the first program;
when the first check code is the same as the second check code, determining that the firmware is successfully upgraded;
and when the first check code is different from the second check code, determining that the firmware upgrading fails.
In a possible implementation manner, the second storage unit is an SOC chip of the driver, and when it is determined that the firmware upgrade fails, the second program is read from the second storage unit;
writing the second program into the first storage unit to update the first program in the first storage unit to the second program.
In one possible embodiment, determining whether the driver is operating properly;
when the driver works normally, the firmware upgrading step is executed;
and when the driver works abnormally, executing the firmware upgrading step after running a firmware upgrading backup program in the Flash chip.
In one possible implementation, a first version number corresponding to a first firmware program and a second version number corresponding to a second firmware program are obtained from an external device through an ethernet, the second firmware program is stored in a Flash chip of a driver, and the second firmware program is a firmware program currently corresponding to the driver;
determining whether the firmware needs to be upgraded according to the first version number and the second version number;
when the firmware is determined to need to be upgraded, acquiring the first firmware program;
and writing the first firmware program into the Flash chip so as to update the second firmware program in the Flash chip into the first firmware program.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, a software module executed by a processor, or a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (12)

1. An upgrade method, comprising:
acquiring a first firmware identification corresponding to a first program and a second firmware identification corresponding to a second program, wherein the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver;
determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification;
when the firmware is determined to need to be upgraded, acquiring the first program;
writing the first program into the first storage unit to update the second program in the first storage unit to the first program.
2. The method of claim 1, wherein prior to said obtaining the first program, the method further comprises:
reading the second program from the first storage unit;
and writing the second program into a second storage unit.
3. The method of claim 1, wherein obtaining a first firmware id corresponding to the first program and a second firmware id corresponding to the second program comprises:
the first storage unit is a Flash chip;
and acquiring a first firmware identifier corresponding to the first program from external equipment through Ethernet, and acquiring a second firmware identifier corresponding to the second program from the Flash chip.
4. The method of claim 1, wherein the determining whether the firmware needs to be upgraded according to the first firmware identifier and the second firmware identifier comprises:
comparing the first firmware identification with the second firmware identification to obtain a comparison result;
when the comparison result is that the first firmware identification and the second firmware identification are the same, determining that the firmware does not need to be upgraded;
and when the comparison result shows that the first firmware identification is different from the second firmware identification, determining that the firmware needs to be upgraded.
5. The method according to claim 3, after writing the first program to the first storage unit to update the second program in the first storage unit to the first program, the method further comprising:
acquiring a first check code corresponding to the first program from the external equipment;
judging whether the first check code is the same as a second check code in the first program;
when the first check code is the same as the second check code, determining that the firmware is successfully upgraded;
and when the first check code is different from the second check code, determining that the firmware upgrading fails.
6. The method of claim 2 or 5, wherein the second storage unit is an SOC chip of the driver, the method further comprising:
when the firmware upgrading is determined to fail, reading the second program from the second storage unit;
writing the second program into the first storage unit to update the first program in the first storage unit to the second program.
7. The method of claim 1, further comprising:
judging whether the driver works normally or not;
when the driver works normally, the firmware upgrading step is executed;
and when the driver works abnormally, executing the firmware upgrading step after running a firmware upgrading backup program in the Flash chip.
8. An upgrade method, comprising:
acquiring a first version number corresponding to a first firmware program and a second version number corresponding to a second firmware program from external equipment through Ethernet, wherein the second firmware program is stored in a Flash chip of a driver and is the firmware program currently corresponding to the driver;
determining whether the firmware needs to be upgraded according to the first version number and the second version number;
when the firmware is determined to need to be upgraded, acquiring the first firmware program;
and writing the first firmware program into the Flash chip so as to update the second firmware program in the Flash chip into the first firmware program.
9. An upgrade apparatus, comprising:
the device comprises an acquisition module, a storage module and a control module, wherein the acquisition module is used for acquiring a first firmware identifier corresponding to a first program and a second firmware identifier corresponding to a second program, the second program is stored in a first storage unit of a driver, and the second program is a firmware program currently corresponding to the driver;
the determining module is used for determining whether the firmware needs to be upgraded according to the first firmware identification and the second firmware identification;
the obtaining module is further configured to obtain the first program when it is determined that the firmware needs to be upgraded;
and the writing module is used for writing the first program into the first storage unit so as to update the second program in the first storage unit into the first program.
10. An upgrade apparatus, comprising:
the device comprises an acquisition module, a storage module and a control module, wherein the acquisition module is used for acquiring a first version number corresponding to a first firmware program and a second version number corresponding to a second firmware program from external equipment through Ethernet, the second firmware program is stored in a Flash chip of a driver, and the second firmware program is a firmware program currently corresponding to the driver;
the determining module is used for determining whether the firmware needs to be upgraded according to the first version number and the second version number;
the obtaining module is further configured to obtain the first firmware program when it is determined that the firmware needs to be upgraded;
and the writing module is used for writing the first firmware program into the Flash chip so as to update the second firmware program in the Flash chip into the first firmware program.
11. An apparatus, comprising: a processor and a memory, the processor being configured to execute an upgrade program stored in the memory to implement the upgrade method of any one of claims 1-8.
12. A storage medium storing one or more programs executable by one or more processors to implement the upgrade method according to any one of claims 1 to 8.
CN202111310907.4A 2021-11-05 2021-11-05 Upgrading method, device, equipment and storage medium Pending CN114035813A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111310907.4A CN114035813A (en) 2021-11-05 2021-11-05 Upgrading method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111310907.4A CN114035813A (en) 2021-11-05 2021-11-05 Upgrading method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114035813A true CN114035813A (en) 2022-02-11

Family

ID=80136619

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111310907.4A Pending CN114035813A (en) 2021-11-05 2021-11-05 Upgrading method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114035813A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117348909A (en) * 2023-12-04 2024-01-05 成都佰维存储科技有限公司 eMMC upgrading method, chip, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117348909A (en) * 2023-12-04 2024-01-05 成都佰维存储科技有限公司 eMMC upgrading method, chip, equipment and storage medium
CN117348909B (en) * 2023-12-04 2024-02-27 成都佰维存储科技有限公司 eMMC upgrading method, chip, equipment and storage medium

Similar Documents

Publication Publication Date Title
JP4668416B2 (en) Protecting boot block code when enabling write access to the boot block
CN110032405B (en) System boot code memory management method, memory device and electronic system using same
US6993642B2 (en) Method and system for creating and employing an operating system having selected functionality
EP1854006B1 (en) Method and system for preserving dump data upon a crash of the operating system
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
US20200250313A1 (en) Bios recovery and update
US20100058314A1 (en) Computer System and Related Method of Logging BIOS Update Operation
US20060236150A1 (en) Timer-based apparatus and method for fault-tolerant booting of a storage controller
US20070055969A1 (en) System and method for updating firmware
CN101329631B (en) Method and apparatus for automatically detecting and recovering start-up of embedded system
CN111258666B (en) Method and device for reading computer file, computer system and storage medium
US20190278508A1 (en) Information Handling System Firmware Persistent Memory Runtime Reclaim
JP2019139373A (en) Information processing system and information processor and bios update method of information processor and bios update program of information processor
CN117130672A (en) Server start flow control method, system, terminal and storage medium
WO2015184732A1 (en) Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium
CN114035813A (en) Upgrading method, device, equipment and storage medium
CN113094107B (en) Data protection method, device, equipment and computer storage medium
KR20020007090A (en) Method and system for booting recovery a computer
CN111857882A (en) Extensible SSD (solid State disk) firmware loading method and device, computer equipment and storage medium
KR100299119B1 (en) PC possessing apparatus for controlling flash ROM
US20220413962A1 (en) Detecting and recovering a corrupted non-volatile random-access memory
JP4735765B2 (en) Linux program startup system
CN111258617B (en) Electronic equipment
CN111159123B (en) Embedded reliable parameter storage file system and method
CN114265603A (en) System upgrading method and device based on asymmetric partition and electronic equipment

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