CN114968321A - Gas meter terminal and cross-version upgrading method thereof - Google Patents

Gas meter terminal and cross-version upgrading method thereof Download PDF

Info

Publication number
CN114968321A
CN114968321A CN202110214629.6A CN202110214629A CN114968321A CN 114968321 A CN114968321 A CN 114968321A CN 202110214629 A CN202110214629 A CN 202110214629A CN 114968321 A CN114968321 A CN 114968321A
Authority
CN
China
Prior art keywords
gas meter
file
upgrading
meter terminal
version
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
CN202110214629.6A
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.)
Newcapec Electronics Co Ltd
Original Assignee
Newcapec Electronics 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 Newcapec Electronics Co Ltd filed Critical Newcapec Electronics Co Ltd
Priority to CN202110214629.6A priority Critical patent/CN114968321A/en
Publication of CN114968321A publication Critical patent/CN114968321A/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
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to a gas meter terminal and a cross-version upgrading method thereof, and belongs to the technical field of software upgrading. The upgrading method comprises the following steps: the gas meter terminal receives a header file of a file to be upgraded, which is issued by the server terminal; the header file comprises APP block data D in the file to be upgraded N1 Corresponding check code C N1 (ii) a N is a block serial number; read all check codes C N1 And calculating the data D of each APP block in the current file N0 Corresponding check code C N0 (ii) a Comparison C N1 And C N0 Whether or not they are equal to each other, if C N0 ≠C N1 And the gas meter terminal requests a check code C from the server end N1 Corresponding APP Block data D N1 (ii) a Gas meter terminal waits for server to issue APP block data D N1 Receiving APP Block data D N1 Then, the original APP block data D is covered N0 And differential upgrading is realized. The upgrading method of the invention is independent of the number of the gas meter terminalsThe amount of the files and the software version number are large, only the latest file to be upgraded of the software version number needs to be stored in the server, and the burden of the server is reduced.

Description

Gas meter terminal and cross-version upgrading method thereof
Technical Field
The invention relates to a gas meter terminal and a cross-version upgrading method thereof, and belongs to the technical field of software upgrading.
Background
The existing gas meter terminal updates the current software version of the differential file in a patching mode, and then upgrades the current software version.
The traditional software upgrading method needs to upgrade sequentially according to the size of the version number, if the current version is x.1 and the latest version is x.3, the current version x.1 needs to be upgraded to the version x.2 in the upgrading process, and then the version x.2 is upgraded to the version x.3, so that the upgrading process is complex.
For this reason, a cross-version upgrade method is proposed, for example: the Chinese patent application publication No. CN 106648798A provides a cross-version OTA dynamic upgrade method, and the upgrade process is as follows: the difference packet between the current version and the latest version of the client is calculated at the server side, the difference packet can be a cross-version difference packet, the server side transmits the difference packet to the client, and the client is directly upgraded from the current version to the latest version, so that cross-version upgrading is realized.
However, the cross-version differential package is generated by the server, so that a complete installation package of a current version and a latest version corresponding to the terminal is stored in the server, and the differential package required by upgrading is generated through the current version and the latest version during upgrading; or the base version and the difference package between every two adjacent versions from the base version to the latest version are stored, and the difference package required by the upgrade is generated through the base version and the corresponding difference package during the upgrade, so that the number of files required to be managed by the server is large, and the load of the server is heavy.
Disclosure of Invention
The application aims to provide a gas meter terminal and a cross-version upgrading method thereof, which are used for solving the problem that the existing cross-version upgrading method causes heavy server burden.
In order to achieve the above object, the present application provides a technical solution of a cross-version upgrading method for a gas meter terminal, including the following steps:
1) gas meter terminal receiving serverA header file of a file to be upgraded issued by the terminal; the header file comprises APP block data D in the file to be upgraded N1 Corresponding check code C N1 (ii) a N is a block serial number;
2) read all check codes C N1 And calculating the data D of each APP block in the current file N0 Corresponding check code C N0
3) Comparison C N1 And C N0 Whether or not equal, if C N0 ≠C N1 If so, the gas meter terminal requests a check code C from the server end N1 Corresponding APP Block data D N1
4) Gas meter terminal waits for server to issue APP block data D N1 Receiving APP Block data D N1 Then, the original APP block data D is covered N0 And realizing differential upgrading.
In addition, the application also provides a technical scheme of the gas meter terminal, which comprises a terminal main body and a controller, wherein the controller comprises a processor, a memory and a computer program which is stored in the memory and can run on the processor, and the processor realizes the cross-version upgrading method of the gas meter terminal when executing the computer program.
The gas meter terminal and the cross-version upgrading method thereof have the beneficial effects that: in the cross-version upgrading method, the process of differential upgrading is implemented by the gas meter terminal, after the gas meter terminal receives the header file, whether the check code in the header file is equal to the check code of the current file is judged, corresponding APP block data with unequal check codes is requested from the server side, differential downloading is carried out, and then differential upgrading is achieved. No matter how many gas meter terminals are and how many software version numbers are, only files to be upgraded with the latest software version numbers need to be stored in the server, so that the number of files to be managed by the server is reduced, and the burden of the server is reduced.
Further, in the gas meter terminal and the cross-version upgrading method thereof, data D of each APP block N0 The APP data of the backup area in the current file.
Further, the method comprisesIn the gas meter terminal and the cross-version upgrading method thereof, all the C are used N1 And C N0 After the comparison is completed and all the backup areas are covered, the method also comprises the step of verifying the APP data in the backup area, and if the verification is valid, the upgrading is successful; if the verification is invalid, the upgrade fails.
Further, in the gas meter terminal and the cross-version upgrading method thereof, the header file further includes a large version number and a small version number of a file to be upgraded, and the gas meter terminal determines whether to perform differential upgrading by comparing the large version number and the small version number in the header file with the large version number and the small version number in the current file:
if the large version numbers are not consistent, the whole upgrading is carried out;
and if the large version number is consistent and the small version number is inconsistent, performing differential upgrading.
Further, in the gas meter terminal and the cross-version upgrading method thereof, in step 1), after receiving the header file, the gas meter terminal further includes a step of comparing a software version number of a current file of the gas meter terminal with a software version number of a file to be upgraded:
if the software version numbers are different, starting upgrading;
and if the software version numbers are the same, closing the upgrade.
Drawings
FIG. 1 is a flow chart of a cross-version upgrading method of a gas meter terminal according to the present invention;
fig. 2 is a flow chart of differential upgrading of the gas meter terminal of the invention.
Detailed Description
Gas meter terminal embodiment:
the main idea of the invention is that in order to avoid the server end managing more files, when the gas meter terminal of the invention receives the header file of the file to be upgraded of the latest version, the difference between the current file and the file to be upgraded is obtained by comparing the check code of the block file in the current file with the check code of the block file in the file to be upgraded, and then different APP block data is requested to the server terminal to cover the original APP block data in the current file, so as to realize the differential upgrade at the gas meter terminal.
The gas meter terminal comprises a terminal body and a controller, wherein the controller comprises a processor, a memory and a computer program which is stored in the memory and can run on the processor, and the processor realizes the cross-version upgrading method of the gas meter terminal when executing the computer program.
Specifically, as shown in fig. 1, the method for upgrading a gas meter terminal across versions includes the following steps:
1) and the server side creates the file to be upgraded of the latest version.
The file structure of the file to be upgraded is shown as table one and comprises a header file and APP data. The APP data is composed of APP block data D N1 The N is the serial number of the block; the header file comprises the software version number, large version number and small version number of the file to be upgraded and the APP block data D N1 Corresponding check code C N1
File structure of file to be updated
File structure Starting position Description of the invention
Header file 0x00000000 Including upgrade files and upgrade plan information.
APP data 0x00000200 Software code
2) And the gas meter terminal reports an upgrading request to the server side.
3) And after receiving the upgrading request, the server side requests the gas meter terminal for the software version number of the current file of the terminal.
4) The gas meter terminal reports the software version number of the current file of the terminal, and the server terminal receives the software version number of the current file of the terminal.
5) The server side judges whether the terminal is the latest software version number, if so, the upgrade is closed; and if not, sending a header file to the gas meter terminal, and entering the step 6).
6) The gas meter terminal compares whether the software version number in the header file is the same as the software version number of the current file, and if so, the upgrading is closed; if not, starting upgrading, and comparing whether the major version number and the minor version number in the current file and the header file are consistent or not;
if the large version numbers are not consistent, performing overall upgrade, and entering the step 7); and if the large version number is consistent with the small version number, performing differential upgrading, and entering the step 8).
7) The gas meter terminal requests the server for the whole APP data of the file to be upgraded; after receiving the request, the server side issues the whole APP data; after receiving the whole APP data, the gas meter terminal covers the APP data of the current file backup area, verifies whether the APP data is valid, and if the APP data is valid, the upgrading is successful; if the updating is invalid, the updating fails.
8) The gas meter terminal requests the server for differential APP data, as shown in fig. 2, the request process is as follows:
a. gas meter terminal reads APP block data D of backup area in current file N0 Calculating the corresponding check code C N0
b. Gas meter terminal reads each APP block data D in head file N1 Corresponding check code C N1
c. Gas meter terminal comparison C N0 And C N1 Whether or not they are equal to each other, if C N0 ≠C N1 The gas meter terminal requests the server end for a check code C N1 Corresponding APP Block data D N1 After the server receives the request, the server sends the APP block data D N1 Gas meter terminal receiving APP block data D N1 And the APP block data D of the backup area is covered N0
d. When N is the total block number, namely after the comparison of the check codes of all the blocks is finished, verifying whether the APP block data in the backup area is valid, and if so, successfully upgrading; if the updating is invalid, the updating fails.
9) And finally copying the APP data in the backup area to the execution area and checking.
In the above embodiment, in order to improve the accuracy of the upgrade, the determination of the software version number is performed again in step 6), and as another embodiment, the gas meter terminal may not perform the determination of the software version number when the server side determines accurately.
In the above embodiment, in order to reduce the calculated amount, under the inconsistent condition of major version number, directly carry out whole APP and download, under the inconsistent condition of minor version number, carry out difference APP and download, as other implementation manners, also can not carry out the judgement of major version number, minor version number, gas meter terminal all carries out the comparison of check code under any circumstance, and when only needing whole APP to download, all check codes are all inequality.
In the above embodiment, in order to ensure the validity of the upgrade, in step 7) and step 8), after replacing the APP data in the backup area, the validity of the APP data is determined, and as another embodiment, the area may be directly verified in step 9).
In the above embodiment, in order to avoid that the gas meter terminal cannot be used in the downloading process, the gas meter terminal adopts the APP block data of the backup area when performing check code comparison, and as other implementation manners, the APP block data of the execution area may also be directly adopted to perform calculation of the check code without considering the use of the terminal.
In the following, by using a specific embodiment, the number of files to be managed by the server end is compared when the server end makes a differential packet file for cross-version upgrade and the gas meter terminal performs cross-version upgrade.
Assume that the software of terminal a needs to be upgraded from version x.1 to version x.3.
If the differential package file is made at the server side, the server side needs to generate and manage the x.1_ x.3 differential package file, the x.1 file and the x.3 file, and create and execute 1 upgrade task.
Therefore, when the number of gas meter terminals is 1 and the version span is 2 versions, the number Q of upgrade files that the server needs to manage and the number M of upgrades that need to be executed are as follows:
Q=2+1=3;M=1;
when the number of the gas meter terminals is 2 and the version spans are 1 version and 2 versions respectively, the number Q of upgrade files to be managed and the number M of upgrade files to be executed by the server are as follows:
Q=2*2+1=5;M=2;
by analogy, when the number of the terminals is X, the version spans are distributed between 1 and V MAX For each version, the number Q of upgrade files to be managed and the number M of upgrades to be executed are as follows:
Q=2*V MAX +1;M=X。
and if the gas meter terminal is upgraded, the server only needs to manage x.3 files, and establishes and executes 1-time upgrading tasks.
When the number of gas meter terminals is 1 and the version span is 2 versions, the number Q of upgrade files to be managed and the number M of upgrade files to be executed are as follows:
Q=1;M=1;
when the number of the gas meter terminals is 2 and the version spans are 1 version and 2 versions respectively, the number Q of upgrade files to be managed and the number M of upgrade files to be executed by the server are as follows:
Q=1;M=2;
when the number of the terminals is X, the version span is 1-V MAX Upgrade files to be managed for individual versionThe number Q and the number of upgrades M that need to be performed are as follows:
Q=1;M=X。
therefore, the number of file management of the server side can be greatly reduced by performing cross-version upgrading in the gas meter terminal. And is suitable for the upgrading process of the batch gas meter terminals: the same upgrading scheme and the files to be upgraded can be configured for terminal upgrading of different versions, so that under the scene that terminals in batches contain different software versions, a server side and management personnel do not need to group and manufacture differential package files for response according to the current versions of the terminals, and the management difficulty of upgrading tasks, upgrading files, differential package files and the like is reduced.
The gas meter terminal judges the differential blocks with different check codes according to the comparison between the acquired header file of the file to be upgraded with the latest version and the current file, and actively initiates a request to the server end by the gas meter terminal to download the file for updating the differential blocks, thereby realizing the self-adaptive differential upgrade of the gas meter terminal. Because the differential upgrading scheme mainly improves the upgrading efficiency by reducing the communication interaction times, the differential upgrading scheme is mainly suitable for being carried out on the premise that the system framework and the upgrading scheme are not changed.
The embodiment of the cross-version upgrading method of the gas meter terminal comprises the following steps:
the implementation process and effect of the cross-version upgrading method for the gas meter terminal are introduced in the above embodiment of the gas meter terminal, and are not described herein again.

Claims (6)

1. A cross-version upgrading method of a gas meter terminal is characterized by comprising the following differential upgrading steps:
1) the method comprises the steps that a gas meter terminal receives a header file of a file to be upgraded, wherein the header file is issued by a server; the header file comprises APP block data D in the file to be upgraded N1 Corresponding check code C N1 (ii) a N is a block serial number;
2) read all check codes C N1 And calculating the data D of each APP block in the current file N0 Corresponding check code C N0
3) Comparison C N1 And C N0 Whether or not they are equal to each other, if C N0 ≠C N1 If so, the gas meter terminal requests a check code C from the server end N1 Corresponding APP Block data D N1
4) Gas meter terminal waits for server to issue APP block data D N1 Receiving APP Block data D N1 Then, the original APP block data D is covered N0 And differential upgrading is realized.
2. The cross-version upgrading method of the gas meter terminal according to claim 1, characterized in that each APP block data D N0 The APP data of the backup area in the current file.
3. The method for upgrading gas meter terminals across versions according to claim 2, characterized in that all C's are upgraded N1 And C N0 After the comparison is completed and all the backup areas are covered, the method also comprises the step of verifying the APP data in the backup area, and if the verification is valid, the upgrading is successful; if the verification is invalid, the upgrade fails.
4. The cross-version upgrading method of the gas meter terminal according to claim 1, characterized in that the header file further includes a large version number and a small version number of a file to be upgraded, and the gas meter terminal determines whether to perform differential upgrading by comparing the large version number and the small version number in the header file with the large version number and the small version number in the current file:
if the large version numbers are not consistent, the whole upgrading is carried out;
and if the large version number is consistent and the small version number is inconsistent, performing differential upgrading.
5. The cross-version upgrading method of the gas meter terminal according to claim 1, characterized in that in the step 1), after the gas meter terminal receives the header file, the method further comprises the step of comparing the software version number of the current file of the gas meter terminal with the software version number of the file to be upgraded:
if the software version numbers are different, starting upgrading;
and if the software version numbers are the same, closing the upgrade.
6. A gas meter terminal comprising a terminal body and a controller, characterized in that the controller comprises a processor, a memory and a computer program stored in the memory and executable on the processor, and the processor, when executing the computer program, implements the cross-version upgrade method of a gas meter terminal according to any one of claims 1 to 5.
CN202110214629.6A 2021-02-25 2021-02-25 Gas meter terminal and cross-version upgrading method thereof Pending CN114968321A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110214629.6A CN114968321A (en) 2021-02-25 2021-02-25 Gas meter terminal and cross-version upgrading method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110214629.6A CN114968321A (en) 2021-02-25 2021-02-25 Gas meter terminal and cross-version upgrading method thereof

Publications (1)

Publication Number Publication Date
CN114968321A true CN114968321A (en) 2022-08-30

Family

ID=82974160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110214629.6A Pending CN114968321A (en) 2021-02-25 2021-02-25 Gas meter terminal and cross-version upgrading method thereof

Country Status (1)

Country Link
CN (1) CN114968321A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605552A (en) * 2013-11-29 2014-02-26 Tcl通力电子(惠州)有限公司 MCU upgrading method and device
CN106528125A (en) * 2016-10-26 2017-03-22 腾讯科技(深圳)有限公司 Data file incremental updating method, server, client and system
CN111090444A (en) * 2019-12-03 2020-05-01 航天信息股份有限公司 Version upgrading method and device, storage medium and electronic equipment
CN111831297A (en) * 2019-04-17 2020-10-27 中兴通讯股份有限公司 Zero-difference upgrading method and device
CN111966375A (en) * 2020-08-13 2020-11-20 科华恒盛股份有限公司 Firmware upgrading method, system, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605552A (en) * 2013-11-29 2014-02-26 Tcl通力电子(惠州)有限公司 MCU upgrading method and device
CN106528125A (en) * 2016-10-26 2017-03-22 腾讯科技(深圳)有限公司 Data file incremental updating method, server, client and system
CN111831297A (en) * 2019-04-17 2020-10-27 中兴通讯股份有限公司 Zero-difference upgrading method and device
CN111090444A (en) * 2019-12-03 2020-05-01 航天信息股份有限公司 Version upgrading method and device, storage medium and electronic equipment
CN111966375A (en) * 2020-08-13 2020-11-20 科华恒盛股份有限公司 Firmware upgrading method, system, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN109040029B (en) Method and apparatus for executing transactions in a blockchain
US9591428B2 (en) Method, software and apparatus for performing actions on a wireless device using action lists and versioning
CN112486554B (en) Vehicle-mounted networking terminal software upgrading method
US9134989B2 (en) System and method for updating dataset versions resident on a wireless device
CN111478897A (en) OTA (over the air) upgrading method and system for vehicle ECU (electronic control Unit)
CN104063239A (en) Application program update method of mobile terminal, server and client
CN103677891A (en) Method for selective software rollback
CN112162768B (en) Block chain upgrading method and system
CN102970342A (en) Automatic update method of embedded terminal based on over the air (OTA) technology
CN109067559A (en) A kind of device updating method and device
CN112152846B (en) Metering instrument remote upgrading method based on Internet of things
CN112035144B (en) Upgrading method and device of block chain system, computer equipment and storage medium
CN110262820A (en) Method, apparatus, system and storage medium based on MQTT protocol realization OTA upgrading
CN110474977A (en) Firmware upgrade method, firmware upgrade system and the intelligent door lock of intelligent door lock
CN110647337A (en) Internet of things MCU (microprogrammed control Unit) air firmware upgrading method
CN110597545A (en) Hot patch intelligent upgrading method and system based on OTA component
JP2023505844A (en) Package-based remote firmware update
CN113377798A (en) Block chain consistency processing method, block chain node and block chain system
CN109976791A (en) A kind of automatically updating method, device and the equipment of NVMe SSD
CN115220767A (en) Software upgrading method, system, electronic equipment and storage medium
CN113610523A (en) Credible contract consensus method, device and equipment for improving performance of alliance chain
CN1731881A (en) Method for carrying out active inquiry maintenance on mobile terminal
CN114968321A (en) Gas meter terminal and cross-version upgrading method thereof
CN111949311B (en) Gray level release method and system
CN112395339A (en) Method and device for checking data access between systems, computer equipment and storage medium

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