CN112068865A - Efficient intelligent gas meter differential firmware upgrading method - Google Patents
Efficient intelligent gas meter differential firmware upgrading method Download PDFInfo
- Publication number
- CN112068865A CN112068865A CN202010911296.8A CN202010911296A CN112068865A CN 112068865 A CN112068865 A CN 112068865A CN 202010911296 A CN202010911296 A CN 202010911296A CN 112068865 A CN112068865 A CN 112068865A
- Authority
- CN
- China
- Prior art keywords
- differential
- gas meter
- file
- intelligent gas
- upgrading
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000002372 labelling Methods 0.000 claims abstract description 4
- 230000005540 biological transmission Effects 0.000 abstract description 6
- 230000006837 decompression Effects 0.000 abstract description 6
- 238000005516 engineering process Methods 0.000 abstract description 4
- 230000010354 integration Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16Y—INFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
- G16Y10/00—Economic sectors
- G16Y10/35—Utilities, e.g. electricity, gas or water
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16Y—INFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
- G16Y40/00—IoT characterised by the purpose of the information processing
- G16Y40/40—Maintenance of things
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
Landscapes
- Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Accounting & Taxation (AREA)
- Computer Security & Cryptography (AREA)
- Business, Economics & Management (AREA)
- Computer Networks & Wireless Communication (AREA)
- Development Economics (AREA)
- Economics (AREA)
- General Business, Economics & Management (AREA)
- Signal Processing (AREA)
- Medical Informatics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a method for upgrading differential firmware of an efficient intelligent gas meter, which comprises the following steps: s1: generating a differential packet by using an MLD (Multi-level labeling) bit differential method; s2: receiving the differential packet by an intelligent gas meter to be upgraded, wherein an old file is stored in the intelligent gas meter to be upgraded; and S3, reading the differential packet and upgrading the firmware of the intelligent gas meter to be upgraded. The efficient intelligent gas meter differential firmware upgrading method can realize smaller differential packets, low-flow network transmission, no decompression, low memory consumption, low disk occupancy and low code technology integration complexity of an embedded system of gas meter equipment.
Description
Technical Field
The invention relates to the field of gas meter firmware upgrading methods, in particular to a high-efficiency intelligent gas meter differential firmware upgrading method.
Background
With the rapid development of computer and internet of things communication technologies, more and more household intelligent gas meters replace household mechanical gas meters at present, and great convenience is brought to gas companies for meter management, so that the functions of the household intelligent gas meters are not only acquisition and display of metering data, but also monitoring of abnormal state information of the meters, management of gas consumption information, and sending of data and receiving and processing of control commands, so that the system is a complete computer software and hardware system, changes in any link can involve change of firmware programs inside the meters, and the changes are very likely to occur in the service life cycle of the meters of 10 years. Therefore, the online upgrading function of the internet of things intelligent gas meter is very necessary, and the upgrading mode of the firmware of the currently common internet of things intelligent gas meter mainly comprises the following steps: whole package upgrade (full), differential upgrade (differential), and these methods have the following problems:
1. in the OTA remote firmware whole package upgrading, the volume of a new version of file is large, so that the transmission time is long, the consumption flow is large, and the power consumption is large.
2. The mainstream differential upgrading depends on compression and decompression algorithms which need more memory and storage space, and the hardware resources of the current intelligent gas meter cannot meet the condition and are difficult to apply.
The traditional BSDIFF differential packet generation mode comprises the following steps:
the suffix array ordering is carried out on the old files to form a dictionary table, then the maximum matching byte length with difference is generated compared with the new and old files, the same byte is replaced by 0, different bytes are represented by the difference value of the two ASCII codes, and redundant data areas are recorded at the same time.
The data area contains a large number of 0, which can be compressed efficiently to form a compressed differential packet with small volume, thereby facilitating transmission, and the device end performs decompression and restoration after receiving the differential packet. But decompression algorithms require more memory and disk storage space.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides the efficient intelligent gas meter differential firmware upgrading method which can realize smaller differential packets, low-flow network transmission, no decompression, low memory consumption of an embedded system of gas meter equipment, low disk occupancy and low code technology integration complexity, and can realize quick problem repair and system updating upgrading under narrow-bandwidth low-rate networks such as NB (NB) and the like, thereby reducing manual intervention, participation of technical personnel, and quickly realizing problem repair and product iterative upgrading.
In order to achieve the purpose, the invention provides a method for upgrading differential firmware of an efficient intelligent gas meter, which comprises the following steps:
s1: generating a differential packet by using an MLD (Multi-level labeling) bit differential method;
s2: receiving the differential packet by an intelligent gas meter to be upgraded, wherein an old file is stored in the intelligent gas meter to be upgraded;
and S3, reading the differential packet and upgrading the firmware of the intelligent gas meter to be upgraded.
Preferably, the step of S1 further comprises the steps of:
s11: comparing a corresponding field in the new file and the old file to obtain the maximum matching byte length with difference of the field and the offset of the next field in the old file;
s12: acquiring matching byte areas of the fields in the new file and the old file according to the matching byte length, and taking the parts of the fields except the matching byte areas as extra byte data;
s13: counting the total number of different byte data in the matching byte areas of the new file and the old file;
s14: recording the positions and values of different byte data in the matching byte areas of the new file and the old file to form a differential data block;
s15: forming a control message, wherein the control message comprises the maximum matching byte length, the total number of the different byte data, the byte length of the extra byte data and the offset of the next field in the old file;
s16: and sequentially writing the control information, the differential data block and the extra byte data to form the differential packet.
Preferably, the S3 further comprises the steps of:
s31: the intelligent gas meter to be upgraded analyzes the read differential packet to obtain the control information, the differential data block and the extra byte data;
s32: establishing an upgrade file;
s33: reading bytes from the old file and writing the upgrade file until the maximum matching byte length, wherein when writing to the location of the different byte data, the value of the different byte data is written to the upgrade file;
s34: writing the extra byte data to the upgrade file;
s35: and replacing the old file of the intelligent gas meter to be upgraded with the upgrading file to finish firmware upgrading.
Due to the adoption of the technical scheme, the invention has the following beneficial effects:
aiming at a household Internet of things remote transmission NB intelligent gas meter, the small differential packet and low-flow network transmission are realized, decompression is not needed, the embedded system of the gas meter equipment has low memory consumption, low disk occupancy and low code technology integration complexity, and quick problem repair and system updating and upgrading are realized under narrow-bandwidth low-rate networks such as NB and the like, so that manual intervention is reduced, technical personnel participate, and problem repair and product iterative upgrading are realized quickly.
Drawings
Fig. 1 is a flowchart of a method for upgrading a differential firmware of an efficient intelligent gas meter according to an embodiment of the present invention.
Detailed Description
The following description of the preferred embodiment of the present invention, in accordance with the accompanying drawings of which 1 is presented to enable a better understanding of the invention as to its functions and features.
Referring to fig. 1, a method for upgrading a differential firmware of an efficient intelligent gas meter according to an embodiment of the present invention includes:
s1: generating a differential packet by using an MLD (Multi-level labeling) bit differential method;
s2: receiving the differential packet by the intelligent gas meter to be upgraded, wherein an old file is stored in the intelligent gas meter to be upgraded;
and S3, reading the differential packet by the intelligent gas meter to be upgraded and upgrading the firmware.
Wherein the step of S1 further comprises the steps of:
s11: comparing a corresponding field in the new file and the old file to obtain the maximum matching byte length of the field with difference (namely not complete matching) and the offset of the next field in the old file;
s12: acquiring matching byte areas of fields in the new file and the old file according to the length of the matching bytes, and taking the parts of the fields except the matching byte areas as extra byte data;
s13: counting the total number of different byte data in the matching byte areas of the new file and the old file;
s14: recording the positions and values of different byte data in the matching byte areas of the new file and the old file to form a differential data block;
s15: forming control information, wherein the control information comprises the maximum matching byte length, the total number of different byte data, the byte length of extra byte data and the offset of the next field in the old file;
s16: and sequentially writing the control information, the differential data block and the extra byte data to form a differential packet.
In this embodiment, S3 further includes the steps of:
s31: the intelligent gas meter to be upgraded analyzes and reads the differential packet to obtain control information, a differential data block and extra byte data;
s32: establishing an upgrade file;
s33: reading bytes from the old file and writing the upgrade file until the maximum matching byte length, wherein when writing to the positions of different byte data, writing the numerical values of the different byte data into the upgrade file;
s34: writing the extra byte data into the upgrade file;
s35: and replacing the old file of the intelligent gas meter to be upgraded with the upgrading file to finish firmware upgrading.
For example: the fields in the old file are: abcdsfaaa;
the corresponding fields in the new file are: abedsfaods;
after the new file and the old file are compared, the maximum matching byte length is set to be 7, and the initial position 0 of the next field in the old file is obtained; "abcdsfa" and "abedsfa" of length 7 are located in the matching byte area, where there is a different data "e"; for a matching byte area with the position of 0-6, the position of the distinguishing byte is 2; forming a differential data block (2, e); finding that the ' sdfaods ' in the new file cannot be found in the old file through comparison, wherein 7 sdfaods ' are found in the new file, and extra byte data ' sdfaods ' are formed; control information (7,1,7,0) is formed, where the first 7 is the maximum matching byte length, the second 1 is the total number of different bytes of data, the third 7 is the byte length of the extra bytes of data, and the fourth is the offset location of the next read from the old file. Then, a difference file is formed: (control information) (differential data block) (extra byte data) ═ 7,1,7,0) (2, e) (sdfaods).
When upgrading the firmware restoration: analyzing the differential packet information, analyzing the differential packet information (7,1,7,0) (2, e) (sdfaods)
Reading two bytes of 0, 1 from the old file, finding that the differential data block has data e at the position of 2, not reading from the old file, directly writing into the upgrade file by using e, then continuously reading 3, 4, 5, 6 bytes from the old file, writing into the upgrade file, and continuously reading extra byte data 'sdfaods' and writing into the upgrade file.
Comparing the firmware upgrading effect of the conventional BSDIFF difference method and the MLD mark difference method of this embodiment:
BSDIFF difference method: RAM resources are required to be more than 5KB, and Flash resources are required to be about 300 KB; the difference rate is 9%; the code quantity of the equipment end is more than 200 lines;
MLD mark difference method: RAM resources < 512B are required; about 200KB of Flash resources are needed; the difference rate is 16%; the device side code quantity is < 50 lines.
While the present invention has been described in detail and with reference to the embodiments thereof as illustrated in the accompanying drawings, it will be apparent to one skilled in the art that various changes and modifications can be made therein. Therefore, certain details of the embodiments are not to be interpreted as limiting, and the scope of the invention is to be determined by the appended claims.
Claims (3)
1. A method for upgrading differential firmware of an efficient intelligent gas meter comprises the following steps:
s1: generating a differential packet by using an MLD (Multi-level labeling) bit differential method;
s2: receiving the differential packet by an intelligent gas meter to be upgraded, wherein an old file is stored in the intelligent gas meter to be upgraded;
and S3, reading the differential packet and upgrading the firmware of the intelligent gas meter to be upgraded.
2. The method for upgrading the differential firmware of the efficient intelligent gas meter according to claim 1, wherein the step S1 further comprises the steps of:
s11: comparing a corresponding field in the new file and the old file to obtain the maximum matching byte length with difference of the field and the offset of the next field in the old file;
s12: acquiring matching byte areas of the fields in the new file and the old file according to the matching byte length, and taking the parts of the fields except the matching byte areas as extra byte data;
s13: counting the total number of different byte data in the matching byte areas of the new file and the old file;
s14: recording the positions and values of different byte data in the matching byte areas of the new file and the old file to form a differential data block;
s15: forming a control message, wherein the control message comprises the maximum matching byte length, the total number of the different byte data, the byte length of the extra byte data and the offset of the next field in the old file;
s16: and sequentially writing the control information, the differential data block and the extra byte data to form the differential packet.
3. The method for upgrading the differential firmware of the efficient intelligent gas meter according to claim 2, wherein the step S3 further comprises the steps of:
s31: the intelligent gas meter to be upgraded analyzes the read differential packet to obtain the control information, the differential data block and the extra byte data;
s32: establishing an upgrade file;
s33: reading bytes from the old file and writing the upgrade file until the maximum matching byte length, wherein when writing to the location of the different byte data, the value of the different byte data is written to the upgrade file;
s34: writing the extra byte data to the upgrade file;
s35: and replacing the old file of the intelligent gas meter to be upgraded with the upgrading file to finish firmware upgrading.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010911296.8A CN112068865A (en) | 2020-09-02 | 2020-09-02 | Efficient intelligent gas meter differential firmware upgrading method |
PCT/CN2021/115268 WO2022048511A1 (en) | 2020-09-02 | 2021-08-30 | Differential upgrade method for intelligent gas meter firmware |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010911296.8A CN112068865A (en) | 2020-09-02 | 2020-09-02 | Efficient intelligent gas meter differential firmware upgrading method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112068865A true CN112068865A (en) | 2020-12-11 |
Family
ID=73665340
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010911296.8A Pending CN112068865A (en) | 2020-09-02 | 2020-09-02 | Efficient intelligent gas meter differential firmware upgrading method |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112068865A (en) |
WO (1) | WO2022048511A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022048511A1 (en) * | 2020-09-02 | 2022-03-10 | 上海飞奥燃气设备有限公司 | Differential upgrade method for intelligent gas meter firmware |
CN114500508A (en) * | 2022-01-25 | 2022-05-13 | 深圳友讯达科技股份有限公司 | Gas meter upgrading method and device and electronic equipment |
CN116521210A (en) * | 2023-04-18 | 2023-08-01 | 宁夏隆基宁光仪表股份有限公司 | Method for upgrading firmware difference of Internet of things water meter |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114518897A (en) * | 2022-04-20 | 2022-05-20 | 北京智芯微电子科技有限公司 | Remote upgrading method and system for communication module |
CN114924761B (en) * | 2022-04-20 | 2023-06-06 | 苏州吾爱易达物联网有限公司 | Method and system for upgrading equipment of Internet of things |
CN116700739A (en) * | 2022-09-21 | 2023-09-05 | 荣耀终端有限公司 | Differential upgrading method and device, electronic equipment and readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070287396A1 (en) * | 2006-06-08 | 2007-12-13 | National Tsing Hua University | Upgrading device and method using bootloader in wireless sensor networks |
CN104932909A (en) * | 2014-03-17 | 2015-09-23 | 中兴通讯股份有限公司 | Terminal software upgrading method and device |
CN106648765A (en) * | 2016-12-07 | 2017-05-10 | 京信通信系统(中国)有限公司 | Embedded device firmware service pack generating and firmware differential upgrading methods and device |
CN108279922A (en) * | 2018-01-03 | 2018-07-13 | 深圳市泰比特科技有限公司 | Differential file generation method, upgrade method and system based on the differential file |
CN109542497A (en) * | 2018-11-26 | 2019-03-29 | 上海艾拉比智能科技有限公司 | A kind of difference algorithm of small memory device system upgrade |
CN110162330A (en) * | 2019-07-08 | 2019-08-23 | 上海赫千电子科技有限公司 | A kind of system and method applied to automobile ECU upgrade file |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112068865A (en) * | 2020-09-02 | 2020-12-11 | 上海飞奥燃气设备有限公司 | Efficient intelligent gas meter differential firmware upgrading method |
-
2020
- 2020-09-02 CN CN202010911296.8A patent/CN112068865A/en active Pending
-
2021
- 2021-08-30 WO PCT/CN2021/115268 patent/WO2022048511A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070287396A1 (en) * | 2006-06-08 | 2007-12-13 | National Tsing Hua University | Upgrading device and method using bootloader in wireless sensor networks |
CN104932909A (en) * | 2014-03-17 | 2015-09-23 | 中兴通讯股份有限公司 | Terminal software upgrading method and device |
CN106648765A (en) * | 2016-12-07 | 2017-05-10 | 京信通信系统(中国)有限公司 | Embedded device firmware service pack generating and firmware differential upgrading methods and device |
CN108279922A (en) * | 2018-01-03 | 2018-07-13 | 深圳市泰比特科技有限公司 | Differential file generation method, upgrade method and system based on the differential file |
CN109542497A (en) * | 2018-11-26 | 2019-03-29 | 上海艾拉比智能科技有限公司 | A kind of difference algorithm of small memory device system upgrade |
CN110162330A (en) * | 2019-07-08 | 2019-08-23 | 上海赫千电子科技有限公司 | A kind of system and method applied to automobile ECU upgrade file |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022048511A1 (en) * | 2020-09-02 | 2022-03-10 | 上海飞奥燃气设备有限公司 | Differential upgrade method for intelligent gas meter firmware |
CN114500508A (en) * | 2022-01-25 | 2022-05-13 | 深圳友讯达科技股份有限公司 | Gas meter upgrading method and device and electronic equipment |
CN116521210A (en) * | 2023-04-18 | 2023-08-01 | 宁夏隆基宁光仪表股份有限公司 | Method for upgrading firmware difference of Internet of things water meter |
CN116521210B (en) * | 2023-04-18 | 2024-05-03 | 宁夏隆基宁光仪表股份有限公司 | Method for upgrading firmware difference of Internet of things water meter |
Also Published As
Publication number | Publication date |
---|---|
WO2022048511A1 (en) | 2022-03-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112068865A (en) | Efficient intelligent gas meter differential firmware upgrading method | |
CN102098131B (en) | Dynamic parameter configuration-based general framing and de-framing method for serial port data frames | |
CN101651683B (en) | Method for generating analysis source code of signaling message | |
CN103379140B (en) | A kind of log processing rule synchronization method and relevant device and system | |
CN108446842B (en) | Power management and distribution wind control management method and system | |
CN114793250B (en) | Configurable CAN data analysis method | |
CN104317601A (en) | Method and system for developing file interfaces | |
CN114449018A (en) | Automatic log file uploading method and system for power acquisition terminal | |
CN107659629A (en) | A kind of efficient electrical power archives synchronous method suitable for power information acquisition system | |
CN115484131A (en) | Internet of things gateway and equipment data storage system for same | |
CN117373225A (en) | Energy data acquisition method | |
CN103684812B (en) | Method and apparatus for managing remote equipment | |
CN113722340A (en) | Processing method and system for remote automatic point table updating based on power distribution device | |
CN104701982B (en) | A kind of method for carrying out automatic upgrading to distribution line monitoring terminal | |
CN108920377A (en) | A kind of log playback test method, system, device and readable storage medium storing program for executing | |
CN115834717B (en) | Communication protocol rapid development method for Internet of things equipment | |
CN114827287B (en) | Data compression method and system | |
CN102156743A (en) | Method for memorizing telecom mass telephone bill data | |
CN115408390A (en) | Data processing method and device and electronic equipment | |
CN105207807A (en) | SIM card flow analysis method applied to power consumption information acquisition system | |
CN114422608A (en) | Data transmission method, device and equipment | |
CN112688692A (en) | Meter reading data compression method, data format, device and storage medium | |
CN111158778A (en) | Intelligent label optimization method based on panoramic model file | |
CN102347772B (en) | Compression processing method and equipment for base station files | |
CN110515955A (en) | Storage, querying method, system, electronic equipment and the storage medium of data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |