NB-IOT technology-based firmware remote upgrading method and electric energy meter
Through the sharded data transmission and breakpoint continuous transmission mechanism based on NB-IOT technology, combined with the firmware check and upgrade feedback mechanism, the problems of low firmware upgrade efficiency and high maintenance cost of smart power meter are solved, and efficient, reliable and safe remote upgrades are achieved.
Patent Information
- Application Number
- CN202510487960.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-05-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing smart power meters have problems such as single upgrade methods, low efficiency and high maintenance costs in firmware upgrades, which are difficult to meet the ever-increasing performance and functional needs.
The firmware remote upgrade method based on NB-IOT technology is adopted, and the NB-IOT communication method combines chip data transmission, firmware verification, breakpoint continuous transmission and upgrade feedback mechanisms to achieve reliable remote upgrade of the firmware of smart power meter.
It realizes efficient, reliable and secure remote upgrade of smart power meter firmware, reduces maintenance costs, improves equipment management efficiency, and is suitable for smart grid and IoT device management fields.
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of firmware upgrade for smart electric energy meters, and in particular to a firmware remote upgrade method and an electric energy meter based on NB-IOT technology. Background Art
[0002] Nowadays, with the improvement of the level of power grid automation, electricity meters have changed from mechanical meters to electronic smart meters. The electronic smart meters can not only be used as electricity bill metering instruments, but also have multiple functions such as power grid detection and power grid event recording. At the same time, the State Grid has made unified specifications for the technical requirements of electricity meters, but provincial and municipal power companies still have certain differentiated needs, so batch upgrades of electricity programs are required.
[0003] The invention patent with application number 202111012359.7 discloses a method for upgrading the firmware of an electric energy meter, including: creating an upgrade task in the master station system, and then sending a start-up upgrade instruction; determining the offset position of the data to be sent in the target firmware file, and then intercepting the data at the corresponding position in the firmware file and packetizing it, the master station sends a data packet to the electric energy meter with the initial packet length, and waits according to the set data transmission interval, and then sends the next data packet until a group of data packets are sent; when the electric energy meter has received the data completely, the master station system sends an activation instruction to the electric energy meter, and the electric energy meter is upgraded. The communication mode of the electric energy meter to be upgraded is at least one or more of the GPRS communication mode and the PLC communication mode.
[0004] Existing smart energy meters mostly use traditional methods for firmware upgrades, which have the problems of single upgrade method, low efficiency and high maintenance cost, making it difficult to meet the ever-increasing performance and functional requirements. NB-IOT (Narrowband Internet of Things) is a low-power, wide-coverage wireless communication technology, especially suitable for large-scale and widely distributed IoT devices such as energy meters; it is a narrowband IoT communication technology, especially suitable for low-power, wide-coverage and large-scale IoT device connection scenarios. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a firmware remote upgrade method and an electric energy meter based on NB-IOT technology, which adopts NB-IOT communication mode, combines fragmented data transmission, firmware verification, breakpoint resumption and upgrade feedback mechanism, to realize reliable remote upgrade of smart electric energy meter firmware.
[0006] The technical solution adopted by the present invention to solve the technical problem is: a firmware remote upgrade method based on NB-IOT technology, the upgrade method mainly includes the following steps: S1, Upgrade preparation phase: including server-side preparation and energy meter-side preparation; S2, data transmission stage: including firmware data transmission, breakpoint resume transmission mechanism and fragmentation verification; S3, firmware update phase: including data analysis and storage, preparation before update, firmware writing and startup; S4, Upgrade verification and feedback: including function verification and feedback information sending; S5. Security measures: including identity authentication, data encryption and digital signature.
[0007] Furthermore, in step S1, the server-side preparation specifically includes, S1.1 firmware compilation and encryption: compile the new firmware version to generate an upgrade file, and encrypt the firmware file using an encryption algorithm to ensure the security of the transmission process; S1.2 fragmentation processing: divide the firmware file into several small data frames, and the size of each frame is determined by the NB-IOT communication bandwidth and memory limit of the electric energy meter; S1.3 upgrade strategy issuance: configure the upgrade strategy, including the serial number of the target device, the upgrade time window, and the number of retries to ensure that the upgrade is carried out in batches and time periods to avoid network congestion; the electric energy meter-side preparation specifically includes, S1.4 NB-IOT module initialization: the built-in NB-IOT module of the electric energy meter is started, a connection is established with the base station, and the communication initialization with the remote server is completed; S1.5 firmware version verification: the electric energy meter sends the current firmware version information to the server, and the server determines whether an upgrade is required based on the version number.
[0008] Furthermore, in step S2, firmware data transmission specifically includes, S2.1 data segment transmission: the server sends firmware data frame by frame through the NB-IOT network, and each frame of data includes a frame header (including frame sequence number, total number of frames, check code) and frame data (firmware fragment); S2.2 Device-side reception and verification: after the electric energy meter receives the data frame, it verifies the integrity of the frame header and frame data. If the verification passes, the data frame is stored in the local buffer; if the verification fails, a retransmission request is sent to the server.
[0009] Furthermore, in step S2, the breakpoint resume mechanism specifically includes, S2.3 interruption processing: if the upgrade is interrupted due to network interruption or power supply abnormality, the electric energy meter will record the received frame number and regularly report the receiving progress to the server; S2.4 resume transmission: when the communication is restored, the server continues to transmit from the interrupted frame number to ensure the integrity of the firmware transmission.
[0010] Furthermore, in step S2, the fragmentation check is specifically a local check. The electric energy meter performs a local check after receiving a certain number of data frames. If the local data check passes, it is written into the non-volatile memory; if it fails, a retransmission is requested.
[0011] Furthermore, in step S3, data parsing and storage specifically include: S3.1 firmware reorganization: the electric energy meter reassembles all received data frames into a complete firmware file in sequence; S3.2 integrity check: use the check code (such as MD5 or SHA256) sent by the server to check the complete firmware file to ensure that the data is not damaged or tampered with.
[0012] Furthermore, in step S3, the preparation before updating specifically includes, S3.3 system status check: the electric energy meter checks whether the current system is in an updateable state, including battery power and grid operation status, to avoid upgrade interruption; S3.4 firmware backup: back up the currently running old firmware to a secure storage area for rollback when the upgrade fails.
[0013] Furthermore, in step S3, firmware writing and startup specifically include, S3.5 firmware writing: writing the new firmware into the main memory to ensure the atomicity of the operation process and avoid incomplete firmware writing due to interruption; S3.6 system restart to load the new firmware: after the firmware writing is completed, the electric energy meter automatically restarts and loads the new firmware to start running.
[0014] Furthermore, in step S4, the functional verification specifically includes: the electric energy meter performs a self-check after startup, including basic function tests (such as metering and communication) and version verification to ensure the normal operation of the device after the firmware is updated; the feedback information sent includes upgrade result feedback and exception handling, and the electric energy meter reports the upgrade result to the server through the NB-IOT network, including the new firmware version number, update status (successful or failed), and timestamp; if the update fails or the device is abnormal, the server can issue a rollback instruction, the electric energy meter loads the backup firmware to resume operation, and sends the failure log for analysis.
[0015] Furthermore, in step S5, in the identity authentication, a unique device identifier (such as IMEI) and encryption authentication are used to ensure that only legitimate devices can accept firmware updates; in the data encryption, all transmitted data are encrypted using a symmetric or asymmetric encryption algorithm to avoid data leakage or tampering; in the digital signature, the new firmware is accompanied by a digital signature, and the electric energy meter verifies the validity of the signature before updating to prevent malicious firmware from being loaded.
[0016] Furthermore, the present invention also discloses an electric energy meter, which has a built-in NB-IOT module and realizes data transmission with a server through NB-IOT communication technology; the electric energy meter is applied to the above-mentioned firmware remote upgrade method to realize remote upgrade of the electric energy meter.
[0017] The beneficial effects of the present invention are as follows: compared with the prior art, the firmware remote upgrade method and electric energy meter based on NB-IOT technology provided by the present invention have the following advantages: 1) Brand-new NB-IOT remote upgrade architecture: Using NB-IOT low-power wide-area communication technology, compared with traditional upgrade methods such as RS485 and wired networks, it reduces wiring and on-site maintenance costs and improves the convenience of remote management; combined with the cloud platform to achieve unified firmware management and batch upgrades, support phased deployment, and improve the management efficiency of smart grid equipment.
[0018] 2) Intelligent fragmentation transmission and breakpoint-resume transmission mechanism: Adopting dynamic data fragmentation transmission algorithm, the data packet size is adjusted according to the NB-IOT network quality, improving transmission efficiency and reducing failure rate; with breakpoint-resume transmission capability, if the network is interrupted or the device is disconnected during the upgrade process, it can continue the transmission from the interrupted position after the connection is restored, avoiding repeated downloads and improving the upgrade success rate.
[0019] 3) Dual firmware verification and security mechanism: Use MD5 / SHA256 verification algorithm to verify the integrity of the firmware during transmission and after storage to ensure that the data has not been tampered with; combine digital signature verification mechanism to ensure that the device only loads firmware from authorized servers to prevent malicious attacks or illegal tampering; support firmware backup and rollback mechanism, and quickly restore to the last stable version when the upgrade fails to avoid device unavailability.
[0020] 4) Low-power optimization design: The NB-IOT module's PSM (Power Saving Mode) and eDRX (Extended Discontinuous Reception) modes are used to ensure that the device operates at ultra-low power consumption in a non-communication state, thereby improving battery life. Combined with the low-power design of the smart energy meter, the impact of the remote upgrade process on the device's daily metering function is minimized.
[0021] 5) Batch upgrade management and strategy optimization: Through the remote management platform, different batches and models of electricity meters can be upgraded in groups to avoid excessive network load caused by large-scale simultaneous upgrades; support flexible upgrade strategies, such as scheduled upgrades, user-authorized upgrades, emergency patch upgrades, etc., to meet the needs of different application scenarios.
[0022] In summary, the present invention provides an efficient, reliable and secure remote firmware upgrade solution for smart electric energy meters based on NB-IOT communication technology. This solution ensures the stability and security of the upgrade process through mechanisms such as fragmented transmission, breakpoint resumption, data verification and secure encryption, while reducing maintenance costs and improving equipment management efficiency. It overcomes the limitations of traditional upgrade methods, significantly improves the intelligence level and remote operation and maintenance capabilities of smart electric energy meters, and can be widely used in the field of smart grid and Internet of Things equipment management, providing technical support for the upgrade and optimization of smart grid infrastructure. DETAILED DESCRIPTION
[0023] The present invention will be further described below through specific embodiments. However, these examples are only used to illustrate the present invention and not to limit the scope of the present invention.
[0024] Embodiment A method for remote upgrade of the firmware of an electricity meter based on NB-IoT technology, the upgrade method mainly includes the following steps: S1. Upgrade preparation stage: including server-side preparation and electricity meter-side preparation. The server-side preparation specifically includes: S1.1 Firmware compilation and encryption: Compile the new firmware version to generate an upgrade file, and encrypt the firmware file using an encryption algorithm to ensure the security of the transmission process; S1.2 Sharding processing: Cut the firmware file into several small data frames, and the size of each frame is determined by the NB-IoT communication bandwidth and memory limit of the electricity meter; S1.3 Upgrade policy distribution: Configure the upgrade policy, including the serial number of the target device, the upgrade time window, and the number of retry attempts, to ensure batch and time-division upgrades and avoid network congestion; The electricity meter-side preparation specifically includes: S1.4 NB-IoT module initialization: The built-in NB-IoT module of the electricity meter starts, establishes a connection with the base station, and completes the communication initialization with the remote server; S1.5 Firmware version verification: The electricity meter sends the current firmware version information to the server, and the server determines whether an upgrade is required based on the version number.
[0025] S2. Data transmission stage: including firmware data transmission, breakpoint resumption mechanism, and shard verification. The firmware data transmission specifically includes: S2.1 Data shard transmission: The server sends the firmware data frame by frame through the NB-IoT network, and each frame of data includes a frame header (including frame sequence number, total number of frames, and check code) and frame data (firmware fragment); S2.2 Device-side reception and verification: After receiving the data frame, the electricity meter verifies the integrity of the frame header and frame data. If the verification passes, the data frame is stored in the local buffer; if the verification fails, a retransmission request is sent to the server. The breakpoint resumption mechanism specifically includes: S2.3 Interruption handling: If the upgrade is interrupted due to network interruption or power supply abnormality, the electricity meter will record the received frame sequence number and regularly report the reception progress to the server; S2.4 Resumption of transmission: When the communication resumes, the server continues to transmit from the interrupted frame sequence number to ensure the integrity of the firmware transmission. The shard verification is specifically local verification. The electricity meter performs local verification after receiving a certain number of data frames. If the local data verification passes, it is written to the non-volatile memory; if it fails, a retransmission is requested.
[0026] S3, firmware update phase: including data analysis and storage, preparation before update, firmware writing and startup. The data analysis and storage specifically include, S3.1 Firmware reorganization: the electric energy meter reassembles all received data frames into a complete firmware file in sequence; S3.2 Integrity check: use the verification code (such as MD5 or SHA256) sent by the server to verify the complete firmware file to ensure that the data is not damaged or tampered with. The preparation before update specifically includes, S3.3 System status check: the electric energy meter checks whether the current system is in an updateable state, including battery power and grid operation status, to avoid upgrade interruption; S3.4 Firmware backup: back up the currently running old firmware to a secure storage area so that it can be rolled back when the upgrade fails. The firmware writing and startup specifically include, S3.5 Firmware writing: write the new firmware to the main memory to ensure the atomicity of the operation process and avoid incomplete firmware writing due to interruption; S3.6 System restart to load new firmware: after the firmware writing is completed, the electric energy meter automatically restarts and loads the new firmware to start running.
[0027] S4. Upgrade verification and feedback: including functional verification and feedback information sending. The functional verification specifically includes self-test after the electric energy meter is started, including basic function testing (such as metering, communication) and version verification to ensure the normal operation of the device after the firmware is updated. The feedback information sending includes feedback on the upgrade result and exception handling. The electric energy meter reports the upgrade result to the server through the NB-IOT network, including the new firmware version number, update status (successful or failed), and timestamp; if the update fails or the device is abnormal, the server can issue a rollback instruction, and the electric energy meter loads the backup firmware to resume operation and sends the failure log for analysis.
[0028] S5. Security measures: including identity authentication, data encryption and digital signature. In the identity authentication, the unique device identifier (such as IMEI) and encryption authentication are used to ensure that only legitimate devices can accept firmware updates; in the data encryption, all transmitted data are encrypted using symmetric or asymmetric encryption algorithms to avoid data leakage or tampering; in the digital signature, the new firmware is accompanied by a digital signature, and the electric energy meter verifies the validity of the signature before updating to prevent malicious firmware from being loaded.
[0029] The technical advantages of the upgrade method provided in this embodiment are as follows: 1) Efficiency: The fragmented transmission and breakpoint-resume transmission mechanisms are used to ensure the reliability of the firmware upgrade process, which is particularly suitable for complex communication environments.
[0030] 2) Reliability: Multiple verification and rollback mechanisms are used to ensure the security of the firmware upgrade process and ensure the continuous and stable operation of the electricity meter.
[0031] 3) Security: Multiple security mechanisms such as encryption, digital signature and identity authentication are used to effectively prevent firmware tampering or illegal access.
[0032] 4) Low power consumption: The NB-IOT module supports low power consumption operation, and the upgrade process will not have a significant impact on the normal operation of the device; 5) No need for manual intervention: Remote upgrades reduce manual intervention, lowering human resources and maintenance costs.
[0033] 6) Large-scale upgrade: NB-IOT's high connectivity enables large-scale simultaneous upgrades of devices, improving upgrade efficiency.
[0034] 7) Real-time feedback: Through NB-IOT communication, the upgrade results can be fed back in time to ensure the timeliness and accuracy of the upgrade process.
[0035] This embodiment also discloses an electric energy meter, which has a built-in NB-IOT module and realizes data transmission with a server through NB-IOT communication technology; the electric energy meter is applied to the above-mentioned firmware remote upgrade method to realize remote upgrade of the electric energy meter.
[0036] The above implementation modes are only used to illustrate the present invention, but not to limit the present invention. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the present invention. The patent protection scope of the present invention should be defined by the claims.
Claims
1. A firmware remote upgrade method based on NB-IOT technology, characterized in that: The upgrade method mainly includes the following steps: S1, Upgrade preparation phase: including server-side preparation and energy meter-side preparation; S2, data transmission stage: including firmware data transmission, breakpoint resume mechanism and fragmentation verification; S3, firmware update phase: including data analysis and storage, preparation before update, firmware writing and startup; S4, Upgrade verification and feedback: including function verification and feedback information sending; S5. Security measures: including identity authentication, data encryption and digital signature.
2. A firmware remote upgrade method based on NB-IOT technology as claimed in claim 1, characterized in that: In step S1, the server-side preparation specifically includes: S1.1 firmware compilation and encryption: compile the new firmware version to generate an upgrade file, and encrypt the firmware file using an encryption algorithm to ensure the security of the transmission process; S1.2 fragmentation processing: divide the firmware file into several small data frames, and the size of each frame is determined by the NB-IOT communication bandwidth and memory limit of the electric energy meter; S1.3 Upgrade strategy issuance: configure the upgrade strategy to ensure that the upgrade is carried out in batches and time periods to avoid network congestion; the preparation of the electric energy meter specifically includes, S1.4 NB-IOT module initialization: the built-in NB-IOT module of the electric energy meter is started, a connection is established with the base station, and the communication initialization with the remote server is completed; S1.5 Firmware version verification: the electric energy meter sends the current firmware version information to the server, and the server determines whether an upgrade is required based on the version number.
3. A firmware remote upgrade method based on NB-IOT technology as claimed in claim 1, characterized in that: In step S2, firmware data transmission specifically includes: S2.1 data segment transmission: the server sends firmware data frame by frame through the NB-IOT network, and each frame of data includes a frame header and frame data; S2.2 device-side reception and verification: after the electric energy meter receives the data frame, it verifies the integrity of the frame header and frame data. If the verification passes, the data frame is stored in the local buffer; If the verification fails, a retransmission request is sent to the server.
4. The method for remote firmware upgrade based on NB-IOT technology according to claim 1, characterized in that: In step S2, the breakpoint resume mechanism specifically includes, S2.3 interruption processing: if the upgrade is interrupted due to network interruption or power supply abnormality, the electric energy meter will record the received frame number and regularly report the receiving progress to the server; S2.4 resume recovery: when the communication is restored, the server continues to transmit from the interrupted frame number to ensure the integrity of the firmware transmission; the fragmentation check is specifically a local check, and the electric energy meter performs a local check after receiving a certain number of data frames. If the local data check passes, it is written to the non-volatile memory; if it fails, a retransmission is requested.
5. A firmware remote upgrade method based on NB-IOT technology as claimed in claim 1, characterized in that: In step S3, data parsing and storage specifically include: S3.1 firmware reorganization: the electric energy meter reassembles all received data frames into a complete firmware file in sequence; S3.2 integrity check: use the check code sent by the server to check the complete firmware file to ensure that the data is not damaged or tampered with.
6. A firmware remote upgrade method based on NB-IOT technology as claimed in claim 1, characterized in that: In step S3, the preparation before updating specifically includes: S3.3 system status check: the electric energy meter checks whether the current system is in an updateable state to avoid interruption of the upgrade; S3.4 Firmware backup: Back up the currently running old firmware to a secure storage area so that it can be rolled back in case of upgrade failure.
7. A firmware remote upgrade method based on NB-IOT technology as claimed in claim 1, characterized in that: In step S3, firmware writing and startup specifically include, S3.5 firmware writing: writing the new firmware into the main memory to ensure the atomicity of the operation process and avoid incomplete firmware writing due to interruption; S3.6 system restart to load the new firmware: after the firmware writing is completed, the electric energy meter automatically restarts and loads the new firmware to start running.
8. The method for remote firmware upgrade based on NB-IOT technology according to claim 1, characterized in that: In step S4, the functional verification specifically includes: the electric energy meter performs a self-check after startup, including basic function testing and version verification, to ensure the normal operation of the device after the firmware is updated; the feedback information sent includes upgrade result feedback and exception handling, and the electric energy meter reports the upgrade result to the server through the NB-IOT network; if the update fails or the device is abnormal, the server can issue a rollback instruction, the electric energy meter loads the backup firmware to resume operation, and sends the failure log for analysis.
9. A firmware remote upgrade method based on NB-IOT technology as claimed in claim 1, characterized in that: In step S5, in the identity authentication, device unique identification and encryption authentication are used to ensure that only legitimate devices can accept firmware updates; in the data encryption, all transmitted data are encrypted using symmetric or asymmetric encryption algorithms to avoid data leakage or tampering; in the digital signature, the new firmware is accompanied by a digital signature, and the electric energy meter verifies the validity of the signature before updating to prevent malicious firmware from being loaded.
10. An electric energy meter, characterized in that: The electric energy meter has a built-in NB-IOT module, and realizes data transmission with the server through NB-IOT communication technology; the electric energy meter is applied to the firmware remote upgrade method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Firmware upgrading method of electric energy meter
CN113949733A
Internet-of-things data transmission method based on NB-IoT technology
CN107682318A
Upgrading method of intelligent water and electricity meter
CN111694590A
Remote upgrading method of street lamp controller based on NB-IoT
CN114915671A
Cited By
Equipment upgrading method and system, computer equipment and computer program product
CN120492003A
Electronic gas meter remote upgrading system and method
CN120935150A
Electronic gas meter remote upgrading system and method
CN120935150B
OTA upgrading method, system and equipment integrating terminal and electric energy meter and medium
CN121013073A
Outdoor 5G communication power supply cabinet remote upgrade management software system supporting version self-healing
CN121116354A