Firmware upgrading method, device, equipment, storage medium and program product
By generating and compressing firmware upgrade files within the photovoltaic inverter, the problem of excessively long firmware upgrade times for photovoltaic inverters is solved, resulting in faster upgrade speeds and higher maintenance efficiency.
Patent Information
- Application Number
- CN202411829988.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-12
AI Technical Summary
Existing methods for upgrading photovoltaic inverter firmware take too long when the file size is large, resulting in low efficiency of after-sales maintenance and a poor user experience.
The first firmware upgrade file is generated based on a pre-configured target compilation environment, and then compressed to generate a second firmware upgrade file. Finally, the firmware of the photovoltaic inverter is upgraded based on this file.
The firmware upgrade file size has been reduced, the upgrade speed has been increased, and the efficiency of after-sales maintenance and user experience have been improved.
Smart Images

Figure CN119847557B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power electronics, and particularly relates to a firmware upgrading method and device, equipment, a storage medium and a program product. BACKGROUND
[0002] At present, there are two methods for firmware upgrading of a photovoltaic inverter: downloading firmware from a cloud platform to a gateway device, and then switching a Recommended Standard 485 (RS485) bus or a power line carrier to a wired mode; or downloading firmware from a cloud platform to a mobile phone, and then directly connecting a Wireless Fidelity (WIFI) or Bluetooth to a wireless mode, wherein the RS485 bus and the power line carrier are limited by a communication baud rate, the WIFI is limited by signal strength and communication distance, and the Bluetooth is limited by signal strength, communication distance and connection interval parameters. When the size of the firmware upgrading file is large, the upgrading time is long, which leads to low work efficiency of after-sales maintenance and poor user experience. SUMMARY
[0003] The present application provides a firmware upgrading method, device, equipment, a storage medium and a program product, which can improve the firmware upgrading speed of a photovoltaic inverter.
[0004] In a first aspect, an embodiment of the present application provides a firmware upgrading method, which comprises: generating a first firmware upgrading file based on a pre-configured target compiling environment; compressing the first firmware upgrading file to obtain a second firmware upgrading file; and upgrading firmware of a photovoltaic inverter based on the second firmware upgrading file.
[0005] In a second aspect, an embodiment of the present application further provides a firmware upgrading device, which comprises: a file generation module configured to generate a first firmware upgrading file based on a pre-configured target compiling environment; a file compression module configured to compress the first firmware upgrading file to obtain a second firmware upgrading file; and a firmware upgrading module configured to upgrade firmware of a photovoltaic inverter based on the second firmware upgrading file.
[0006] In a third aspect, an embodiment of the present application further provides an electronic device, which comprises: one or more processors; and a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the firmware upgrading method as described in the embodiments of the present application.
[0007] In a fourth aspect, an embodiment of the present application further provides a storage medium containing computer executable instructions, when the computer executable instructions are executed by a computer processor, the computer executable instructions are used to execute the firmware upgrading method as described in the embodiments of the present application.
[0008] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the firmware upgrading method according to the embodiments of the present application.
[0009] The technical solution of the embodiments of the present application generates a first firmware upgrading file based on a pre-configured target compiling environment; compresses the first firmware upgrading file to obtain a second firmware upgrading file; and upgrades firmware of a photovoltaic inverter based on the second firmware upgrading file. The embodiments of the present application can reduce the size of the firmware upgrading file through the target compiling environment, and further reduce the size of the firmware upgrading file through compression, so as to improve the firmware upgrading speed of the photovoltaic inverter, thereby improving the work efficiency of after-sales maintenance and improving user experience. BRIEF DESCRIPTION OF DRAWINGS
[0010] The above and other features, advantages, and aspects of the embodiments of the present application will become more apparent upon reading the following detailed description in conjunction with the accompanying drawings, in which like reference numerals refer to like elements. Throughout the drawings, the same or similar elements are denoted with the same or similar reference numbers. It is to be understood that the drawings are schematic, and the elements and features are not necessarily drawn to scale.
[0011] Figure 1 A flowchart of a firmware upgrading method provided by an embodiment of the present application;
[0012] Figure 2 A flowchart of another firmware upgrading method provided by an embodiment of the present application;
[0013] Figure 3 A flowchart of still another firmware upgrading method provided by an embodiment of the present application
[0014] Figure 4 A structural schematic diagram of a firmware upgrading device provided by an embodiment of the present application;
[0015] Figure 5 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0016] Embodiments of the present application will be described in more detail by referring to the drawings. Although certain embodiments of the present application are shown in the drawings, it is understood that the present application can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein, but rather these embodiments are provided to more thoroughly and completely understand the present application. It is understood that the drawings and embodiments of the present application are only for exemplary purposes, and are not intended to limit the scope of protection of the present application.
[0017] It should be understood that each of the steps recited in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit performing the steps shown. The scope of the present disclosure is not limited in this respect. The term "comprising" and variations thereof as used herein are open-ended, that is, "comprising" means "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 modification of "one" or "multiple" mentioned in the present disclosure is illustrative and not limiting, and those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more". It can be understood that the data involved in the technical solution (including but not limited to data itself, acquisition or use of data) should comply with the requirements of relevant laws and regulations and relevant provisions.
[0018] Figure 1 A flowchart of a firmware upgrading method provided by an embodiment of the present application is shown. The embodiment of the present application is applicable to the case of upgrading firmware of a photovoltaic inverter. The method can be performed by a firmware upgrading device, which can be implemented in the form of software and / or hardware, and can be implemented by an electronic device, which can be a mobile terminal, a PC terminal, or a server, etc. As shown in the figure, the method comprises: Figure 1
[0019] S110, generating a first firmware upgrading file based on a pre-configured target compilation environment.
[0020] The target compilation environment can be used to control the compilation of the source code of the photovoltaic inverter, for example, to limit the compilation of the modified part of the source code. The first firmware upgrading file can be understood as a firmware upgrading file generated under the target compilation environment. The firmware can be understood as software embedded in the photovoltaic inverter.
[0021] In this embodiment, the current modified source code of the photovoltaic inverter can be obtained, and based on the current modified source code, a corresponding first firmware upgrading file can be generated by using a compilation tool in combination with the target compilation environment. The current modified source code can be a modification based on the current latest business requirements.
[0022] In this embodiment, the compilation is performed in combination with the target compilation environment, so that the modified part of the source code is compiled during the compilation. Compared with the way of compiling all the source code, the generated firmware upgrading file is smaller in size, that is, the first firmware upgrading file is smaller in size, which is equivalent to trimming the firmware upgrading file generated by compiling all the source code.
[0023] S120, compressing the first firmware upgrade file to obtain a second firmware upgrade file.
[0024] The second firmware upgrade file can be a firmware upgrade file compressed from the first firmware upgrade file. In this embodiment, any compression algorithm can be used to compress the first firmware upgrade file to reduce the size of the first firmware upgrade file. For example, the compression algorithm can be a lossless compression algorithm or a lossy compression algorithm.
[0025] Optionally, the compression of the first firmware upgrade file to obtain the second firmware upgrade file includes: dividing the first firmware upgrade file into a plurality of data blocks; compressing the plurality of data blocks respectively to obtain a plurality of compressed data blocks; respectively counting the byte lengths of the plurality of compressed data blocks; and writing the plurality of compressed data blocks and the byte lengths of the plurality of compressed data blocks into a first compressed file correspondingly to obtain the second firmware upgrade file.
[0026] The first compressed file can be understood as a file including only a compressed file header, i.e., without specific compressed data and byte lengths of the compressed data. After the first compressed file is filled with the plurality of compressed data blocks and the byte lengths of the plurality of compressed data blocks, it can be referred to as the second firmware upgrade file.
[0027] In this embodiment, the byte length of each compressed data block is not limited, for example, it can be 4 bytes.
[0028] In this embodiment, the first firmware upgrade file can be divided into a plurality of data blocks according to a specified byte length (i.e., the number of bytes). The byte length of each data block can be the same or different. For example, the plurality of data blocks can be denoted as data block 1, data block 2,..., and data block N. N is a positive integer. A firmware compression tool software programmed with a pre-selected compression algorithm can be used to compress all the data blocks respectively to obtain a plurality of compressed data blocks. The plurality of compressed data blocks can be temporarily stored in a random access memory (RAM) buffer area, and the plurality of compressed data blocks can be denoted as compressed data block 1, compressed data block 2,..., and compressed data block N. The byte lengths of all the compressed data blocks are counted respectively. The order of writing the plurality of compressed data blocks and the byte lengths of the plurality of compressed data blocks in the RAM buffer area into the compressed file can be: compressed data block 1, byte length of compressed data block 1, compressed data block 2, byte length of compressed data block 2,..., compressed data block N, and byte length of compressed data block N.
[0029] In this embodiment, by dividing and compressing the first firmware upgrade file 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 enhanced. The final obtained second firmware upgrade file is smaller in size.
[0030] Optionally, the plurality of compressed data blocks and the byte lengths of the plurality of compressed data blocks are written into the first compressed file correspondingly to obtain a second firmware upgrade file, including: starting from a set position in 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 correspondingly to obtain a second compressed file; wherein the set position is located at a set byte length in the first compressed file, and a position between the beginning of the first compressed file and the set byte length is used to store set configuration information of the first compressed file; byte alignment padding is performed at the tail of the second compressed file to obtain the second firmware upgrade file.
[0031] In this embodiment, the set byte length is not limited, for example, it can be 256 bytes. For example, the set byte length is taken as 256 bytes, and the position between the beginning of the first compressed file and the set byte length, i.e. 0-255 bytes in the first compressed file, is used to store the set configuration information of the first compressed file. The set configuration information can be understood as a compressed file header. In this embodiment, the set configuration information is not limited, for example, it can include unique identity information of the first compressed file, a compression algorithm used, an encryption algorithm, etc.
[0032] For example, the byte alignment padding at the tail of the second compressed file can be filled with hexadecimal number 0xFF to align to a target byte length. In this embodiment, the target byte length is not limited, 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 precisely controlling the writing positions of the compressed data blocks and the byte lengths of the compressed data blocks, the utilization efficiency of file storage space can be improved, and the total size of the second firmware upgrade file can be reduced. The byte alignment padding at the tail 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 also reduce errors in the data transmission process.
[0034] S130, upgrading the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0035] In the embodiment, the second firmware upgrade file can be uploaded to the cloud platform, downloaded from the cloud platform to the gateway device through Ethernet, transmitted from the gateway device to the photovoltaic inverter by using the wired transmission mode, and used to upgrade the firmware corresponding to the photovoltaic inverter based on the second firmware upgrade file. In the upgrading process, the decompression algorithm corresponding to the compression algorithm is used to decompress the firmware corresponding to the photovoltaic inverter, and then the firmware corresponding to the photovoltaic inverter is upgraded based on the decompressed second firmware upgrade file.
[0036] For example, the original firmware upgrade file that is not compiled by the target compilation environment and is not compressed is uploaded to the cloud platform, the size of the original firmware upgrade file is 800 KB, the second firmware upgrade file is downloaded from the cloud platform to the gateway device, the second firmware upgrade file is transmitted from the gateway device to the photovoltaic inverter, the firmware upgrade operation is performed on the cloud platform, and the time for the firmware upgrade is 14 minutes and 13 seconds. The second firmware upgrade file that is compiled by the target compilation environment and is compressed is uploaded to the cloud platform, the size of the second firmware upgrade file is 370 KB, 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, the second firmware upgrade file is transmitted from the gateway device to the photovoltaic inverter, the firmware of the photovoltaic inverter is upgraded, and the time for the firmware upgrade is 6 minutes and 48 seconds.
[0037] In the embodiment, the second firmware upgrade file is used to upgrade the firmware of the photovoltaic inverter, so that the amount of file data transmitted from the gateway device to the photovoltaic inverter can be reduced, and the firmware upgrade speed can be improved.
[0038] In the embodiment, the second firmware upgrade file can be downloaded from the cloud platform to the terminal device. In the embodiment, the terminal device is not limited, for example, the terminal device can be a mobile phone. The second firmware upgrade file is transmitted from the terminal device to the photovoltaic inverter by using the wireless transmission mode, and the firmware corresponding to the photovoltaic inverter is upgraded based on the second firmware upgrade file. In the upgrading process, the decompression algorithm corresponding to the compression algorithm is used to decompress the firmware corresponding to the photovoltaic inverter, and then the firmware corresponding to the photovoltaic inverter is upgraded based on the decompressed second firmware upgrade file.
[0039] For example, the original firmware upgrade file which is not compiled by the target compiling environment and is not compressed is uploaded to the cloud platform, the size of the original firmware upgrade file is 800 KB, the second firmware upgrade file is downloaded from the cloud platform to the terminal device, the second firmware upgrade file is transmitted from the terminal device to the photovoltaic inverter, the firmware upgrade operation is performed on the terminal device, and the firmware upgrade time is 8 minutes and 4 seconds. The second firmware upgrade file which is compiled by the target compiling environment and is compressed is uploaded to the cloud platform, the size of the second firmware upgrade file is 370 KB, the second firmware upgrade file is downloaded from the cloud platform to the terminal device, the second firmware upgrade file is transmitted from the terminal device to the photovoltaic inverter, the firmware upgrade operation is performed on the terminal device, and the firmware upgrade time is 3 minutes and 57 seconds.
[0040] In the embodiment, the firmware of the photovoltaic inverter is upgraded by the second firmware upgrade file, so that the amount of file data transmitted from the terminal device to the photovoltaic inverter is reduced, and the firmware upgrade speed is improved.
[0041] The technical scheme of the embodiment of the application generates the first firmware upgrade file based on the pre-configured target compiling environment, compresses the first firmware upgrade file to obtain the second firmware upgrade file, and upgrades the firmware of the photovoltaic inverter based on the second firmware upgrade file. In the embodiment of the disclosure, the size of the firmware upgrade file is reduced by the target compiling environment, and the size of the firmware upgrade file is further reduced by compression, so that the firmware upgrade speed of the photovoltaic inverter is improved, and the work efficiency of after-sales maintenance and user experience are improved.
[0042] Figure 2 Another firmware upgrade method flowchart provided by the embodiment of the application. The embodiment of the application is a specific embodiment based on the above-mentioned application embodiment. Referring to Figure 2 The method provided by the embodiment of the application specifically includes the following steps:
[0043] S210, obtaining the current target source code of the photovoltaic inverter.
[0044] The current target source code includes the current modified source code and / or the current unmodified source code.
[0045] In the embodiment, the current target source code which 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 part of the unmodified source code. Alternatively, the current target source code includes all modified source codes of the photovoltaic inverter (i.e., all levels of source codes are modified). Alternatively, the current target source code includes all unmodified source codes of the photovoltaic inverter.
[0046] Optionally, the configuration process of the target compiling environment includes: dividing the source code of the photovoltaic inverter into multiple levels; and configuring a corresponding macro definition for the source code of each level to control the compiling of the source code of each level.
[0047] The macro definition of each level is used to indicate that the source code of the corresponding level is compiled when the source code of the corresponding level is modified. In this embodiment, the specific macro definition is not limited. For example, when the firmware of the photovoltaic inverter is shipped, the source code of all levels is compiled. When the source code of a certain level is modified, the level in which the modified source code is located is compiled, and the level in which the unmodified source code is located is not compiled, so that the compiling control can be achieved.
[0048] In this embodiment, the source code of the photovoltaic inverter can be divided into multiple levels according to any mode. For example, the source code of the photovoltaic inverter can be layered according to hardware source code, operating system source code and application software source code; the source code of the photovoltaic inverter can be layered according to different functional modules; and the source code of the photovoltaic inverter can be divided into different technical levels according to technical stacks such as front end, back end and database.
[0049] In this embodiment, by dividing the source code of the photovoltaic inverter into multiple levels and configuring a corresponding macro definition for the source code of each level, the source code of different levels can be independently compiled, 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, the compiling efficiency and flexibility are improved, and thus the file size of the generated first firmware upgrade file is smaller.
[0050] Optionally, dividing the source code of the photovoltaic inverter into multiple levels includes: sequentially dividing the source code of the photovoltaic inverter into photovoltaic inverter chip driving source code, system communication source code and business application source code; configuring the photovoltaic inverter chip driving source code as a driving layer; configuring the system communication source code as an intermediate layer; and configuring the business application source code as an application layer.
[0051] For example, the entire source code of the photovoltaic inverter is sequentially divided into photovoltaic inverter chip driving source code, system communication source code and business application source code. The system communication source code can include operating system, protocol stack and other source code. The business application source code is the source code related to the business.
[0052] In this embodiment, the photovoltaic inverter chip driving source code is configured as a driving layer, the system communication source code is configured as an intermediate layer, and the business application source code is configured as an application layer, so that an effective layering mode is provided, and the firmware upgrade of the photovoltaic inverter becomes more efficient.
[0053] S220, determining a target level corresponding to the current target source code based on the target compiling environment.
[0054] The target level is a level in the plurality of levels in which the source code currently modified is located.
[0055] In this embodiment, the target level is not limited, for example, it can be 0, 1, or multiple. If the current target source code includes all unmodified source codes of the photovoltaic inverter, the target level can be 0. If the current target source code includes all modified source codes of the photovoltaic inverter, the number of target levels is equal to the total number of levels. If the current target source code includes the source code of the modified part and the source code of the unmodified part of the photovoltaic inverter, the target level can be 1 or multiple, and the number of target levels is less than the total number of levels.
[0056] S230, compiling 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 level is compiled, that is, the source code of the modified part is edited, and the first firmware upgrade file can be obtained.
[0058] S240, compressing the first firmware upgrade file to obtain a second firmware upgrade file.
[0059] S250, upgrading the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0060] The technical scheme 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. In the embodiment of the present disclosure, the target level corresponding to the current target source code is determined based on the target compilation environment, and 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. Further compression can further reduce the size of the firmware upgrade file, thereby effectively improving the firmware upgrade speed of the photovoltaic inverter, and further improving the work efficiency of after-sales maintenance and user experience.
[0061] Figure 3 Another firmware upgrade method flowchart provided by the embodiment of the present application.
[0062] S301, obtaining a compression algorithm and a corresponding decompression algorithm.
[0063] In this embodiment, the compression algorithm and the decompression algorithm are not limited, for example, it can be fastLZ, quickLZ, miniLZO, RLE, and the like. These algorithms provide compression and decompression functions.
[0064] S302, embedding the acquired decompression algorithm into the photovoltaic inverter.
[0065] S303, configuring a target compiling environment.
[0066] S304, generating a first firmware upgrade file based on the pre-configured target compiling 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 denoted as firmware.bin.
[0068] S305, writing the compression algorithm as a firmware compression tool software.
[0069] For example, the firmware compression tool software can be denoted as compress_ware.
[0070] S306, compressing the first firmware upgrade file by using the firmware compression tool software to obtain a second firmware upgrade file.
[0071] For example, the second firmware upgrade file can be denoted as compress_firmware.bin.
[0072] S307, upgrading the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0073] In this embodiment, the target compiling environment combined with the compression algorithm can reduce the size of the firmware upgrade file, thereby reducing the file data transmission amount during the remote upgrade of the photovoltaic inverter, achieving the purpose of improving the firmware upgrade speed, and improving the efficiency of after-sales maintenance.
[0074] Figure 4 A structural schematic diagram of a firmware upgrade device provided by the embodiment of the present application is shown in FIG. 4. Figure 4 As shown in FIG. 4, the device includes a file generation module 410, a file compression module 420, and a firmware upgrade module 430.
[0075] The file generation module 410 is configured to generate a first firmware upgrade file based on a pre-configured target compiling environment.
[0076] The file compression module 420 is configured to compress the first firmware upgrade file to obtain a second firmware upgrade file.
[0077] The firmware upgrade module 430 is configured to upgrade the firmware of the photovoltaic inverter based on the second firmware upgrade file.
[0078] The technical scheme of the embodiment of the application comprises the following steps: a file generation module generates a first firmware upgrade file based on a pre-configured target compiling environment; a file compression module compresses the first firmware upgrade file to obtain a second firmware upgrade file; and a firmware upgrade module upgrades firmware of a photovoltaic inverter based on the second firmware upgrade file. The embodiment of the application can reduce the size of the firmware upgrade file through the target compiling environment, and further reduce the size of the firmware upgrade file through compression, thereby improving the firmware upgrade speed of the photovoltaic inverter, and thus improving the work efficiency of after-sales maintenance and user experience.
[0079] Optionally, the apparatus further comprises a configuration module configured to: divide source code of the photovoltaic inverter into a plurality of levels; and configure a corresponding macro definition for the source code of each level to control compilation of the source code of each level; wherein the macro definition of each level is used to instruct compilation of the source code of the corresponding level when the source code of the corresponding level is modified.
[0080] Optionally, the apparatus further comprises a configuration module, and the configuration module is further configured to: divide 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; configure the photovoltaic inverter chip driving source code as a driving layer; configure the system communication source code as an intermediate layer; and configure the business application source code as an application layer.
[0081] Optionally, the file generation module is specifically configured to: obtain current target source code of the photovoltaic inverter; wherein the current target source code comprises source code that is currently modified and / or source code that is not currently modified; determine a target level corresponding to the current target source code based on the target compiling environment; wherein the target level is a level in which the source code that is currently modified is located in the plurality of levels; and compile source code corresponding to the target level to obtain the first firmware upgrade file.
[0082] Optionally, the file compression module is specifically configured to: divide the first firmware upgrade file into a plurality of data blocks; compress the plurality of data blocks respectively to obtain a plurality of compressed data blocks; respectively count byte lengths of the plurality of compressed data blocks; and write the plurality of compressed data blocks and the byte lengths of the plurality of compressed data blocks into a first compressed file correspondingly to obtain the second firmware upgrade file.
[0083] Optionally, the file compression module is further configured to: write the plurality of compressed data blocks and byte lengths of the plurality of compressed data blocks into the first compressed file in a corresponding manner starting from a set position of 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 positions between the beginning and the set byte length in the first compressed file are used to store set configuration information of the first compressed file; and perform byte alignment padding at a tail of the second compressed file to obtain a second firmware upgrade file.
[0084] The firmware upgrade device provided by the embodiments of the present application can perform the firmware upgrade method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0085] Figure 5 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.
[0086] As shown in Figure 5 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the 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 into 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 plurality 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 magnetic 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 can be various general and / or special purpose 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 specialized 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 performs various methods and processes described above, such as the method firmware upgrade.
[0089] In some embodiments, the method firmware upgrade can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the method firmware upgrade described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the method firmware upgrade by any other appropriate means, such as by means of firmware.
[0090] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0091] Computer programs used to practice the methods of the application can be written in any combination of one or more programming languages. These computer programs can be implemented on general-purpose computers, special purpose computers, or other programmable data processing apparatus to produce the functions / acts specified in the flow diagrams and / or block diagrams. Computer programs can be applied to a data changed on the functioning of the computer or processing apparatus by transforming the programming language into a machine language.
[0092] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0093] To provide for interaction with a user, the systems and techniques described here can 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 a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0094] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can 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), blockchain networks, and the Internet.
[0095] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can 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 large management difficulty and weak business scalability in traditional physical host and VPS service.
[0096] The embodiments of the present application further provide a computer program product, comprising a computer program which, when executed by a processor, implements the firmware upgrading method provided by any of the embodiments of the present application.
[0097] The computer program code implementing the present application can be written in one or more programming languages or combinations of languages including object oriented languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, 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 the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0098] Note that the above merely describes preferred embodiments of the application and the principles of the application. It will be understood by those skilled in the art that the application is not limited to the specific embodiments described herein, and that changes, modifications and substitutions can be made by those skilled in the art without departing from the scope of the application. Therefore, although the application has been described in detail by the above embodiments, the application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the application, and the scope of the application is determined by the appended claims.
Claims
1. A firmware upgrade method characterized by comprising: The method comprises the following steps: generating a first firmware upgrade file based on a preconfigured target compiling environment; compressing the first firmware upgrade file to obtain a second firmware upgrade file; upgrading firmware of a photovoltaic inverter based on the second firmware upgrade file; wherein the configuration process of the target compiling environment comprises the following steps: dividing 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; wherein the macro definitions of each level are used to instruct the compilation of the source code of the corresponding level when the source code of the corresponding level is modified.
2. The method of claim 1, wherein, The step of dividing the source code of the photovoltaic inverter into multiple levels comprises the following steps: 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 driving source code as a driving layer; configuring the system communication source code as an intermediate layer; configuring the business application source code as an application layer.
3. The method according to any one of claims 1-2, characterized in that, The step of generating a first firmware upgrade file based on a preconfigured target compiling environment comprises the following steps: obtaining current target source code of the photovoltaic inverter; wherein the current target source code comprises currently modified source code and / or currently unmodified source code; determining a target level corresponding to the current target source code based on the target compiling environment; wherein the target level is a level in the multiple levels where the currently modified source code is located; compiling the source code corresponding to the target level to obtain a first firmware upgrade file.
4. The method of claim 1, wherein, The step of compressing the first firmware upgrade file to obtain a second firmware upgrade file comprises the following steps: dividing the first firmware upgrade file into multiple data blocks; compressing the multiple data blocks respectively to obtain multiple compressed data blocks; statistically counting 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 a first compressed file correspondingly to obtain a second firmware upgrade file.
5. The method of claim 4, wherein, The step of writing the multiple compressed data blocks and the byte lengths of the multiple compressed data blocks into a first compressed file to obtain a second firmware upgrade file comprises the following steps: starting from a set position of the first compressed file, writing 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 positions between the beginning and the set byte length in the first compressed file are used to store set configuration information of the first compressed file; performing byte alignment padding at the tail of the second compressed file to obtain a second firmware upgrade file.
6. A firmware upgrade apparatus characterized by comprising: The method comprises the following steps: a file generation module configured to generate a first firmware upgrade file based on a preconfigured target compiling environment; a file compression module configured to compress the first firmware upgrade file to obtain a second firmware upgrade file; a firmware upgrade module configured to upgrade firmware of a photovoltaic inverter based on the second firmware upgrade file; a configuration module configured to divide source code of the photovoltaic inverter into multiple levels; A macro definition corresponding to each level of source code is configured to perform compilation control on the source code of the corresponding 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.
7. An electronic device, comprising: The electronic device includes: 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 claimed in any one of claims 1-5.
8. A storage medium containing computer-executable instructions for performing the firmware upgrade method as claimed in any one of claims 1-5 when executed by a computer processor.
9. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the firmware upgrade method as claimed in any one of claims 1-5.
Citation Information
Patent Citations
Method and system for upgrading firmware through data compression and encryption
CN115640022A
ECU flash updating method and system based on compression algorithm
CN118897690A