CN111694590A - Upgrading method of intelligent water meter - Google Patents

Upgrading method of intelligent water meter Download PDF

Info

Publication number
CN111694590A
CN111694590A CN202010544581.0A CN202010544581A CN111694590A CN 111694590 A CN111694590 A CN 111694590A CN 202010544581 A CN202010544581 A CN 202010544581A CN 111694590 A CN111694590 A CN 111694590A
Authority
CN
China
Prior art keywords
upgrading
program
server
water meter
water
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
Application number
CN202010544581.0A
Other languages
Chinese (zh)
Inventor
李翔威
常峰
陈飞舟
吴静华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Quanzhou Huiji Technology Co ltd
Original Assignee
Quanzhou Huiji Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Quanzhou Huiji Technology Co ltd filed Critical Quanzhou Huiji Technology Co ltd
Priority to CN202010544581.0A priority Critical patent/CN111694590A/en
Publication of CN111694590A publication Critical patent/CN111694590A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link

Abstract

The invention provides an upgrading method of an intelligent water electric meter, which collects customer requirements, develops upgrading programs of different reading modes and feedback modes of different use scenes and stores the upgrading programs in a server; the water meter is connected to the server and carries out identity authentication; the water meter reports the information of the water meter and receives the upgrade status repackage of the water meter; if the upgrade state repackage is the state needing upgrading, a corresponding upgrade program is requested from the server; if not, ending; and downloading the upgrading program, covering the downloaded upgrading program with the previous firmware, restarting the single chip microcomputer to finish upgrading, upgrading the firmware of the single chip microcomputer, changing the reading mode, and feeding back according to the requirements of the use scene.

Description

Upgrading method of intelligent water meter
Technical Field
The invention relates to an upgrading method of an intelligent water meter.
Background
The intelligent water and electricity meters on the market at present have the condition of single application function, can only report at fixed time points and fixed frequency, and cannot be properly adjusted according to different requirements of use scenes; the firmware upgrading mode is that only one fixed upgrading package is provided, and if upgrading is performed, all upgrading versions of the water meters are consistent and cannot be adjusted, so that the upgrading method cannot be suitable for various requirements under different use scenes.
Moreover, the existing firmware upgrading package is large, and the time required by upgrading is long; and the upgrade package is easy to be tampered and is easy to be utilized by lawbreakers.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an upgrading method of an intelligent water meter, which can upgrade the firmware of the intelligent water meter, change the reading mode and make feedback according to the requirements of a use scene.
The invention is realized by the following steps: an upgrading method of a smart water meter comprises the following steps:
step 1, collecting customer requirements, developing upgrading programs of different reading modes and feedback modes of different use scenes, and storing the upgrading programs to a server;
step 2, connecting the water meter to a server, and performing identity authentication;
step 3, reporting self information by the water and electricity meter, and receiving a self upgrading state repackage;
if the upgrade state repackage is the state needing upgrading, a corresponding upgrade program is requested from the server; if not, ending;
and 4, downloading the upgrading program, covering the downloaded upgrading program with the front firmware, and restarting the single chip microcomputer to finish upgrading.
Further, a step a is included between the step 1 and the step 2, the terminal is connected to the water electric meter, and the terminal stores an upgrading program required by the water electric meter.
Further, the step 2 is further specifically: the water ammeter is connected to the server and carries out identity authentication, and after the authentication is passed, the water ammeter and the server respectively generate a same secret key.
Further, the key generation method is as follows: the water and electricity meter generates a first random number and sends the first random number to the server; the server generates a second random number; the server generates a key according to the first random number and the second random number; and the server sends the second random number to the water electric meter, and the water electric meter generates a secret key according to the first random number and the second random number.
Further, the step 4 is further specifically: the server encrypts the upgrading program according to the generated secret key, then the water meter downloads the encrypted upgrading program, after the downloading is completed, the secret key is used for decryption, the downloaded upgrading program covers the front firmware, the single chip microcomputer is restarted, and the upgrading is completed.
Further, the step 4 is further specifically: downloading an upgrading program, and performing CRC and CHECKSUM verification on the upgrading program, wherein if the verification fails, the upgrading fails; and if the verification is passed, the downloaded upgrading program is used for covering the previous firmware, and the singlechip is restarted to finish upgrading.
Further, the step 4 is further specifically: downloading the upgrading program in a fragmentation mode, and performing CRC and CHECKSUM verification on the upgrading program of each fragment; after all the upgrading programs are downloaded, performing CRC and CHECKSUM verification on the whole upgrading program; if the verification fails, the upgrading fails; and if the verification is passed, the downloaded upgrading program is used for covering the previous firmware, and the singlechip is restarted to finish upgrading.
Further, the method also comprises a step 5 of reporting the upgrading success state to the server by the water meter.
Further, the firmware in the water electric meter comprises an upgradable program and a non-upgradable program; when compiling, the code segment and the data segment address of the non-upgradable program and the upgradable program are configured; the non-upgradable program comprises a flashing program and a constant; the upgradeable program includes business logic and firmware file configuration information.
The invention has the following advantages: according to the upgrading method, the water-electricity meter is provided with the multifunctional application data acquisition device based on wireless upgrading, the firmware of the water-electricity meter can be upgraded, the reading mode is changed, and feedback is made according to the requirements of a use scene; and the safety of the upgrading program and the quick downloading of the upgrading program are ensured.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
One specific embodiment of the present invention:
the intelligent water meter can upgrade the firmware of the intelligent water meter, change the reading mode and make feedback according to the requirements of the use scene.
For example: 1. and changing reading modes such as time points, frequency and the like for reading the data of the water electric meter. And reporting the data once a month in a cell use scene. In a factory use scene, the use data is reported every day, and the reporting time is determined after the factory stops every day or at a specific time point.
2. In the areas with anti-terrorism requirements, once data records appear in rooms without water and electricity meter data records for a long time, the water and electricity meter immediately reports the data and gives an alarm.
3. Under the use scene of a factory, the daily water consumption is evaluated, once the daily water consumption greatly exceeds the average level, the water and electricity meter immediately reports data and gives an alarm.
The above examples of changing the reading mode and making feedback according to the usage scenario are only partial cases, and various adjustments and changes can be made according to the needs of the customers in practical use. Through the adjustment and the change, the use requirements of different customers are met, and the privately customized intelligent water and electricity meter product is realized. And in the upgrading process of the product, 1, only the content needing to be upgraded is upgraded. 2. Making a check prevents the program from being tampered. 3. And (5) upgrading the slices.
The method comprises the following specific steps:
the method comprises the following steps of firstly, upgrading the firmware according to different use scenes:
1. and collecting the customer requirements, and developing upgrading programs of different reading modes and feedback modes of different use scenes.
2. And uploading the upgrading program to a server for upgrading and managing the background of the intelligent water meter by using the APP through the mobile phone.
3. And the intelligent water meter maintainer is connected with the intelligent water meter needing to be upgraded through the APP at the mobile phone end.
4. Upgrading of the water ammeter is realized through the background management APP of the intelligent water ammeter at the mobile phone end, and the change of the reading mode and the feedback modes of different scenes is completed.
II, firmware upgrading process:
1. and starting a module (the module refers to a wireless transmission module of the whole water meter, namely a circuit board and is responsible for wireless transmission and upgrading of water meter data), so that the NB-IOT and the server establish TCP/IP connection.
2. The module and the server perform identity authentication to generate a secret key; the method for generating the key comprises the following steps:
21. the client generates a random number, does not encrypt and sends the random number to the server.
22. The server generates a random number.
23. The server stores the server random number and the client random number, and then generates a client key.
24. The server sends the server random number to the client, and the client generates a key according to the two random numbers.
25. The above process is not encrypted, but the verification information is added to prevent tampering, if the random number is modified, the verification fails, and the authentication fails.
3. The module reports self information, the self information comprises a firmware version number, a software version number, a current signal value, a current battery voltage state and the like, the self upgrading state repackage is received, after the equipment reports data (with the information of the version and the like), whether the equipment needs upgrading is immediately detected, a prompt for upgrading the APP at the mobile phone end is sent, and the upgrading is started after the prompt is confirmed.
4. The module requests the upgrade data from the server according to the upgrade status, which is divided into the upgrade-required status and the upgrade-unnecessary status of the upgradable part. .
5. The module is downloaded in a split mode, CRC and CHEKSUM verification can be conducted after each downloading, and the CRC and CHEKSUM verification is stored in the EPPROM chip.
6. And after the verification is passed, continuously requesting the residual data until the data request is finished.
6.1, reporting the upgrading failure state if the verification fails
7. And after the downloading is finished, performing CRC and CHECKSUM check on the whole block data.
8. And covering the downloaded complete firmware with the previous firmware, and restarting the singlechip.
9. And after restarting, reporting the upgrading success state.
10. The firmware file is analyzed to obtain the required information, and various application scenes can be flexibly changed.
Thirdly, a technical implementation approach for solving three problems in upgrading:
1. only the content needing to be upgraded is upgraded: the firmware is divided into an upgradable part and a non-upgradable part, the firmware is flexibly configured, a compiling connection technology is adopted, the firmware and the non-upgradable part are independent, and the firmware and the compiling connection technology are respectively linked to the specified address after the firmware is compiled. The non-upgradeable portion flushes non-modifiable content such as machine programs, constants, and the like. The upgradeable part comprises normal service logic and firmware file configuration information, and the firmware file configuration information can be used for firmware file analysis. The firmware file configuration information includes a firmware version number, firmware division data (start address, size, upgradeable), and the like. The non-upgradable part is used as the related logic of firmware upgrading, so that the self-erasing action is avoided in the upgrading process. The code of the part which is not upgraded can not be changed, and only the verification is carried out in the upgrading process.
The upgradable part and the non-upgradable part configure the addresses of the code segments and the data segments of the non-upgradable part and the upgradable part through configuration during compiling, so that the positions are ensured to be fixed and not to be influenced mutually. The code between the upgradable part and the non-upgradable part is independent, the upgradable part can call the C language standard library and call the non-upgradable part, the non-upgradable part is a separate library which is the same as the C language standard library, the upgradable part is not called, the C language standard library is not introduced, and mutual independence is ensured through the structural design of the program.
2. Preventing the file from being tampered: when the updating is requested, CRC and CHECKSUM verification of the part, which cannot be updated, of the current firmware are calculated, then data are requested to the server, the server also performs one-time verification on the firmware to be updated, the updating is started after the verification is passed, and otherwise, the updating fails.
3. And (4) updating the fragments, dividing the firmware upgrading file into fragments, and downloading each fragment after checking to support breakpoint transmission.
Another embodiment of the invention:
as shown in fig. 1, the method for upgrading the intelligent water meter of the present invention includes:
step 1, collecting customer requirements, developing upgrading programs of different reading modes and feedback modes of different use scenes, and storing the upgrading programs to a server;
a, connecting a terminal to a water ammeter, wherein the terminal stores an upgrading program required by the water ammeter, and a firmware in the water ammeter comprises an upgradable program and an unegradable program; when compiling, the code segment and the data segment address of the non-upgradable program and the upgradable program are configured; the non-upgradable program comprises a flashing program and a constant; the upgradeable program comprises business logic and firmware file configuration information;
step 2, connecting the water meter to the server, performing identity authentication, and after the authentication is passed, respectively generating a same secret key by the water meter and the server, wherein the secret key generation method comprises the following steps: the water and electricity meter generates a first random number and sends the first random number to the server; the server generates a second random number; the server generates a key according to the first random number and the second random number; the server sends the second random number to the water electric meter, and the water electric meter generates a secret key according to the first random number and the second random number;
step 3, reporting self information by the water and electricity meter, and receiving a self upgrading state repackage;
if the upgrade state repackage is the state needing upgrading, a corresponding upgrade program is requested from the server; if not, ending;
step 4, the server encrypts the upgrading program according to the generated secret key, then the water ammeter downloads the encrypted upgrading program, after the downloading is completed, the secret key is adopted for decryption, the upgrading program is downloaded in a slicing mode, and CRC and CHECKSUM verification is conducted on the upgrading program of each slice; after all the upgrading programs are downloaded, performing CRC and CHECKSUM verification on the whole upgrading program; if the verification fails, the upgrading fails; if the verification is passed, the downloaded upgrading program is covered with the previous firmware, and the single chip microcomputer is restarted to finish upgrading;
and 5, reporting the upgrading success state to the server by the water and electricity meter.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (9)

1. An upgrading method of an intelligent water meter is characterized by comprising the following steps: the method comprises the following steps:
step 1, collecting customer requirements, developing upgrading programs of different reading modes and feedback modes of different use scenes, and storing the upgrading programs to a server;
step 2, connecting the water meter to a server, and performing identity authentication;
step 3, reporting self information by the water and electricity meter, and receiving a self upgrading state repackage;
if the upgrade state repackage is the state needing upgrading, a corresponding upgrade program is requested from the server; if not, ending;
and 4, downloading the upgrading program, covering the downloaded upgrading program with the front firmware, and restarting the single chip microcomputer to finish upgrading.
2. The upgrading method of the intelligent water meter according to claim 1, characterized in that: and a step a is also included between the step 1 and the step 2, the terminal is connected to the water electric meter, and the terminal stores an upgrading program required by the water electric meter.
3. The upgrading method of the intelligent water meter according to claim 1, characterized in that: the step 2 is further specifically as follows: the water ammeter is connected to the server and carries out identity authentication, and after the authentication is passed, the water ammeter and the server respectively generate a same secret key.
4. The upgrading method of the intelligent water meter according to claim 3, characterized in that: the key generation method comprises the following steps: the water and electricity meter generates a first random number and sends the first random number to the server; the server generates a second random number; the server generates a key according to the first random number and the second random number; and the server sends the second random number to the water electric meter, and the water electric meter generates a secret key according to the first random number and the second random number.
5. The upgrading method of the intelligent water meter according to claim 3, characterized in that: the step 4 is further specifically as follows: the server encrypts the upgrading program according to the generated secret key, then the water meter downloads the encrypted upgrading program, after the downloading is completed, the secret key is used for decryption, the downloaded upgrading program covers the front firmware, the single chip microcomputer is restarted, and the upgrading is completed.
6. The upgrading method of the intelligent water meter according to claim 1, characterized in that: the step 4 is further specifically as follows: downloading an upgrading program, and performing CRC and CHECKSUM verification on the upgrading program, wherein if the verification fails, the upgrading fails; and if the verification is passed, the downloaded upgrading program is used for covering the previous firmware, and the singlechip is restarted to finish upgrading.
7. The upgrading method of the intelligent water meter according to claim 6, characterized in that: the step 4 is further specifically as follows: downloading the upgrading program in a fragmentation mode, and performing CRC and CHECKSUM verification on the upgrading program of each fragment; after all the upgrading programs are downloaded, performing CRC and CHECKSUM verification on the whole upgrading program; if the verification fails, the upgrading fails; and if the verification is passed, the downloaded upgrading program is used for covering the previous firmware, and the singlechip is restarted to finish upgrading.
8. The upgrading method of the intelligent water meter according to claim 1, characterized in that: and step 5, the water meter reports the upgrading success state to the server.
9. The upgrading method of the intelligent water meter according to claim 1, characterized in that: the firmware in the water electric meter comprises an upgradable program and a non-upgradable program; when compiling, the code segment and the data segment address of the non-upgradable program and the upgradable program are configured; the non-upgradable program comprises a flashing program and a constant; the upgradeable program includes business logic and firmware file configuration information.
CN202010544581.0A 2020-06-15 2020-06-15 Upgrading method of intelligent water meter Pending CN111694590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010544581.0A CN111694590A (en) 2020-06-15 2020-06-15 Upgrading method of intelligent water meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010544581.0A CN111694590A (en) 2020-06-15 2020-06-15 Upgrading method of intelligent water meter

Publications (1)

Publication Number Publication Date
CN111694590A true CN111694590A (en) 2020-09-22

Family

ID=72481243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010544581.0A Pending CN111694590A (en) 2020-06-15 2020-06-15 Upgrading method of intelligent water meter

Country Status (1)

Country Link
CN (1) CN111694590A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312078A (en) * 2021-05-07 2021-08-27 南方电网数字电网研究院有限公司 Electric energy meter software modularization difference upgrading method and electric energy meter system
WO2022142153A1 (en) * 2020-12-31 2022-07-07 威胜集团有限公司 Electricity meter upgrading method and system, smart meter, and storage medium
CN115171279A (en) * 2022-07-07 2022-10-11 杭州正华电子科技有限公司 Remote electricity meter card payment management method, system and readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040008007A (en) * 2002-07-15 2004-01-28 에임텍 주식회사 Method of upgrading firmware for wireless terminal
CN106101841A (en) * 2016-07-13 2016-11-09 青岛海信宽带多媒体技术有限公司 The firmware upgrade method of a kind of projection TV and device
CN106485140A (en) * 2016-10-17 2017-03-08 中国电力科学研究院 A kind of upgrade method of electric energy meter and upgrade-system
CN108415721A (en) * 2018-03-20 2018-08-17 山东比特智能科技股份有限公司 A kind of node device programme upgrade method and relevant apparatus
CN109117158A (en) * 2018-08-02 2019-01-01 郑州云海信息技术有限公司 Firmware update and device
CN110532735A (en) * 2018-05-23 2019-12-03 霍尼韦尔环境自控产品(天津)有限公司 Firmware upgrade method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040008007A (en) * 2002-07-15 2004-01-28 에임텍 주식회사 Method of upgrading firmware for wireless terminal
CN106101841A (en) * 2016-07-13 2016-11-09 青岛海信宽带多媒体技术有限公司 The firmware upgrade method of a kind of projection TV and device
CN106485140A (en) * 2016-10-17 2017-03-08 中国电力科学研究院 A kind of upgrade method of electric energy meter and upgrade-system
CN108415721A (en) * 2018-03-20 2018-08-17 山东比特智能科技股份有限公司 A kind of node device programme upgrade method and relevant apparatus
CN110532735A (en) * 2018-05-23 2019-12-03 霍尼韦尔环境自控产品(天津)有限公司 Firmware upgrade method
CN109117158A (en) * 2018-08-02 2019-01-01 郑州云海信息技术有限公司 Firmware update and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022142153A1 (en) * 2020-12-31 2022-07-07 威胜集团有限公司 Electricity meter upgrading method and system, smart meter, and storage medium
CN113312078A (en) * 2021-05-07 2021-08-27 南方电网数字电网研究院有限公司 Electric energy meter software modularization difference upgrading method and electric energy meter system
CN115171279A (en) * 2022-07-07 2022-10-11 杭州正华电子科技有限公司 Remote electricity meter card payment management method, system and readable medium

Similar Documents

Publication Publication Date Title
CN110446201B (en) Communication module, communication method and system for realizing eSIM remote configuration
CN111694590A (en) Upgrading method of intelligent water meter
US7480907B1 (en) Mobile services network for update of firmware/software in mobile handsets
CN1653460B (en) Method for loading an application in a device, device and smart card therefor
US7366589B2 (en) Method and system for remote reflash
WO2020107905A1 (en) Monitoring and managing methods for device, and terminal device
JP2015092374A (en) Apparatus and methods for managing firmware verification on wireless device
EP2878140B1 (en) Wireless firmware upgrades to an alarm security panel
JP2012084159A5 (en)
JP2008547092A5 (en)
JP2015092374A5 (en)
CN111935704B (en) Profile downloading method, device and equipment
EP2425335B1 (en) Carrier specific provisioning for computer cellular wireless cards
CN112637365B (en) Terminal resource issuing and acquiring method and device and electronic equipment
US11100081B2 (en) Methods for loading a profile to a secure element, manager and personalisable secure element
CN105763389A (en) Electrical power monitoring and fault information management system based on Android platform
CN112650520B (en) Ammeter upgrading method and system, intelligent ammeter and storage medium
CN107623735B (en) Accurate updating and upgrading system and method based on openssl in credit investigation machine system
CN105468393B (en) Module release upgrade method and terminal installation
KR20100063474A (en) Method and system for providing fota service
CN110716538A (en) Vehicle diagnosis method, device, equipment and readable storage medium
WO2020119729A1 (en) Base station starting method and apparatus, and computer storage medium and device
CN113727333B (en) Downloading system for custom applications
CN110113207A (en) A kind of method for updating protocol based on Internet of Things, device, equipment and storage medium
US20140273973A1 (en) Method and system for replacing key deployed in se of mobile terminal

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Li Xiangwei

Inventor after: Chang Feng

Inventor after: Chen Feizhou

Inventor after: Wu Jinghua

Inventor before: Li Xiangwei

Inventor before: Chang Feng

Inventor before: Chen Feizhou

Inventor before: Wu Jinghua

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200922