Firmware repair method and device, computer equipment and storage medium

By detecting the legitimacy of firmware packets between the upper and lower computers and performing corresponding processing, the problem of firmware repair failure is solved and the system stability is improved.

CN119088602APending Publication Date: 2024-12-06THINKCAR TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411099369.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

During the firmware repair process, some factors cause the firmware repair to fail, resulting in abnormal product functions and lack of normal application firmware available, affecting system stability.

Method used

By setting an interactive mode between the upper and lower computers, the legality of the firmware data packets is detected, and when it is detected that it is illegal, enter the firmware repair program or backup firmware repair program to ensure that the firmware repair is successful.

Benefits of technology

Improves the system stability of the product, ensures successful firmware repair, and avoids abnormal functions caused by failure of firmware repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088602A_ABST
    Figure CN119088602A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware repairing method and device, computer equipment and a storage medium, and relates to the technical field of embedding. The firmware repairing method is applied to an upper computer and a lower computer and comprises the steps that the lower computer is commanded to obtain a firmware data packet, and the firmware data packet comprises a file name and a file size; carrying out legality detection on the firmware data packet; if it is detected that the firmware data packet is legal, firmware corresponding to the firmware data packet is written into a lower computer; and if the detection result is illegal, entering a firmware repair program. By setting the interaction mode of the upper computer and the lower computer, the firmware repair problem is solved, and the system stability of a product is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of embedded technology, and in particular to a firmware repair method, device, computer equipment and storage medium. Background Art

[0002] The product firmware is stored in the upper computer's server. When the product firmware needs to repair problems or add functions, the firmware repair function is required, and the firmware data will be sent to the lower computer via wired or wireless means.

[0003] During the firmware repair process, the firmware repair fails due to certain factors. At this time, the product does not have a normal application firmware available, resulting in abnormal product functions. Summary of the invention

[0004] In order to solve the defects in the prior art, the present invention provides a firmware repair method, device, computer equipment and storage medium.

[0005] The technical document provided by the present invention is a firmware repair method, which is applied to a host computer and a slave computer, and its improvement lies in that it includes:

[0006] Instruct the lower computer to obtain a firmware data packet, wherein the firmware data packet includes a file name and a file size;

[0007] Performing a legitimacy check on the firmware data packet;

[0008] If the detection is legal, the firmware corresponding to the firmware data packet is written into the lower computer;

[0009] If the detection is illegal, enter the firmware repair program.

[0010] As an improvement of the above solution, the method further includes:

[0011] Detecting whether the firmware is legal;

[0012] If the firmware is illegal, enter the backup firmware repair program.

[0013] As a further improvement of the above solution, before instructing the lower computer to obtain the firmware data packet, the method further includes:

[0014] When the firmware repair operation is to be performed, the lower computer program is detected;

[0015] When the lower computer program is in the application layer, the lower computer program is commanded to jump from the application layer to the Boot layer and enter the firmware repair preparation program.

[0016] As a further improvement of the above solution, the method further includes:

[0017] When entering the firmware repair preparation program, the upper computer is commanded to send a first firmware data packet to the lower computer.

[0018] As a further improvement of the above solution, the method further includes:

[0019] When the lower computer receives the first firmware data packet, instruct the lower computer to detect whether the first firmware data packet is legal;

[0020] If the first firmware data package is legal, the first firmware is backed up and saved as backup firmware.

[0021] As a further improvement of the above solution, the method further includes:

[0022] When the first firmware data packet or the first firmware is detected to be qualified, instructing the lower computer to send a confirmation instruction to the upper computer;

[0023] When the host computer receives the confirmation instruction, the process ends;

[0024] When the first firmware data packet or the first firmware fails the detection, instructing the lower computer to send an error instruction to the upper computer;

[0025] When the host computer receives an error instruction, it terminates the current firmware repair operation and performs a firmware backup and repair operation.

[0026] As a further improvement of the above solution, the first firmware data packet is an upgrade data packet.

[0027] The present application also discloses a firmware repair device, comprising:

[0028] A first processing module, the first processing module is used to command the lower computer to obtain a firmware data packet, wherein the firmware data packet includes a file name and a file size;

[0029] The first detection module is used to perform a validity detection on the firmware data packet; if the detection is legal, the firmware corresponding to the firmware data packet is written into the lower computer; if the detection is illegal, the firmware repair program is entered.

[0030] Furthermore, the device also includes:

[0031] The second detection module is used to detect whether the firmware is legal; if the firmware is not legal, a backup firmware repair program is entered.

[0032] Furthermore, the device also includes:

[0033] The third detection module is used to detect the lower computer program when a firmware repair operation is to be performed; when the lower computer program is in the application layer, the lower computer program is commanded to jump from the application layer to the Boot layer and enter the firmware repair preparation program.

[0034] Furthermore, the device also includes:

[0035] The second processing module is used for commanding the upper computer to send a first firmware data packet to the lower computer when entering the firmware repair preparation program.

[0036] Furthermore, the device also includes:

[0037] The fourth detection module is used to command the lower computer to detect whether the first firmware data packet is legal when the lower computer receives the first firmware data packet; if the first firmware data packet is legal, the first firmware is backed up and saved as a backup firmware.

[0038] Furthermore, the device also includes:

[0039] The fifth detection module is used to command the lower computer to send a confirmation instruction to the upper computer when the first firmware data packet or the first firmware is detected to be qualified; when the upper computer receives the confirmation instruction, the process is terminated; when the first firmware data packet or the first firmware is detected to be unqualified, the lower computer is commanded to send an error instruction to the upper computer; when the upper computer receives the error instruction, the current firmware repair operation is terminated and a firmware backup and repair operation is performed.

[0040] The present application also discloses an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program so that the electronic device executes the steps of a firmware repair method as described above.

[0041] The present application also discloses a computer-readable storage medium, comprising instructions. When the instructions are executed on an electronic device, the electronic device executes the steps of a firmware repair method as described above.

[0042] The present application also discloses a computer program product, which includes computer instructions. When the computer instructions are run on an electronic device, the electronic device executes the steps of a firmware repair method as described above.

[0043] Beneficial effect: This application solves the firmware repair problem and improves the system stability of the product by setting the interaction mode between the upper computer and the lower computer. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram of a flow chart of a firmware repair method of the present invention;

[0045] Figure 2 A schematic diagram of a flow chart of a firmware repair method of the present invention;

[0046] Figure 3 A schematic diagram of a flow chart of a firmware repair method of the present invention;

[0047] Figure 4 A schematic diagram of the structure of a firmware repair device of the present invention;

[0048] Figure 5 It is a schematic diagram of the structure of the electronic device of the present invention.

[0049] 100, a first processing module, 200, a first detection module, 300, a second detection module, 400, a third detection module, 500, a second processing module, 600, a fourth detection module, 700, a fifth detection module. DETAILED DESCRIPTION

[0050] In order to facilitate the understanding of the present invention, the present invention is described in more detail below in conjunction with the accompanying drawings and specific embodiments. Preferred embodiments of the present invention are provided in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.

[0051] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "fixed", "integrally formed", "left", "right" and similar expressions used in this specification are for illustrative purposes only. In the drawings, units with similar structures are marked with the same reference numerals.

[0052] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in this specification in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0053] Computing devices use firmware for hardware initialization, low-level hardware management, and management boot processes. In addition to platform firmware, computing devices may also include dedicated firmware for controller chips, peripherals, or other components. Firmware is typically read at runtime and combined with boot, but can be updated in conjunction with a dedicated firmware update process. Runtime firmware patches can be deployed for various central processing unit (CPU) firmware engines to fix vulnerabilities (errors), introduce updated features, or restore to previous firmware versions. Some firmware patches require a system reset. However, rebooting the CPU can cause system downtime, during which the CPU cannot execute workloads, or the delay in workload completion increases. CPU downtime can increase the total cost of ownership (TCO) for data center owners or operators, which may be undesirable. The present application provides a firmware repair method, device, computer device, and storage medium, which can solve the problem of firmware repair failure and no firmware available by reading firmware backed up in a non-volatile storage area, thereby improving the system stability of the product.

[0054] The present invention will be described in detail below in conjunction with the accompanying drawings.

[0055] Embodiment 1:

[0056] See also Figure 1 , the present application discloses a firmware repair method, which is applied to a host computer and a slave computer, and includes:

[0057] S1: commanding the lower computer to obtain a firmware data packet, wherein the firmware data packet includes a file name and a file size;

[0058] S2: Performing a validity check on the firmware data packet;

[0059] S3: If the detection is legal, write the firmware corresponding to the firmware data packet into the lower computer;

[0060] S4: If the detection is illegal, enter the firmware repair program.

[0061] In the above embodiment, for steps S1-S4, the GPIO, serial port and other peripheral hardware of the lower computer are initialized first. When the firmware is updated or the firmware function is changed and a fault occurs, a reset instruction can be sent to the lower computer through the upper computer, commanding the lower computer to obtain a firmware data packet, wherein the firmware data packet includes a file name and a file size; the firmware data packet is checked for legitimacy; if the detection is legal, the firmware corresponding to the firmware data packet is written to the lower computer, and the storage location corresponds to the flash area of ​​the lower computer, and this operation is repeated until the entire firmware is backed up; if the detection is illegal, the firmware repair program is entered. This application solves the firmware repair problem and improves the system stability of the product by setting the interaction mode between the upper computer and the lower computer.

[0062] Furthermore, when the firmware data package is legal, the firmware stored in the lower computer has the following steps:

[0063] S5: Detect whether the firmware is legal;

[0064] S6: If the firmware is illegal, enter the backup firmware repair program.

[0065] In the above embodiment, for steps S5-S6, the firmware is checked for legality; if legal, the checking process is terminated; if illegal, the backup firmware repair program is entered. The invention of the present application ensures that the firmware can be repaired, solves the problem of no firmware available when the firmware repair fails, and improves the system stability of the product.

[0066] In addition, before instructing the lower computer to obtain the firmware data packet, the method further includes:

[0067] S7: When the firmware repair operation is to be performed, the lower computer program is detected;

[0068] S8: When the lower computer program is in the application layer, command the lower computer program to jump from the application layer to the Boot layer and enter the firmware repair preparation program.

[0069] In the above embodiment, for steps S7-S8, when repairing the firmware, it is necessary to ensure that the lower computer is in the Boot layer before the program can be modified, and the lower computer is commanded to modify the application layer to the Boot layer. Among them, the full name of the Boot layer is SpringBoot layer, and the SpringBoot layer includes the mode 1 layer, the dao layer, the service layer and the controller layer. The mode 1 layer is the database entity layer; the dao layer data persistence layer is used to access the database, send SQL statements to the database, and complete the modification tasks such as adding and deleting data; the service layer is the business logic layer, which is used to call the dao layer interface, receive the data returned by the dao layer, and complete the basic function design of the project; the controller layer is the control layer, whose function is request and response control, responsible for the front-end and back-end data interaction, receiving the front-end request, calling the service layer, receiving the data returned by the service layer, and finally returning the specific page and data to the client. The application layer is modified to the Boot layer to realize the modification and new functions of the firmware. When the lower computer program is in the Boot layer, the upper computer will send the file name and file size of the firmware to the lower computer, and the lower computer will judge the legitimacy of the file name and file size.

[0070] See also Figure 2 , the method further comprises:

[0071] S9: when entering the firmware repair preparation program, instructing the upper computer to send a first firmware data packet to the lower computer, where the first firmware data packet is an upgrade data packet;

[0072] S10: When the lower computer receives the upgrade data packet, the lower computer is instructed to detect whether the upgrade data packet is legal;

[0073] S11: If the upgrade data package is legal, the first firmware is backed up and saved as a backup firmware.

[0074] In the above embodiment, for steps S9-S11, the upgrade data packet is checked for legality; if the check is legal, the firmware corresponding to the upgrade data packet is written into the lower computer, and the storage location corresponds to the flash area of ​​the lower computer, and this operation is repeated until the entire firmware corresponding to the upgrade data packet is backed up; if the check is illegal, the backup firmware repair program is entered to ensure the firmware repair work is achieved.

[0075] See also Figure 3 , the method further comprises:

[0076] S12: when the upgrade data packet or the first firmware passes the detection, instructing the lower computer to send a confirmation instruction to the upper computer;

[0077] S13: When the host computer receives the confirmation instruction, the process ends;

[0078] S14: when the upgrade data packet or the first firmware fails the detection, instructing the lower computer to send an error instruction to the upper computer;

[0079] S15: When the host computer receives an error instruction, it terminates the current firmware repair operation and performs a firmware backup and repair operation.

[0080] In the above embodiment, for steps S12-S15, when the upgrade data packet or the first firmware is qualified, the lower computer is commanded to send a confirmation instruction to the upper computer; when the upper computer receives the confirmation instruction, the process ends; when the upgrade data packet or the first firmware is unqualified, the lower computer is commanded to send an error instruction to the upper computer; when the upper computer receives the error instruction, the current firmware repair operation is terminated and the firmware backup repair operation is performed. This further ensures that the firmware repair work is implemented.

[0081] Embodiment 2:

[0082] See also Figure 4 , the present application discloses that the present application also discloses a firmware repair device, including:

[0083] A first processing module 100, the first processing module 100 is used to instruct the lower computer to obtain a firmware data packet, wherein the firmware data packet includes a file name and a file size;

[0084] The first detection module 200 is used to perform a validity check on the firmware data packet; if the check is legal, the firmware corresponding to the firmware data packet is written into the lower computer; if the check is illegal, the firmware repair program is entered.

[0085] Furthermore, the device also includes:

[0086] The second detection module 300 is used to detect whether the firmware is legal; if the firmware is not legal, enter the backup firmware repair program.

[0087] Furthermore, the device also includes:

[0088] The third detection module 400 is used to detect the lower computer program when a firmware repair operation is to be performed; when the lower computer program is in the application layer, the lower computer program is commanded to jump from the application layer to the Boot layer and enter the firmware repair preparation program.

[0089] Furthermore, the device also includes:

[0090] The second processing module 500 is used to instruct the upper computer to send a first firmware data packet to the lower computer when entering the firmware repair preparation program.

[0091] Furthermore, the device also includes:

[0092] The fourth detection module 600 is used to command the lower computer to detect whether the first firmware data packet is legal when the lower computer receives the first firmware data packet; if the first firmware data packet is legal, the first firmware is backed up and saved as a backup firmware.

[0093] Furthermore, the device also includes:

[0094] The fifth detection module 700 is used to command the lower computer to send a confirmation instruction to the upper computer when the first firmware data packet or the first firmware is detected to be qualified; when the upper computer receives the confirmation instruction, the process is terminated; when the first firmware data packet or the first firmware is detected to be unqualified, the lower computer is commanded to send an error instruction to the upper computer; when the upper computer receives the error instruction, the current firmware repair operation is terminated and a firmware backup and repair operation is performed.

[0095] The implementation process of a firmware repair device of the present application is consistent with the above-mentioned embodiment 1 and will not be repeated here.

[0096] Embodiment three:

[0097] See also Figure 5 The present application also discloses an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program so that the electronic device executes the steps of a firmware repair method as described above.

[0098] The present application also discloses a computer-readable storage medium, comprising instructions. When the instructions are executed on an electronic device, the electronic device executes the steps of a firmware repair method as described above.

[0099] The present application also discloses a computer program product, which includes computer instructions. When the computer instructions are run on an electronic device, the electronic device executes the steps of a firmware repair method as described above.

[0100] In the embodiments provided in the present application, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, and units with the same function may be combined into one unit. For example, multiple units or components may be combined or integrated into another diagnostic system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be electrical, mechanical or other forms of connection.

[0101] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0102] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0103] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable an electronic device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only processor (ROM, Read-Only Memory), a disk or an optical disk.

[0104] It should be noted that the above-mentioned technical features are further combined with each other to form various embodiments not listed above, which are all deemed to be within the scope of the present invention; and, for ordinary technicians in this field, they can be improved or transformed according to the above description, and all these improvements and transformations should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A firmware repair method, applied to a host computer and a slave computer, characterized in that: include: Instruct the lower computer to obtain a firmware data packet, wherein the firmware data packet includes a file name and a file size; Performing a legitimacy check on the firmware data packet; If the detection is legal, the firmware corresponding to the firmware data packet is written into the lower computer; If the detection is illegal, enter the firmware repair program.

2. A firmware repair method according to claim 1, characterized in that: The method further comprises: Detecting whether the firmware is legal; If the firmware is illegal, enter the backup firmware repair program.

3. A firmware repair method according to claim 1, characterized in that: Before instructing the lower computer to obtain the firmware data packet, the method further includes: When the firmware repair operation is to be performed, the lower computer program is detected; When the lower computer program is in the application layer, the lower computer program is commanded to jump from the application layer to the Boot layer and enter the firmware repair preparation program.

4. A firmware repair method according to claim 3, characterized in that: The method further comprises: When entering the firmware repair preparation program, the upper computer is commanded to send a first firmware data packet to the lower computer.

5. A firmware repair method according to claim 4, characterized in that: The method further comprises: When the lower computer receives the first firmware data packet, instruct the lower computer to detect whether the first firmware data packet is legal; If the first firmware data package is legal, the first firmware is backed up and saved as backup firmware.

6. A firmware repair method according to claim 5, characterized in that: The method further comprises: When the first firmware data packet or the first firmware is detected to be qualified, instructing the lower computer to send a confirmation instruction to the upper computer; When the host computer receives the confirmation instruction, the process ends; When the first firmware data packet or the first firmware fails the detection, instructing the lower computer to send an error instruction to the upper computer; When the host computer receives an error instruction, it terminates the current firmware repair operation and performs a firmware backup and repair operation.

7. A firmware repair method according to claim 4-6, characterized in that: The first firmware data packet is an upgrade data packet.

8. An electronic device, comprising a memory and a processor, wherein: The memory is used to store a computer program, and the processor is used to call the computer program, characterized in that the electronic device executes the steps of a firmware repair method according to any one of claims 1 to 7.

9. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on the electronic device, the electronic device executes the steps of a firmware repair method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The computer program product includes computer instructions. When the computer instructions are run on an electronic device, the electronic device executes the steps of a firmware repair method according to any one of claims 1 to 7.