Firmware upgrading method and device, equipment, storage medium and program product
By using the target compilation environment in the photovoltaic inverter to generate and compress firmware upgrade files, the problem of long firmware upgrade time is solved, and the upgrade speed and maintenance efficiency are improved.
Patent Information
- Application Number
- CN202411829988.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-12
AI Technical Summary
The existing photovoltaic inverter firmware upgrade methods have problems with long upgrade time, resulting in low after-sales maintenance work efficiency and poor user experience.
By generating the first firmware upgrade file based on the pre-configured target compilation environment, compressing it, obtaining the second firmware upgrade file, thereby achieving a rapid upgrade of the photovoltaic inverter firmware.
The firmware upgrade file size is reduced, and the firmware upgrade speed of photovoltaic inverters is improved, thereby improving after-sales maintenance work efficiency and user experience.
Smart Images

Figure CN119847557A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power electronics technology, and in particular to a firmware upgrade method, device, equipment, storage medium and program product. Background Art
[0002] At present, there are generally two ways to upgrade the firmware of photovoltaic inverters: download the firmware from the cloud platform to the gateway device, and the gateway device transfers the recommended standard 485 (RS485) bus, power line carrier and other wired methods; or download the firmware from the cloud platform to the mobile phone, and the mobile phone directly connects to wireless fidelity (Wireless Fidelity, WIFI), Bluetooth and other wireless methods. Among them, RS485 bus and power line carrier are limited by communication baud rate, WIFI is limited by signal strength and communication distance, and Bluetooth is limited by signal strength, communication distance and connection interval parameters. When the size of the firmware upgrade file is large, the upgrade time is very long, resulting in low efficiency of after-sales maintenance work and poor user experience. Summary of the invention
[0003] The present application provides a firmware upgrade method, device, equipment, storage medium and program product, which can improve the firmware upgrade speed of a photovoltaic inverter.
[0004] In a first aspect, an embodiment of the present application provides a firmware upgrade method, including: generating a first firmware upgrade file based on a preconfigured target compilation environment; compressing the first firmware upgrade file to obtain a second firmware upgrade file; and upgrading the firmware of a photovoltaic inverter based on the second firmware upgrade file.
[0005] In the second aspect, an embodiment of the present application also provides a firmware upgrade device, including: a file generation module, used to generate a first firmware upgrade file based on a pre-configured target compilation environment; a file compression module, used to compress the first firmware upgrade file to obtain a second firmware upgrade file; a firmware upgrade module, used to upgrade the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0006] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the firmware upgrade method as described in the embodiment of the present application.
[0007] In a fourth aspect, an embodiment of the present application further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the firmware upgrade method as described in the embodiment of the present application.
[0008] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the firmware upgrade method as described in the embodiment of the present application.
[0009] The technical solution of the embodiment of the present application generates a first firmware upgrade file based on a pre-configured target compilation environment; compresses the first firmware upgrade file to obtain a second firmware upgrade file; and upgrades the firmware of the photovoltaic inverter based on the second firmware upgrade file. The embodiment of the present disclosure reduces the size of the firmware upgrade file through the target compilation environment, and further reduces the size of the firmware upgrade file through compression, which can increase the firmware upgrade speed of the photovoltaic inverter, thereby improving the efficiency of after-sales maintenance work and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0011] Figure 1 A flowchart of a firmware upgrade method provided in an embodiment of the present application;
[0012] Figure 2 A flowchart of another firmware upgrade method provided in an embodiment of the present application;
[0013] Figure 3 A flowchart of another firmware upgrade method provided in an embodiment of the present application
[0014] Figure 4 A schematic diagram of the structure of a firmware upgrade device provided in an embodiment of the present application;
[0015] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0017] It should be understood that the various steps recorded in the method implementation of the present disclosure can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect. The term "including" and its variations used herein are open inclusions, that is, "including but not limited to". It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless otherwise clearly stated in the context, it should be understood as "one or more". It is understandable that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of the corresponding laws, regulations and relevant provisions.
[0018] Figure 1 The following is a flowchart of a firmware upgrade method provided in an embodiment of the present application. The embodiment of the present application is applicable to the case of upgrading the firmware of a photovoltaic inverter. The method can be executed by a firmware upgrade device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC, or a server. Figure 1 As shown, the method includes:
[0019] S110: Generate a first firmware upgrade file based on a pre-configured target compilation environment.
[0020] The target compilation environment can be used to compile and control the source code of the photovoltaic inverter, for example, to limit the compilation to the modified part of the source code. The first firmware upgrade file can be understood as a firmware upgrade file generated in the target compilation environment. The firmware can be understood as software embedded in the photovoltaic inverter.
[0021] In this embodiment, the currently modified source code of the photovoltaic inverter can be obtained, and based on the currently modified source code, a compilation tool is used in combination with a target compilation environment to generate a corresponding first firmware upgrade file. The currently modified source code can be a modification made based on the latest current business needs.
[0022] In this embodiment, compilation is performed in combination with the target compilation environment, so that during compilation, the modified part of the source code is compiled. Compared with the method of compiling the entire source code, the size of the generated firmware upgrade file is smaller, that is, the size of the first firmware upgrade file is smaller, which is equivalent to trimming the firmware upgrade file generated by compiling the entire source code.
[0023] S120: compress the first firmware upgrade file to obtain a second firmware upgrade file.
[0024] The second firmware upgrade file may be a firmware upgrade file compressed from the first firmware upgrade file. In this embodiment, any compression algorithm may be used to compress the first firmware upgrade file to reduce the size of the first firmware upgrade file. For example, the compression algorithm may be a lossless compression algorithm or a lossy compression algorithm.
[0025] Optionally, compressing the first firmware upgrade file to obtain the second firmware upgrade file includes: dividing the first firmware upgrade file into multiple data blocks; compressing the multiple data blocks respectively to obtain multiple compressed data blocks; counting the byte lengths of the multiple compressed data blocks respectively; writing the multiple compressed data blocks and the byte lengths of the multiple compressed data blocks into the first compressed file accordingly to obtain the second firmware upgrade file.
[0026] The first compressed file can be understood as a file including only a compressed file header, that is, without specific compressed data and the byte length of the compressed data. After the first compressed file is filled with multiple compressed data blocks and the byte lengths of the multiple compressed data blocks, it can be called a second firmware upgrade file.
[0027] In this embodiment, there is no restriction on the byte length of each compressed data block, for example, the length of each compressed data block may be 4 bytes.
[0028] In this embodiment, the first firmware upgrade file can be divided into multiple data blocks according to the specified byte length (i.e., the number of bytes). The byte length of each data block may be the same or different. Exemplarily, multiple data blocks may be recorded as data block 1, data block 2, ..., data block N. Wherein N is a positive integer. All data blocks may be compressed separately using a firmware compression tool software written using a pre-selected compression algorithm to obtain multiple compressed data blocks. Multiple compressed data blocks may be temporarily stored in a random access memory (RAM) buffer, and multiple compressed data blocks may be recorded as compressed data block 1, compressed data block 2, ..., compressed data block N. The byte lengths of all compressed data blocks are counted separately. The position order of the multiple compressed data blocks in the RAM buffer and the byte lengths of the multiple compressed data blocks corresponding to the writing of the compressed file may be: compressed data block 1, the byte length of compressed data block 1, compressed data block 2, the byte length of compressed data block 2, ..., compressed data block N, the byte length of compressed data block N.
[0029] In this embodiment, by compressing the first firmware upgrade file into blocks and recording the byte length of each compressed data block, the size of the firmware upgrade file is effectively reduced, the transmission and storage efficiency is improved, and the file management and data integrity are also enhanced. The size of the second firmware upgrade file is eventually smaller.
[0030] Optionally, multiple compressed data blocks and the byte lengths of the multiple compressed data blocks are written into the first compressed file accordingly to obtain a second firmware upgrade file, including: starting from a set position in the first compressed file, multiple compressed data blocks and the byte lengths of the multiple compressed data blocks are written into corresponding positions in the first compressed file to obtain the second compressed file; wherein the set position is located at the set byte length in the first compressed file, and the position between the beginning and the set byte length in the first compressed file is used to store the set configuration information of the first compressed file; and byte alignment padding is performed at the end of the second compressed file to obtain the second firmware upgrade file.
[0031] In this embodiment, there is no restriction on the setting byte length, for example, it can be 256 bytes. Exemplarily, the setting byte length takes 256 bytes as an example, and the position between the beginning of the first compressed file and the setting byte length, that is, 0-255 bytes in the first compressed file, is used to store the setting configuration information of the first compressed file. The setting configuration information can be understood as a compressed file header. In this embodiment, there is no restriction on the setting configuration information, for example, it can include the unique identity information of the first compressed file, the compression algorithm used, the encryption algorithm, etc.
[0032] Exemplarily, byte alignment padding is performed at the end of the second compressed file, and hexadecimal number 0xFF can be used for padding to align to the target byte length. In this embodiment, there is no restriction on the target byte length, for example, it can be an even byte length or an odd byte length. After padding to the target byte length, the second firmware upgrade file can be obtained.
[0033] In this embodiment, by accurately controlling the writing position of the compressed data block and the byte length of the compressed data block, the utilization efficiency of the file storage space can be improved and the total size of the second firmware upgrade file can be reduced. Performing byte alignment padding at the end of the second compressed file can ensure that the second firmware upgrade file meets the requirements of the photovoltaic inverter hardware or operating system, improve the compatibility and performance of the second firmware upgrade file, and reduce errors in the data transmission process.
[0034] S130: Upgrade the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0035] In this embodiment, the second firmware upgrade file can be uploaded to the cloud platform, downloaded from the cloud platform to the gateway device via Ethernet, and transmitted from the gateway device to the photovoltaic inverter via wired transmission, and the firmware corresponding to the photovoltaic inverter is upgraded based on the second firmware upgrade file. During the upgrade process, the firmware corresponding to the photovoltaic inverter is decompressed according to the decompression algorithm corresponding to the compression algorithm pre-embedded in the firmware corresponding to the photovoltaic inverter, and then the firmware corresponding to the photovoltaic inverter is upgraded according to the decompressed second firmware upgrade file.
[0036] Exemplarily, the original firmware upgrade file that has not been compiled by the target compilation environment and has not been compressed is uploaded to the cloud platform. The size of the original firmware upgrade file is 800KB. The second firmware upgrade file is downloaded from the cloud platform to the gateway device, and the second firmware upgrade file is transferred from the gateway device to the photovoltaic inverter. The firmware upgrade operation is performed on the cloud platform. The time taken for the firmware upgrade is 14 minutes and 13 seconds. The second firmware upgrade file that has been compiled and compressed by the target compilation environment is uploaded to the cloud platform. The size of the second firmware upgrade file is 370KB. The firmware upgrade operation is performed on the cloud platform: the second firmware upgrade file is downloaded from the cloud platform to the gateway device, and the second firmware upgrade file is transferred from the gateway device to the photovoltaic inverter. The firmware of the photovoltaic inverter is upgraded. The time taken for the firmware upgrade is 6 minutes and 48 seconds.
[0037] In this embodiment, the method of upgrading the firmware of the photovoltaic inverter through the second firmware upgrade file can reduce the amount of file data transmitted from the gateway device to the photovoltaic inverter and improve the firmware upgrade speed.
[0038] In this embodiment, the second firmware upgrade file can be downloaded from the cloud platform to the terminal device. In this embodiment, there is no restriction on the terminal device, for example, it can be a mobile phone. The second firmware upgrade file is transmitted from the terminal device to the photovoltaic inverter by wireless transmission, and the firmware corresponding to the photovoltaic inverter is upgraded based on the second firmware upgrade file. During the upgrade process, the firmware corresponding to the photovoltaic inverter is decompressed according to the decompression algorithm corresponding to the compression algorithm pre-embedded in the firmware corresponding to the photovoltaic inverter, and then the firmware corresponding to the photovoltaic inverter is upgraded according to the decompressed second firmware upgrade file.
[0039] Exemplarily, the original firmware upgrade file that has not been compiled by the target compilation environment and has not been compressed is uploaded to the cloud platform, the size of the original firmware upgrade file is 800KB, the second firmware upgrade file is downloaded from the cloud platform to the terminal device, the second firmware upgrade file is transferred from the terminal device to the photovoltaic inverter, and the firmware upgrade operation is performed on the terminal device, and the time taken for the firmware upgrade is 8 minutes and 4 seconds. The second firmware upgrade file that has been compiled and compressed by the target compilation environment is uploaded to the cloud platform, the size of the second firmware upgrade file is 370KB, the second firmware upgrade file is downloaded from the cloud platform to the terminal device, the second firmware upgrade file is transferred from the terminal device to the photovoltaic inverter, and the firmware upgrade operation is performed on the terminal device, and the time taken for the firmware upgrade is 3 minutes and 57 seconds.
[0040] In this embodiment, the method of upgrading the firmware of the photovoltaic inverter through the second firmware upgrade file can reduce the amount of file data transmitted from the terminal device to the photovoltaic inverter and improve the firmware upgrade speed.
[0041] The technical solution of the embodiment of the present application generates a first firmware upgrade file based on a pre-configured target compilation environment; compresses the first firmware upgrade file to obtain a second firmware upgrade file; and upgrades the firmware of the photovoltaic inverter based on the second firmware upgrade file. The embodiment of the present disclosure reduces the size of the firmware upgrade file by using the target compilation environment, and further reduces the size of the firmware upgrade file by compression, which can increase the firmware upgrade speed of the photovoltaic inverter, thereby improving the efficiency of after-sales maintenance work and improving user experience.
[0042] Figure 2 This is another firmware upgrade method flow chart provided by the embodiment of the present application. The embodiment of the present application is a specific implementation based on the above invention embodiment. Figure 2 The method provided in the embodiment of the present application specifically includes the following steps:
[0043] S210. Obtain the current target source code of the photovoltaic inverter.
[0044] The current target source code includes the currently modified source code and / or the currently unmodified source code.
[0045] In this embodiment, the current target source code after the source code of the photovoltaic inverter is modified according to the current latest demand can be obtained. The current target source code includes the source code of the modified part of the photovoltaic inverter and the source code of part of the unmodified part. Alternatively, the current target source code includes all the modified source codes of the photovoltaic inverter (that is, the source codes of all levels are modified). Alternatively, the current target source code includes all the unmodified source codes of the photovoltaic inverter.
[0046] Optionally, the configuration process of the target compilation environment is as follows, including: dividing the source code of the photovoltaic inverter into multiple levels; configuring corresponding macro definitions for the source code of each level to control the compilation of the source code of each level.
[0047] Among them, the macro definition of each level is used to indicate that when the source code of the corresponding level is modified, the source code of the corresponding level is compiled. In this embodiment, there is no restriction on the specific macro definition. For example, when the firmware of the photovoltaic inverter is shipped, the source code of all layers is compiled. When the source code of a certain level is modified, the level where the modified source code is located is compiled, and the level where the unmodified source code is located is not compiled, so that the compilation control can be achieved.
[0048] In this embodiment, the source code of the photovoltaic inverter can be divided into multiple levels according to any method. For example, the source code of the photovoltaic inverter can be layered according to the hardware source code, the operating system source code, and the application software source code; the source code of the photovoltaic inverter can also be layered according to different functional modules; the source code of the photovoltaic inverter can also be divided into different technical levels according to the technology stack, such as the front end, the back end, the database, etc.
[0049] In this embodiment, by dividing the source code of the photovoltaic inverter into multiple levels and configuring corresponding macro definitions for the source code of each level, it is possible to independently compile source codes of different levels, so that when the source code of a certain level is modified, only the source code of the corresponding level is recompiled instead of the entire source code, thereby improving compilation efficiency and flexibility, thereby making the file size of the generated first firmware upgrade file smaller.
[0050] Optionally, the source code of the photovoltaic inverter is divided into multiple levels, including: dividing the source code of the photovoltaic inverter into photovoltaic inverter chip driver source code, system communication source code and business application source code in sequence; configuring the photovoltaic inverter chip driver source code as a driver layer; configuring the system communication source code as a middle layer; configuring the business application source code as an application layer.
[0051] Exemplarily, the entire source code of the photovoltaic inverter is divided into photovoltaic inverter chip driver source code, system communication source code and business application source code in sequence; wherein the system communication source code may include source codes such as operating system and protocol stack. Business application source code is source code related to the business.
[0052] In this embodiment, the photovoltaic inverter chip driver source code is configured as the driver layer; the system communication source code is configured as the middle layer; and the business application source code is configured as the application layer, providing an effective layering method to make the firmware upgrade of the photovoltaic inverter more efficient.
[0053] S220. Determine a target level corresponding to the current target source code based on the target compilation environment.
[0054] The target level is the level where the currently modified source code is located among multiple levels.
[0055] In this embodiment, there is no restriction on the target level, for example, it can be 0, 1, or multiple. If the current target source code includes all the unmodified source codes of the photovoltaic inverter, the target level can be 0. If the current target source code includes all the modified source codes of the photovoltaic inverter, the number of target levels is the total number of levels. If the current target source code includes the modified source code of the photovoltaic inverter and some unmodified source codes, the target level can be 1 or multiple, and in this case, the number of target levels is less than the total number of levels.
[0056] S230: Compile the source code corresponding to the target level to obtain a first firmware upgrade file.
[0057] In this embodiment, the source code corresponding to the target layer is compiled, that is, the source code of the modified part is edited, so as to obtain the first firmware upgrade file.
[0058] S240: compress the first firmware upgrade file to obtain a second firmware upgrade file.
[0059] S250: Upgrade the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0060] The technical solution of the embodiment of the present application obtains the current target source code of the photovoltaic inverter; determines the target level corresponding to the current target source code based on the target compilation environment; compiles the source code corresponding to the target level to obtain a first firmware upgrade file; compresses the first firmware upgrade file to obtain a second firmware upgrade file; and upgrades the firmware of the photovoltaic inverter based on the second firmware upgrade file. The embodiment of the present disclosure determines the target level corresponding to the current target source code through the target compilation environment; the source code corresponding to the target level is compiled, which can improve the compilation efficiency, and targeted compilation can reduce the size of the firmware upgrade file. The size of the firmware upgrade file can be further reduced by compression, thereby effectively improving the firmware upgrade speed of the photovoltaic inverter, thereby improving the efficiency of after-sales maintenance work and improving user experience.
[0061] Figure 3 A flowchart of another firmware upgrade method provided in an embodiment of the present application.
[0062] S301. Obtain a compression algorithm and a corresponding decompression algorithm.
[0063] In this embodiment, there is no limitation on the compression algorithm and the decompression algorithm, and the algorithms may be, for example, fastLZ, quickLZ, miniLZO, RLE, etc. These algorithms provide compression and decompression functions.
[0064] S302: embed the obtained decompression algorithm into the photovoltaic inverter.
[0065] S303, configure the target compilation environment.
[0066] S304: Generate a first firmware upgrade file based on a pre-configured target compilation environment.
[0067] In this embodiment, the format of the first firmware upgrade file is not limited, for example, it can be .bin. The first firmware upgrade file can be recorded as firmware.bin.
[0068] S305, compiling the compression algorithm into firmware compression tool software.
[0069] Exemplarily, the firmware compression tool software may be recorded as compress_ware.
[0070] S306: Compress the first firmware upgrade file using firmware compression tool software to obtain a second firmware upgrade file.
[0071] Exemplarily, the second firmware upgrade file may be recorded as compress_firmware.bin.
[0072] S307: Upgrade the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0073] In this embodiment, the size of the firmware upgrade file can be reduced by combining the target compilation environment with the compression algorithm, thereby reducing the amount of file data transmission during the remote upgrade of the photovoltaic inverter, thereby achieving the purpose of increasing the firmware upgrade speed and improving the efficiency of after-sales maintenance.
[0074] Figure 4 A schematic diagram of the structure of a firmware upgrade device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the device includes: a file generation module 410, a file compression module 420 and a firmware upgrade module 430;
[0075] A file generation module 410, configured to generate a first firmware upgrade file based on a pre-configured target compilation environment;
[0076] A file compression module 420, configured to compress the first firmware upgrade file to obtain a second firmware upgrade file;
[0077] The firmware upgrade module 430 is used to upgrade the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0078] The technical solution of the embodiment of the present application generates a first firmware upgrade file based on a pre-configured target compilation environment through a file generation module; compresses the first firmware upgrade file through a file compression module to obtain a second firmware upgrade file; and upgrades the firmware of the photovoltaic inverter based on the second firmware upgrade file through a firmware upgrade module. The embodiment of the present disclosure reduces the size of the firmware upgrade file through a target compilation environment, and further reduces the size of the firmware upgrade file through compression, which can increase the firmware upgrade speed of the photovoltaic inverter, thereby improving the efficiency of after-sales maintenance work and improving user experience.
[0079] Optionally, the above-mentioned device also includes a configuration module, which is used to: divide the source code of the photovoltaic inverter into multiple levels; configure corresponding macro definitions for the source code of each level to compile and control the source code of each level; wherein the macro definition of each level is used to indicate that when the source code of the corresponding level is modified, the source code of the corresponding level is compiled.
[0080] Optionally, the above-mentioned device also includes a configuration module, which is also used to: divide the source code of the photovoltaic inverter into photovoltaic inverter chip driver source code, system communication source code and business application source code in sequence; configure the photovoltaic inverter chip driver source code as a driver layer; configure the system communication source code as an intermediate layer; configure the business application source code as an application layer.
[0081] Optionally, the file generation module is specifically used to: obtain the current target source code of the photovoltaic inverter; wherein the current target source code includes the currently modified source code and / or the currently unmodified source code; determine the target level corresponding to the current target source code based on the target compilation environment; wherein the target level is the level where the currently modified source code is located among the multiple levels; compile the source code corresponding to the target level to obtain a first firmware upgrade file.
[0082] Optionally, the file compression module is specifically used to: divide the first firmware upgrade file into multiple data blocks; compress the multiple data blocks respectively to obtain multiple compressed data blocks; count the byte lengths of the multiple compressed data blocks respectively; write the multiple compressed data blocks and the byte lengths of the multiple compressed data blocks into the first compressed file accordingly to obtain the second firmware upgrade file.
[0083] Optionally, the file compression module is also used to: starting from a set position of the first compressed file, write the multiple compressed data blocks and the byte lengths of the multiple compressed data blocks into corresponding positions in the first compressed file to obtain a second compressed file; wherein the set position is located at a set byte length in the first compressed file, and the position between the beginning and the set byte length in the first compressed file is used to store the setting configuration information of the first compressed file; perform byte alignment padding at the end of the second compressed file to obtain a second firmware upgrade file.
[0084] The firmware upgrade device provided in the embodiments of the present application can execute the firmware upgrade method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0085] Figure 5 A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0086] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0087] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0088] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as method firmware upgrade.
[0089] In some embodiments, the method firmware upgrade may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method firmware upgrade described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method firmware upgrade in any other appropriate manner (e.g., by means of firmware).
[0090] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0091] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0092] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0093] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0094] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0095] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0096] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements a firmware upgrade method as provided in any embodiment of the present application.
[0097] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present application, and the programming language includes an object-oriented programming language, such as Java, Smalltalk, C++, and also includes a conventional procedural programming language, such as "C" language or similar programming language. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0098] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A firmware upgrade method, characterized in that: include: Generate a first firmware upgrade file based on a preconfigured target compilation environment; Compressing the first firmware upgrade file to obtain a second firmware upgrade file; The firmware of the photovoltaic inverter is upgraded based on the second firmware upgrade file.
2. The method according to claim 1, characterized in that The configuration process of the target compilation environment is as follows, including: Dividing the source code of the photovoltaic inverter into multiple levels; A corresponding macro definition is configured for each level of source code to perform compilation control on the source code of each level; wherein the macro definition of each level is used to indicate that when the source code of the corresponding level is modified, the source code of the corresponding level is compiled.
3. The method according to claim 2, characterized in that The source code of the photovoltaic inverter is divided into multiple levels, including: Dividing the source code of the photovoltaic inverter into photovoltaic inverter chip driving source code, system communication source code and business application source code in sequence; Configuring the photovoltaic inverter chip driver source code as a driver layer; Configuring the system communication source code as an intermediate layer; The business application source code is configured as an application layer.
4. The method according to any one of claims 2 to 3, characterized in that: Generate a first firmware upgrade file based on a pre-configured target compilation environment, including: Acquire the current target source code of the photovoltaic inverter; wherein the current target source code includes the currently modified source code and / or the currently unmodified source code; Determining a target level corresponding to the current target source code based on the target compilation environment; wherein the target level is the level at which the currently modified source code is located among the multiple levels; Compile the source code corresponding to the target layer to obtain a first firmware upgrade file.
5. The method according to claim 1, characterized in that Compressing the first firmware upgrade file to obtain a second firmware upgrade file includes: Dividing the first firmware upgrade file into a plurality of data blocks; Compressing the multiple data blocks respectively to obtain multiple compressed data blocks; respectively counting the byte lengths of the plurality of compressed data blocks; The plurality of compressed data blocks and the byte lengths of the plurality of compressed data blocks are correspondingly written into the first compressed file to obtain a second firmware upgrade file.
6. The method according to claim 5, characterized in that Writing the plurality of compressed data blocks and the byte lengths of the plurality of compressed data blocks into the first compressed file accordingly to obtain a second firmware upgrade file, comprising: Starting from the set position of the first compressed file, the plurality of compressed data blocks and the byte lengths of the plurality of compressed data blocks are written into corresponding positions in the first compressed file to obtain a second compressed file; wherein the set position is located at the set byte length in the first compressed file, and the position from the beginning to the set byte length in the first compressed file is used to store the setting configuration information of the first compressed file; Byte alignment padding is performed at the end of the second compressed file to obtain a second firmware upgrade file.
7. A firmware upgrade device, characterized in that: include: A file generation module, used to generate a first firmware upgrade file based on a pre-configured target compilation environment; A file compression module, used for compressing the first firmware upgrade file to obtain a second firmware upgrade file; A firmware upgrade module is used to upgrade the firmware of the photovoltaic inverter based on the second firmware upgrade file.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the firmware upgrade method as described in any one of claims 1-6.
9. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the firmware upgrade method according to any one of claims 1 to 6 when executed by a computer processor.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the firmware upgrade method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Firmware upgrading method and device for embedded equipment, terminal and storage medium
CN113225397A
Interlayer version management method and device and readable storage medium
CN115495139A
Method and system for upgrading firmware through data compression and encryption
CN115640022A
Network card firmware management method and device, medium and terminal
CN118672615A
ECU flash updating method and system based on compression algorithm
CN118897690A