Hybrid power supply CPU firmware upgrading method, electronic equipment and storage medium
By using the same data parsing protocol in a hybrid power supply system, and distributing files to the CPU through buffers, the problem of high software redundancy in the existing technology is solved, and more efficient firmware upgrade and maintenance is achieved.
Patent Information
- Application Number
- CN202411928553.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
AI Technical Summary
In existing hybrid power supply systems, different software modules implement different firmware upgrade methods, resulting in increased software redundancy and increased maintenance complexity.
The method based on the same data analysis protocol is adopted to parse the firmware upgrade files corresponding to all firmware upgrade methods, and distribute the parsed files to the corresponding CPU through the buffer for firmware upgrade, regardless of whether the system contains SPI FLASH.
It reduces the software redundancy of hybrid power supply systems, simplifies the firmware upgrade process, and improves the system maintenance efficiency and stability.
Smart Images

Figure CN119847564A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of civil energy storage hybrid power supplies, and in particular to a hybrid power supply CPU firmware upgrade method, electronic equipment and storage medium. Background Art
[0002] A hybrid power system refers to an energy supply system composed of at least two primary power sources (such as wind power generation, photovoltaic power generation, diesel power generation, etc.); a hybrid power system usually contains multiple CPUs (Central Processing Units), and the product is complex. Since the hybrid power system requires software updates, the CPU firmware needs to be frequently upgraded. Currently, there are many ways to upgrade the CPU firmware on the market, such as OTA upgrade, serial port upgrade, and USB flash drive upgrade.
[0003] However, the same manufacturer uses different software modules to implement different upgrade methods, which increases the software redundancy of the hybrid power system. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a hybrid power CPU firmware upgrade method, electronic device and storage medium, which can parse the firmware upgrade files corresponding to all firmware upgrade methods based on the same data parsing protocol, and regardless of whether the hybrid power system includes SPI FLASH, the firmware upgrade files can be distributed to the corresponding CPU in the same way, thereby reducing the software redundancy of the hybrid power system.
[0005] In a first aspect, an embodiment of the present application provides a hybrid power supply CPU firmware upgrade method, the method comprising:
[0006] Get the firmware upgrade file;
[0007] Parse the firmware upgrade file using the data parsing protocol corresponding to the target firmware upgrade method;
[0008] Write the parsed firmware upgrade file into the buffer;
[0009] Distribute the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade.
[0010] In a possible implementation, parsing the firmware upgrade file using a data parsing protocol corresponding to the target firmware upgrade mode includes:
[0011] Determine whether the firmware upgrade method corresponding to the firmware upgrade file is the same as the target firmware upgrade method;
[0012] According to the judgment result and the firmware upgrade file, determine the target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method;
[0013] The target firmware upgrade file is parsed using a data parsing protocol corresponding to the target firmware upgrade method.
[0014] In a possible implementation, determining a target firmware upgrade file that complies with a data parsing protocol corresponding to a target firmware upgrade method according to the judgment result and the firmware upgrade file includes:
[0015] If the firmware upgrade method corresponding to the firmware upgrade file is different from the target firmware upgrade method, the firmware upgrade file is converted into a target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method;
[0016] If the firmware upgrade mode corresponding to the firmware upgrade file is the same as the target firmware upgrade mode, the firmware upgrade file is determined as the target firmware upgrade file.
[0017] In a possible implementation, writing the parsed firmware upgrade file into a buffer includes:
[0018] If the hybrid power supply includes a memory, the parsed firmware upgrade file is stored in a corresponding storage location in the memory;
[0019] Write the firmware upgrade file read from the memory into the buffer.
[0020] In a possible implementation, writing the parsed firmware upgrade file into a buffer further includes:
[0021] If the hybrid power supply does not include a memory, the parsed firmware upgrade file is directly written into the buffer.
[0022] In a possible implementation, distributing the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade includes:
[0023] Determine whether the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU;
[0024] If the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU, the firmware upgrade file in the buffer is distributed to the corresponding CPU for firmware upgrade.
[0025] In a possible implementation, distributing the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade includes:
[0026] Calculate the hash value of the firmware upgrade file in the buffer; and use the private key to digitally sign the firmware upgrade file in the buffer to obtain signature information;
[0027] The hash value of the firmware upgrade file in the buffer and the signature information are stored on the blockchain;
[0028] The firmware upgrade file in the buffer, the hash value and signature information corresponding to the firmware upgrade file in the buffer stored on the blockchain are distributed to the corresponding CPU, so that the corresponding CPU verifies the firmware upgrade file in the buffer based on the hash value and the signature information before upgrading.
[0029] In a possible implementation, after the firmware is successfully upgraded, the corresponding CPU stores the upgrade result on the blockchain.
[0030] In a second aspect, an embodiment of the present application further provides a hybrid power CPU firmware upgrade system, the hybrid power CPU firmware upgrade system comprising:
[0031] Acquisition module, used to obtain firmware upgrade files;
[0032] A parsing module, used for parsing the firmware upgrade file using a data parsing protocol corresponding to the target firmware upgrade method;
[0033] A writing module is used to write the parsed firmware upgrade file into the buffer;
[0034] The distribution module is used to distribute the firmware upgrade files in the buffer to the corresponding CPU for firmware upgrade.
[0035] In one possible implementation, the parsing module is specifically used to determine whether the firmware upgrade method corresponding to the firmware upgrade file is the same as the target firmware upgrade method; determine the target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method based on the judgment result and the firmware upgrade file; and parse the target firmware upgrade file using the data parsing protocol corresponding to the target firmware upgrade method.
[0036] In one possible implementation, the parsing module is specifically used to convert the firmware upgrade file into a target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method if the firmware upgrade method corresponding to the firmware upgrade file is different from the target firmware upgrade method; if the firmware upgrade method corresponding to the firmware upgrade file is the same as the target firmware upgrade method, the firmware upgrade file is determined as the target firmware upgrade file.
[0037] In a possible implementation, the writing module is specifically configured to store the parsed firmware upgrade file to a corresponding storage location in the memory if the hybrid power source includes a memory; and write the firmware upgrade file read from the memory to the buffer.
[0038] In a possible implementation manner, the writing module is specifically configured to directly write the parsed firmware upgrade file into the buffer if the hybrid power supply does not include a memory.
[0039] In one possible implementation, the distribution module is specifically used to determine whether the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU; if the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU, the firmware upgrade file in the buffer is distributed to the corresponding CPU for firmware upgrade.
[0040] In a possible implementation, the distribution module is specifically used to calculate the hash value of the firmware upgrade file in the buffer; and use the private key to digitally sign the firmware upgrade file in the buffer to obtain signature information; store the hash value of the firmware upgrade file in the buffer and the signature information on the blockchain; distribute the firmware upgrade file in the buffer, the hash value and signature information corresponding to the firmware upgrade file in the buffer stored on the blockchain to the corresponding CPU, so that the corresponding CPU verifies the firmware upgrade file in the buffer based on the hash value and the signature information before upgrading.
[0041] In a possible implementation, after the firmware is successfully upgraded, the corresponding CPU stores the upgrade result on the blockchain.
[0042] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of any hybrid power CPU firmware upgrade method as described in the first aspect.
[0043] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the hybrid power CPU firmware upgrade method as described in any one of the first aspects are executed.
[0044] The embodiment of the present application provides a hybrid power CPU firmware upgrade method, an electronic device, and a storage medium, the method comprising: obtaining a firmware upgrade file; parsing the firmware upgrade file using a data parsing protocol corresponding to a target firmware upgrade method; writing the parsed firmware upgrade file into a buffer; distributing the firmware upgrade file in the buffer to a corresponding CPU for firmware upgrade. The present application can parse the firmware upgrade files corresponding to all firmware upgrade methods based on the same data parsing protocol, and regardless of whether the hybrid power system includes SPI FLASH, the firmware upgrade file can be distributed to the corresponding CPU in the same manner, reducing the software redundancy of the hybrid power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A schematic diagram of an application scenario of a hybrid power CPU firmware upgrade system provided by an embodiment of the present application is shown;
[0047] Figure 2 A flowchart of a hybrid power supply CPU firmware upgrade method provided by an embodiment of the present application is shown;
[0048] Figure 3 A flowchart of another hybrid power CPU firmware upgrade method provided by an embodiment of the present application is shown;
[0049] Figure 4 A structural schematic diagram of a hybrid power CPU firmware upgrade system provided by an embodiment of the present application is shown;
[0050] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0051] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0052] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0053] In order to enable those skilled in the art to use the contents of this application, the following implementation methods are provided in conjunction with the specific application scenario "civilian energy storage hybrid power supply field". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the "civilian energy storage hybrid power supply field", it should be understood that this is only an exemplary embodiment.
[0054] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0055] In the field of energy storage hybrid power sources, the software update frequency of the hybrid power system is relatively high, and the upgrade methods include OTA (Over-The-Air, wireless network upgrade), serial port, USB flash drive (USB flash drive) and other upgrade methods. The firmware upgrade files of different upgrade methods are processed differently. Therefore, the same manufacturer needs to provide a separate software module for each upgrade method to implement firmware upgrade operations of different upgrade methods, which increases the software redundancy of the hybrid power system.
[0056] In view of this, the present invention provides a hybrid power CPU firmware upgrade system; Figure 1As shown, it is a schematic diagram of the application scenario of the hybrid power CPU firmware upgrade system provided by the embodiment of the present application. The hybrid power CPU firmware upgrade system is specifically used to obtain the firmware upgrade file upgraded by the firmware upgrade method such as OTA, serial port, U disk, etc.; the firmware upgrade file is parsed by the data parsing protocol corresponding to the target firmware upgrade method; the parsed firmware upgrade file is written to the buffer; the firmware upgrade file in the buffer is distributed to the corresponding CPU for firmware upgrade; the CPU includes DSP1 (DigitalSignal Processor 1, digital signal processor 1), DSP2 (Digital Signal Processor 2, digital signal processor 2), BMS LINK (Battery Management System, LINK, communication interface or module in the battery management system), ARM (Advanced RISC Machine, advanced reduced instruction set computer), etc. This system can parse the firmware upgrade files corresponding to all firmware upgrade methods based on the same data parsing protocol, and regardless of whether the hybrid power system includes SPIFLASH (Serial Peripheral Interface Flash Memory, serial peripheral interface flash memory), the firmware upgrade file can be distributed to the corresponding CPU through the buffer, reducing the software redundancy of the hybrid power system.
[0057] The following is a detailed description of a hybrid power CPU firmware upgrade method provided in an embodiment of the present application.
[0058] Reference Figure 2 As shown, it is a flow chart of a hybrid power CPU firmware upgrade method provided by an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0059] S201, obtaining a firmware upgrade file.
[0060] In the implementation manner of the present application, the firmware upgrade mode selected by the user in the firmware upgrade interface is obtained, and the firmware upgrade file is obtained based on the firmware upgrade mode selected by the user.
[0061] Among them, the firmware upgrade methods include OTA upgrade method, serial port upgrade method, U disk upgrade method, etc.
[0062] Specifically, if the firmware upgrade method selected by the user is the serial port upgrade method, obtaining the firmware upgrade file based on the firmware upgrade method selected by the user includes: sending a request to the host computer to issue a firmware command; and receiving the firmware upgrade file issued by the host computer after confirmation.
[0063] Among them, the firmware upgrade file sent by the host computer includes the protocol header, data payload, sequential reading file packet length, CRC check, protocol bit and other contents; the protocol header includes the upgrade method, firmware upgrade file name, file size information, etc.; the firmware upgrade file name is used to indicate the CPU corresponding to the firmware upgrade file, and the name of the firmware upgrade file of each CPU is pre-set.
[0064] Here, the CPU in the hybrid power supply includes DSP1, DSP2, BMS-LINK, ARM, etc.; the firmware upgrade file name of DSP1 can be DSP1_FMV.BIN, the firmware upgrade file name of DSP2 can be DSP2_FMV.BIN, the firmware upgrade file name of BMS-LINK can be BMSLINK_FMV.BIN, and the firmware upgrade file name of ARM can be ARM_FMV.BIN.
[0065] Among them, "FMV" is the abbreviation of Firmware Version. ".BIN" is the file extension, which usually indicates a binary file.
[0066] Specifically, if the firmware upgrade method selected by the user is the OTA upgrade method, the firmware upgrade file is obtained based on the firmware upgrade method selected by the user, including: downloading the firmware upgrade file in the host computer through the wireless network.
[0067] Among them, the firmware upgrade file downloaded in the host computer follows the same communication protocol as the firmware upgrade file issued by the host computer, and also includes the protocol header, data payload, sequential reading file packet length, CRC check (CyclicRedundancy Check), protocol bit and other contents.
[0068] Specifically, if the firmware upgrade method selected by the user is the USB flash drive upgrade method, a file with the same file name as the preset firmware upgrade file name is read from the fixed file path of the currently connected USB flash drive to obtain the firmware upgrade file.
[0069] S202: Parse the firmware upgrade file using a data parsing protocol corresponding to the target firmware upgrade method.
[0070] In the implementation manner of the present application, the firmware upgrade files of all firmware upgrade methods are parsed through a data parsing protocol, and there is no need to develop a parsing software for each firmware upgrade method.
[0071] Example 1: If the target firmware upgrade mode is OTA upgrade mode and serial port upgrade mode, the data parsing protocol corresponding to the target firmware upgrade mode is the serial port data parsing protocol; that is, the serial port data parsing protocol is used to parse the firmware upgrade files of all firmware upgrade modes.
[0072] Specifically, the firmware upgrade file is parsed using the data parsing protocol corresponding to the target firmware upgrade method through the following steps:
[0073] Step 1: Determine whether the firmware upgrade method corresponding to the firmware upgrade file is the same as the target firmware upgrade method.
[0074] Step 2: According to the judgment result and the firmware upgrade file, determine the target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method.
[0075] In an implementation manner of the present application, if the firmware upgrade method corresponding to the firmware upgrade file is different from the target firmware upgrade method, the firmware upgrade file is converted into a target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method; if the firmware upgrade method corresponding to the firmware upgrade file is the same as the target firmware upgrade method, the firmware upgrade file is determined as the target firmware upgrade file.
[0076] Example 2. Based on Example 1, if the firmware upgrade method corresponding to the firmware upgrade file is the OTA upgrade method or the serial port upgrade method, the firmware upgrade file is determined as the target firmware upgrade file. Since the communication protocol followed by the firmware upgrade file corresponding to the OTA upgrade method and the firmware upgrade file corresponding to the serial port upgrade method is the same, there is no need to convert the firmware upgrade file corresponding to the OTA upgrade method.
[0077] Example 3, based on Example 1, if the firmware upgrade method corresponding to the firmware upgrade file is the USB flash drive upgrade method, the firmware upgrade file is converted into a target firmware upgrade file that complies with the serial port communication protocol through the USB flash drive to serial port virtual channel.
[0078] Step 3: parse the target firmware upgrade file using a data parsing protocol corresponding to the target firmware upgrade method.
[0079] Furthermore, after step S202, the method further includes: if the firmware upgrade mode corresponding to the firmware upgrade file is a serial port upgrade mode, sending a response signal to the host computer to confirm that the data has been correctly received and processed.
[0080] S203: Write the parsed firmware upgrade file into the buffer.
[0081] In an embodiment of the present application, if the hybrid power supply includes a memory, the parsed firmware upgrade file is stored in a corresponding storage location in the memory; the firmware upgrade file read from the memory is written to the buffer; if the hybrid power supply does not include a memory, the parsed firmware upgrade file is directly written to the buffer.
[0082] The memory may be SPI FLASH. A storage location corresponding to the parsed firmware upgrade file of each CPU is pre-established in the memory; and the storage location corresponding to the parsed firmware upgrade file of each CPU is independent.
[0083] In addition, the check value corresponding to the parsed firmware upgrade file is calculated, and if the check value is the same as the check value of the CPU firmware corresponding to the firmware upgrade file, the parsed firmware upgrade file is stored in the corresponding storage location in the memory. If the check value is different from the check value of the CPU firmware corresponding to the firmware upgrade file, it is not stored.
[0084] Furthermore, the firmware upgrade file read from the memory is written into the buffer or the parsed firmware upgrade file is directly written into the buffer, including: converting the read firmware upgrade file or the parsed firmware upgrade file according to the internal distribution upgrade protocol and then writing it into the buffer.
[0085] In the implementation manner of the present application, the internal distribution upgrade protocol is a communication protocol between CPUs inside the hybrid power system, which ensures that the firmware files stored in the buffer are files that can be distributed to other CPUs; therefore, regardless of whether the hybrid power supply contains a memory, subsequent firmware distribution upgrades can be achieved through the buffer.
[0086] S204: Distribute the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade.
[0087] In an implementation manner of the present application, the firmware upgrade file of each CPU in the buffer is read sequentially; a determination is made as to whether the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU; if the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU, the firmware upgrade file in the buffer is distributed to the corresponding CPU for firmware upgrade.
[0088] Here, in addition to the above-mentioned control of the version of the firmware upgrade file, the upgrade permission of the firmware upgrade file can also be verified. The execution of firmware distribution and upgrade rules through this smart contract can reduce errors and improve the stability of the system.
[0089] Specifically, the firmware upgrade file in the buffer is distributed to the corresponding CPU for firmware upgrade, including:
[0090] Step 1: Calculate the hash value of the firmware upgrade file in the buffer; and use the private key to digitally sign the firmware upgrade file in the buffer to obtain signature information.
[0091] Step 2: Store the hash value and signature information of the firmware upgrade file in the buffer on the blockchain;
[0092] In the implementation mode of the present application, the operation of uploading the hash value of the firmware upgrade file in the buffer to the chain can provide an unalterable identifier for the firmware upgrade file in the buffer, ensuring that the firmware upgrade file is not maliciously tampered with during redistribution. The operation of uploading the signature information of the firmware upgrade file in the buffer to the chain ensures the source and integrity of the firmware upgrade file in the buffer.
[0093] Step 3: Distribute the firmware upgrade file in the buffer, the hash value and signature information corresponding to the firmware upgrade file in the buffer stored on the blockchain to the corresponding CPU, so that the corresponding CPU verifies the firmware upgrade file in the buffer based on the hash value and signature information before upgrading.
[0094] In the implementation manner of the present application, the corresponding CPU performs a firmware upgrade after successful verification to ensure that the firmware upgrade file upgraded by the corresponding CPU has not been tampered with, thereby improving the user's trust in the system.
[0095] Furthermore, after the firmware upgrade is successfully completed, the corresponding CPU (the CPU that receives the firmware upgrade file in the buffer) stores the upgrade result on the blockchain.
[0096] In the implementation manner of the present application, the upgrade result includes the upgrade time, device ID, etc. In this way, a traceable upgrade history is formed.
[0097] Here, through the above-mentioned automated firmware distribution and upgrade management, the efficiency of firmware distribution and upgrade is improved and the operating cost is reduced.
[0098] Further, the firmware upgrade file in the buffer and the corresponding hash value and signature information are distributed to the corresponding CPU, including: sending a handshake instruction to the corresponding CPU to enable the corresponding CPU to enter the Boot mode; after receiving the Boot mode entry completion information sent by the corresponding CPU, sending an erase instruction to the corresponding CPU to enable the corresponding CPU to erase the firmware corresponding to the firmware upgrade file in the buffer; after receiving the erase completion information sent by the corresponding CPU, the firmware upgrade file in the buffer and the corresponding hash value and signature information are packaged and sent to the corresponding CPU, so that the corresponding CPU completes the firmware upgrade.
[0099] The embodiment of the present application provides a hybrid power CPU firmware upgrade method, the method comprising: obtaining a firmware upgrade file; parsing the firmware upgrade file using a data parsing protocol corresponding to a target firmware upgrade method; writing the parsed firmware upgrade file into a buffer; distributing the firmware upgrade file in the buffer to a corresponding CPU for firmware upgrade. The present application can parse the firmware upgrade files corresponding to all firmware upgrade methods based on the same data parsing protocol, and regardless of whether the hybrid power system includes an SPI FLASH memory, the firmware upgrade file can be distributed to the corresponding CPU in the same manner, thereby reducing the software redundancy of the hybrid power system.
[0100] Reference Figure 3 As shown, it is a flow chart of another hybrid power CPU firmware upgrade method provided in an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0101] S301, determining whether a firmware upgrade method corresponding to a firmware upgrade file is the same as a target firmware upgrade method.
[0102] S302: Determine a target firmware upgrade file that complies with a data parsing protocol corresponding to a target firmware upgrade method according to the determination result and the firmware upgrade file.
[0103] In an implementation manner of the present application, if the firmware upgrade method corresponding to the firmware upgrade file is different from the target firmware upgrade method, the firmware upgrade file is converted into a target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method; if the firmware upgrade method corresponding to the firmware upgrade file is the same as the target firmware upgrade method, the firmware upgrade file is determined as the target firmware upgrade file.
[0104] S303: parse the target firmware upgrade file using a data parsing protocol corresponding to the target firmware upgrade method.
[0105] Based on the same inventive concept, a hybrid power supply CPU firmware upgrade system corresponding to the hybrid power supply CPU firmware upgrade method is also provided in the embodiment of the present application. Since the principle of solving the problem by the system in the embodiment of the present application is similar to the above-mentioned hybrid power supply CPU firmware upgrade method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0106] Reference Figure 4 FIG. 1 is a schematic diagram of a hybrid power CPU firmware upgrade system provided in an embodiment of the present application. The firmware upgrade system can run on an ARM processor of a hybrid power supply. The hybrid power CPU firmware upgrade system includes:
[0107] The acquisition module 401 is used to acquire the firmware upgrade file;
[0108] Parsing module 402, used to parse the firmware upgrade file using a data parsing protocol corresponding to the target firmware upgrade mode;
[0109] The writing module 403 is used to write the parsed firmware upgrade file into the buffer;
[0110] The distribution module 404 is used to distribute the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade.
[0111] In one possible implementation, the parsing module 402 is specifically used to determine whether the firmware upgrade method corresponding to the firmware upgrade file is the same as the target firmware upgrade method; determine the target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method based on the judgment result and the firmware upgrade file; and parse the target firmware upgrade file using the data parsing protocol corresponding to the target firmware upgrade method.
[0112] In one possible implementation, the parsing module 402 is specifically used to convert the firmware upgrade file into a target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method if the firmware upgrade method corresponding to the firmware upgrade file is different from the target firmware upgrade method; if the firmware upgrade method corresponding to the firmware upgrade file is the same as the target firmware upgrade method, the firmware upgrade file is determined as the target firmware upgrade file.
[0113] In a possible implementation, the writing module 403 is specifically configured to store the parsed firmware upgrade file to a corresponding storage location in the memory if the hybrid power system includes a memory; and write the firmware upgrade file read from the memory to the buffer.
[0114] In a possible implementation manner, the writing module 403 is specifically configured to directly write the parsed firmware upgrade file into the buffer if the hybrid power system does not include a memory.
[0115] In one possible implementation, the distribution module 404 is specifically used to determine whether the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU; if the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU, the firmware upgrade file in the buffer is distributed to the corresponding CPU for firmware upgrade.
[0116] In one possible implementation, the distribution module 404 is specifically used to calculate the hash value of the firmware upgrade file in the buffer; and use the private key to digitally sign the firmware upgrade file in the buffer to obtain signature information; store the hash value of the firmware upgrade file in the buffer and the signature information on the blockchain; distribute the firmware upgrade file in the buffer, the hash value and signature information corresponding to the firmware upgrade file in the buffer stored on the blockchain to the corresponding CPU, so that the corresponding CPU verifies the firmware upgrade file in the buffer based on the hash value and the signature information before upgrading.
[0117] In a possible implementation, after the firmware is successfully upgraded, the corresponding CPU stores the upgrade result on the blockchain.
[0118] The embodiment of the present application provides a hybrid power CPU firmware upgrade system, which includes: an acquisition module 401, used to acquire a firmware upgrade file; a parsing module 402, used to parse the firmware upgrade file using a data parsing protocol corresponding to a target firmware upgrade method; a writing module 403, used to write the parsed firmware upgrade file into a buffer; a distribution module 404, used to distribute the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade. Through the present application, the firmware upgrade files corresponding to all firmware upgrade methods can be parsed based on the same data parsing protocol, and regardless of whether the hybrid power system includes an SPI FLASH memory, the firmware upgrade file can be distributed to the corresponding CPU in the same manner, reducing the software redundancy of the hybrid power system.
[0119] like Figure 5 As shown, an electronic device 500 provided in an embodiment of the present application includes: a processor 501, a memory 502 and a bus, wherein the memory 502 stores machine-readable instructions executable by the processor 501. When the electronic device is running, the processor 501 communicates with the memory 502 through the bus, and the processor 501 executes the machine-readable instructions to perform the steps of the hybrid power CPU firmware upgrade method as described above.
[0120] Specifically, the memory 502 and the processor 501 can be general-purpose memories and processors, which are not specifically limited here. When the processor 501 runs the computer program stored in the memory 502, the hybrid power CPU firmware upgrade method can be executed.
[0121] Corresponding to the above hybrid power CPU firmware upgrade method, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above hybrid power CPU firmware upgrade method are executed.
[0122] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0123] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 solution of this embodiment.
[0124] 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.
[0125] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the information processing method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0126] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A hybrid power CPU firmware upgrade method, characterized in that: The method comprises: Get the firmware upgrade file; Parsing the firmware upgrade file using a data parsing protocol corresponding to the target firmware upgrade method; Write the parsed firmware upgrade file into the buffer; Distribute the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade.
2. The hybrid power CPU firmware upgrade method according to claim 1, characterized in that: The adopting of a data parsing protocol corresponding to the target firmware upgrade mode to parse the firmware upgrade file includes: Determine whether the firmware upgrade mode corresponding to the firmware upgrade file is the same as the target firmware upgrade mode; Determine, according to the judgment result and the firmware upgrade file, a target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method; The target firmware upgrade file is parsed using a data parsing protocol corresponding to the target firmware upgrade method.
3. The hybrid power CPU firmware upgrade method according to claim 2, characterized in that: The step of determining, based on the judgment result and the firmware upgrade file, a target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade method comprises: If the firmware upgrade mode corresponding to the firmware upgrade file is different from the target firmware upgrade mode, converting the firmware upgrade file into a target firmware upgrade file that complies with the data parsing protocol corresponding to the target firmware upgrade mode; If the firmware upgrade mode corresponding to the firmware upgrade file is the same as the target firmware upgrade mode, the firmware upgrade file is determined as the target firmware upgrade file.
4. The hybrid power CPU firmware upgrade method according to claim 1, characterized in that: The step of writing the parsed firmware upgrade file into the buffer includes: If the hybrid power supply includes a memory, storing the parsed firmware upgrade file in a corresponding storage location in the memory; The firmware upgrade file read from the memory is stored in the buffer.
5. The hybrid power supply CPU firmware upgrade method according to claim 1, characterized in that: Write the parsed firmware upgrade file to the buffer, including: If the hybrid power supply does not include a memory, the parsed firmware upgrade file is directly written into a buffer.
6. The hybrid power CPU firmware upgrade method according to claim 5, characterized in that: The step of distributing the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade includes: Determine whether the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU; If the version of the firmware upgrade file in the buffer is higher than the current version of the corresponding CPU, the firmware upgrade file in the buffer is distributed to the corresponding CPU for firmware upgrade.
7. The hybrid power supply CPU firmware upgrade method according to claim 1 or 6, characterized in that: The step of distributing the firmware upgrade file in the buffer to the corresponding CPU for firmware upgrade includes: Calculate the hash value of the firmware upgrade file in the buffer; and use the private key to digitally sign the firmware upgrade file in the buffer to obtain signature information; Storing the hash value and the signature information of the firmware upgrade file in the buffer on the blockchain; The firmware upgrade file in the buffer, the hash value corresponding to the firmware upgrade file in the buffer stored on the blockchain, and the signature information are distributed to the corresponding CPU, so that the corresponding CPU verifies the firmware upgrade file in the buffer based on the hash value and the signature information before upgrading.
8. The hybrid power supply CPU firmware upgrade method according to claim 7, characterized in that: After the firmware is successfully upgraded, the corresponding CPU stores the upgrade result on the blockchain.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the hybrid power CPU firmware upgrade method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the hybrid power CPU firmware upgrade method according to any one of claims 1 to 8 are executed.