Firmware upgrading method and device and related equipment
By compressing and digitally signing the firmware file, and adopting a three-stage upgrade strategy of broadcast distribution, broadcast packet replacement, and unicast packet replacement, the problems of low efficiency, long time consumption, and poor security of firmware upgrades for power line carrier communication modules are solved, achieving efficient and secure firmware upgrades.
Patent Information
- Application Number
- CN202511935357.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-01-20
AI Technical Summary
Existing firmware upgrade methods for power line carrier communication modules are inefficient, time-consuming, and have poor security, especially with a low success rate in large-scale equipment upgrades.
The system employs a three-stage upgrade strategy that combines compressed firmware files with digital signatures, using both broadcast and unicast methods. This strategy includes broadcasting firmware upgrade instructions, sending firmware data in pages and blocks, dynamically adjusting the number of repeated transmissions and delays, identifying and retransmitting lost data, and finally using unicast packet replacement to ensure successful upgrades for all devices.
It significantly improves the success rate and efficiency of large-scale device firmware upgrades, reduces transmission time, and enhances security.
Smart Images

Figure CN121367649A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of power line carrier communication, and particularly relates to a firmware upgrading method and device and related equipment. BACKGROUND
[0002] High-speed power line carrier communication (HPLC) is a communication mode that uses existing power lines (such as high-voltage transmission lines, low-voltage distribution lines, and household power supply lines) as transmission media, and transmits data signals on the power lines through modulation technology. It realizes bidirectional communication of data without affecting the normal transmission of power, by using the physical characteristics of the power line. HPLC is widely used in power consumption information collection systems, and has covered more than 90% of smart meter upgrades. After the electric energy meter is equipped with an HPLC communication module, it becomes a terminal STA in the HPLC network, responsible for uploading power consumption data or receiving instructions. During the operation and maintenance process, the electric energy meter HPLC communication module needs to be upgraded due to business demand adjustment or software defects. Currently, there are several upgrading methods: method 1: on-site manual upgrade, the old module is removed and replaced with a new module upgraded in advance, or a data line is used to connect the old module and a burning tool is used to burn a new firmware version; method 2: the electric energy meter HPLC communication module periodically queries the concentrator for upgradeable firmware versions, and when upgrading, the firmware version is sent from the master station to the concentrator, and then the electric energy meter HPLC communication module and the concentrator use unicast to receive and transmit firmware; method 3: the firmware version is sent from the master station to the concentrator, and then the concentrator uses a broadcast method to distribute it to each electric energy meter HPLC communication module through a central coordinator (CCO).
[0003] Method 1 above consumes a large amount of human resources and is inefficient; method 2 uses a point-to-point upgrade method, which can ensure success rate, but it takes a lot of time to upgrade all electric energy meter HPLC communication modules, and the concentrator needs to communicate with each electric energy meter, resulting in large network load and packet loss, further prolonging the upgrade time; method 3 uses a broadcast upgrade method, and the electric energy meter does not need to confirm each upgrade packet, the network load is small, but due to the influence of power supply quality and on-site environment, it is easy to cause packet loss, resulting in low upgrade success rate and no security guarantee. SUMMARY
[0004] The embodiments of the present application provide a firmware upgrading method, device and related equipment, which can solve the problems of long upgrade time, poor security and low success rate in related technologies.
[0005] In a first aspect, a firmware upgrading method is provided, which is executed by a central coordinator (CCO), and the method comprises: The original firmware file is compressed, and a digital signature is generated based on the compressed firmware file to obtain a firmware upgrade package to be distributed; The firmware upgrade instruction message is sent to the plurality of high-speed power line carrier communication (HPLC) communication modules in a broadcast mode based on the preset repeated sending number and sending delay, so as to wake up the HPLC communication modules to enter a firmware upgrade state. The firmware upgrade package is sent after being divided into pages and blocks in the broadcast mode based on the preset repeated sending number and sending delay, and the data receiving states of the HPLC communication modules are obtained and stored after one or more pages of firmware data are sent. After the broadcast sending of the firmware upgrade package is completed, common packet loss data is identified based on the data receiving states of all the HPLC communication modules, and the common packet loss data is re-sent in the broadcast mode based on the dynamically adjusted repeated sending number and sending delay. After the re-sending of the common packet loss data is completed, the data receiving states of the HPLC communication modules are traversed, and the HPLC communication modules with packet loss are re-sent in a unicast mode.
[0006] In a second aspect, a firmware upgrade method is provided, which is executed by a high-speed power line carrier communication (HPLC) communication module, and includes the following steps. A firmware upgrade instruction message from a central coordinator (CCO) is received and responded to, and a firmware upgrade state is entered. Firmware upgrade data broadcast and unicast sent by the central coordinator (CCO) is received, and a data receiving state is recorded. The data receiving state is reported when queried by the central coordinator (CCO). After all the firmware upgrade data is received, a firmware upgrade package is obtained, and the firmware upgrade package is verified. After the verification is passed, the firmware upgrade package is decompressed to obtain an original firmware file. Based on the original firmware file, an upgrade is completed, and a firmware upgrade result message is reported.
[0007] In a third aspect, a firmware upgrade device is provided, which includes the following. A firmware compression module is configured to compress an original firmware file, and generate a digital signature based on the compressed firmware file to obtain a firmware upgrade package to be distributed. The firmware upgrade indication module is configured to send a firmware upgrade indication message to a plurality of high-power line carrier communication (HPLC) modules to be upgraded in a broadcast manner based on a preset number of repeated transmissions and a transmission delay, so as to wake up the HPLC modules to enter a firmware upgrade state; The firmware sending module is configured to send the firmware upgrade package in a broadcast manner after paging and blocking, based on the preset number of repeated transmissions and the transmission delay, acquire and store data receiving states of the HPLC communication modules after sending one or more pages of firmware data, calculate a packet loss rate and a receiving delay according to the data receiving states, and dynamically adjust the number of repeated transmissions and the transmission delay according to the packet loss rate and the receiving delay. The broadcast retransmission module is configured to identify common packet loss data according to the data receiving states of all the HPLC communication modules after the broadcast transmission of the firmware upgrade package is completed, and retransmit the common packet loss data in a broadcast manner based on the dynamically adjusted number of repeated transmissions and the transmission delay. The unicast retransmission module is configured to traverse the data receiving states of the HPLC communication modules after the retransmission of the common packet loss data is completed, and retransmit the HPLC communication modules with packet loss in a unicast manner.
[0008] In a fourth aspect, a firmware upgrade device is provided, which includes: The firmware upgrade response module is configured to receive and respond to a firmware upgrade indication message from a central coordinator (CCO) to enter a firmware upgrade state. The firmware receiving module is configured to receive firmware upgrade data broadcast and transmitted in unicast by the central coordinator (CCO) and record data receiving states. The receiving state reporting module is configured to report the data receiving states when queried by the central coordinator (CCO). The verification module is configured to obtain a firmware upgrade package after all the firmware upgrade data is received, and verify the firmware upgrade package. The decompression module is configured to decompress the firmware upgrade package to obtain an original firmware file after the verification is passed. The firmware upgrade execution module is configured to complete the upgrade based on the original firmware file and report a firmware upgrade result message.
[0009] In a fifth aspect, a central coordinator is provided, which includes a processor and a memory, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the method of the first aspect.
[0010] In a sixth aspect, there is provided an HPLC communication module comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implement the steps of the method according to the second aspect.
[0011] In a seventh aspect, there is provided a readable storage medium having stored thereon a program or instructions, the program or instructions, when executed by a processor, implement the steps of the method according to the first aspect, or implement the steps of the method according to the second aspect.
[0012] In an eighth aspect, there is provided a firmware upgrade system comprising a central coordinator and an HPLC communication module, the central coordinator being configured to implement the steps of the method according to the first aspect, and the HPLC communication module being configured to implement the steps of the method according to the second aspect.
[0013] In a ninth aspect, there is provided a chip comprising a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to execute a program or instructions, implement the steps of the method according to the first aspect, or implement the steps of the method according to the second aspect.
[0014] In a tenth aspect, there is provided a computer program / program product stored in a storage medium, the computer program / program product being executed by at least one processor to implement the steps of the firmware upgrade method according to the first aspect, or implement the steps of the firmware upgrade method according to the second aspect.
[0015] In the embodiments of the present application, the original firmware file is compressed and a digital signature is calculated, so that the firmware transmission time can be reduced, and the firmware transmission efficiency and security can be improved; the broadcast upgrade parameters, i.e., the number of repeated transmissions and the transmission delay, are defined, the firmware upgrade indication message is broadcasted first to wake up the HPLC communication modules to be upgraded to enter the firmware upgrade state; when the upgrade firmware is broadcasted, the firmware is divided into pages, and each page is further divided into blocks, and the broadcast transmission is performed according to the number of repeated transmissions and the transmission delay, and then the data receiving state of each HPLC communication module is acquired and stored, the packet loss rate and the receiving delay are calculated according to the data receiving state, and the number of repeated transmissions and the transmission delay are dynamically adjusted, and the step is repeated until the firmware broadcast transmission is completed; then the broadcast packet supplement is performed first, the common packet loss data is identified, and the common packet loss data is retransmitted according to the dynamically adjusted number of repeated transmissions and the transmission delay; after the retransmission of the common packet loss data is completed, the data receiving state of each HPLC communication module is traversed, and in the case that there are still HPLC communication modules with packet loss, the packet supplement is performed for the HPLC communication modules with packet loss one by one in the unicast mode, the embodiments of the present application ensure the efficiency and security of the firmware transmission by compression and generation of the digital signature, and innovatively adopt the three-stage upgrade strategy of broadcast distribution, broadcast packet supplement and unicast packet supplement, and introduce the dynamic parameter adjustment mechanism based on the packet loss rate and the receiving delay, so that the success rate and efficiency of the firmware upgrade of large-scale equipment are significantly improved. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 is one of the flowcharts of the firmware upgrade method provided by some embodiments of the present application; Figure 2 is the schematic diagram of the firmware upgrade package provided by some embodiments of the present application; Figure 3 is the second flowchart of the firmware upgrade method provided by some embodiments of the present application; Figure 4 is the interaction flowchart of the firmware upgrade method provided by some embodiments of the present application; Figure 5 is one of the structural schematic diagrams of the firmware upgrade device provided by some embodiments of the present application; Figure 6 is the second structural schematic diagram of the firmware upgrade device provided by some embodiments of the present application; Figure 7 is the structural schematic diagram of the communication device provided by some embodiments of the present application. DETAILED DESCRIPTION
[0017] Clearly, the described embodiments are only some but not all of embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art are within the scope of protection of the present application.
[0018] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in a "or" relationship.
[0019] The firmware upgrading method, device and related equipment provided by the embodiments of the present application will be described in detail below in combination with the accompanying drawings and specific embodiments and application scenarios.
[0020] Figure 1This is one of the flowcharts illustrating a firmware upgrade method provided in some embodiments of this application. This firmware upgrade method is applied to a Central Coordinator (CCO). It should be noted that a Power Line Carrier (PLC) network or HPLC network system typically includes: a master station, a concentrator, a Central Coordinator (CCO), a Proxy Coordinator (PCO), and stations (STAs). The master station is the top-level power company's master station system, serving as the command and data center for the entire system, communicating with field devices via networks such as 4G, 5G, or fiber optics. At the distribution station site, the concentrator acts as a data gateway, responsible for data interaction with the master station, but it does not perform PLC or HPLC communication itself; instead, it controls the Central Coordinator through local interfaces such as serial ports or Ethernet. The Central Coordinator (CCO) is the true "commander" responsible for establishing, managing, and maintaining the local communication network via power lines. The CCO can also be called a head node, responsible for coordinating and managing the routing of the entire network, receiving power consumption information from various areas, and realizing real-time monitoring, remote control, and intelligent management of power data. The Central Coordinator (CCO) polls and manages every communication node, or station, in the network, such as a smart meter installed at a user's location. Stations report metering data level by level via PLC or HPLC networks, ultimately being aggregated by the concentrator and sent to the master station. A station is a lower-level device managed by the CCO via power lines. A station typically refers to a smart meter installed at a user's location, but it is not always a smart meter. For example, if a user's meter is too far from the CCO, a repeater / relay node may be added in between. This repeater / relay node must also be managed in the network, thus constituting a "station," but it is not itself a meter. The Platform Coordinator (PCO), acting as a relay node, can connect multiple Stations (STAs) to achieve a multi-level interconnected communication structure. Furthermore, the PCO supports dynamic role switching; in some cases, an STA can be upgraded to a PCO to extend network coverage. Therefore, STA can also be used to refer to the PCO.
[0021] It should be noted that the firmware upgrade method provided in this application implements firmware upgrades for communication modules of multiple stations. This communication module can be a communication module supporting HPLC or PLC; this application uses the firmware upgrade of an HPLC communication module as an example for illustration.
[0022] like Figure 1 As shown, the firmware upgrade method includes steps 100, 101, 102, 103, and 104.
[0023] Step 100, compressing the original firmware file, and generating a digital signature based on the compressed firmware file to obtain a firmware upgrade package to be distributed; In order to shorten the firmware upgrade time and reduce the calculation amount of the digital signature, the original firmware file is compressed first.
[0024] Optionally, the compression processing of the original firmware file comprises: The original firmware file is compressed using a minilzo compression algorithm to obtain the compressed firmware file.
[0025] Then, a digital signature is generated based on the compressed firmware file to obtain the firmware upgrade package to be distributed.
[0026] Optionally, the generating of the digital signature based on the compressed firmware file to obtain the firmware upgrade package to be distributed comprises: The hash value of the compressed firmware file is calculated first, and then the hash value is encrypted using an RSA private key of an asymmetric encryption algorithm to obtain the digital signature of the compressed firmware file; A file header of a fixed size is added to the compressed firmware file to obtain the firmware upgrade package to be distributed; The file header comprises file information, digital signature information and compressed package header information.
[0027] Specifically, the hash value of the compressed firmware file can be calculated using an SHA256 algorithm.
[0028] The file information comprises file size, file header checksum, vendor information, firmware version number and the like, the digital signature information comprises RSA public key, digital signature and the like, and the compressed package header information comprises compression algorithm type, compressed firmware size, original firmware size and the like.
[0029] Step 101, sending a firmware upgrade instruction message to a plurality of high-speed power line carrier communication (HPLC) communication modules to be upgraded through a broadcast mode based on a preset repeated sending number and sending delay, so as to wake up the HPLC communication modules to enter a firmware upgrade state; Optionally, the repeated sending number of each broadcast message during the broadcast upgrade is set as T (1<= T<= 5), and T is 3 by default. The sending delay of each broadcast message is D milliseconds (100<= D<= 1000), and D is 400 by default.
[0030] The central coordinator (CCO) broadcasts the firmware upgrade instruction message according to the parameters T and D, which is used to notify the HPLC communication modules to be upgraded that the firmware upgrade is about to be performed, so as to wake up the HPLC communication modules to be upgraded to enter the firmware upgrade state.
[0031] Optionally, the firmware upgrade instruction message carries information such as manufacturer information, firmware version number, firmware size, number of HPLC communication modules to be upgraded, address list or broadcast address of the HPLC communication modules to be upgraded, message checksum, and the like.
[0032] Correspondingly, after receiving the firmware upgrade instruction message, the HPLC communication module to be upgraded determines whether to participate in the upgrade. If so, the HPLC communication module to be upgraded responds to the firmware upgrade instruction message and enters a firmware upgrade state.
[0033] In step 102, the firmware upgrade package is sent in a paging manner based on a preset number of repeated transmissions and a transmission delay, and after sending one or more pages of firmware data, the data receiving status of each HPLC communication module is obtained and stored, the packet loss rate and the receiving delay are calculated according to the data receiving status, and the number of repeated transmissions and the transmission delay are dynamically adjusted according to the packet loss rate and the receiving delay. The firmware upgrade package is paged, each page is further divided into blocks, and then sequentially numbered. Each page is divided into blocks according to a preset number of blocks, and each data block is a fixed byte length.
[0034] Optionally, each page is divided into 4 blocks, each block is 256 bytes, and sequentially numbered. Figure 2 is a schematic diagram provided by some embodiments of the present application for paging and blocking the firmware upgrade package. As shown in Figure 2 , the compressed firmware file (i.e. the compressed firmware in Figure 2 ) is divided into Page0, Page1, …, PageN, etc. Among them, Page0 is divided into Block[0], Block[1], Block[2], Block[3]; Page1 is divided into Block[4], Block[5], Block[6], Block[7]; PageN is divided into Block[4N], Block[4N+1], Block[4N+2], Block[4N+3].
[0035] In a specific implementation, the concentrator pages and blocks the firmware upgrade package, the central coordinator CCO obtains one page size of firmware data from the concentrator each time, and broadcasts the data blocks in the page according to the parameters T and D described above, each data block and the corresponding block information form a data packet, and each data packet is a firmware upgrade data.
[0036] Correspondingly, after receiving the data packet, the HPLC communication module records the data block number. Further, the HPLC communication module uses a bitmap data structure to record the received data block number, for example, data block N is received, the Nth bit of the bitmap is set to 1, otherwise it is defaulted to 0, and the bitmap data structure can save memory space.
[0037] The central coordinator CCO obtains the data receiving status of each HPLC communication module by sending a receiving status query message and receiving a receiving status response message after sending one or more pages of firmware data. It should be noted that the data receiving status includes received data block information and lost data block information.
[0038] The central coordinator CCO stores the data receiving status of each HPLC communication module. Optionally, a communication module upgrade status table is locally maintained in the central coordinator CCO to store the data receiving status of each HPLC communication module. It should be noted that the data receiving status of each HPLC communication module can also be stored in other data structures in the embodiments of the present application.
[0039] After obtaining the data receiving status of each HPLC communication module, the packet loss rate and the receiving delay of each page of firmware data can be calculated according to the data receiving status, and the number of repeated transmissions and the transmission delay can be dynamically adjusted according to the packet loss rate and the receiving delay.
[0040] It can be understood that the packet loss rate and the receiving delay are calculated once, and the number of repeated transmissions and the transmission delay are dynamically adjusted.
[0041] The central coordinator CCO continues to send the next page of firmware data after broadcasting the sending of one page of firmware data, until the broadcasting of the firmware upgrade package is completed.
[0042] In step 103, after the broadcasting of the firmware upgrade package is completed, common lost data is identified according to the data receiving status of all HPLC communication modules, and the common lost data is retransmitted in a broadcast manner based on the dynamically adjusted number of repeated transmissions and transmission delay. It can be understood that the common lost data refers to the same data packet that is not received by at least two HPLC communication modules, i.e., the common lost data is a data packet with a lost packet number greater than 1. After the broadcasting of the firmware upgrade package is completed, the common lost data can be identified according to the data receiving status of all HPLC communication modules.
[0043] For the common lost data, the common lost data is retransmitted in a broadcast manner based on the number of repeated transmissions and the transmission delay that are dynamically adjusted last time.
[0044] For the common lost data, retransmission in a broadcast manner can reduce the delay.
[0045] Optionally, the maximum number of repeated broadcast retransmissions is preset as BR (for example, BR<= 5). The operation of retransmitting the common lost data can be repeatedly performed until there is no data packet with a lost packet number greater than 1 or the maximum number of repeated broadcast retransmissions is reached.
[0046] It should be noted that after sending the common packet loss data, the central coordinator CCO can receive the state query message by broadcasting and receive the reception state response message fed back by each HPLC communication module, acquire the data reception state of each HPLC communication module for the common packet loss data, and update the data reception state of each HPLC communication module stored locally by the central coordinator CCO based on the data reception state for the common packet loss data, and calculate the packet loss rate and reception delay according to the data reception state, and dynamically adjust the number of repeated sending and sending delay according to the packet loss rate and reception delay.
[0047] Step 104, after the common packet loss data is completed, the data reception state of each HPLC communication module is traversed, and in the case that the HPLC communication module still has packet loss is identified, the still packet loss HPLC communication module is one by one supplemented by using the unicast mode.
[0048] After the common packet loss data is completed, the central coordinator CCO traverses the data reception state of each HPLC communication module stored locally to determine whether there is still a HPLC communication module with packet loss, and if so, the HPLC communication module with packet loss is identified. Further, the central coordinator CCO supplements each HPLC communication module with packet loss one by one by using the unicast mode for each HPLC communication module with packet loss, that is, the HPLC communication module with packet loss is supplemented one by one by using the unicast mode.
[0049] For example, the central coordinator CCO traverses the data reception state of each HPLC communication module and identifies HPLC communication module 1 and HPLC communication module 2 with packet loss, wherein the packet loss data of HPLC communication module 1 is data block with block number 3 and 4, and the packet loss data of HPLC communication module 2 is data block with block number 7. The central coordinator CCO unicasts the HPLC communication module 1, that is, obtains the data block with block number 3 and 4 from the concentrator, generates the corresponding data packet, and then sends it to the HPLC communication module 1. Then, the central coordinator CCO unicasts the HPLC communication module 2, that is, obtains the data block with block number 7 from the concentrator, generates the corresponding data packet, and then sends it to the HPLC communication module 2.
[0050] Optionally, the maximum number of unicast packet loss is preset to UR (for example, UR<= 3). The operation of supplementing each HPLC communication module with packet loss one by one by using the unicast mode can be repeatedly executed until each HPLC communication module has no packet loss or reaches the maximum number of unicast packet loss.
[0051] Correspondingly, after receiving all the firmware upgrade data, the HPLC communication module obtains the firmware upgrade package and enters the firmware integrity verification and decompression phase. Specifically, first, compare the local factory-stored RSA public key with the RSA public key in the file header of the firmware upgrade package. If they are different, proceed to the next step of reporting the upgrade result. Otherwise, calculate whether the digital signature of the compressed firmware is the same as the digital signature in the file header. If they are different, proceed to the next step of reporting the upgrade result. Otherwise, decompress the compressed firmware using the minilzo compression algorithm to obtain the original firmware file, write the original firmware file to the program area, and proceed to the next step of reporting the upgrade success and resetting. The HPLC communication module reports the firmware upgrade result message, which carries information such as manufacturer information, firmware version number, and upgrade result.
[0052] In the embodiments of the present application, the original firmware file is first compressed and the digital signature is calculated, which can reduce the firmware transmission time, prevent illegal tampering, and improve the efficiency and security of firmware transmission; the broadcast upgrade parameters, i.e., the number of repeated transmissions and the transmission delay, are defined. First, the firmware upgrade indication message is broadcasted to wake up the HPLC communication modules to be upgraded and enter the firmware upgrade state. When broadcasting the upgrade firmware, the firmware is first divided into pages, and each page is further divided into blocks. The broadcast is sent according to the number of repeated transmissions and the transmission delay. Then, the data reception status of each HPLC communication module is obtained and stored. The packet loss rate and reception delay are calculated based on the data reception status, and the number of repeated transmissions and the transmission delay are dynamically adjusted. This step is repeated until the firmware broadcast is completed. Then, the broadcast packet supplement is performed. The common packet loss data is identified, and the common packet loss data is supplemented according to the dynamically adjusted number of repeated transmissions and transmission delay. After the common packet loss data is supplemented, the data reception status of each HPLC communication module is traversed. If there are still HPLC communication modules with packet loss, the packet is supplemented to each HPLC communication module with packet loss using the unicast mode. The embodiments of the present application ensure the efficiency and security of firmware transmission by compression and generation of digital signatures, and innovatively adopt a three-stage upgrade strategy of broadcast distribution, broadcast packet supplement, and unicast packet supplement. At the same time, a dynamic parameter adjustment mechanism based on packet loss rate and reception delay is introduced, which significantly improves the success rate and efficiency of large-scale device firmware upgrade.
[0053] Optionally, the broadcast mode is used to send the firmware upgrade package after dividing it into pages and blocks based on the preset number of repeated transmissions and transmission delay, which includes: Divide the firmware upgrade package into pages, and then divide each page into blocks to obtain a plurality of data blocks corresponding to each page and sequentially number them; Each data block and the block information corresponding to each data block are combined into a data packet; Each data packet is sequentially sent in broadcast mode based on the preset number of repeated transmissions and transmission delay.
[0054] It should be noted that the block information corresponding to each data block includes: manufacturer information, firmware version number, block number, block size, checksum, etc.
[0055] The central coordinator CCO groups each data block and the manufacturer information, firmware version number, block number, block size, checksum, etc. corresponding to each data block into a data packet, broadcasts and transmits the data packet, and transmits each data packet in order according to the block number.
[0056] In the embodiment of the application, the firmware upgrade package is divided into pages, each page is divided into blocks, a plurality of data blocks corresponding to each page are obtained and sequentially numbered, each data block and the block information corresponding to each data block are grouped into a data packet, each data packet is sequentially transmitted in a broadcast manner based on a preset number of repeated transmissions and a transmission delay, the flexibility of firmware upgrade file transmission is improved, it is beneficial to packet loss data packet, and the overall upgrade efficiency can be improved.
[0057] Optionally, after transmitting one or more pages of firmware data, the data receiving states of the HPLC communication modules are obtained and stored, including: broadcasting a receiving state query message, the receiving state query message carrying at least one of the following: manufacturer information, firmware version number, number and address of HPLC communication modules to be upgraded, transmission time, and checksum; receiving a receiving state response message of each HPLC communication module, the receiving state response message including at least one of the following: manufacturer information, firmware version number, received data block bitmap, and receiving time; According to the receiving state response message of each HPLC communication module, the data receiving state of each HPLC communication module in the communication module upgrade state table maintained locally by the central coordinator CCO is updated.
[0058] It should be noted that the received data block bitmap is a bitmap data structure used by the HPLC communication module to record the received data block number, for example, if data block N is received, the Nth bit of the received data block bitmap is set to 1, otherwise it is set to 0 by default. The received data block bitmap can save memory space. The received data block bitmap can reflect the data receiving state of each HPLC communication module.
[0059] Table 1 is a communication module upgrade state table maintained locally by the central coordinator CCO according to an embodiment of the application.
[0060] Table 1
[0061] The central coordinator CCO updates the data receiving status of each HPLC communication module in a communication module upgrade status table maintained by the central coordinator CCO according to the status response messages of the receiving status of each HPLC communication module, including the received data block information and the lost data block information.
[0062] In the embodiments of the present application, by querying, receiving and storing the data receiving status of each HPLC communication module, the central coordinator CCO can accurately determine the data packets that need to be retransmitted, thereby improving the overall upgrade success rate and efficiency.
[0063] Optionally, the dynamic adjustment of the repeated sending times and the sending delay according to the packet loss rate and the receiving delay comprises: In the case that the packet loss rate or the receiving delay is higher than a preset threshold, the repeated sending times or the sending delay is increased; In the case that the packet loss rate or the receiving delay is lower than a preset threshold, the repeated sending times or the sending delay is reduced.
[0064] It can be understood that the higher the packet loss rate is, the greater the repeated sending times T is, the greater the receiving delay is, and the greater the sending delay D is.
[0065] In the embodiments of the present application, by dynamically adjusting the broadcast sending parameters based on the packet loss rate and the receiving delay, the success rate and efficiency of large-scale device firmware upgrade are significantly improved.
[0066] Optionally, according to the data receiving status of all HPLC communication modules, the common lost data packets are identified, and the common lost data packets are retransmitted in a broadcast manner based on the dynamically adjusted repeated sending times and sending delay, comprising: The data receiving status of each HPLC communication module is traversed by querying the communication module upgrade status table maintained by the central coordinator CCO, and the data block numbers with the packet loss number greater than 1 and the corresponding HPLC communication module addresses are counted; The data blocks corresponding to the data block numbers with the packet loss number greater than 1 are obtained from the concentrator, and the corresponding data packets are generated, thereby obtaining the common lost data packets; The common lost data packets are retransmitted in a broadcast manner based on the dynamically adjusted repeated sending times and sending delay; The receiving status response of each HPLC communication module to the common lost data packets is queried and received, the data receiving status of each HPLC communication module in the communication module upgrade status table maintained by the central coordinator CCO is updated, and the packet loss rate and the receiving delay are calculated, and the repeated sending times and the sending delay are dynamically adjusted according to the packet loss rate and the receiving delay.
[0067] It can be understood that the central coordinator CCO first traverses the data receiving states of each HPLC communication module by querying the communication module upgrade state table maintained locally by the central coordinator CCO, and counts the data block numbers with the number of lost packets greater than 1 and the corresponding HPLC communication module addresses. Then, the central coordinator CCO obtains the corresponding data block from the concentrator, generates a corresponding data packet, and then broadcasts and sends the corresponding data packet according to parameters T and D. The central coordinator CCO broadcasts a receiving state query message to query the receiving state of each HPLC communication module for the common lost packet data. The receiving state query message carries the number and addresses of the electric energy meters for which the broadcast packet is supplemented. The central coordinator CCO receives the receiving state response message fed back by the HPLC communication module corresponding to the corresponding address, updates the data receiving state of each HPLC communication module in the communication module upgrade state table maintained locally by the central coordinator CCO, and calculates the packet loss rate and reception delay. The number of repeated transmissions and the transmission delay are dynamically adjusted according to the packet loss rate and the reception delay.
[0068] The above operation of supplementing the common lost packet data can be repeatedly performed until there is no data packet with the number of lost packets greater than 1 or the maximum number of repeated broadcasts for supplementing the packet is reached, and then the next step is entered.
[0069] In the embodiments of the present application, by traversing the data receiving states of each HPLC communication module, the data block numbers with the number of lost packets greater than 1 are counted, the common lost packet data is determined, and the common lost packet data is broadcasted, thereby realizing the broadcast of the common lost packet data, reducing the large-scale firmware upgrade delay, improving the firmware upgrade efficiency, updating the communication module upgrade state table maintained locally by the central coordinator CCO according to the receiving state response of each HPLC communication module for the common lost packet data, calculating the packet loss rate and the reception delay, and dynamically adjusting the number of repeated transmissions and the transmission delay according to the packet loss rate and the reception delay. The firmware upgrade efficiency can be improved by dynamically adjusting the broadcast transmission parameters according to the network state.
[0070] Optionally, the traversing of the data receiving states of each HPLC communication module includes: The communication module upgrade state table maintained locally by the central coordinator CCO is queried to traverse the data receiving states of each HPLC communication module, and the HPLC communication module with lost packets is identified. The HPLC communication module with lost packets is supplemented one by one in a unicast manner.
[0071] Understandably, the Central Coordinator (CCO) queries the communication module upgrade status table maintained locally by the CCO, traverses the data reception status of each HPLC communication module, identifies the HPLC communication modules that still have packet loss, and then performs unicast packet replenishment for each of the HPLC communication modules that still have packet loss.
[0072] Optionally, the operation of re-packetizing each of the HPLC communication modules that still have packet loss can be repeated using unicast until each HPLC communication module has no packet loss or reaches the preset maximum number of unicast packet re-packet repetitions.
[0073] In this embodiment of the application, when the HPLC communication module is found to still have packet loss, unicast retransmission can be performed to improve the success rate of firmware upgrade data transmission.
[0074] Figure 3 This is a second schematic flowchart of a firmware upgrade method provided in some embodiments of this application. For example... Figure 3 As shown, this firmware upgrade method is applied to an HPLC communication module. This HPLC communication module can be a site's HPLC communication module, such as the HPLC communication module of an electricity meter.
[0075] The firmware upgrade method includes steps 300, 301, 302, 303, 304, and 305. Among them, Step 300: Receive and respond to the firmware upgrade instruction message from the Central Coordinator (CCO) and enter the firmware upgrade state; The HPLC communication module receives a firmware upgrade instruction message from the central coordinator (CCO), determines whether to participate in the upgrade, and if so, responds to the firmware upgrade instruction message and enters the firmware upgrade state.
[0076] Step 301: Receive firmware upgrade data broadcast and unicast by the Central Coordinator (CCO) and record the data reception status; Understandably, the Central Coordinator (CCO) employs a three-stage upgrade strategy of "broadcast distribution -> broadcast packet replacement -> unicast packet replacement," and the HPLC communication module accordingly receives the firmware upgrade data sent by the CCO.
[0077] After receiving the firmware upgrade data, the HPLC communication module records the data block number. Furthermore, the HPLC communication module uses a bitmap data structure to record the received data block number. For example, if data block N is received, the Nth bit in the bitmap is set to 1; otherwise, it defaults to 0. This bitmap data structure can save memory space.
[0078] Step 302: When the Central Coordinator (CCO) queries, report the data reception status; The HPLC communication module receives a reception state query message broadcast by the central coordinator CCO, and the reception state query message carries at least one of the following: manufacturer information, a firmware version number, a number and an address of HPLC communication modules to be upgraded, a sending time, and a checksum. Then, a reception state response message is generated according to a bitmap data structure, and the reception state response message is sent to the central coordinator CCO, and the reception state response message includes at least one of the following: manufacturer information, a firmware version number, a received data block bitmap, and a reception time.
[0079] Step 303: After all the firmware upgrade data is received, a firmware upgrade package is obtained, and the firmware upgrade package is verified. Step 304: After the verification is passed, the firmware upgrade package is decompressed to obtain an original firmware file. Step 305: Based on the original firmware file, the upgrade is completed, and a firmware upgrade result message is reported.
[0080] Specifically, the HPLC communication module first compares whether the RSA public key stored locally at the factory and the RSA public key in the file header of the firmware upgrade package are the same. If they are different, the next step of reporting the upgrade result is entered. Otherwise, it is determined whether the digital signature of the compressed firmware is the same as the digital signature in the file header. If they are different, the next step of reporting the upgrade result is entered. Otherwise, the original firmware file is obtained by decompressing the compressed firmware using the minilzo compression algorithm. The original firmware file is written into the program area, and the next step of reporting the upgrade success and resetting is entered. The HPLC communication module reports a firmware upgrade result message, and the message carries manufacturer information, a firmware version number, and an upgrade result.
[0081] The firmware upgrade method provided by the embodiments of the present application enters a firmware upgrade state by receiving and responding to a firmware upgrade instruction message from the central coordinator CCO, receives firmware upgrade data broadcast and unicast sent by the central coordinator CCO, and records a data reception state. When the central coordinator CCO queries, the data reception state is reported. After all the firmware upgrade data is received, a firmware upgrade package is obtained, and the firmware upgrade package is verified. After the verification is passed, the firmware upgrade package is decompressed to obtain an original firmware file. Based on the original firmware file, the upgrade is completed, and a firmware upgrade result message is reported. The security, success rate, and efficiency of large-scale device firmware upgrade are significantly improved.
[0082] Figure 4 is an interactive flowchart of the firmware upgrade method provided by some embodiments of the present application. As shown in Figure 4 The HPLC communication module is a power meter communication module, and the firmware upgrade method includes the following steps. Step 1: To shorten the firmware upgrade time and reduce the amount of digital signature calculation, the original firmware file is compressed, specifically, the minilzo compression algorithm is used to compress the original firmware file to obtain the compressed firmware file (i.e. compressed firmware); Step 2: To prevent tampering during firmware transmission, a digital signature is calculated for the compressed firmware, specifically, the SHA256 algorithm is used to calculate the hash value of the compressed firmware, and then the RSA private key is used to encrypt the hash value to obtain the digital signature of the compressed firmware; Step 3: A fixed-size file header is added to the compressed firmware to obtain the firmware to be upgraded. The file header includes file information, digital signature information, and compressed package header information. Specifically, the file information includes file size, file header checksum, vendor information, firmware version number, etc. The digital signature information includes RSA public key, digital signature, etc. The compressed package header information includes compression algorithm type, compressed firmware size, original firmware size, etc. Step 4: The number of repeated sending of each broadcast message during broadcast upgrade is specified as T (1 <= T <= 5), and T is set to 3 by default. The sending delay of each broadcast message is D milliseconds (100 <= D <= 1000), and D is set to 400 by default. Step 5: First, the central coordinator CCO broadcasts the firmware upgrade instruction message according to the parameters T and D, which is used to notify the communication module of the meter to be upgraded that firmware upgrade is about to be performed. This message carries information such as vendor information, firmware version number, firmware size, number of meters to be upgraded, address list or broadcast address, message checksum, etc. After receiving this message, the communication module of the meter judges whether to participate in the upgrade. If so, it enters the upgrade state. Step 6: The firmware is divided into pages, and each page is further divided into blocks. It is specified that each page is divided into 4 blocks, each block is 256 bytes, and they are sequentially numbered. Each data block and vendor information, firmware version number, block number, block size, checksum, etc. form an upgrade data packet, and the data packet is used as a unit during upgrade.
[0083] Step 7: Broadcast the upgrade firmware package. Specifically, the central coordinator CCO obtains a page size of firmware, sequentially forms data packets, and then sends each data packet according to the values of parameters T and D. After receiving the data packet, the communication module of the meter records the data block number. Further, the communication module of the meter uses a bitmap data structure to record the received data block number, for example, receiving data block N sets the Nth bit of the bitmap to 1, otherwise it is set to 0 by default. This structure can save memory space.
[0084] Step 8: After the end of the page firmware sending, the central coordinator CCO broadcasts a receiving status query message, which carries the manufacturer information, firmware version number, number and address of the electric energy meter to be upgraded, sending time, checksum and other information. The electric energy meter communication module receives the message and sends a receiving status response message, which carries the manufacturer information, firmware version number, received data block bitmap, receiving time and other information. The central coordinator CCO updates the data receiving status of each electric energy meter in the communication module upgrade status table, calculates the packet loss rate and receiving delay of the current page firmware, and dynamically adjusts the parameter T and D values. Step 9: Repeat steps 7 and 8 until the end of the firmware broadcast sending, and then go to the next step. Step 10: After the end of the broadcast sending, enter the packet loss repair process. The repair process first broadcasts the repair, and then unicasts the repair. The maximum number of broadcast repair is BR (BR <= 5), and the maximum number of unicast repair is UR (UR <= 3). Step 11: First, the central coordinator CCO queries the communication module upgrade status table to count the data packet number and electric energy meter address with packet loss greater than 1. The central coordinator CCO obtains the corresponding data block from the concentrator, forms a data packet, and then broadcasts the data packet according to the values of parameters T and D. Step 12: Repeat the previous step until all data packets with packet loss greater than 1 are sent, and then go to the next step. Step 13: The central coordinator CCO broadcasts a receiving status query message, which carries the number and address of the electric energy meter for broadcast repair. The electric energy meter communication module receives the message and sends a receiving status response message. The central coordinator CCO updates the receiving status information of each electric energy meter in the communication module upgrade status table, calculates the packet loss rate and receiving delay, and dynamically adjusts the parameter T and D values. Step 14: Repeat steps 11-13 until there are no data packets with packet loss greater than 1 or the maximum number of broadcast repair is exceeded, and then go to the next step. Step 15: The central coordinator CCO queries the communication module upgrade status table, and unicasts the repair for each electric energy meter communication module still with packet loss. Step 16: Repeat the previous step until there is no packet loss or the maximum number of unicast repair is exceeded. Step 17: After receiving all the firmware upgrade data, the electric energy meter communication module obtains the firmware upgrade package and enters the firmware integrity verification and decompression phase. Specifically, first, compare the local factory-stored RSA public key with the RSA public key in the file header of the firmware upgrade package. If they are different, proceed to the next step of reporting the upgrade result. Otherwise, calculate whether the digital signature of the compressed firmware is the same as the digital signature in the file header. If they are different, proceed to the next step of reporting the upgrade result. Otherwise, decompress the compressed firmware using the minilzo compression algorithm to obtain the original firmware, write the original firmware into the program area, and proceed to the next step of reporting the upgrade success and resetting. Step 18: The electric energy meter communication module reports the firmware upgrade result message, which carries information such as manufacturer information, firmware version number, and upgrade result.
[0085] The embodiments of the present application ensure the efficiency and security of firmware transmission through compression and signature, and adopt a three-stage upgrade strategy including broadcast distribution, broadcast patching, and unicast patching. At the same time, a dynamic parameter adjustment mechanism based on packet loss rate and delay is introduced, which significantly improves the success rate and efficiency of large-scale device firmware upgrade.
[0086] The firmware upgrade method provided by the embodiments of the present application can be executed by a firmware upgrade device. In the embodiments of the present application, the firmware upgrade method executed by the firmware upgrade device is taken as an example to illustrate the firmware upgrade device provided by the embodiments of the present application.
[0087] Figure 5 As shown in FIG. 1, the firmware upgrade device 500 includes a firmware compression module 510, a firmware upgrade indication module 520, a firmware sending module 530, a broadcast patching module 540, and a unicast patching module 550. Figure 5
[0088] The firmware compression module 510 is configured to compress the original firmware file and generate a digital signature based on the compressed firmware file to obtain a firmware upgrade package to be distributed. The firmware upgrade indication module 520 is configured to send a firmware upgrade indication message to a plurality of high-speed power line carrier communication (HPLC) communication modules to be upgraded in a broadcast manner based on a preset number of repeated transmissions and a transmission delay, so as to wake up the HPLC communication modules to enter a firmware upgrade state. The firmware sending module 530 is configured to send the firmware upgrade package after paging and blocking in a broadcast manner based on the preset number of repeated transmissions and the transmission delay, and after sending one or more pages of firmware data, acquire and store data reception states of the HPLC communication modules, calculate a packet loss rate and a reception delay according to the data reception states, and dynamically adjust the number of repeated transmissions and the transmission delay according to the packet loss rate and the reception delay. The broadcast retransmission module 540 is configured to, after the broadcast transmission of the firmware upgrade package is completed, identify common missing data according to data receiving states of all HPLC communication modules, and retransmit the common missing data in a broadcast manner based on the dynamically adjusted number of repeated transmissions and transmission delay. The unicast retransmission module 550 is configured to, after the retransmission of the common missing data is completed, traverse data receiving states of all HPLC communication modules, and in a case where it is identified that there are still missing data in some HPLC communication modules, retransmit the missing data in the HPLC communication modules in a unicast manner.
[0089] Optionally, the firmware compression module 510 is configured to: calculate a hash value of the compressed firmware file, and then encrypt the hash value by using an RSA private key to obtain a digital signature of the compressed firmware file; add a file header with a fixed size to the compressed firmware file to obtain a firmware upgrade package to be distributed; The file header includes file information, digital signature information, and compressed package header information.
[0090] Optionally, the firmware transmission module 530 is configured to: page the firmware upgrade package, block each page obtained, obtain a plurality of data blocks corresponding to each page, and sequentially number the data blocks; combine each data block and block information corresponding to the data block into a data packet; transmit each data packet in a broadcast manner based on the preset number of repeated transmissions and transmission delay.
[0091] Optionally, the firmware transmission module 530 is configured to: broadcast a receiving state query message, the receiving state query message carrying at least one of the following: manufacturer information, a firmware version number, a number and address of HPLC communication modules to be upgraded, a transmission time, and a checksum; receive a receiving state response message of each HPLC communication module, the receiving state response message including at least one of the following: manufacturer information, a firmware version number, a received data block bitmap, and a receiving time; update data receiving states of each HPLC communication module in a communication module upgrade state table maintained locally by the central coordinator CCO according to the receiving state response messages of the HPLC communication modules.
[0092] Optionally, the dynamically adjusting the number of repeated transmissions and the transmission delay according to the missing data rate and the receiving delay comprises: increase the number of repeated transmissions or the transmission delay when the packet loss rate or the reception delay is higher than a preset threshold value; decrease the number of repeated transmissions or the transmission delay when the packet loss rate or the reception delay is lower than a preset threshold value.
[0093] Optionally, the broadcast retransmission module 540 is configured to: query a communication module upgrade state table locally maintained by the central coordinator CCO, traverse data reception states of the HPLC communication modules, and count data block numbers with a packet loss number greater than 1 and corresponding HPLC communication module addresses; obtain data blocks corresponding to the data block numbers with the packet loss number greater than 1 from the concentrator and generate corresponding data packets to obtain common packet loss data; retransmit the common packet loss data in a broadcast manner based on the dynamically adjusted number of repeated transmissions and transmission delay; query and receive reception state responses of the HPLC communication modules to the common packet loss data, update data reception states of the HPLC communication modules in the communication module upgrade state table locally maintained by the central coordinator CCO, calculate a packet loss rate and a reception delay, and dynamically adjust the number of repeated transmissions and the transmission delay based on the packet loss rate and the reception delay.
[0094] Optionally, the operation of retransmitting the common packet loss data can be repeatedly performed until there is no data packet with a packet loss number greater than 1 or a preset maximum number of repeated broadcast retransmissions is reached.
[0095] Optionally, the unicast retransmission module 550 is configured to: query a communication module upgrade state table locally maintained by the central coordinator CCO, traverse data reception states of the HPLC communication modules, and identify HPLC communication modules that still have packet loss; unicast retransmit data packets to the HPLC communication modules that still have packet loss.
[0096] Optionally, the operation of unicast retransmitting data packets to the HPLC communication modules that still have packet loss can be repeatedly performed until there is no packet loss in the HPLC communication modules or a preset maximum number of repeated unicast retransmissions is reached.
[0097] The firmware upgrade device in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a central coordinator CCO.
[0098] The firmware upgrade device in this application embodiment can be a device with an operating system. This operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.
[0099] The firmware upgrade device provided in this application embodiment can achieve... Figures 1 to 2 The methods and implementations described herein achieve the same technical effects. To avoid repetition, they will not be elaborated upon here.
[0100] Figure 6 This is a second schematic diagram of the firmware upgrade device provided in the embodiments of this application, as shown below. Figure 6 As shown, the firmware upgrade device 600 includes: a firmware upgrade response module 610, a firmware receiving module 620, a receiving status reporting module 630, a verification module 640, a decompression module 650, and a firmware upgrade execution module 660.
[0101] Firmware upgrade response module 610 is used to receive and respond to firmware upgrade instruction messages from the central coordinator (CCO) and enter firmware upgrade state. Firmware receiving module 620 is used to receive firmware upgrade data broadcast and unicast by the Central Coordinator (CCO) and to record the data reception status. The receiving status reporting module 630 is used to report the data receiving status when the Central Coordinator (CCO) queries the data. The verification module 640 is used to verify the firmware upgrade package after all firmware upgrade data has been received. The decompression module 650 is used to decompress the firmware upgrade package to obtain the original firmware file after verification. Firmware upgrade execution module 660 is used to complete the upgrade based on the original firmware file and report the firmware upgrade result message.
[0102] The firmware upgrade device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a site, a site communication module, or an electricity meter communication module.
[0103] The firmware upgrade device in this application embodiment can be a device with an operating system. This operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.
[0104] The firmware upgrade device provided in this application embodiment can achieve...Figure 3 The various processes of the method embodiments are implemented, and the same technical effects can be achieved. To avoid repetition, details are not described here.
[0105] In some embodiments, as shown in Figure 7 The application also provides a communication device 700, which includes a processor 701 and a memory 702, and the memory 702 stores programs or instructions executable on the processor 701. For example, when the communication device 700 is a central coordinator, the programs or instructions are executed by the processor 701 to implement the various steps of the above firmware upgrade method embodiments, and the same technical effects can be achieved. When the communication device 700 is an HPLC communication module, the programs or instructions are executed by the processor 701 to implement the various steps of the above firmware upgrade method embodiments, and the same technical effects can be achieved. To avoid repetition, details are not described here.
[0106] The application also provides a central coordinator, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is configured to run programs or instructions to implement the steps in the method embodiments as shown in Figure 1 The central coordinator embodiments correspond to the above-mentioned central coordinator-side method embodiments, and the various implementation processes and implementation manners of the above-mentioned method embodiments can be applied to the central coordinator embodiments, and the same technical effects can be achieved. The central coordinator can be the firmware upgrade device as shown in Figure 5
[0107] The application also provides an HPLC communication module, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is configured to run programs or instructions to implement the steps in the method embodiments as shown in Figure 3 The HPLC communication module embodiments correspond to the above-mentioned HPLC communication module-side method embodiments, and the various implementation processes and implementation manners of the above-mentioned method embodiments can be applied to the HPLC communication module embodiments, and the same technical effects can be achieved. The HPLC communication module can be the firmware upgrade device as shown in Figure 6
[0108] The application also provides a readable storage medium, which stores programs or instructions executable by a processor to implement the various processes of the above firmware upgrade method embodiments, and the same technical effects can be achieved. To avoid repetition, details are not described here.
[0109] The processor is the processor in the access point or the processor in the station in the above-described embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. In some examples, the readable storage medium can be a non-transitory readable storage medium.
[0110] The embodiments of the present application further provide a chip, which comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used to run programs or instructions, to realize the processes of the above-mentioned firmware upgrading method embodiments, and to achieve the same technical effects. To avoid repetition, details are not described herein.
[0111] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system chip, a system chip, a chip system or a system on chip, etc.
[0112] The embodiments of the present application further provide a computer program / program product, which is stored in a storage medium, and is executed by at least one processor to realize the processes of the above-mentioned firmware upgrading method embodiments, and to achieve the same technical effects. To avoid repetition, details are not described herein.
[0113] The embodiments of the present application further provide a firmware upgrading system, which comprises a central coordinator and an HPLC communication module, the central coordinator is used to execute the steps of the above-mentioned firmware upgrading method, and the HPLC communication module is used to execute the steps of the above-mentioned firmware upgrading method.
[0114] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusions, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or include elements inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to the order of performing the functions as shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in a reverse order, for example, the described method can be performed in an order different from the described order, and various steps can be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.
[0115] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and necessary general hardware platforms, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk), and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device) to execute the methods described in the various embodiments of the present application.
[0116] The embodiments of the present application are described above in combination with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, rather than limiting, and those skilled in the art can make many forms without departing from the purpose of the present application and the scope protected by the claims under the inspiration of the present application, which all belong to the protection of the present application.
[0117] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an illustrative embodiment", "an example", "a specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0118] Although the embodiments of the present application have been shown and described, those skilled in the art can understand that various changes, modifications, replacements and variations can be made to the embodiments without departing from the principles and purposes of the present application, and the scope of the present application is defined by the claims and their equivalents.
Claims
1. A firmware upgrade method characterized by comprising: The application is applied to a central coordinator CCO, comprising: Compressing the original firmware file, and generating a digital signature based on the compressed firmware file to obtain a firmware upgrade package to be distributed; In a broadcast manner, based on a preset repeated sending number and sending delay, a firmware upgrade instruction message is sent to a plurality of high-speed power line carrier communication HPLC communication modules to be upgraded, so as to wake up the HPLC communication modules to enter a firmware upgrade state; In a broadcast manner, based on the preset repeated sending number and sending delay, the firmware upgrade package is sent after being divided into pages and blocks, and after one or more pages of firmware data are sent, the data receiving states of the HPLC communication modules are acquired and stored, the packet loss rate and receiving delay are calculated according to the data receiving states, and the repeated sending number and sending delay are dynamically adjusted according to the packet loss rate and receiving delay; After the broadcast sending of the firmware upgrade package is completed, common packet loss data are identified according to the data receiving states of all the HPLC communication modules, and the common packet loss data are re-sent in a broadcast manner based on the dynamically adjusted repeated sending number and sending delay; After the re-sending of the common packet loss data is completed, the data receiving states of the HPLC communication modules are traversed, and in the case that there are still HPLC communication modules with packet loss, the HPLC communication modules with packet loss are re-sent one by one in a unicast manner.
2. The method of claim 1, wherein, The application is applied to a central coordinator CCO, comprising: The hash value of the compressed firmware file is calculated, and then the hash value is encrypted by using an RSA private key to obtain the digital signature of the compressed firmware file; A fixed-size file header is added to the compressed firmware file to obtain the firmware upgrade package to be distributed; The file header comprises file information, digital signature information and compressed package header information.
3. The method of claim 1, wherein, The application is applied to a central coordinator CCO, comprising: The firmware upgrade package is divided into pages, and each page is divided into blocks to obtain a plurality of data blocks corresponding to each page and sequentially numbered; Each data block and the block information corresponding to each data block are combined into a data packet; In a broadcast manner, based on the preset repeated sending number and sending delay, each data packet is sequentially sent.
4. The method of claim 1, wherein, The application is applied to a central coordinator CCO, comprising: A receiving state query message is broadcasted, and the receiving state query message carries at least one of the following: manufacturer information, firmware version number, number and address of HPLC communication modules to be upgraded, sending time and checksum; A receiving state response message of each HPLC communication module is received, and the receiving state response message comprises at least one of the following: manufacturer information, firmware version number, received data block bitmap and receiving time; According to the receiving state response message of each HPLC communication module, the data receiving state of each HPLC communication module in the communication module upgrade state table locally maintained by the central coordinator CCO is updated.
5. The method of claim 1, wherein, The dynamic adjustment of the number of repeated transmissions and the transmission delay according to the packet loss rate and the receiving delay comprises: In the case that the packet loss rate or the receiving delay is higher than a preset threshold, the number of repeated transmissions or the transmission delay is increased; In the case that the packet loss rate or the receiving delay is lower than a preset threshold, the number of repeated transmissions or the transmission delay is decreased.
6. The method of claim 1, wherein, According to the data receiving state of all HPLC communication modules, common packet loss data is identified, and the common packet loss data is retransmitted based on the dynamically adjusted number of repeated transmissions and transmission delay in a broadcast manner, which comprises: By querying the communication module upgrade state table locally maintained by the central coordinator CCO, the data receiving state of each HPLC communication module is traversed, and the data block numbers with packet loss number greater than 1 and the corresponding HPLC communication module addresses are counted; The data block corresponding to the data block number with packet loss number greater than 1 is obtained from the concentrator, and the corresponding data packet is generated, to obtain common packet loss data; The common packet loss data is retransmitted based on the dynamically adjusted number of repeated transmissions and transmission delay in a broadcast manner; The receiving state response of each HPLC communication module to the common packet loss data is queried and received, the data receiving state of each HPLC communication module in the communication module upgrade state table locally maintained by the central coordinator CCO is updated, and the packet loss rate and the receiving delay are calculated, and the number of repeated transmissions and the transmission delay are dynamically adjusted according to the packet loss rate and the receiving delay.
7. The method according to claim 1 or 6, characterized in that, The operation of retransmitting the common packet loss data can be repeatedly executed until there is no data packet with packet loss number greater than 1 or the maximum number of repeated broadcast packet retransmission is reached.
8. The method of claim 1, wherein, In the case that there is still HPLC communication module with packet loss, the HPLC communication module with packet loss is one by one retransmitted in a unicast manner, which comprises: By querying the communication module upgrade state table locally maintained by the central coordinator CCO, the data receiving state of each HPLC communication module is traversed, and the HPLC communication module with packet loss is identified; The HPLC communication module with packet loss is one by one retransmitted in a unicast manner.
9. The method according to claim 1 or 8, characterized in that, The operation of one by one retransmitting the HPLC communication module with packet loss in a unicast manner can be repeatedly executed until there is no HPLC communication module with packet loss or the maximum number of repeated unicast packet retransmission is reached.
10. A firmware upgrade method characterized by comprising: The application is applied to a high-speed power line carrier communication HPLC communication module, which comprises: Receiving and responding to the firmware upgrade instruction message from the central coordinator CCO to enter the firmware upgrade state; Receiving the firmware upgrade data broadcast and unicast transmitted by the central coordinator CCO, and recording the data receiving state; Reporting the data receiving state when queried by the central coordinator CCO; After receiving all the firmware upgrade data, obtaining the firmware upgrade packet, and verifying the firmware upgrade packet; decompress the firmware upgrade package to obtain an original firmware file after verification; complete the upgrade based on the original firmware file, and report a firmware upgrade result message.
11. A firmware upgrade apparatus, characterized by comprising: Comprising: a firmware compression module, configured to compress an original firmware file, and generate a digital signature based on the compressed firmware file to obtain a firmware upgrade package to be distributed; a firmware upgrade indication module, configured to send a firmware upgrade indication message to a plurality of high-speed power line carrier communication (HPLC) modules to be upgraded in a broadcast manner based on a preset number of repeated transmissions and a transmission delay, so as to wake up the HPLC modules to enter a firmware upgrade state; a firmware sending module, configured to send the firmware upgrade package after paging and blocking in a broadcast manner based on the preset number of repeated transmissions and the transmission delay, and acquire and store data receiving states of the HPLC modules after sending one or more pages of firmware data, calculate a packet loss rate and a receiving delay based on the data receiving states, and dynamically adjust the number of repeated transmissions and the transmission delay based on the packet loss rate and the receiving delay; a broadcast retransmission module, configured to identify common packet loss data based on the data receiving states of all the HPLC modules after the broadcast sending of the firmware upgrade package is completed, and retransmit the common packet loss data in a broadcast manner based on the dynamically adjusted number of repeated transmissions and the transmission delay; a unicast retransmission module, configured to traverse the data receiving states of the HPLC modules after the retransmission of the common packet loss data is completed, and retransmit HPLC modules still having packet loss one by one in a unicast manner.
12. A firmware upgrade apparatus, characterized by comprising: Comprising: a firmware upgrade response module, configured to receive and respond to a firmware upgrade indication message from a central coordinator (CCO) to enter a firmware upgrade state; a firmware receiving module, configured to receive firmware upgrade data broadcast and unicast sent by the CCO, and record data receiving states; a receiving state reporting module, configured to report the data receiving states when queried by the CCO; a verification module, configured to obtain a firmware upgrade package after all the firmware upgrade data is received, and verify the firmware upgrade package; a decompression module, configured to decompress the firmware upgrade package to obtain an original firmware file after verification; a firmware upgrade execution module, configured to complete the upgrade based on the original firmware file, and report a firmware upgrade result message.
13. A central coordinator, characterized by A device comprising a processor and a memory, the memory storing programs or instructions executable on the processor, and the programs or instructions being executed by the processor to implement the steps of the firmware upgrade method according to any one of claims 1 to 9.
14. An HPLC communication module characterized by, A device comprising a processor and a memory, the memory storing programs or instructions executable on the processor, and the programs or instructions being executed by the processor to implement the steps of the firmware upgrade method according to claim 10.
Citation Information
Patent Citations
Digital signature technology-based electric energy meter upgrading method and system
CN107678763A
Method for improving firmware upgrading efficiency of electric energy meter
CN115658112A
Program upgrading method and system of communication module, and electricity consumption information acquisition system
CN116055920A
HPLC (High Performance Liquid Chromatography) communication module online upgrading method
CN116319316A
Electric energy meter broadcast upgrading method
CN117729108A
