Method for generating upgrading file for inverter and inverter upgrading method

By generating an upgrade file containing device attribute information and verification information, the problem of device upgrade accuracy in multi-component systems is solved, and the accuracy and safe upgrade of the inverter is achieved.

CN119806606APending Publication Date: 2025-04-11GONEO GRP CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411845132.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Traditional OTA upgrade methods cannot ensure the accuracy of equipment upgrades in multi-component systems, resulting in difficulty in controlling in software upgrades, fault repairs, or new equipment.

Method used

A method for generating an inverter upgrade file is proposed. By obtaining the attribute information of the device to be upgraded, a file header and a program file are generated. The file header at least includes the verification information of the program file and the attribute information of the device to be upgraded, and it is combined into an upgrade file.

Benefits of technology

It realizes accurate upgrades to a single device in a multi-component system, improves the accuracy and security of upgrade files, and ensures the correct operation of the device after the upgrade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806606A_ABST
    Figure CN119806606A_ABST
Patent Text Reader

Abstract

The invention provides a generation method of an upgrade file for an inverter, an inverter upgrade method, electronic equipment and a computer storage medium. The method for generating the upgrading file for the inverter comprises the following steps: acquiring attribute information of equipment to be upgraded; a file header and a program file corresponding to the to-be-upgraded device are generated, the file header at least comprises verification information of the program file and attribute information of the to-be-upgraded device, and the file header is used for verifying correctness of the program file and the to-be-upgraded device; and synthesizing the file header and the program file into an upgrade file. Therefore, the equipment upgrading accuracy in the multi-component system is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software, and in particular to a method for generating an inverter upgrade file, an inverter upgrade method, an electronic device and a computer storage medium. Background Art

[0002] With the vigorous development of distributed photovoltaic power generation systems, the shipment volume of the micro inverter market has also increased rapidly. It is expected that the micro inverter market will continue to maintain a rapid growth trend in the next few years. On the one hand, with the continuous advancement of photovoltaic technology and the reduction of costs, the cost performance of micro inverters will be further improved; on the other hand, with the increasing attention paid to renewable energy and the promotion of policies around the world, distributed photovoltaic power generation systems will be more widely used, thereby driving the rapid development of the micro inverter market.

[0003] Micro inverters generally refer to inverters with a power of less than or equal to 1 kilowatt and component-level MPPT (Maximum Power Point Tracking) in photovoltaic power generation systems. The full name is micro photovoltaic grid-connected inverters. Micro inverters perform independent MPPT control on each component, which can greatly improve the overall efficiency. However, multiple components also increase the control difficulty for software upgrades, fault repairs, or new equipment. Traditional OTA upgrade methods cannot ensure the accuracy of equipment upgrades in multi-component systems. To solve this problem, this application proposes a method for generating an upgrade file for an inverter, an inverter upgrade method, an electronic device, and a computer storage medium. Summary of the invention

[0004] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or critical elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.

[0005] According to one aspect of the present invention, a method for generating an upgrade file for an inverter is provided.

[0006] In one embodiment, a method for generating an upgrade file for an inverter includes: obtaining attribute information of a device to be upgraded; generating a file header and a program file corresponding to the device to be upgraded, wherein the file header includes at least verification information of the program file and attribute information of the device to be upgraded, and the file header is used to verify the correctness of the program file and the device to be upgraded; and combining the file header and the program file into an upgrade file.

[0007] In one embodiment, the file header also includes encryption algorithm information, and combining the file header and the program file into an upgrade file includes: encrypting the program file multiple times; and combining the encrypted program file and the file header into an upgrade file, and the encryption algorithm information includes indication information of the encryption algorithm used for the multiple encryptions.

[0008] Preferably, the multiple times is twice.

[0009] In one embodiment, the verification information of the program file includes the MD5 checksum of the program file and / or the size information of the program file, and the attribute information of the device to be upgraded includes one or more of the hardware identification of the device to be upgraded, the object information of the program file, and the area code where the device to be upgraded is located.

[0010] In one embodiment, the file header further includes file header verification information, and the file header verification information includes the length of the file header and / or the file header checksum.

[0011] In one embodiment, the file header also includes an upgrade password for the program file and / or a software version of the program file.

[0012] In one embodiment, the program file of the device to be upgraded includes a program file in a bin format and an MD5 check value, where the MD5 check value is a hash value of the program file in the bin format calculated using an MD5 algorithm.

[0013] In one embodiment, generating a program file for the device to be upgraded includes: converting a program file in hex format into a program file in bin format. During the conversion process, the free addresses in the program file in hex format are filled with preset characters and then converted into a program file in bin format. The program file in bin format is stored in big endian order.

[0014] In one embodiment, the method for generating an upgrade file for an inverter further includes: in response to the data length of a bin-formatted program file not being divisible by a first preset length, filling the bin-formatted program file with preset characters until the bin-formatted program file is divisible by the first preset length.

[0015] In any of the foregoing embodiments, after synthesizing the upgrade file, the method further includes: calculating the total length of the upgrade file; dividing the upgrade file into N data packets, wherein, in response to the total length being divisible by a second preset length, taking the quotient of the total length and the second preset length as N, otherwise taking the quotient of the total length and the second preset length plus 1 as N; and in response to the data length of the Nth data packet being less than the second preset length, filling the remaining bytes of the Nth file with preset characters so that the data length of the Nth data packet is equal to the second preset length.

[0016] According to another aspect of the present invention, there is also provided an electronic device, comprising a memory, a processor and a computer program stored on the memory, wherein the processor is used to execute the computer program stored on the memory to implement the steps of a method for generating an inverter upgrade file as described in any of the aforementioned embodiments.

[0017] According to another aspect of the present invention, there is further provided a computer storage medium on which a computer program is stored. When the computer program is executed, the steps of the method for generating an inverter upgrade file as described in any of the aforementioned embodiments are implemented.

[0018] According to another aspect of the present invention, there is also provided an inverter upgrade method, which is applicable to a background control device. The inverter upgrade method comprises: generating an upgrade file for the device to be upgraded using the method for generating an inverter upgrade file as in any of the aforementioned embodiments; and sending the upgrade file to the device to be upgraded.

[0019] In one embodiment, before generating the upgrade file of the device to be upgraded, the method further includes: sending an upgrade instruction to the device to be upgraded; and generating the upgrade file of the device to be upgraded includes: generating the upgrade file in response to receiving an upgrade confirmation message of the device to be upgraded.

[0020] In one embodiment, the upgrade file is divided into N data packets, where N is an integer, each data packet includes data of a preset length, wherein several packets are file header data packets, and the remaining data packets are program file data packets, and sending the upgrade file includes: sending several file header data packets to the device to be upgraded; and in response to receiving the file header confirmation information of the device to be upgraded, sending the remaining data packets to the device to be upgraded.

[0021] In one embodiment, after sending the upgrade file, the method further includes: in response to receiving upgrade file confirmation information of the device to be upgraded, updating the upgrade status of the device to be upgraded to completion.

[0022] According to another aspect of the present invention, there is also provided an inverter upgrade method, which is applicable to a terminal device. In one embodiment, the inverter upgrade method includes: the terminal device receives an upgrade file, the upgrade file includes a file header and a program file, the file header includes at least verification information of the program file and attribute information of the device to be upgraded; and the terminal device verifies the file header, and in response to all the information in the file header being verified, the terminal device executes the program file to complete the upgrade, wherein the verification at least includes: the verification information of the program file indicates that the program file is correct and the attributes of the terminal device are consistent with the attribute information of the device to be upgraded.

[0023] In one embodiment, the file header also includes encryption algorithm information, and executing the program file also includes: the terminal device determines the number of encryption algorithm times of the program file and the encryption algorithm for each encryption based on the encryption algorithm information; the terminal device decrypts the program file in reverse order according to the order of the encryption algorithm; and the terminal device executes the decrypted program file to complete the upgrade.

[0024] In one embodiment, before receiving the upgrade file, the method further includes: in response to receiving the upgrade instruction, the terminal device confirming whether it is in an upgradeable state; and in the upgradeable state, the terminal device returning upgrade confirmation information.

[0025] In one embodiment, the upgrade file is divided into N data packets, where N is an integer, each data packet includes data of a preset length, wherein several packets are file header data packets, and the remaining data packets are program file data packets, and receiving the upgrade file includes: receiving several file header data packets in sequence; the terminal device verifies the attribute information of the device to be upgraded in the file header and the attributes of the terminal device, and in response to the attribute information of the device to be upgraded being consistent with the attributes of the terminal device, the terminal device returns file header confirmation information; and receiving the remaining data packets in sequence.

[0026] In one embodiment, the program file of the device to be upgraded includes a program file in a bin format and an MD5 check value, the MD5 check value is a hash value of the program file in the bin format calculated using the MD5 algorithm, and the inverter upgrade method also includes: after the upgrade is completed, before starting the upgraded program file each time, calculating the hash value of the upgraded program file, and in response to the calculated hash value being consistent with the MD5 check value in the program file, starting the upgraded program file, otherwise determining that the program file has been damaged or modified. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above features and advantages of the present invention will be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings.

[0028] Figure 1 is a flow chart of a method for generating an inverter upgrade file in an embodiment according to one aspect of the present invention;

[0029] Figure 2 is a schematic diagram of a file header format in an embodiment according to one aspect of the present invention;

[0030] Figure 3 is a flow chart of a method for generating an inverter upgrade file in another embodiment according to one aspect of the present invention;

[0031] Figure 4 is a flow chart of a method for generating an inverter upgrade file in another embodiment according to one aspect of the present invention;

[0032] Figure 5 is a schematic block diagram of an electronic device in an embodiment according to another aspect of the present invention;

[0033] Figure 6 is a schematic diagram of an interaction process in a system embodiment according to another aspect of the present invention;

[0034] Figure 7 FIG. 4 is a flow chart of an inverter upgrading method in an embodiment according to another aspect of the present invention. DETAILED DESCRIPTION

[0035] The following description is given to enable those skilled in the art to implement and use the invention and incorporate it into a specific application context. Various modifications, as well as various uses in different applications will be readily apparent to those skilled in the art, and the general principles defined herein are applicable to a wide range of embodiments. Thus, the present invention is not limited to the embodiments given herein, but should be granted the broadest scope consistent with the principles and novel features disclosed herein.

[0036] In the following detailed description, many specific details are set forth to provide a more thorough understanding of the present invention. However, it will be apparent to those skilled in the art that the practice of the present invention need not be limited to these specific details. In other words, known structures and devices are shown in block diagram form without detailed display to avoid obscuring the present invention.

[0037] The reader is reminded of all documents and literature filed simultaneously with this specification and open to public inspection, and the contents of all such documents and literature are incorporated herein by reference. Unless otherwise directly stated, all features disclosed in this specification (including any attached claims, abstracts and drawings) can be replaced by alternative features for achieving the same, equivalent or similar purposes. Therefore, unless otherwise explicitly stated, each feature disclosed is only an example of a group of equivalent or similar features.

[0038] Note that, where used, the symbols left, right, front, back, top, bottom, forward, reverse, clockwise and counterclockwise are used only for convenience and do not imply any specific fixed direction. In fact, they are used to reflect the relative position and / or direction between the various parts of the object. In addition, the terms "first" and "second" are used only for descriptive purposes and should not be understood as indicating or implying relative importance.

[0039] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood as electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0040] Note that, in the case of use, further, preferably, further and more preferably are simple beginnings for explaining another embodiment based on the previous embodiment, and the content of further, preferably, further or more preferably followed by the above embodiment is combined with the previous embodiment as a complete composition of another embodiment. Several further, preferably, further or more preferably settings followed by the same embodiment can be arbitrarily combined to form another embodiment.

[0041] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the aspects described below in conjunction with the accompanying drawings and specific embodiments are only exemplary and should not be construed as limiting the scope of protection of the present invention in any way.

[0042] According to one aspect of the present invention, a method for generating an upgrade file for an inverter is provided, wherein the upgrade file can be used to perform targeted upgrades on a single device in a multi-component system.

[0043] Figure 1 A method for generating an inverter upgrade file in an embodiment is shown. In this embodiment, the method for generating an inverter upgrade file includes steps S110-S130.

[0044] Wherein, step S110 is: obtaining attribute information of the device to be upgraded.

[0045] In a multi-component system, the upgrade requirements of each device may be different, so it is necessary to clarify the upgrade requirements of the device. The attribute information of the device can characterize the device. Therefore, based on the attribute information of the device to be upgraded, the device to be upgraded can be determined, and then the upgrade plan for the device can be determined.

[0046] The attribute information of the device to be upgraded can be given by input, or obtained through command interaction between the host computer and the terminal.

[0047] Step S120 is: generating a file header and a program file corresponding to the device to be upgraded.

[0048] The present invention does not limit the method for generating a program file, and a person skilled in the art may use an existing or future method for generating a program file to generate a program file corresponding to the upgrade requirements of the device to be upgraded. For example, a file with a suffix of .dat may be created and opened, and then the upgrade program file in hex format may be converted into a program file in bin format, and then the program file in bin format may be stored in a .dat file.

[0049] In particular, to facilitate conversion, in the process of converting the upgrade program file in hex format to the program file in bin format, the free addresses in the upgrade program file in hex format can be filled with preset characters (such as FF), and then the filled upgrade program file in hex format is converted to the program file in bin format, and the program file in bin format is stored in big endian mode. Among them, big endian storage means outputting to bin file in the order of high byte to low byte.

[0050] Preferably, when converting the upgrade program file in hex format to the program file in bin format, the total length of the program file in bin format is preferably set to P (P is 128, or 2). j , j is an integer multiple of a positive integer). In the conversion process, in response to the data length of the converted bin-format program file not being divisible by P, the bin-format program file is filled with preset characters until the bin-format program file is divisible by P.

[0051] To verify the correctness of the program file and the correctness of the device to be upgraded, the file header includes at least the verification information of the program file and the attribute information of the device to be upgraded. The correctness of the program file includes the integrity of the program file and the correctness of the content. The correctness of the upgraded device includes the correctness of relevant information such as the device type, hardware type, and region that may be related to the upgrade requirements of the device.

[0052] Preferably, the verification information of the program file may include an MD5 verification value of the program file and / or size information of the program file.

[0053] The principle of MD5 file verification is to use the content of the file as input and calculate a unique fixed-length hash value through the MD5 algorithm (Message-Digest Algorithm 5). If the contents of two files are the same, their MD5 values ​​will be the same; if the contents of two files are different, their MD5 values ​​will be different. Therefore, by comparing the MD5 values ​​of two files, the integrity and consistency of the files can be verified to ensure that the files have not been tampered with or damaged during transmission or storage.

[0054] During the verification of the program file at the terminal, for the MD5 check value in the file header, the terminal can use the MD5 algorithm to calculate the hash value of the program file, and then compare the calculated hash value with the hash value in the file header to determine whether the MD5 file verification has passed. It can be understood that if the two hash values ​​are the same, it means that the program file has not been modified during the transmission process; if they are different, it means that the program file may have been tampered with or damaged.

[0055] During the verification process of the program file in the terminal, for the size information of the program file in the file header, the number of bytes of the program file can be calculated and compared with the size information of the program file in the file header. If the two are the same, it indicates that the program file is complete; if the calculated number of bytes is smaller than the size information of the program file in the file header, it indicates that the program file is lost.

[0056] Preferably, the attribute information of the device to be upgraded may include one or more of the hardware identification of the device to be upgraded, the object information of the program file, and the region code where the device to be upgraded is located.

[0057] In some specific embodiments, the hardware identification can be represented by 16 bytes, such as using {'M','I','C','I','N','V','0','8','0','0'} to represent a micro inverter 800W device; the object information of the program file refers to whether the upgrade file is an upgrade file for a DSP (digital signal processor) or a module MCU (Microcontroller Unit); the area code is a code used to indicate the region (such as a country, province, city or other administrative unit) where the device to be upgraded is located, so as to distinguish the needs of different regions.

[0058] In some embodiments, to improve the correctness of the upgrade file, the file header may further include other verification information, such as verification information related to the file header and / or other information that can be used to verify the correctness of the upgrade file.

[0059] In some specific embodiments, the verification information related to the file header may include the length of the file header and / or the checksum of the file header. The length of the file header refers to the data byte length of the entire upgrade file header, which is used to verify the correctness of the length of the file header. Figure 2 FIG. 2 shows an exemplary setting of a file header format in an embodiment. The length of the file header refers to the sum of the byte lengths of each block of verification information, that is, the sum of the 8 bytes of the upgrade watermark, the 2 bytes of the file header length, ..., and the 1 byte of the file header checksum. The file header checksum refers to the sum of all data contents stored in the file header (except the data contents other than the file header checksum) to verify the correctness of the data contents in the file header. Figure 2For example, the file header checksum refers to the sum of the data stored in the 8 bytes of the upgrade watermark, the data stored in the 2 bytes of the file header length, ..., and the data stored in the 16 bytes of the hardware identifier.

[0060] In some embodiments, other information that can be used to verify the correctness of the upgrade file may include an upgrade password for the program file and / or a password or software attribute information set for the software version of the program file, etc. Figure 2 In the illustrated embodiment, the upgrade watermark refers to the upgrade password of the program file, and the upgrade version refers to the software version of the program file.

[0061] In some embodiments, the program file may also include other information related to the program file for verifying the program file when starting the program file. For example, in a specific embodiment, the program file may also include an MD5 check value in bin format. After the upgrade program file in hex format is converted into a program file in bin format, the MD5 check value of the program file in bin format may be calculated using the MD5 algorithm, and the MD5 check value in bin format may be stored at the relevant address of the program file in bin format. The MD5 check value in bin format and the program file in bin format together constitute the program file in bin format. Finally, the bin format program file generated after merging is stored in a .dat file as a program file. In this embodiment, when the terminal device completes the upgrade, the hash value of the upgraded program file may be calculated each time the upgraded program is started, and the hash value may be compared with the MD5 check value in bin format stored in the program file. When the two are the same, it is determined that the upgraded program file is correct, and then the upgraded program file is started; when the two are different, it is determined that the upgraded program file has been damaged or modified, and the startup of the upgraded program file is stopped.

[0062] Furthermore, after the file header and the program file are generated, step S130 is: combining the file header and the program file into an upgrade file.

[0063] It can be understood that the file header and the program file together constitute the upgrade file. The terminal verifies all the information in the file header during verification. When all the information in the file header is verified, the terminal runs the program file in the upgrade file to complete the upgrade. Figure 2 In the illustrated embodiment, all verification information stored in the file header needs to be verified.

[0064] To improve the security of program files, you can also encrypt program files.

[0065] Figure 3 A method for generating an inverter upgrade file in another specific embodiment is shown. Figure 1The difference between the generation method shown is that before step S130, step S310 is further included: encrypting the program file multiple times. The corresponding step S130 is refined as follows: combining the encrypted program file and the file header into an upgrade file.

[0066] The encryption algorithm for program files can adopt existing or future algorithms that can encrypt program files, for example, symmetric encryption algorithms such as AES (Advanced Encryption Standard) or DES (Data Encryption Standard), asymmetric encryption algorithms such as RSA (Rivest-Shamir-Adleman, RSA encryption algorithm), ECC (Elliptic Curve Cryptography) or DSA (Digital Signature Algorithm), or even hybrid algorithms that mix symmetric encryption algorithms and asymmetric encryption algorithms.

[0067] Since a single encryption algorithm is easy to be cracked or guessed, in some embodiments, multiple encryptions can be used to reduce the possibility of the encryption algorithm being cracked or guessed. Preferably, multiple encryptions can be set to two encryptions.

[0068] Correspondingly, the file header may be provided with indication information related to the encryption algorithm used for the multiple encryptions, that is, encryption algorithm information, such as Figure 2 The encryption algorithm in the embodiment shown. Specifically, the encryption algorithm information may include the number of encryptions and the code of the encryption algorithm used for each encryption, so that the terminal can determine the number of encryptions of the program file and the decryption algorithm corresponding to each encryption algorithm according to the encryption algorithm information during decryption.

[0069] Furthermore, considering that the data length of each packet of the upgrade file is limited during the transmission process, it is assumed that the length of the transmission data packet is set to N (N can be 128 or other 2 k , k is an integer), when the total length Lenth of the upgrade file is divisible by N (that is, when N|Lenth), the upgrade file is divided into Lenth / N data packets; when the total length Lenth of the upgrade file is not divisible by N, the bin format program file is divided into Lenth / / N+1 data packets, wherein the symbol “ / / ” refers to integer division, that is, Lenth / / N is the integer quotient of Lenth / N (ignoring the decimal part).

[0070] Figure 4 A method for generating an inverter upgrade file in another specific embodiment is shown. Figure 3The difference between the generation method shown is that it further includes steps S410 to 430 after step S130.

[0071] Wherein, step S410 is: calculating the total length Lenth of the upgrade file.

[0072] Step S420 is: divide the upgrade file into M data packets, wherein, in response to the total length Lenth being divisible by the preset length N, M takes the quotient of the total length and the preset length Lenth / N; otherwise (i.e., when the total length Lenth is not divisible by the preset length N), M takes the quotient of the total length and the preset length (Lenth / / N) plus 1, i.e., Lenth / / N+1.

[0073] Step S430 is: in response to the data length of the Mth data packet being less than the preset length N, filling the remaining bytes of the Mth data packet with preset characters so that the data length of the Mth data packet is equal to the preset length N.

[0074] Assuming that the upgrade file is divided into M data packets in sequence according to the preset length N, when the total length Lenth cannot be divided by the preset length N, the length of the Mth data packet is not N, and the remaining bytes of the Mth data packet are filled with preset characters (such as FF) to make the length of the Mth data packet N. It can be understood that the premise of filling the Mth data packet is that the upgrade file is divided into data packets in sequence according to the preset length N and sorted in sequence. Those skilled in the art can understand that in some embodiments, when the upgrade file is randomly sorted during the division process, the filling is performed on the data packets whose data length is less than the preset length N.

[0075] In the aforementioned multiple embodiments, the length P and the preset length N may be the same or different.

[0076] Although the above methods are illustrated and described as a series of actions for simplicity of explanation, it should be understood and appreciated that these methods are not limited by the order of the actions, because according to one or more embodiments, some actions may occur in a different order and / or concurrently with other actions from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art.

[0077] According to another aspect of the present invention, there is also provided an electronic device for implementing the steps of the method for generating an inverter upgrade file in any of the aforementioned embodiments.

[0078] Figure 5 FIG. 5 shows a schematic block diagram of an electronic device 500 in a specific embodiment. Figure 5 As shown, the electronic device 500 includes a memory 510 and a processor 520 .

[0079] The memory 510 is used to store computer programs.

[0080] The processor 520 is connected to the memory 510 to execute the computer program stored in the memory 510. When the processor 520 executes the computer program, the steps of the method for generating an inverter upgrade file in any of the aforementioned embodiments are implemented.

[0081] According to another aspect of the present invention, there is further provided a computer storage medium having a computer program stored thereon, which, when executed, implements the steps of the method for generating an inverter upgrade file in any of the aforementioned embodiments.

[0082] According to another aspect of the present invention, there is also provided an inverter upgrade method applicable to a background control device and an inverter upgrade method applicable to a controlled terminal. The background control device refers to a device with background control capabilities such as a host computer or a server, and the controlled terminal refers to a terminal device controlled by the background control device, and the two constitute an upgrade system. For ease of understanding, the steps of the inverter upgrade method applicable to the background control device and the steps of the inverter upgrade method applicable to the terminal device of the present invention are described in coordination, and a description is provided. Figure 6 The interaction process between the background control device and the terminal device is shown as an example to facilitate the understanding of technical personnel.

[0083] Specifically, the background control device may generate an upgrade file for the device to be upgraded using the method for generating an inverter upgrade file in any of the aforementioned embodiments, and send the upgrade file to the corresponding device to be upgraded.

[0084] Correspondingly, Figure 7 A schematic diagram of a process flow of an inverter upgrade method applicable to a terminal device in a specific embodiment is shown. Figure 7 As shown, the inverter upgrade method applicable to the terminal device includes steps S710 to S720.

[0085] Among them, step S710 is: the terminal device receives the upgrade file. Figure 1 The upgrade file generated in step S120 shown in the figure includes at least a file header and a program file, and the file header includes at least verification information of the program file and attribute information of the device to be upgraded.

[0086] Step S720 is: the terminal device verifies the file header, and in response to all the information in the file header being verified, the terminal device executes the program file to complete the upgrade, wherein the verification at least includes: the verification information of the program file indicates that the program file is correct and the attributes of the terminal device are consistent with the attribute information of the device to be upgraded.

[0087] In some specific embodiments, the verification information of the program file may include the MD5 check value of the program file and / or the size information of the program file. For the MD5 check value, when verifying, the terminal device calculates the hash value of the program file through the MD5 algorithm. If the calculated hash value is the same as the MD5 check value in the file header, the MD5 check is judged to have passed. For the size information of the program file, when verifying, the terminal device calculates the byte length of the program file. If the calculated byte length is the same as the size information of the program file stored in the file header, the size information of the program file is judged to have passed the check. It can be understood that the terminal device judges that the program file has passed the check if and only if all the check information of the program file has passed the check.

[0088] In some specific embodiments, the attribute information of the device to be upgraded may include one or more of the hardware identification of the device to be upgraded, the object information of the program file, and the region code where the device to be upgraded is located. For the hardware identification, the terminal device compares its own hardware identification with the hardware identification in the file header. When the hardware identification of the terminal device itself is the same as the hardware identification in the file header, the terminal device determines that the hardware identification verification is passed; for the object information of the program file, the terminal device determines whether its own device type is consistent with the object information stored in the file header. For example, when the terminal device is a DSP (or module MCU), if the terminal device verifies that the object information stored in the file header is the corresponding DSP (or module MCU), the terminal device determines that the object information verification is passed; for the region code, the terminal device compares the code of the region where it is located with the region code stored in the file header. If the two are the same, the terminal device determines that the region code verification is passed. It can be understood that the terminal device determines that the attribute information verification is passed when and only when all the attribute information of the device to be upgraded is verified.

[0089] In some embodiments, if the file header also includes other verification information, the terminal device needs to verify each verification information. Only when all verification information is verified, the terminal device reads the program file in the upgrade file and runs it to complete the upgrade.

[0090] In some specific embodiments, the file header also includes verification information related to the file header, such as the length of the file header and / or the file header checksum. With respect to the length of the file header, the terminal device calculates the byte length of the file header in the upgrade file, and compares the calculated byte length with the file header length stored in the file header. When the two are the same, the terminal device determines that the file header length verification has passed; with respect to the file header checksum, the terminal device sums all data contents stored in the file header (data contents except the file header checksum), and compares the calculated data sum with the file header checksum stored in the file header. When the two are the same, the terminal device determines that the file header checksum verification has passed.

[0091] In some specific embodiments, the file header also includes other information that can be used to verify the correctness of the upgrade file, such as the upgrade password of the program file and / or the password or software attribute information set by the software version of the program file, etc. For the upgrade password, the terminal device compares the upgrade password of this upgrade with the upgrade secret stored in the file header. When the two are the same, the terminal device determines that the upgrade password verification has passed; for the software version, the terminal device compares the software version to be upgraded this time with the software version stored in the file header. When the two are the same, the terminal device determines that the software version verification has passed.

[0092] In some specific embodiments, the file header also includes encryption algorithm information. Correspondingly, after all other verification information has been verified, the terminal device determines the number of encryption algorithms of the program file and the encryption algorithm used for each encryption based on the encryption algorithm information in the file header; the terminal device then decrypts the program file in reverse order according to the encryption algorithm sequence and executes the decrypted program file to complete the upgrade.

[0093] Preferably, the background control device may send an upgrade instruction to the device to be upgraded before generating the upgrade file; correspondingly, after receiving the upgrade instruction, the terminal device confirms whether it is in an upgradeable state, and in response to the terminal device being in an upgradeable state, the terminal device returns upgrade confirmation information to the background control device; the background control device generates an upgrade file corresponding to the device to be upgraded in response to receiving the upgrade confirmation message from the device to be upgraded.

[0094] Furthermore, for Figure 4 In the embodiment of the method for generating an inverter upgrade file shown, the upgrade file is divided into M data packets, some of which are file header data packets. For example, when the number of bytes in the file header is 256 and the preset length N of the data packet is 128, the file header has 2 data packets, and the remaining M-2 data packets are program file data packets.

[0095] Preferably, the background control device, in the process of sending the upgrade file, gives priority to sending the file header data packet to the device to be upgraded; correspondingly, the terminal device verifies all the information in the file header, and in response to all the information being verified, the terminal device returns the file header confirmation information; correspondingly, the background control device sends the remaining data packets ( Figure 4 In the embodiment shown, M-2 packages a data packet of a program file) to the device to be upgraded; correspondingly, the terminal device receives the remaining data packets in sequence.

[0096] Preferably, the terminal device returns upgrade file confirmation information to the background control device after receiving all data packets or completing the upgrade; correspondingly, in response to receiving the upgrade file confirmation information of the device to be upgraded, the upgrade status of the device to be upgraded is updated to completed.

[0097] Preferably, in some embodiments, the program file includes a program file in a bin format and an MD5 check value. In these embodiments, the inverter upgrade method of the terminal device also includes: after the upgrade is completed, before starting the upgraded program file each time, first calculate the hash value of the upgraded program file, in response to the calculated hash value being consistent with the MD5 check value in the upgraded program file, determine that the upgraded program file is correct, and start the upgraded program file; otherwise, determine that the program file has been damaged or modified, and stop starting and running the program file.

[0098] Those skilled in the art will appreciate that information, signals, and data may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips cited throughout the above description may be represented by voltage, current, electromagnetic waves, magnetic fields or magnetic particles, optical fields or optical particles, or any combination thereof.

[0099] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or a combination of the two. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. The technician may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present invention.

[0100] The various illustrative logic modules and circuits described in conjunction with the embodiments disclosed herein may be implemented or executed with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in cooperation with a DSP core, or any other such configuration.

[0101] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software module may reside in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read and write information from / to the storage medium. In an alternative, a storage medium may be integrated into a processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.

[0102] In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented as a computer program product in software, each function may be stored on or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include both computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one place to another. Storage media may be any available medium that can be accessed by a computer. As an example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer. Any connection is also properly referred to as a computer-readable medium. For example, if the software is transmitted from a website, a server, or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein disk often reproduces data magnetically, while disc reproduces data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0103] The foregoing description is provided to enable any person skilled in the art to practice the various aspects described herein. However, it should be understood that the scope of protection of the present invention shall be subject to the appended claims and shall not be limited to the specific structures and components of the above-described embodiments. Those skilled in the art may make various changes and modifications to the embodiments within the spirit and scope of the present invention, and these changes and modifications also fall within the scope of protection of the present invention.

Claims

1. A method for generating an upgrade file for an inverter, characterized in that: The method comprises: Get the property information of the device to be upgraded; Generate a file header and a program file corresponding to the device to be upgraded, wherein the file header includes at least verification information of the program file and attribute information of the device to be upgraded, and the file header is used to verify the correctness of the program file and the device to be upgraded; and The file header and the program file are combined into an upgrade file.

2. The method for generating an inverter upgrade file according to claim 1, characterized in that: The file header also includes encryption algorithm information, and the step of combining the file header and the program file into an upgrade file includes: encrypting the program file multiple times; and The encrypted program file and the file header are combined into an upgrade file, and the encryption algorithm information includes indication information of the encryption algorithm used for the multiple encryptions.

3. The method for generating an inverter upgrade file according to claim 1, characterized in that: The verification information of the program file includes the MD5 checksum of the program file and / or the size information of the program file, and the attribute information of the device to be upgraded includes one or more of the hardware identification of the device to be upgraded, the object information of the program file, and the area code where the device to be upgraded is located.

4. The method for generating an inverter upgrade file according to any one of claims 1 to 3, characterized in that: The file header further includes file header verification information, wherein the file header verification information includes the length of the file header and / or a file header checksum; and / or The file header also includes an upgrade password for the program file and / or a software version of the program file.

5. The method for generating an inverter upgrade file according to claim 1, characterized in that: The program file of the device to be upgraded includes a program file in a bin format and an MD5 check value, where the MD5 check value is a hash value of the program file in the bin format calculated using an MD5 algorithm.

6. The method for generating an inverter upgrade file according to claim 1, characterized in that: The program files generated for the device to be upgraded include: A program file in hex format is converted into a program file in bin format. During the conversion process, the free addresses in the program file in hex format are filled with preset characters and then converted into a program file in bin format. The program file in bin format is stored in big endian order.

7. The method for generating an inverter upgrade file according to claim 6, characterized in that: Also includes: In response to the data length of the bin-format program file not being divisible by a first preset length, the bin-format program file is padded with preset characters until the bin-format program file is divisible by the first preset length.

8. The method for generating an inverter upgrade file according to any one of claims 1 to 3 or 5 to 7, characterized in that: After synthesizing the upgrade file, the following steps are also included: Calculate the total length of the upgrade file; Divide the upgrade file into N data packets, wherein in response to the total length being divisible by a second preset length, the quotient of the total length and the second preset length is taken as N, otherwise the quotient of the total length and the second preset length plus 1 is taken as N; and In response to the data length of the Nth data packet being less than the second preset length, the remaining bytes of the Nth file are filled with preset characters so that the data length of the Nth data packet is equal to the second preset length.

9. An inverter upgrade method, characterized in that: The method comprises: The terminal device receives an upgrade file, the upgrade file including a file header and a program file, the file header including at least verification information of the program file and attribute information of the device to be upgraded; and The terminal device verifies the file header, and in response to all the information in the file header being verified, the terminal device executes the program file to complete the upgrade, wherein the verification at least includes: the verification information of the program file indicates that the program file is correct and the attributes of the terminal device are consistent with the attribute information of the device to be upgraded.

10. The inverter upgrading method according to claim 9, characterized in that: The file header also includes encryption algorithm information, and the execution program file also includes: The terminal device determines the number of encryption algorithms of the program file and the encryption algorithm for each encryption based on the encryption algorithm information; The terminal device decrypts the program file in reverse order according to the encryption algorithm; and The terminal device executes the decrypted program file to complete the upgrade.

11. The inverter upgrading method according to claim 9 or 10, characterized in that: Before receiving the upgrade file, you will also need to: In response to receiving the upgrade instruction, the terminal device confirms whether it is in an upgradeable state; and In the upgradeable state, the terminal device returns upgrade confirmation information.

12. The inverter upgrading method according to claim 11, characterized in that: The upgrade file is divided into N data packets, where N is an integer, and each data packet includes data of a preset length, wherein several packets are file header data packets, and the remaining data packets are program file data packets. The receiving of the upgrade file includes: receiving the plurality of packet file header data packets in sequence; The terminal device verifies the attribute information of the device to be upgraded in the file header and the attribute of the terminal device, and in response to the attribute information of the device to be upgraded being consistent with the attribute of the terminal device, the terminal device returns file header confirmation information; and The remaining data packets are received in sequence.

13. The inverter upgrading method according to claim 9, characterized in that: The program file of the device to be upgraded includes a program file in bin format and an MD5 check value, the MD5 check value is a hash value of the program file in bin format calculated using the MD5 algorithm, and the inverter upgrade method further includes: After the upgrade is completed, before each startup of the upgraded program file, the hash value of the upgraded program file is calculated. In response to the calculated hash value being consistent with the MD5 checksum value in the program file, the upgraded program file is started, otherwise it is determined that the program file has been damaged or modified.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor is used to implement the steps of the method for generating an inverter upgrade file according to any one of claims 1 to 8 when executing the computer program stored in the memory.

Citation Information

Cited By

  • Energy storage firmware upgrading method, system and equipment

    CN121255246A