CN115359828A - Server firmware refreshing method, device, terminal and storage medium - Google Patents

Server firmware refreshing method, device, terminal and storage medium Download PDF

Info

Publication number
CN115359828A
CN115359828A CN202211035432.7A CN202211035432A CN115359828A CN 115359828 A CN115359828 A CN 115359828A CN 202211035432 A CN202211035432 A CN 202211035432A CN 115359828 A CN115359828 A CN 115359828A
Authority
CN
China
Prior art keywords
firmware
refreshed
page
sectors
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
CN202211035432.7A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211035432.7A priority Critical patent/CN115359828A/en
Publication of CN115359828A publication Critical patent/CN115359828A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/10Programming or data input circuits
    • G11C16/107Programming all cells in an array, sector or block to the same state prior to flash erasing

Landscapes

  • Read Only Memory (AREA)

Abstract

The invention relates to the field of firmware refreshing, and particularly discloses a server firmware refreshing method, a device, a terminal and a storage medium, wherein S1, a firmware to be refreshed and a current firmware are respectively divided into N sectors in the same way; s2, comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording the sectors as sectors to be refreshed; and S3, performing flash on the sector to be flashed. The invention utilizes the characteristic that the time for reading the code information is much faster than the time for writing, obtains the difference point between the firmware information to be refreshed and the existing firmware information in the Flash chip by comparing the firmware information to be refreshed and the existing firmware information in the Flash chip, and then only writes in the difference part, thereby avoiding the repeated writing in of the same code part, effectively reducing the time of the FW (Flash firmware) flashing process and improving the FW flashing efficiency.

Description

Server firmware refreshing method, device, terminal and storage medium
Technical Field
The invention relates to the field of firmware refreshing, in particular to a server firmware refreshing method, device, terminal and storage medium.
Background
Interaction and communication between the Flash chip of the server firmware and other hardware units such as a CPU on the mainboard need to be supported by an FW interface program. For the refreshing of the Flash chip of the server firmware, the currently adopted mode is to read the FW (firmware) file to be refreshed firstly, then erase the current whole FW in the Flash chip, and finally write the read FW file to be refreshed into the Flash chip. The FW file is generally divided into sectors, each Sector is composed of pages, and the current process of writing the FW file into the Flash chip is to write each Page of each Sector in the FW file into the Flash chip to refresh Flash.
In the development and debugging process, the debugging of the server firmware is very complicated, the Flash chip needs to be continuously refreshed, the FW file of the current Flash chip is generally large, the checking mechanisms are more, each Page of each Sector in the FW file is refreshed into the Flash chip, the time for the whole process is longer, the code change is smaller, and when the FW file needs to be frequently refreshed into the Flash chip to debug bit by bit, the current refreshing process is particularly complicated and time-consuming.
Disclosure of Invention
In order to solve the problems, the invention provides a server firmware refreshing method, a device, a terminal and a storage medium, which utilize the characteristic that the time for reading code information is much faster than the time for writing in, obtain difference points of the firmware information to be refreshed and the existing firmware information in a Flash chip by comparing the firmware information to be refreshed and the existing firmware information in the Flash chip, and then write in only the difference part, thereby greatly improving the server firmware refreshing efficiency.
In a first aspect, a technical solution of the present invention provides a method for refreshing a server firmware, including the following steps:
s1, dividing a firmware to be refreshed and a current firmware into N sectors respectively according to the same mode;
s2, comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording the sectors as sectors to be refreshed;
and S3, performing flash on the sector to be flashed.
Further, after dividing the firmware to be refreshed and the current firmware into N sectors in step S1, dividing each sector of the firmware to be refreshed into M pages, and dividing each sector of the current firmware into M pages, respectively, in the same manner;
correspondingly, the step S3 is to flash the sector to be flashed, and specifically includes:
s3-1, comparing M pages of the sector to be refreshed one by one, finding out pages with different information, and recording as pages to be refreshed;
and S3-2, performing flashing on the page to be flashed.
Further, the step S3-2 is to perform the flash on the page to be flashed, and specifically includes:
s3-21, judging whether the page to be refreshed of the current firmware is empty;
s3-22, if the firmware is empty, directly flashing information of the corresponding page to be flashed of the firmware to be refreshed to the page to be flashed of the current firmware;
and S3-23, if the firmware is not empty, erasing the page to be refreshed of the current firmware, and after the erasing is successful, refreshing the information of the page to be refreshed corresponding to the firmware to be refreshed to the page to be refreshed of the current firmware.
Further, the step S3-23 specifically includes:
s3-231, erasing the page to be flashed of the current firmware;
s3-232, judging whether the page to be flashed of the current firmware is erased completely;
s3-233, if the firmware is erased completely, the information of the corresponding page to be refreshed of the firmware to be refreshed is refreshed on the page to be refreshed of the current firmware;
s3-234, if the data are not erased completely, judging whether the erased times reach a threshold value;
s3-235, if not, returning to the step S3-231; and if so, sending an abnormal alarm of the memory chip.
Further, in step S1, the firmware to be refreshed and the current firmware are converted into hexadecimal code information, and the hexadecimal code information is divided into N sectors.
Further, whether the page to be refreshed is empty or whether the page to be refreshed is completely erased specifically includes: and judging whether the hexadecimal code information of the page to be refreshed is totally FF, if so, the page to be refreshed is empty or erased completely.
In a second aspect, an aspect of the present invention provides a server firmware refreshing apparatus, including,
a zone page dividing module: respectively dividing the firmware to be refreshed and the current firmware into N sectors in the same way;
a sector comparison module: comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and marking as sectors to be refreshed;
a flash module: and performing flash on the sector to be flashed.
Furthermore, after the sector page dividing module divides the firmware to be refreshed and the current firmware into N sectors, each sector of the firmware to be refreshed is divided into M pages respectively according to the same mode, and each sector of the current firmware is divided into M pages respectively;
correspondingly, the device also comprises a control device,
a page comparison module: comparing M pages of the sector to be refreshed one by one, finding out pages with different information, and recording as pages to be refreshed;
correspondingly, the flashing module is used for flashing the sector to be flashed, specifically for flashing the page to be flashed, and specifically comprises:
judging whether a page to be refreshed of the current firmware is empty or not;
if the firmware is empty, directly flashing information of the corresponding page to be flashed of the firmware to be refreshed to the page to be flashed of the current firmware;
if not, erasing the page to be refreshed of the current firmware, and after the erasing is successful, refreshing the information of the page to be refreshed of the firmware to be refreshed to the page to be refreshed of the current firmware;
when the page to be refreshed of the current firmware is not empty, the refreshing module specifically executes the following process:
erasing a page to be flashed of the current firmware;
judging whether a page to be refreshed of the current firmware is erased completely;
if the firmware is erased completely, the information of the corresponding page to be refreshed of the firmware to be refreshed is refreshed on the page to be refreshed of the current firmware;
if the data is not erased completely, judging whether the erased times reach a threshold value;
if not, erasing the page to be refreshed of the current firmware again; and if so, sending an abnormal alarm of the memory chip.
In a third aspect, a technical solution of the present invention provides a terminal, including:
a memory for storing a server firmware refresh program;
a processor, configured to implement the steps of the server firmware refreshing method according to any one of the above descriptions when executing the server firmware refreshing program.
In a fourth aspect, an aspect of the present invention provides a computer-readable storage medium, where a server firmware refreshing program is stored on the computer-readable storage medium, and when executed by a processor, the server firmware refreshing program implements the steps of the server firmware refreshing method according to any one of the above.
Compared with the prior art, the method, the device, the terminal and the storage medium for refreshing the server firmware have the following beneficial effects: by utilizing the characteristic that the time for reading the code information is much faster than the time for writing, the difference point between the firmware information to be refreshed and the existing firmware information in the Flash chip is obtained by comparing the firmware information to be refreshed and the existing firmware information in the Flash chip, and then only the difference part is written, so that the repeated writing of the same code part is avoided, the time of the FW (Flash firmware) flashing process is effectively reduced, and the FW flashing efficiency is improved.
Drawings
For a clearer explanation of the embodiments or technical solutions of the prior art of the present application, the drawings needed for the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for refreshing server firmware according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a server firmware refreshing method according to an embodiment of the present invention.
Fig. 3 is a schematic flowchart of a method for refreshing firmware of a server according to an embodiment of the present invention.
Fig. 4 is a flowchart illustrating a server firmware refreshing method according to an embodiment of the present invention.
Fig. 5 is a block diagram illustrating a structure of a server firmware refreshing apparatus according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings. It should be apparent that the described embodiments are only a few embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The core of the invention is to provide a server firmware refreshing method, which compares the difference points of the firmware to be refreshed and the current firmware, and only refreshes the difference part instead of refreshing each page of each sector, thereby greatly saving the refreshing time of the firmware in a Flash chip and improving the firmware refreshing efficiency.
Fig. 1 is a flowchart illustrating a server firmware refreshing method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps.
S1, dividing a firmware to be refreshed and a current firmware into N sectors respectively according to the same mode;
s2, comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording the sectors as sectors to be refreshed;
and S3, performing flash on the sector to be flashed.
Firstly, dividing the firmware to be refreshed and the current firmware into sectors which are divided in the same mode, wherein the number of the sectors is the same, then comparing the firmware information by taking the sectors as a unit, comparing the first sector of the firmware to be refreshed with the first sector of the current firmware, and so on, finding out the sectors with inconsistent information, indicating that the information in the sectors is changed and needs to be refreshed, and finally, refreshing the sectors to be refreshed, namely refreshing the information in the sectors to be refreshed in the firmware to be refreshed in the sectors to be refreshed corresponding to the sectors to be refreshed.
Before the sectors are divided into the firmware, the firmware to be refreshed and the current firmware are converted into hexadecimal code information, and the sectors are divided into N sectors based on the hexadecimal code information so as to facilitate information comparison.
According to the method for refreshing the firmware of the server, provided by the embodiment of the invention, by utilizing the characteristic that the time for reading the code information is much faster than the time for writing, the difference point between the firmware information to be refreshed and the existing firmware information in a Flash chip is obtained by comparing the firmware information to be refreshed and the existing firmware information in the Flash chip, and then only the difference part is written, so that the repeated writing of the same code part is avoided, the time of an FW (firmware) flashing process is effectively reduced, and the FW flashing efficiency is improved.
Fig. 2 is a flowchart illustrating a method for refreshing server firmware according to an embodiment of the present invention, as shown in fig. 2, the method includes the following steps.
S1, respectively dividing the firmware to be refreshed and the current firmware into N sectors in the same mode.
And S2, dividing each sector of the firmware to be refreshed into M pages respectively according to the same mode, and dividing each sector of the current firmware into M pages respectively.
And S3, comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording the sectors as sectors to be refreshed.
And S4, comparing the M pages of the sector to be refreshed one by one, finding out pages with different information, and recording as the pages to be refreshed.
And S5, performing flash on the page to be flashed.
In the embodiment, the efficiency is higher when the flash is performed in the unit of page than when the flash is performed in the unit of sector. The sector with updated information is found out firstly, a plurality of pages are arranged in the current sector, the information of each page is not updated, then the page with updated information is found out and recorded as the page to be refreshed, and only the page to be refreshed is refreshed, so that the updating of the firmware can be ensured, and the updating efficiency is improved.
Before the sectors are divided into the firmware, the firmware to be refreshed and the current firmware are converted into hexadecimal code information, the sectors are divided into N sectors based on the hexadecimal code information, and then each sector is divided into a plurality of pages based on the hexadecimal code information, so that information comparison is facilitated.
According to the method for refreshing the firmware of the server, provided by the embodiment of the invention, by utilizing the characteristic that the time for reading the code information is much faster than the time for writing, the difference point between the firmware information to be refreshed and the existing firmware information in a Flash chip is obtained by comparing the firmware information to be refreshed and the existing firmware information in the Flash chip, and then only the difference part is written, so that the repeated writing of the same code part is avoided, the time of an FW (firmware) flashing process is effectively reduced, and the FW flashing efficiency is improved.
Fig. 3 is a schematic flowchart of a server firmware refreshing method according to an embodiment of the present invention, and as shown in fig. 3, the method includes the following steps.
S1, respectively dividing the firmware to be refreshed and the current firmware into N sectors in the same mode.
And S2, dividing each sector of the firmware to be refreshed into M pages respectively according to the same mode, and dividing each sector of the current firmware into M pages respectively.
S3, comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording as sectors to be refreshed.
And S4, comparing the M pages of the sector to be refreshed one by one, finding out pages with different information, and recording as the pages to be refreshed.
And S5, judging whether the page to be refreshed of the current firmware is empty or not.
And S6, if the firmware is empty, directly flashing the information of the page to be flashed corresponding to the firmware to be refreshed to the page to be flashed of the current firmware.
And S7, if the firmware is not empty, erasing the page to be refreshed of the current firmware, and after the erasing is successful, refreshing the information of the page to be refreshed of the firmware to be refreshed to the page to be refreshed of the current firmware.
Before the flash is performed, the page to be flashed in the current firmware needs to be erased, in order to improve the flash efficiency, in this embodiment, before the flash is erased, it is determined whether the page to be flashed in the current firmware is empty, and if the page is empty, the flash does not need to be erased, so that the erasing step is omitted, and the flash can be performed directly. And in the case of not being empty, erasing is performed first and then writing is performed.
The step S7 specifically includes the following steps.
S7-1, erasing the page to be flashed of the current firmware;
s7-2, judging whether the page to be flashed of the current firmware is erased completely;
s7-3, if the firmware is erased completely, flashing information of the corresponding page to be flashed of the firmware to be refreshed to the page to be flashed of the current firmware;
s7-4, if the data are not erased completely, judging whether the erased times reach a threshold value or not;
s7-5, if not, returning to the step S7-1; and if so, sending an abnormal alarm of the memory chip.
After the page to be refreshed of the current firmware is subjected to one-time erasing operation, whether the page to be refreshed of the current firmware is erased completely or not is detected, and the refreshing and erasing are performed under the condition of complete erasing so as to ensure normal refreshing and writing. If not, erasing is performed again. Certainly, if the memory chip cannot be erased for a plurality of times and then erased for a certain number of times and still cannot be erased completely, the memory chip possibly fails, and at the moment, an abnormal alarm of the memory chip is sent out to inform a worker to process the memory chip in time.
Before the sectors are divided into the firmware, the firmware to be refreshed and the current firmware are converted into hexadecimal code information, the sectors are divided into N sectors based on the hexadecimal code information, and then each sector is divided into a plurality of pages based on the hexadecimal code information, so that information comparison is facilitated.
Correspondingly, whether the page to be written with a brush is empty or whether the page to be written with a brush is erased completely is specifically as follows: and judging whether the hexadecimal code information of the page to be refreshed is totally FF, if so, the page to be refreshed is empty or erased completely.
According to the method for refreshing the firmware of the server, provided by the embodiment of the invention, by utilizing the characteristic that the time for reading the code information is much faster than the time for writing, the difference point between the firmware information to be refreshed and the existing firmware information in a Flash chip is obtained by comparing the firmware information to be refreshed and the existing firmware information in the Flash chip, and then only the difference part is written, so that the repeated writing of the same code part is avoided, the time of an FW (firmware) flashing process is effectively reduced, and the FW flashing efficiency is improved.
To further understand the present invention, a specific embodiment is provided below to further explain the present invention in detail, and fig. 4 is a schematic flow chart of the method of the specific embodiment.
The specific embodiment utilizes the characteristic that the time for reading code information is much faster than the time for writing code information, obtains the difference point between Flash FW information to be refreshed and Flash Existing FW by comparing the Flash FW information (Update FW) of firmware to be refreshed and Flash Existing FW information (Existing FW), and then writes only the difference part as follows.
1. Reading the code of Update FW, converting the code into hexadecimal FW code information, and dividing part of the code information into Update Sector1, update Sector2, 8230, and Update Sector N; dividing each Update Sector into Update Page1, update Page2, \8230, \8230andupdate Page M;
2. reading an Existing FW code, converting hexadecimal code FW information, and dividing part of code information into Existing Sector1, existing Sector2, \ 8230; \8230; and Existing Sector N; each Existing Sector is divided into an Existing Page1, an Existing Page2, \ 8230 \ 8230and an Existing Page M.
3. And comparing each Update Sector with an Existing Sector, if the Update Sector N is the same as the Existing Sector N, the FW information to be refreshed is the same as the FW information in Flash, the Flash does not need to be refreshed and written, and if the Update Sector N is different from the Existing Sector N, the step 4 is carried out.
4. For different SectorN, comparing the Update Page M with the Existing Page M for each Page of the SectorN, keeping the same Page part for the same Page without operation, and performing the step 5 for different pages.
5. Judging whether FW information of different Existing Page M hexadecimal codes is totally FF, if yes, representing that no FW information exists in Flash, and directly performing Flash without erasing; if the Existing PageM hexadecimal codes are not all FFs, go to step 6.
6. Carrying out erasing operation of the Existing pageM, recording the erasing times of the Existing pageM, and if the times are 3, representing that the Flash chip is abnormal, and replacing the Flash chip; if not 3, go to step 7.
7. Judging whether the Existing Page M is FF, if not, representing that the page is not erased, and returning to the step 6; if the Existing Page M is FF, representing the erase clean, go to step 8.
8. And reading the Update PageM, and then performing Flash on the PageM erased by Flash, thereby realizing one-time FW complete Flash.
The foregoing describes in detail an embodiment of a server firmware refreshing method, and based on the server firmware refreshing method described in the foregoing embodiment, an embodiment of the present invention further provides a server firmware refreshing apparatus corresponding to the method.
Fig. 5 is a schematic block diagram of a structure of a server firmware refreshing apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus includes: the device comprises a zone page dividing module 101, a sector comparison module 102, a page comparison module 103 and a flash module 104.
The section page dividing module 101: the firmware to be refreshed and the current firmware are respectively divided into N sectors in the same way.
In specific implementation, after the to-be-refreshed firmware and the current firmware are divided into N sectors by the page partition module 101, each sector of the to-be-refreshed firmware is divided into M pages, and each sector of the current firmware is divided into M pages.
Sector alignment module 102: and comparing the N sectors of the firmware to be refreshed and the current firmware one by one, finding out sectors with different information, and recording as sectors to be refreshed.
The page comparison module 103: and comparing the M pages of the sector to be refreshed one by one, finding out pages with different information, and recording as the pages to be refreshed.
The flash module 104: and performing flash on the sector to be flashed.
The flashing module 104 flashes the sector to be flashed, specifically, flashes the page to be flashed, which specifically includes:
judging whether a page to be refreshed of the current firmware is empty or not;
if the firmware is empty, directly flashing information of the corresponding page to be flashed of the firmware to be refreshed to the page to be flashed of the current firmware;
and if not, erasing the page to be refreshed of the current firmware, and after the erasing is successful, refreshing the information of the page to be refreshed corresponding to the firmware to be refreshed to the page to be refreshed of the current firmware.
When the page to be flashed of the current firmware is not empty, the flashing module specifically executes the following process:
erasing a page to be flashed of the current firmware;
judging whether a page to be refreshed of the current firmware is erased completely;
if the firmware is erased completely, the information of the corresponding page to be refreshed of the firmware to be refreshed is refreshed on the page to be refreshed of the current firmware;
if the data is not erased completely, judging whether the erased times reach a threshold value;
if not, erasing the page to be flashed of the current firmware again; and if so, sending an abnormal alarm of the memory chip.
The server firmware refreshing apparatus of this embodiment is used for implementing the foregoing server firmware refreshing method, so that a detailed implementation of the apparatus may be seen in the foregoing embodiment of the server firmware refreshing method, and therefore, reference may be made to the description of the corresponding embodiments of each part, and a description thereof will not be further provided herein.
In addition, since the server firmware refreshing apparatus of this embodiment is used to implement the foregoing server firmware refreshing method, its role corresponds to that of the foregoing method, and is not described herein again.
Fig. 6 is a schematic structural diagram of a terminal device 600 according to an embodiment of the present invention, including: a processor 610, a memory 620, and a communication unit 630. The processor 610 is configured to implement the following steps when implementing the server firmware refresh program stored in the memory 620:
s1, dividing a firmware to be refreshed and a current firmware into N sectors respectively according to the same mode;
s2, comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording the sectors as sectors to be refreshed;
and S3, performing flash on the sector to be flashed.
The invention utilizes the characteristic that the time for reading the code information is much faster than the time for writing in, obtains the difference point between the firmware information to be refreshed and the existing firmware information in the Flash chip by comparing the firmware information to be refreshed and the existing firmware information in the Flash chip, and then only writes in the difference part, thereby avoiding the repeated writing in of the same code part, effectively reducing the time of the FW (Flash firmware) Flash process and improving the FW Flash efficiency.
The terminal apparatus 600 includes a processor 610, a memory 620, and a communication unit 630. The components communicate via one or more buses, and those skilled in the art will appreciate that the architecture of the servers shown in the figures is not intended to be limiting, and may be a bus architecture, a star architecture, a combination of more or less components than those shown, or a different arrangement of components.
The memory 620 may be used for storing instructions executed by the processor 610, and the memory 620 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as a Static Random Access Memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk. The executable instructions in memory 620, when executed by processor 610, enable terminal 600 to perform some or all of the steps in the method embodiments described below.
The processor 610 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 620 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 610 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A communication unit 630, configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present invention also provides a computer storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
A computer storage medium storing a server firmware refresh program that when executed by a processor performs the steps of:
s1, dividing a firmware to be refreshed and a current firmware into N sectors respectively according to the same mode;
s2, comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording the sectors as sectors to be refreshed;
and S3, performing flash on the sector to be flashed.
The invention utilizes the characteristic that the time for reading the code information is much faster than the time for writing, obtains the difference point between the firmware information to be refreshed and the existing firmware information in the Flash chip by comparing the firmware information to be refreshed and the existing firmware information in the Flash chip, and then only writes in the difference part, thereby avoiding the repeated writing in of the same code part, effectively reducing the time of the FW (Flash firmware) flashing process and improving the FW flashing efficiency.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of a software product, where the computer software product is stored in a storage medium, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, and the storage medium can store program codes, and includes instructions for enabling a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, and the like) to perform all or part of the steps of the method in the embodiments of the present invention.
In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The above disclosure is only for the preferred embodiments of the present invention, but the present invention is not limited thereto, and any non-inventive changes that can be made by those skilled in the art and several modifications and amendments made without departing from the principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for refreshing server firmware is characterized by comprising the following steps:
s1, dividing a firmware to be refreshed and a current firmware into N sectors respectively according to the same mode;
s2, comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording the sectors as sectors to be refreshed;
and S3, performing flash on the sector to be flashed.
2. The method for refreshing the firmware of the server according to claim 1, wherein after the firmware to be refreshed and the current firmware are divided into N sectors in step S1, each sector of the firmware to be refreshed is divided into M pages, and each sector of the current firmware is divided into M pages;
correspondingly, the step S3 is to flash the sector to be flashed, and specifically includes:
s3-1, comparing M pages of the sector to be refreshed one by one, finding out pages with different information, and marking as pages to be refreshed;
and S3-2, performing flashing on the page to be flashed.
3. The method for refreshing the firmware of the server according to claim 2, wherein the step S3-2 is to flush the page to be flushed, and specifically comprises:
s3-21, judging whether the page to be refreshed of the current firmware is empty;
s3-22, if the firmware is empty, directly writing the information of the page to be written corresponding to the firmware to be refreshed to the page to be refreshed of the current firmware;
and S3-23, if the firmware is not empty, erasing the page to be refreshed of the current firmware, and after the erasing is successful, refreshing the information of the page to be refreshed corresponding to the firmware to be refreshed to the page to be refreshed of the current firmware.
4. The server firmware refreshing method according to claim 3, wherein the steps S3 to S23 specifically include:
s3-231, erasing the page to be flashed of the current firmware;
s3-232, judging whether the page to be refreshed of the current firmware is completely erased or not;
s3-233, if the firmware is erased completely, the information of the page to be refreshed corresponding to the firmware to be refreshed is refreshed on the page to be refreshed of the current firmware;
s3-234, if the data are not erased completely, judging whether the erased times reach a threshold value;
s3-235, if not, returning to the step S3-231; and if so, sending an abnormal alarm of the memory chip.
5. The server firmware refreshing method according to claim 4, wherein the firmware to be refreshed and the current firmware are converted into hexadecimal code information in step S1, and the hexadecimal code information is divided into N sectors.
6. The method for refreshing the firmware of the server according to claim 5, wherein whether the page to be refreshed is empty or whether the page to be refreshed is completely erased is specifically: and judging whether the hexadecimal code information of the page to be refreshed is totally FF, if so, the page to be refreshed is empty or erased completely.
7. A server firmware refreshing apparatus, comprising,
a zone page dividing module: respectively dividing the firmware to be refreshed and the current firmware into N sectors in the same way;
a sector comparison module: comparing the firmware to be refreshed with the N sectors of the current firmware one by one, finding out sectors with different information, and recording as sectors to be refreshed;
a flash module: and performing flash on the sector to be flashed.
8. The server firmware refreshing apparatus according to claim 7, wherein after the partition dividing module divides the firmware to be refreshed and the current firmware into N sectors, each sector of the firmware to be refreshed is divided into M pages, and each sector of the current firmware is divided into M pages, respectively, in the same manner;
correspondingly, the device also comprises a control device,
a page comparison module: comparing M pages of the sector to be refreshed one by one, finding out pages with different information, and recording as pages to be refreshed;
correspondingly, the flashing module is used for flashing the sector to be flashed, specifically for flashing the page to be flashed, and specifically comprises:
judging whether a page to be refreshed of the current firmware is empty or not;
if the firmware is empty, directly writing the information of the page to be written corresponding to the firmware to be refreshed to the page to be refreshed of the current firmware;
if the current firmware is not empty, erasing the page to be refreshed of the current firmware, and after the erasing is successful, refreshing the information of the page to be refreshed corresponding to the firmware to be refreshed to the page to be refreshed of the current firmware;
when the page to be flashed of the current firmware is not empty, the flashing module specifically executes the following process:
erasing a page to be flashed of the current firmware;
judging whether a page to be refreshed of the current firmware is erased completely;
if the firmware is erased completely, the information of the corresponding page to be refreshed of the firmware to be refreshed is refreshed on the page to be refreshed of the current firmware;
if the data is not erased completely, judging whether the erased times reach a threshold value;
if not, erasing the page to be flashed of the current firmware again; and if so, sending an abnormal alarm of the memory chip.
9. A terminal, comprising:
a memory for storing a server firmware refresh program;
a processor for implementing the steps of the server firmware refresh method according to any one of claims 1 to 6 when executing the server firmware refresh program.
10. A computer readable storage medium, characterized in that the readable storage medium has stored thereon a server firmware refresh program, which when executed by a processor implements the steps of the server firmware refresh method according to any one of claims 1 to 6.
CN202211035432.7A 2022-08-26 2022-08-26 Server firmware refreshing method, device, terminal and storage medium Pending CN115359828A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211035432.7A CN115359828A (en) 2022-08-26 2022-08-26 Server firmware refreshing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211035432.7A CN115359828A (en) 2022-08-26 2022-08-26 Server firmware refreshing method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN115359828A true CN115359828A (en) 2022-11-18

Family

ID=84004459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211035432.7A Pending CN115359828A (en) 2022-08-26 2022-08-26 Server firmware refreshing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN115359828A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116400946A (en) * 2023-02-24 2023-07-07 深圳市丰润达科技有限公司 Block difference-based switch upgrading method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116400946A (en) * 2023-02-24 2023-07-07 深圳市丰润达科技有限公司 Block difference-based switch upgrading method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
CN111723079A (en) Data migration method and device, computer equipment and storage medium
CN110515641A (en) The update method of server firmware, apparatus and system
CN113626256A (en) Virtual machine disk data backup method, device, terminal and storage medium
US20240264915A1 (en) Data storage method and apparatus, and electronic device and readable storage medium
CN110543281A (en) Storage compression implementation method, device, equipment and storage medium
CN115543217B (en) Data organization method, device, server and medium for independent redundant disk array
CN115359828A (en) Server firmware refreshing method, device, terminal and storage medium
CN112214384A (en) Hard disk serial number management method, system, terminal and storage medium
CN115454512A (en) Chip drive loading configuration method, device, equipment and storage medium
CN115271586A (en) Bill of material generation method and device, computer equipment and storage medium
CN114446381A (en) eMMC fault analysis method, eMMC fault analysis device, readable storage medium and electronic equipment
CN112764683B (en) Storage block management information synchronous recording method, system, terminal and storage medium
CN112700814B (en) EEPROM data reading method and device, electronic control equipment and medium
CN111966531B (en) Data snapshot method and device, computer equipment and storage medium
CN110321125B (en) Data configuration method and device for cells and readable storage medium
CN110865772A (en) Method and device for protecting system data physical block erasure count value, computer equipment and storage medium
CN108874318A (en) The data reconstruction method and solid state hard disk of solid state hard disk
CN111367710A (en) eMMC problem reduction method and device
CN111857586A (en) SSD Trim optimization method, system, terminal and storage medium
CN113468105A (en) Data structure of data snapshot, related data processing method, device and system
CN114637626B (en) Method, device and equipment for reducing read-write errors of EEPROM (electrically erasable programmable read-only memory) data and readable storage medium
CN109886050B (en) Card information acquisition method and device, computer equipment and storage medium
CN114518834B (en) Information storage method and device and electronic equipment
CN118193941A (en) Address de-duplication method, device, HMI device 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