Firmware upgrading method and device, electronic equipment and computer program product
By using processors and field programmable gate array units in the firmware upgrade system, the chip firmware is moved from one storage area to another and checksum upgrades, and the chip firmware does not support upgrades is solved, ensuring that users use it normality.
Patent Information
- Application Number
- CN202411167621.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-17
AI Technical Summary
Some chip products do not support the upgrade of chip firmware, which leads to the system being unable to update when there is a need for firmware upgrade during use, affecting the normal use of the user.
Provide a firmware upgrade method, by using a processor and a field programmable gate array unit in the firmware upgrade system, the firmware stored in the first storage area is moved to the second storage area, obtaining the upgrade data and verifying it, if the calibration is performed. If the verification is successful, run the firmware to upgrade, otherwise the upgrade will be stopped.
The system firmware stored on the chip is upgraded, the problem of not supporting updates is solved, and the normal use of users is ensured.
Smart Images

Figure CN119149068A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a firmware upgrade method, device, electronic device and computer program product. Background Art
[0002] Some chip products do not support chip firmware upgrades. For example, the firmware stored in the chip system that uses a field programmable gate array (FPGA) as the main control and a CPU to provide computing power does not support updates. If these products require firmware upgrades during user use, the system firmware does not support upgrades and the user's normal use will be affected. Summary of the invention
[0003] The present application provides a firmware upgrade method, device, electronic device and computer program product to solve the problem that the firmware stored in the system on a chip does not support update and upgrade, affecting user use.
[0004] A first aspect of the present application provides a firmware upgrade method, which is applied to a firmware upgrade system. The firmware upgrade system includes a processor, a field programmable gate array unit and a first memory, the first memory includes a first storage area and a second storage area, the first storage area is used to store firmware, and the method includes the following steps: receiving an upgrade instruction sent by the field programmable gate array unit; based on the upgrade instruction, moving the firmware stored in the first storage area to the second storage area, obtaining firmware upgrade data and storing it in the first storage area; verifying the firmware upgrade data stored in the first storage area, if the firmware upgrade data verification is successful, running the firmware in the first storage area for upgrading, otherwise, stopping upgrading the firmware in the first storage area.
[0005] Optionally, the running of the firmware of the first storage area for upgrading includes: sending a verification success message to the field programmable gate array unit; after receiving an upgrade instruction sent by the field programmable gate array unit based on the verification success notification message, running the firmware of the first storage area for upgrading based on the upgrade instruction.
[0006] Optionally, when the firmware of the first storage area is upgraded based on the upgrade instruction, it includes: determining whether the firmware of the first storage area is successfully upgraded within a preset time period; if the firmware of the first storage area is not successfully upgraded within the preset time period, sending an upgrade failure message to the field programmable gate array unit, and triggering the field programmable gate array unit to move the firmware stored in the second storage area to the first storage area.
[0007] Optionally, the firmware stored in the first storage area is divided into multiple firmware data blocks, and the firmware upgrade data includes upgrade data for a first firmware data block among the multiple firmware data blocks. The firmware stored in the first storage area is moved to the second storage area, and the firmware upgrade data is obtained and stored in the first storage area. It also includes: moving the first firmware data block in the first storage area to the second storage area; obtaining the upgrade data of the first firmware data block, and storing the storage address of the upgrade data of the first firmware data block to the first storage address of the first storage area.
[0008] Optionally, the firmware upgrade system also includes a second memory and a third memory, the second memory and the third memory are used to store firmware respectively, and the field programmable gate array unit reads the firmware from the first memory, the second memory and the third memory by a two-out-of-three voting method, and also includes: if the firmware in the first storage area is successfully upgraded within the preset time length, an upgrade success message is sent to the field programmable gate array unit, and the field programmable gate array unit is triggered to copy the firmware in the first storage area to the second memory and the third memory respectively.
[0009] A second aspect of the present application provides a firmware upgrade device, which is applied to a firmware upgrade system. The firmware upgrade system includes a processor, a field programmable gate array unit and a first memory, the first memory includes a first storage area and a second storage area, the first storage area is used to store firmware, and the device includes: a receiving module, which is used to receive an upgrade instruction sent by the field programmable gate array unit; a storage module, which is used to move the firmware stored in the first storage area to the second storage area based on the upgrade instruction, obtain firmware upgrade data and store it in the first storage area; an upgrade module, which is used to verify the firmware upgrade data stored in the first storage area, if the firmware upgrade data stored in the first storage area is successfully verified, then run the firmware in the first storage area for upgrading, otherwise, stop upgrading the firmware in the first storage area.
[0010] Optionally, the upgrade module is further used to: send a verification success message to the field programmable gate array unit; after receiving an upgrade instruction sent by the field programmable gate array unit based on the verification success notification message, run the firmware of the first storage area to upgrade based on the upgrade instruction.
[0011] Optionally, the upgrade module is also used to: determine whether the firmware in the first storage area is successfully upgraded within a preset time period; if the firmware in the first storage area is not successfully upgraded within the preset time period, send an upgrade failure message to the field programmable gate array unit, and trigger the field programmable gate array unit to move the firmware stored in the second storage area to the first storage area.
[0012] Optionally, the firmware stored in the first storage area is divided into multiple firmware data blocks, and the firmware upgrade data includes upgrade data for a first firmware data block among the multiple firmware data blocks. The storage module is also used to: move the first firmware data block in the first storage area to the second storage area; obtain the upgrade data of the first firmware data block, and store the storage address of the upgrade data of the first firmware data block to the first storage address of the first storage area.
[0013] Optionally, the firmware upgrade system also includes a second memory and a third memory, the second memory and the third memory are used to store firmware respectively, and the field programmable gate array unit reads the firmware from the first memory, the second memory and the third memory by a two-out-of-three voting method. The above-mentioned firmware upgrade device also includes: a copy module, which is used to send an upgrade success message to the field programmable gate array unit if the firmware in the first storage area is successfully upgraded within the preset time period, and trigger the field programmable gate array unit to copy the firmware in the first storage area to the second memory and the third memory respectively.
[0014] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the firmware upgrade method as described in the above embodiment.
[0015] The fourth aspect of the present application provides a computer program product on which a computer program is stored. The program is executed by a processor to implement the firmware upgrade method as described in the above embodiment.
[0016] In the above implementation, an upgrade instruction sent by the field programmable gate array unit is received, and based on the upgrade instruction, the firmware stored in the first storage area is moved to the second storage area, the firmware upgrade data is obtained and stored in the first storage area, and the firmware upgrade data stored in the first storage area is verified. If the firmware upgrade data verification succeeds, the firmware in the first storage area is run for upgrade, otherwise, the firmware upgrade in the first storage area is stopped. In this way, the problem that the firmware stored in the system on chip does not support update and upgrade, affecting user use, etc. is solved, and the upgrade of the system firmware is realized.
[0017] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0019] Figure 1 A flowchart of a firmware upgrade method provided according to an embodiment of the present application;
[0020] Figure 2 It is a structural schematic diagram of a firmware upgrade system according to an embodiment of the present application;
[0021] Figure 3 It is a structural schematic diagram of another firmware upgrade system according to an embodiment of the present application;
[0022] Figure 4 This is an example diagram of a firmware upgrade device according to an embodiment of the present application;
[0023] Figure 5 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. Description of the drawings:
[0025] 10-firmware upgrade device; 100-receiving module; 200-storage module and 300-upgrade module. DETAILED DESCRIPTION
[0026] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0027] The firmware upgrade method, device, electronic device and computer program product of the embodiments of the present application are described below with reference to the accompanying drawings. In view of the problem mentioned in the above background technology that the firmware stored in the system on chip does not support updates and upgrades, which affects user use, the present application provides a firmware upgrade method, in which an upgrade instruction sent by a field programmable gate array unit is received, and based on the upgrade instruction, the firmware stored in the first storage area is moved to the second storage area, the firmware upgrade data is obtained and stored in the first storage area, and the firmware upgrade data stored in the first storage area is verified. If the firmware upgrade data verification is successful, the firmware in the first storage area is run for upgrade, otherwise, the firmware upgrade in the first storage area is stopped. In this way, the problem that the firmware stored in the system on chip does not support updates and upgrades, which affects user use, is solved, and the upgrade of the system firmware is realized.
[0028] Specifically, Figure 1 A flowchart of a firmware upgrade method provided in an embodiment of the present application.
[0029] like Figure 1 As shown, the firmware upgrade method includes the following steps:
[0030] First, the application scenario of the firmware upgrade method proposed in the embodiment of the present application is introduced. The solution can be applied to Figure 2 The application scenario shown shows a firmware upgrade system, which includes a processor, a field programmable gate array unit, and a first memory, wherein the storage space of the first memory is divided into a first storage area and a second storage area, and the operating firmware of the processor is stored in the first storage area. The processor is connected to the field programmable gate array unit and the first memory respectively, and the field programmable gate array unit is connected to the first memory.
[0031] The first memory is a memory device for storing data in the firmware upgrade system, and any type of memory device may be used. In the embodiment of the present application, the first memory is a FLASH flash memory.
[0032] The first memory includes a first storage area and a second storage area, which may be obtained by dividing the entire storage space of the first memory into areas, or may be obtained by dividing a portion of the storage space of the first memory into areas, and the storage space sizes of the first storage area and the second storage area may be the same or different, and the embodiments of the present application do not limit this, as long as the first storage area and the second storage area are sufficient to accommodate the running firmware of the processor.
[0033] Figure 3 A more specific application scenario is provided, in which a firmware upgrade system includes a processor CPU, a field programmable gate array unit FPGA and a FLASH chip. Among them, the FLASH chip is used as the memory of the firmware upgrade system. There are three FLASH chips, which are respectively represented as CS1, CS2, and CS3, corresponding to the three memories constituting the firmware upgrade system. A first storage area FLASH1 and a second storage area FLASH2 are arranged inside each FLASH chip. The CPU includes a processor core and a queued serial peripheral interface (Queued Serial Peripheral Interface, QSPI), and the CPU can interact with the FPGA and the FLASH chip through the QSPI. A storage carrier is also provided in the firmware upgrade system for storing firmware upgrade data. The storage carrier can adopt any on-chip storage device. The storage carrier is connected to the CPU and the FPGA respectively, so that it can be called by the CPU and the FPGA.
[0034] The firmware upgrade method proposed in the embodiment of the present application is introduced below by taking the firmware upgrade in the first memory of the above-mentioned firmware upgrade system as an example. The above-mentioned first memory may be Figure 2 The first memory in can also be Figure 3 Any one of the memories CS1, CS2, and CS3 of the firmware upgrade system shown in .
[0035] In step S101, an upgrade instruction sent by a field programmable gate array unit is received.
[0036] In step S102, based on the upgrade instruction, the firmware stored in the first storage area is moved to the second storage area, and the firmware upgrade data is obtained and stored in the first storage area.
[0037] In step S103, the firmware upgrade data stored in the first storage area is verified. If the firmware upgrade data verification succeeds, the firmware in the first storage area is run for upgrade. Otherwise, the firmware upgrade in the first storage area is stopped.
[0038] Optionally, in some embodiments, the firmware stored in the first storage area is divided into multiple firmware data blocks, the firmware upgrade data includes upgrade data for a first firmware data block among the multiple firmware data blocks, the firmware stored in the first storage area is moved to the second storage area, the firmware upgrade data is obtained and stored in the first storage area, and further includes: moving the first firmware data block in the first storage area to the second storage area; obtaining the upgrade data of the first firmware data block, and storing the storage address of the upgrade data of the first firmware data block to the first storage address of the first storage area.
[0039] The above-mentioned firmware upgrade data may be upgrade data for the complete firmware code or upgrade data for part of the firmware code, and may be full upgrade data or incremental upgrade data.
[0040] Specifically, when the field programmable gate array unit FPGA is working normally, it is in a three-out-of-two triple-module redundant working mode. When the FPGA receives firmware upgrade data, such as receiving a firmware upgrade instruction initiated by an external organization and receiving firmware upgrade data, it exits the three-out-of-two triple-module redundant working mode and enters the upgrade mode. When entering the upgrade mode, the field programmable gate array unit FPGA sends an upgrade instruction to the processor CPU to divide the firmware stored in the first storage area into multiple firmware data blocks. Therefore, the above-mentioned firmware upgrade data can be upgrade data for the first firmware data block among the above-mentioned multiple firmware data blocks.
[0041] Furthermore, when the CPU receives the upgrade instruction sent by the FPGA, it reads the firmware upgrade data from the FPGA and stores it in the storage medium by calling the peripheral driver, or the processor core stores the firmware upgrade data in the storage medium through the external FPGA.
[0042] Furthermore, after the processor core stores the upgraded firmware data in the storage medium, it detects whether the processor core is idle, and enters the upgrade mode when the processor core is idle. At this time, the processor core moves the firmware stored in the first storage area of the first memory to the second storage area through the QSPI driver, that is, the firmware in the first memory is migrated from the first storage area to the second storage area, so that the first storage area frees up space for storing the firmware upgrade data.
[0043] Then, the processor core reads pre-stored firmware upgrade data from the storage carrier, and stores the firmware upgrade data in the first storage area.
[0044] For example, if the firmware upgrade data is upgrade data corresponding to the first firmware data block in the first storage area, the processor core reads the upgrade data of the first firmware data block from the storage carrier and stores it to the first storage address of the first storage area.
[0045] Through the above processing, the original firmware data originally stored in the first storage area is moved to the second storage area, and the upgraded firmware data is stored in the first storage area. In the case where the firmware data is divided into multiple firmware data blocks, one or more firmware data blocks in the first storage area can also be migrated to the second storage area, and the upgraded data corresponding to the firmware data blocks are stored in the corresponding storage addresses of the first storage area.
[0046] Further, in some embodiments, running the firmware of the first storage area for upgrading includes: sending a verification success message to the field programmable gate array unit; after receiving an upgrade instruction sent by the field programmable gate array unit based on the verification success notification message, running the firmware of the first storage area for upgrading based on the upgrade instruction.
[0047] Specifically, the processor verifies the firmware upgrade data in the first storage area in terms of integrity, functionality, etc., to ensure that the firmware upgrade data is correct and usable upgrade data. If the verification is successful, the processor sends a verification success notification message to the field programmable gate array unit, notifying the FPGA that the CPU can be upgraded, thereby triggering the FPGA to send an upgrade instruction. When the CPU receives the upgrade instruction, it runs the firmware in the first storage area to upgrade.
[0048] Further, in some embodiments, when the firmware of the first storage area is upgraded based on the upgrade instruction, it includes: determining whether the firmware of the first storage area is successfully upgraded within a preset time period; if the firmware of the first storage area is not successfully upgraded within the preset time period, sending an upgrade failure message to the field programmable gate array unit, and triggering the field programmable gate array unit to move the firmware stored in the second storage area to the first storage area.
[0049] Specifically, if the firmware in the first storage area is not successfully upgraded within a preset time period, the CPU sends an upgrade failure notification message to the FPGA to notify the FPGA of the upgrade failure.
[0050] When the FPGA receives the upgrade failure notification message, it determines that the upgrade has failed. At this time, the FPGA moves the firmware stored in the second storage area to the first storage area, that is, deletes the upgraded firmware stored in the first storage area, and moves the original firmware before the upgrade from the second storage area back to the first storage area, so that the CPU can continue to run with the old version of the firmware when it is upgraded again. Then, the FPGA exits the upgrade mode and records the upgrade failure result.
[0051] Optionally, in some embodiments, the firmware upgrade system also includes a second memory and a third memory, the second memory and the third memory are used to store firmware respectively, and the field programmable gate array unit reads the firmware from the first memory, the second memory and the third memory by a two-out-of-three voting method, and also includes: if the firmware in the first storage area is successfully upgraded within a preset time, an upgrade success message is sent to the field programmable gate array unit, and the field programmable gate array unit is triggered to copy the firmware in the first storage area to the second memory and the third memory respectively.
[0052] Specifically, if the firmware in the first storage area is successfully upgraded within the preset time, it means that the upgraded firmware can run normally. At this time, the CPU sends an upgrade success notification message to the FPGA, indicating that the CPU has successfully upgraded the firmware. At this time, the FPGA copies the upgraded firmware in the first storage area of the first memory to the second memory and the third memory respectively. Then, the FPGA exits the upgrade mode and enters the normal three-out-of-two triple-module redundant working mode.
[0053] Through the above processing, the firmware in each memory can be upgraded, so that the FPGA can normally execute the three-out-of-two triple-module redundant working mode.
[0054] According to the firmware upgrade method proposed in the embodiment of the present application, an upgrade instruction sent by a field programmable gate array unit is received, and based on the upgrade instruction, the firmware stored in the first storage area is moved to the second storage area, the firmware upgrade data is obtained and stored in the first storage area, and the firmware upgrade data stored in the first storage area is verified. If the firmware upgrade data verification is successful, the firmware in the first storage area is run for upgrade, otherwise, the firmware upgrade in the first storage area is stopped. In this way, the problem that the firmware stored in the system on chip does not support update and upgrade, affecting user use, etc. is solved, and the upgrade of the system firmware is realized.
[0055] Next, the firmware upgrade device proposed according to the embodiment of the present application is described with reference to the accompanying drawings.
[0056] Figure 4 It is a block diagram of a firmware upgrade device according to an embodiment of the present application.
[0057] Among them, the firmware upgrade device 10 is applied to a firmware upgrade system, the firmware upgrade system includes a processor, a field programmable gate array unit and a first memory, the first memory includes a first storage area and a second storage area, the first storage area is used to store firmware, and the firmware upgrade device 10 includes: a receiving module 100, a storage module 200 and an upgrade module 300.
[0058] Among them, the receiving module 100 is used to receive the upgrade instruction sent by the field programmable gate array unit; the storage module 200 is used to move the firmware stored in the first storage area to the second storage area based on the upgrade instruction, obtain the firmware upgrade data and store it in the first storage area; the upgrade module 300 is used to verify the firmware upgrade data stored in the first storage area. If the firmware upgrade data stored in the first storage area is successfully verified, the firmware in the first storage area is run for upgrade, otherwise, the firmware upgrade of the first storage area is stopped.
[0059] Optionally, in some embodiments, the upgrade module 300 is further used to: send a verification success message to the field programmable gate array unit; after receiving an upgrade instruction sent by the field programmable gate array unit based on the verification success notification message, run the firmware of the first storage area to upgrade based on the upgrade instruction.
[0060] Optionally, in some embodiments, the upgrade module 300 is also used to: determine whether the firmware in the first storage area is successfully upgraded within a preset time period; if the firmware in the first storage area is not successfully upgraded within the preset time period, send an upgrade failure message to the field programmable gate array unit, and trigger the field programmable gate array unit to move the firmware stored in the second storage area to the first storage area.
[0061] Optionally, in some embodiments, the firmware stored in the first storage area is divided into multiple firmware data blocks, and the firmware upgrade data includes upgrade data for a first firmware data block among the multiple firmware data blocks. The storage module 200 is also used to: move the first firmware data block in the first storage area to the second storage area; obtain the upgrade data of the first firmware data block, and store the storage address of the upgrade data of the first firmware data block to the first storage address of the first storage area.
[0062] Optionally, in some embodiments, the firmware upgrade system also includes a second memory and a third memory, the second memory and the third memory are used to store firmware respectively, and the field programmable gate array unit reads the firmware from the first memory, the second memory and the third memory by a two-out-of-three voting method. The above-mentioned firmware upgrade device 10 also includes: a copy module, which is used to send an upgrade success message to the field programmable gate array unit if the firmware in the first storage area is successfully upgraded within a preset time period, and trigger the field programmable gate array unit to copy the firmware in the first storage area to the second memory and the third memory respectively.
[0063] It should be noted that the above explanation of the firmware upgrade method embodiment is also applicable to the firmware upgrade device of this embodiment, and will not be repeated here.
[0064] According to the firmware upgrade device proposed in the embodiment of the present application, an upgrade instruction sent by the field programmable gate array unit is received, and based on the upgrade instruction, the firmware stored in the first storage area is moved to the second storage area, the firmware upgrade data is obtained and stored in the first storage area, and the firmware upgrade data stored in the first storage area is verified. If the firmware upgrade data verification is successful, the firmware in the first storage area is run for upgrade, otherwise, the firmware upgrade in the first storage area is stopped. In this way, the problem that the firmware stored in the system on chip does not support update and upgrade, affecting user use, etc. is solved, and the upgrade of the system firmware is realized.
[0065] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0066] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0067] When the processor 502 executes the program, the firmware upgrade method provided in the above embodiment is implemented.
[0068] Furthermore, the electronic device further comprises:
[0069] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0070] The memory 501 is used to store computer programs that can be executed on the processor 502 .
[0071] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0072] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0073] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0074] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0075] An embodiment of the present application also provides a computer program product, on which a computer program is stored, and when the program is executed by a processor, the above firmware upgrade method is implemented.
[0076] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0077] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0078] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0079] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer program product for use with an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a "computer program product" can be any device that can contain, store, communicate, propagate or transmit a program for use with an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer program products (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). Furthermore, the computer program product may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example by optically scanning the paper or other medium and then editing, interpreting or, if necessary, processing it in another suitable manner, and then storing it in a computer memory.
[0080] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0081] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer program product, which, when executed, includes one or a combination of the steps of the method embodiment.
[0082] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer program product.
[0083] The computer program product mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A firmware upgrade method, characterized in that: The firmware upgrade method is applied to a firmware upgrade system, the firmware upgrade system includes a processor, a field programmable gate array unit and a first memory, the first memory includes a first storage area and a second storage area, the first storage area is used to store firmware, the method includes the following steps: Receiving an upgrade instruction sent by the field programmable gate array unit; Based on the upgrade instruction, the firmware stored in the first storage area is moved to the second storage area, and the firmware upgrade data is acquired and stored in the first storage area; The firmware upgrade data stored in the first storage area is verified. If the firmware upgrade data is successfully verified, the firmware in the first storage area is run for upgrading. Otherwise, the firmware upgrade in the first storage area is stopped.
2. The method according to claim 1, characterized in that The step of upgrading the firmware of the first storage area includes: Sending a verification success message to the field programmable gate array unit; After receiving the upgrade instruction sent by the field programmable gate array unit based on the verification success notification message, the firmware of the first storage area is run to upgrade based on the upgrade instruction.
3. The method according to claim 1, characterized in that When the firmware of the first storage area is upgraded based on the upgrade instruction, the method includes: Determining whether the firmware in the first storage area is successfully upgraded within a preset time period; If the firmware in the first storage area is not successfully upgraded within the preset time period, an upgrade failure message is sent to the field programmable gate array unit, and the field programmable gate array unit is triggered to move the firmware stored in the second storage area to the first storage area.
4. The method according to claim 1, characterized in that: The firmware stored in the first storage area is divided into a plurality of firmware data blocks, the firmware upgrade data includes upgrade data of a first firmware data block among the plurality of firmware data blocks, the firmware stored in the first storage area is moved to the second storage area, the firmware upgrade data is acquired and stored in the first storage area, and further includes: Moving the first firmware data block in the first storage area to the second storage area; The upgrade data of the first firmware data block is acquired, and the storage address of the upgrade data of the first firmware data block is stored in the first storage address of the first storage area.
5. The method according to claim 3, characterized in that: The firmware upgrade system further includes a second memory and a third memory, wherein the second memory and the third memory are respectively used to store firmware, and the field programmable gate array unit reads the firmware from the first memory, the second memory and the third memory by a two-out-of-three voting method, and further includes: If the firmware in the first storage area is successfully upgraded within the preset time period, an upgrade success message is sent to the field programmable gate array unit, and the field programmable gate array unit is triggered to copy the firmware in the first storage area to the second memory and the third memory respectively.
6. A firmware upgrade device, characterized in that: The firmware upgrade device is applied to a firmware upgrade system, the firmware upgrade system includes a processor, a field programmable gate array unit and a first memory, the first memory includes a first storage area and a second storage area, the first storage area is used to store firmware, the device includes: A receiving module, used for receiving an upgrade instruction sent by the field programmable gate array unit; A storage module, configured to move the firmware stored in the first storage area to the second storage area based on the upgrade instruction, obtain firmware upgrade data and store it in the first storage area; The upgrade module is used to verify the firmware upgrade data stored in the first storage area. If the firmware upgrade data stored in the first storage area is successfully verified, the firmware in the first storage area is upgraded; otherwise, the firmware upgrade in the first storage area is stopped.
7. The device according to claim 6, characterized in that The upgrade module is also used for: Sending a verification success message to the field programmable gate array unit; After receiving the upgrade instruction sent by the field programmable gate array unit based on the verification success notification message, the firmware of the first storage area is run to upgrade based on the upgrade instruction.
8. The device according to claim 6, characterized in that The upgrade module is also used for: Determining whether the firmware in the first storage area is successfully upgraded within a preset time period; If the firmware in the first storage area is not successfully upgraded within the preset time period, an upgrade failure message is sent to the field programmable gate array unit, and the field programmable gate array unit is triggered to move the firmware stored in the second storage area to the first storage area.
9. An electronic device, characterized in that: Including memory and processor; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the firmware upgrade method as described in any one of claims 1 to 5.
10. A computer program product, wherein the computer-readable storage medium stores a computer program, characterized in that: When the program is executed by a processor, the firmware upgrade method as described in any one of claims 1 to 5 is implemented.
