[go: up one dir, main page]

CN111078251A - Self-adaptive program upgrading method and system for electric energy meter - Google Patents

Self-adaptive program upgrading method and system for electric energy meter Download PDF

Info

Publication number
CN111078251A
CN111078251A CN201911136690.2A CN201911136690A CN111078251A CN 111078251 A CN111078251 A CN 111078251A CN 201911136690 A CN201911136690 A CN 201911136690A CN 111078251 A CN111078251 A CN 111078251A
Authority
CN
China
Prior art keywords
electric energy
upgrade
energy meter
file
upgraded
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
CN201911136690.2A
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.)
Guangxi Power Grid Co Ltd
Original Assignee
Guangxi Power Grid 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 Guangxi Power Grid Co Ltd filed Critical Guangxi Power Grid Co Ltd
Priority to CN201911136690.2A priority Critical patent/CN111078251A/en
Publication of CN111078251A publication Critical patent/CN111078251A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • H04L9/3252Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures using DSA or related signature schemes, e.g. elliptic based signatures, ElGamal or Schnorr schemes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种电能表的自适应程序升级方法及系统,其所述方法包括:待升级电能表接收基于系统主站发送的升级文件与签名文件;检测待升级电能表上是否存在硬件数字签名芯片;在检测待升级电能表上不存在硬件数字签名芯片后,判断所述升级文件是否需要硬件数字签名芯片的支持;在判断所述升级文件不需要硬件数字签名芯片支持后,利用数字签名的公钥对所述签名文件进行解密处理,验证所述升级文件是否正确;在验证所述升级文件正确之后,待升级电能表根据所述升级文件执行程序升级。在本发明实施例中,采用所述升级方法保障了升级文件的完整性与可行性,极大地降低人为误操作导致电能表升级后工作异常或无法再次进行程序升级的风险。

Figure 201911136690

The invention discloses a self-adaptive program upgrade method and system for an electric energy meter. The method includes: receiving an upgrade file and a signature file sent by a system master station on the electric energy meter to be upgraded; detecting whether there is a hardware digital on the electric energy meter to be upgraded signature chip; after detecting that there is no hardware digital signature chip on the electric energy meter to be upgraded, determine whether the upgrade file needs the support of the hardware digital signature chip; after determining that the upgrade file does not need the support of the hardware digital signature chip, use the digital signature The public key of the device decrypts the signature file to verify whether the upgrade file is correct; after verifying that the upgrade file is correct, the electric energy meter to be upgraded performs program upgrade according to the upgrade file. In the embodiment of the present invention, the use of the upgrade method ensures the integrity and feasibility of the upgrade file, and greatly reduces the risk of abnormal operation of the electric energy meter after the upgrade caused by human error or failure to upgrade the program again.

Figure 201911136690

Description

Self-adaptive program upgrading method and system for electric energy meter
Technical Field
The invention relates to the technical field of electric energy meters, in particular to a self-adaptive program upgrading method and system of an electric energy meter.
Background
With the improvement of the automation level of the power grid and the domestic power utilization level, the demand and the utilization rate of electric energy sources of people are increased year by year, and the application of the electronic electric energy meter is more and more extensive. In order to facilitate the centralized management of an electric power company and meet the new requirements of customers for use, a relatively mature electric energy meter program upgrading method is formed in the existing market on the premise of not increasing the use cost of the customers. The upgrading method comprises the steps of calculating the CRC or MD5 value of an upgrading file, sending the upgrading file and the calculated check value to the electric energy meter to be upgraded in an asymmetric encryption mode, and then carrying out program upgrading on the electric energy meter to be upgraded after the completeness and the consistency of the upgrading file are ensured through a digital signature technology.
However, in the prior art, the problem of security of the upgrade file is more considered, the electric energy meter is ensured to obtain the complete upgrade file and then perform program upgrade, but the problem of judging whether the electric energy meter is upgradable does not exist, so that the situation that the unmatched electric energy meter is abnormally worked or cannot be upgraded again after being upgraded by mistake can not be avoided, the efficiency of field application can be influenced, and the use cost of a client is increased.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a self-adaptive program upgrading method and a self-adaptive program upgrading system for an electric energy meter.
In order to solve the above technical problem, an embodiment of the present invention provides an adaptive program upgrading method for an electric energy meter, where the upgrading method includes:
the electric energy meter to be upgraded receives an upgrade file and a signature file which are sent by a system master station;
detecting whether a hardware digital signature chip exists on the electric energy meter to be upgraded or not;
after detecting that the hardware digital signature chip does not exist on the electric energy meter to be upgraded, judging whether the upgrade file needs the support of the hardware digital signature chip;
after the upgrade file is judged not to be supported by the hardware digital signature chip, the signature file is decrypted by using a public key of a digital signature, and whether the upgrade file is correct or not is verified;
and after the upgrading file is verified to be correct, the electric energy meter to be upgraded executes program upgrading according to the upgrading file.
Optionally, before the electric energy meter to be upgraded receives the upgrade file and the signature file sent by the system master station, the method includes:
the system master station acquires the upgrading information and the upgrading file of the electric energy meter to be upgraded;
processing the upgrade file based on a Hash algorithm to obtain summary information;
encrypting the summary information based on a private key of a digital signature to generate the signature file;
and transmitting the upgrading file and the signature file to the electric energy meter to be upgraded based on the upgrading information.
Optionally, after detecting whether the hardware digital signature chip exists on the electric energy meter to be upgraded, the method includes:
if the hardware digital signature chip exists on the electric energy meter to be upgraded, decrypting the signature file by using a public key of a digital signature;
and if the electric energy meter to be upgraded is detected to be not provided with the hardware digital signature chip, judging whether the upgrade file needs the support of the hardware digital signature chip.
Optionally, the determining whether the upgrade file needs the support of the hardware digital signature chip includes:
performing summary operation on the upgrade package based on a Hash algorithm to generate first summary information;
judging whether the first summary information is consistent with the summary information which is stored in the electric energy meter to be upgraded in advance;
if the upgrade files are consistent with the hardware digital signature chip, judging that the upgrade files need the support of the hardware digital signature chip, and stopping upgrading the electric energy meter to be upgraded;
if not, judging that the upgrade file does not need the support of the hardware digital signature chip, and decrypting the signature file by using a public key of the digital signature.
Optionally, the upgrade package includes the upgrade file and the signature file.
In addition, an embodiment of the present invention further provides a system for upgrading an adaptive program of an electric energy meter, where the system includes:
the receiving module is used for receiving the upgrade file and the signature file sent by the system master station;
the detection module is used for detecting whether a hardware digital signature chip exists on the electric energy meter to be upgraded;
the judging module is used for judging whether the upgrade file needs the support of the hardware digital signature chip;
the decryption module is used for decrypting the signature file by using the public key of the digital signature and verifying whether the upgrade file is correct or not;
and the upgrading module is used for upgrading the electric energy meter execution program to be upgraded according to the upgrading file.
Optionally, the system further includes:
the system master station is used for acquiring the upgrading information and the upgrading file of the electric energy meter to be upgraded;
processing the upgrade file based on a Hash algorithm to obtain summary information;
encrypting the summary information based on a private key of a digital signature to generate the signature file;
and transmitting the upgrading file and the signature file to the electric energy meter to be upgraded based on the upgrading information.
Optionally, the determining module is configured to perform digest operation on an upgrade package based on a hash algorithm and generate first digest information, where the upgrade package includes the upgrade file and the signature file;
judging whether the first summary information is consistent with the summary information which is stored in the electric energy meter to be upgraded in advance;
if the electric energy meters are consistent, the upgrading of the electric energy meters to be upgraded is stopped;
and if the two files are not consistent, decrypting the signature file by using the public key of the digital signature.
In the embodiment of the invention, aiming at the safety problem of program upgrading of the electric energy meter to be upgraded, the digital signature technology is adopted, and the integrity and consistency of the upgrading file in the transmission process are ensured by using the signature of a system master station to the upgrading file and the signature verification of the electric energy meter to be upgraded to the upgrading file; aiming at the feasibility problem of program upgrading of the electric energy meter to be upgraded, whether a hardware digital signature chip exists in the electric energy meter to be upgraded or not is detected, whether the upgrade file needs the support of the hardware digital signature chip or not is verified, the electric energy meter to be upgraded is guaranteed to execute upgrading operation within an allowable range, and the risk that the electric energy meter is abnormal in work or cannot be upgraded again due to manual misoperation is greatly reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for upgrading an adaptive program of an electric energy meter according to an embodiment of the present invention;
fig. 2 is a schematic structural component diagram of an adaptive program upgrading system of an electric energy meter according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for upgrading an adaptive program of an electric energy meter according to an embodiment of the present invention, where the method includes the following steps:
s101, a system master station acquires upgrade information and an upgrade file of an electric energy meter to be upgraded;
it should be noted that the upgrade information includes: and the meter position information of the electric energy meter to be upgraded and the latest software version information.
Specifically, a system master station acquires the epitope information of the electric energy meter to be upgraded, establishes communication with the electric energy meter to be upgraded based on the epitope information, reads the current software version information of the electric energy meter to be upgraded, compares the current software version information with the latest software version information, and judges whether the electric energy meter to be upgraded is allowed to be upgraded or not;
if the current software version information is consistent with the latest software version information, judging that the electric energy meter to be upgraded is not allowed to be upgraded, generating an alarm signal, and recording the information of the upgraded program of the electric energy meter;
and if the current software version information is not consistent with the latest software version information, continuing to execute the step S102.
S102, processing the upgrade file based on a Hash algorithm to obtain summary information;
assuming that the upgrade file is M, calculating summary information of the upgrade file M based on a hash algorithm as follows: e-sha (m).
S103, encrypting the summary information based on a private key of the digital signature to generate a signature file;
specifically, the system master station encrypts the digest information based on a private key of a digital signature, wherein an elliptic curve digital signature algorithm is adopted, and the method comprises the following steps:
(1) selecting any base point G on the original elliptic curve Ep (a, b), wherein the order of the base point G is n;
(2) randomly selecting an integer K in the range of [1, n-1], and setting K as a private key of the digital signature, wherein a public key K of the digital signature meets a formula: k is kG;
(3) in [1, n-1]]Randomly selects an integer d, and selects a point p (x) on the original elliptic curve Ep (a, b)1,y1) And satisfies the point p (x)1,y1) The distance to the origin of coordinates is dG;
(4) calculating a portion r of the signature file as x1mod n, judging the value r, and if r is equal to 0, executing the step (3) again; if r ≠ 0, continuing to execute the step (5);
(5) calculating another part of the signature file s ═ d-1*(e+kr)mod n;
(6) And after the digest information e is encrypted, generating a signature file (r, s).
It should be noted that, the system master station encrypts the digest information based on the private key of the digital signature by using a public key system, and when the signature file generated by encryption is transmitted over a network, the elliptic curve Ep (a, b) and the point p (x) are generated1,y1) The base point G and the public key K are public parameters.
S104, transmitting the upgrading file and the signature file to the electric energy meter to be upgraded based on the upgrading information;
it should be noted that the upgrade information further includes a size of each data frame transmitted.
Specifically, based on the communication established between the system master station and the electric energy meter to be upgraded in step S101, the system master station transmits the upgrade file and the signature file to the electric energy meter to be upgraded according to the specified size of each data frame transmitted.
S105, the electric energy meter to be upgraded receives the upgrade file and the signature file;
s106, detecting whether a hardware digital signature chip exists on the electric energy meter to be upgraded or not; if not, executing step S107; if yes, executing step S108;
it should be noted that, detecting whether a hardware digital signature chip exists on the electric energy meter to be upgraded is a self-checking process of the electric energy meter to be upgraded, where the hardware digital signature chip is an ESAM chip.
Specifically, the internal program of the electric energy meter to be upgraded initializes the pin of the ESAM chip, sends a reset timing sequence to the ESAM chip, waits for the ESAM chip to reply a reset response signal, and determines that the electric energy meter to be upgraded does not have a hardware digital signature chip or determines that a faulty hardware digital signature chip exists on the electric energy meter to be upgraded when the reset response signal is not received after the electric energy meter to be upgraded is circularly sent for several times, and then executes step S107; and when the internal program of the electric energy meter to be upgraded receives the reset response signal, judging that the electric energy meter to be upgraded has a hardware digital signature chip, and executing the step S108.
It should be noted that before the electric energy meter to be upgraded performs self-checking of the hardware digital signature chip, memory capacity matching detection is performed according to the information carried by the upgrade file. Based on the information carried by the upgrade file, the electric energy meter to be upgraded acquires the capacity of a memory (EEPROM, FRAM, DataFlash) which is required to be used when the upgrade file can normally run after upgrading, reads the code area of an internal memory chip by using an internal program, and finally judges whether the two are matched. According to the self-checking result of the electric energy meter to be upgraded, when the capacity of a memory required after the upgrade file is upgraded to the electric energy meter to be upgraded is not matched with actual hardware resources, the electric energy meter to be upgraded cannot normally operate after being upgraded, and therefore the electric energy meter to be upgraded is directly refused to be upgraded.
S107, the electric energy meter to be upgraded judges whether the upgrade file needs the support of the hardware digital signature chip; if so, go to step 110; if not, go to step S108;
specifically, the electric energy meter to be upgraded performs summary operation on an upgrade package based on a hash algorithm to generate first summary information, wherein the upgrade package comprises the upgrade file and the signature file received by the electric energy meter to be upgraded; judging whether the first summary information is consistent with the summary information which is stored in the electric energy meter to be upgraded in advance; if the files are consistent, the upgrade files need the support of the hardware digital signature chip, and step S110 is executed; if not, the upgrade file does not need the support of the hardware digital signature chip, and step S108 is executed.
It should be noted that the summary information originally stored in the electric energy meter to be upgraded is calculated by a program requiring a hardware digital signature chip, and if the first summary information is consistent with the originally stored summary information, it is indicated that the electric energy meter to be upgraded needs support of the hardware digital signature chip when the program is upgraded.
S108, the electric energy meter to be upgraded decrypts the received signature file by using the public key of the digital signature, and verifies whether the upgrade file is correct; if yes, go to step S109; otherwise, go to step S110;
it should be noted that, according to step S103, since the system master station adopts a public key system, the electric energy meter to be upgraded can obtain the public key K and the point p (x) of the public digital signature1,y1) An elliptic curve Ep (a, b) and a base point G.
Specifically, the method for verifying the correctness of the upgrade file includes the following steps that the electric energy meter to be upgraded decrypts the received signature file (r, s) by using a public key K of a digital signature:
(1) assuming that the received upgrade file is M1Calculating the upgrade file M1Hash digest information of (1): e.g. of the type1=SHA(M1);
(2) Calculating s-1e1And n is a modulo value: u. of1=s-1e1mod n;
(3) Calculating rs-1And n is a modulo value: u. of2=rs-1mod n;
(4) Generating a target elliptic curve X, and satisfying the formula: x ═ u1G+u2K;
(5) Judging the target elliptic curve X, and if X is equal to 0, judging that the signature is illegal; if X ≠ 0, calculate X1And n is a modulo value: v ═ x1mod n;
(6) And comparing v and r, and if v ≠ r, verifying that the upgrade file is correct, and if v ≠ r, verifying that the upgrade file is tampered.
It should be noted that, when one encryption and decryption process includes two carriers, the two carriers must agree in advance to use the same algorithm to ensure that the decryption result has contrast, so in the decryption process, the hash algorithm used by the electric energy meter to be upgraded is consistent with the hash algorithm used by the system master station.
It should be noted that, when the hash algorithm is used for operation, there is an obvious feature: two identical input files can ensure that two identical abstract information are output, and even if one of the input files is slightly changed, the two output abstract information are greatly different.
In the decryption verification process, a back-certification method is adopted, assuming that the upgrade file and the signature file received by the electric energy meter to be upgraded are both correct, after the upgrade file is subjected to abstract operation to generate abstract information, the abstract information and the signature file are subjected to a series of operations, the signature file received by the electric energy meter to be upgraded is back-certified as the original signature file sent by a system master station, and the fact that the abstract information used in the decryption process is consistent with the abstract information used in the encryption process is verified, so that the upgrade file received by the electric energy meter to be upgraded is not tampered in the transmission process is guaranteed.
Optionally, the method for verifying whether the upgrade file received by the electric energy meter to be upgraded is correct further includes: decrypting the signature file received by the electric energy meter to be upgraded by using a public key of a digital signature, and acquiring decrypted first abstract information, wherein the first abstract information is obtained by performing abstract operation on an original upgrade file; performing summary operation on the upgrade file received by the electric energy meter to be upgraded based on a Hash algorithm to generate second summary information; judging whether the first abstract information is consistent with the second abstract information; if the upgrade files are consistent with the upgrade files, judging that the upgrade files received by the electric energy meter to be upgraded are not tampered in the transmission process; and if the upgrade files are inconsistent, judging that the upgrade files received by the electric energy meter to be upgraded are tampered in the transmission process.
S109, the electric energy meter to be upgraded executes program upgrading according to the upgrading file;
specifically, after the electric energy meter to be upgraded verifies that the upgrade file is correct, the upgrade file is loaded to a code area, and program upgrade is executed.
And S110, terminating upgrading of the electric energy meter to be upgraded.
Specifically, after the electric energy meter to be upgraded verifies that the upgrade file is incorrect, an alarm signal is generated, and invalid information of the upgrade file is recorded.
In the specific implementation process, the upgrading of the electric energy meter executive program to be upgraded at least meets three preconditions: firstly, after the electric energy meter to be upgraded receives the upgrade file, carrying out self-checking of matching of the capacity of a conventional hardware memory, and ensuring that the capacity of the memory required by normal operation after the upgrade file is upgraded is matched with the capacity of the memory in the electric energy meter to be upgraded; secondly, ensuring that a hardware digital signature chip exists in the electric energy meter to be upgraded, otherwise ensuring that the upgrade file does not need the support of the hardware digital signature chip; and finally, ensuring that the upgrading file is not tampered in the process of transmitting the upgrading file to the electric energy meter to be upgraded from the system master station. The self-checking capability of the electric energy meter to be upgraded plays a crucial role in feasibility of program upgrading, and the self-checking capability comprises self-checking of hardware memory capacity and self-checking of a hardware digital signature chip. And when the electric energy meter to be upgraded simultaneously meets the three preconditions, the program upgrading is allowed to be executed. Based on the three preconditions, the upgrading conditions of the two electric energy meters are respectively analyzed:
(1) the method comprises the steps that based on a single-phase table of TDK6542GT, an internal program is utilized to detect that the capacity of an EEPROM in a TDK6542GT chip is 64kb, the capacity of an FRAM is 16kb and the capacity of a DataFlash is 4Mb, if the single-phase table obtains that the capacity of the EEPROM needed after an upgrade file is upgraded into the table is 128kb according to information carried by the received upgrade file, and compared with the situation that actual hardware resources (the capacity of the EEPROM is 64kb) are not matched, the single-phase table refuses upgrading.
If the single-phase meter obtains that the capacity of an EEPROM (electrically erasable programmable read-only memory) required after the upgrade file is upgraded into the meter is 64kb according to the information carried by the received upgrade file, and an internal program is continuously utilized to detect that no hardware digital signature chip exists, if the upgrade file needs the support of the hardware digital signature chip, the single-phase meter refuses to upgrade.
(2) The method comprises the steps that based on a TDK6543GT three-phase table, an internal program is utilized to detect that the capacity of an EEPROM in a TDK6543GT chip is 64kb, the capacity of an FRAM is 16kb and the capacity of a DataFlash is 4Mb, if the three-phase table obtains the required capacity of the EEPROM after an upgrade file is upgraded into the table according to information carried by the received upgrade file and is 128kb, and compared with the situation that actual hardware resources (the capacity of the EEPROM is 64kb) are not matched, the three-phase table refuses upgrading.
If the three-phase table obtains that the capacity of an EEPROM (electrically erasable programmable read-only memory) required after the upgrade file is upgraded into the table is 64kb according to the received information carried by the upgrade file, and an internal program is continuously utilized to detect that no hardware digital signature chip exists, if the upgrade file needs the support of the hardware digital signature chip, the three-phase table refuses to be upgraded.
Referring to fig. 2, fig. 2 is a schematic structural composition diagram of an adaptive program upgrading system of an electric energy meter according to an embodiment of the present invention, where the system includes:
the system master station 201 is used for acquiring upgrading information and upgrading files of the electric energy meter to be upgraded; processing the upgrade file based on a Hash algorithm to obtain summary information; encrypting the summary information based on a private key of a digital signature to generate a signature file; and transmitting the upgrading file and the signature file to the electric energy meter to be upgraded based on the upgrading information.
A receiving module 202, configured to receive the upgrade file and the signature file sent by the system master station;
the detection module 203 is used for detecting whether a hardware digital signature chip exists on the electric energy meter to be upgraded;
the judging module 204 is configured to judge whether the upgrade file needs to be supported by the hardware digital signature chip;
specifically, the judging module is configured to perform digest operation on an upgrade package based on a hash algorithm and generate first digest information, where the upgrade package includes the upgrade file and the signature file; judging whether the first summary information is consistent with the summary information which is stored in the electric energy meter to be upgraded in advance; if the current time is consistent with the preset time, the electric energy meter to be upgraded is terminated; and if the two files are not consistent, decrypting the signature file by using the public key of the digital signature.
A decryption module 205, configured to decrypt the signature file with a public key of a digital signature, and verify whether the upgrade file is correct;
and the upgrading module 206 is configured to perform program upgrading on the electric energy meter to be upgraded according to the upgrading file.
For the specific implementation of each module in the system, please refer to the above-mentioned embodiment, which is not described herein again.
In the embodiment of the invention, aiming at the safety problem of program upgrading of the electric energy meter to be upgraded, the digital signature technology is adopted, and the integrity and consistency of the upgrading file in the transmission process are ensured by using the signature of a system master station to the upgrading file and the signature verification of the electric energy meter to be upgraded to the upgrading file; aiming at the feasibility problem of program upgrading of the electric energy meter to be upgraded, whether a hardware digital signature chip exists in the electric energy meter to be upgraded or not is detected, whether the upgrade file needs the support of the hardware digital signature chip or not is verified, the electric energy meter to be upgraded is guaranteed to execute upgrading operation within an allowable range, and the risk that the electric energy meter is abnormal in work or cannot be upgraded again due to manual misoperation is greatly reduced.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic or optical disk, or the like.
In addition, the above detailed description is given to the adaptive program upgrading method and system for an electric energy meter provided by the embodiment of the present invention, and a specific example should be adopted herein to explain the principle and the implementation manner of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1.一种电能表的自适应程序升级方法,其特征在于,所述方法包括:1. An adaptive program upgrade method for an electric energy meter, wherein the method comprises: 待升级电能表接收基于系统主站发送的升级文件与签名文件;The electric energy meter to be upgraded receives the upgrade file and signature file sent by the system master station; 检测所述待升级电能表上是否存在硬件数字签名芯片;Detecting whether there is a hardware digital signature chip on the electric energy meter to be upgraded; 在检测所述待升级电能表上不存在所述硬件数字签名芯片后,判断所述升级文件是否需要所述硬件数字签名芯片的支持;After detecting that the hardware digital signature chip does not exist on the electric energy meter to be upgraded, determine whether the upgrade file needs the support of the hardware digital signature chip; 在判断所述升级文件不需要所述硬件数字签名芯片的支持后,利用数字签名的公钥对所述签名文件进行解密处理,验证所述升级文件是否正确;After judging that the upgrade file does not need the support of the hardware digital signature chip, decrypt the signature file by using the public key of the digital signature to verify whether the upgrade file is correct; 在验证所述升级文件正确之后,所述待升级电能表根据所述升级文件执行程序升级。After verifying that the upgrade file is correct, the to-be-upgraded electric energy meter performs program upgrade according to the upgrade file. 2.根据权利要求1所述的电能表的自适应程序升级方法,其特征在于,在所述待升级电能表接收基于系统主站发送的升级文件与签名文件之前,包括:2. The self-adaptive program upgrade method of an electric energy meter according to claim 1, wherein before the electric energy meter to be upgraded receives the upgrade file and the signature file sent based on the system master station, comprising: 系统主站获取所述待升级电能表的升级信息和所述升级文件;The system master station obtains the upgrade information and the upgrade file of the electric energy meter to be upgraded; 基于哈希算法对所述升级文件进行处理得到摘要信息;Process the upgrade file based on a hash algorithm to obtain summary information; 基于数字签名的私钥对所述摘要信息进行加密处理,生成所述签名文件;Encrypting the digest information based on the private key of the digital signature to generate the signature file; 基于所述升级信息将所述升级文件与所述签名文件传输至所述待升级电能表。The upgrade file and the signature file are transmitted to the to-be-upgraded electric energy meter based on the upgrade information. 3.根据权利要求1所述的电能表的自适应程序升级方法,其特征在于,在检测所述待升级电能表上是否存在所述硬件数字签名芯片之后,包括:3. The self-adaptive program upgrade method for an electric energy meter according to claim 1, wherein after detecting whether the hardware digital signature chip exists on the electric energy meter to be upgraded, the method comprises: 若检测所述待升级电能表上存在硬件数字签名芯片时,利用数字签名的公钥对所述签名文件进行解密处理;If it is detected that there is a hardware digital signature chip on the electric energy meter to be upgraded, decrypt the signature file by using the public key of the digital signature; 若检测所述待升级电能表上不存在硬件数字签名芯片时,判断所述升级文件是否需要所述硬件数字签名芯片的支持。If it is detected that there is no hardware digital signature chip on the electric energy meter to be upgraded, it is determined whether the upgrade file needs the support of the hardware digital signature chip. 4.根据权利要求3所述的电能表的自适应程序升级方法,其特征在于,所述判断所述升级文件是否需要所述硬件数字签名芯片的支持包括:4. The self-adaptive program upgrade method of the electric energy meter according to claim 3, wherein the judging whether the upgrade file needs the support of the hardware digital signature chip comprises: 基于哈希算法将升级包进行摘要运算,生成第一摘要信息;Perform a digest operation on the upgrade package based on the hash algorithm to generate the first digest information; 判断所述第一摘要信息与所述待升级电能表中原先存储的摘要信息是否一致;judging whether the first summary information is consistent with the summary information originally stored in the to-be-upgraded electric energy meter; 若一致,判断所述升级文件需要所述硬件数字签名芯片的支持,所述待升级电能表终止升级;If they are consistent, it is determined that the upgrade file needs the support of the hardware digital signature chip, and the upgrade of the to-be-upgraded electric energy meter is terminated; 若不一致,判断所述升级文件不需要所述硬件数字签名芯片的支持,利用数字签名的公钥对所述签名文件进行解密处理。If not, it is determined that the upgrade file does not need the support of the hardware digital signature chip, and the signature file is decrypted by using the public key of the digital signature. 5.根据权利要求4所述的电能表的自适应程序升级方法,其特征在于,所述升级包包括所述升级文件和所述签名文件。5 . The method for upgrading an adaptive program of an electric energy meter according to claim 4 , wherein the upgrade package includes the upgrade file and the signature file. 6 . 6.一种电能表的自适应程序升级系统,其特征在于,所述系统包括:6. An adaptive program upgrading system for an electric energy meter, wherein the system comprises: 接收模块,用于接收基于系统主站发送的升级文件与签名文件;The receiving module is used to receive the upgrade files and signature files sent by the system master station; 检测模块,用于检测待升级电能表上是否存在硬件数字签名芯片;The detection module is used to detect whether there is a hardware digital signature chip on the electric energy meter to be upgraded; 判断模块,用于判断所述升级文件是否需要所述硬件数字签名芯片的支持;A judging module for judging whether the upgrade file needs the support of the hardware digital signature chip; 解密模块,用于利用数字签名的公钥对所述签名文件进行解密处理,验证所述升级文件是否正确;A decryption module, used for decrypting the signature file with the public key of the digital signature, and verifying whether the upgrade file is correct; 升级模块,用于根据所述升级文件对所述待升级电能表执行程序升级。An upgrade module, configured to perform program upgrade on the electric energy meter to be upgraded according to the upgrade file. 7.根据权利要求6所述的电能表的自适应程序升级系统,其特征在于,所述系统还包括:7. The self-adaptive program upgrading system of the electric energy meter according to claim 6, wherein the system further comprises: 系统主站,用于获取所述待升级电能表的升级信息和所述升级文件;a system master station, configured to obtain the upgrade information and the upgrade file of the electric energy meter to be upgraded; 基于哈希算法将所述升级文件进行处理得到摘要信息;Process the upgrade file based on a hash algorithm to obtain summary information; 基于数字签名的私钥对所述摘要信息进行加密处理,生成所述签名文件;Encrypting the digest information based on the private key of the digital signature to generate the signature file; 基于所述升级信息将所述升级文件和所述签名文件传输至所述待升级电能表。The upgrade file and the signature file are transmitted to the to-be-upgraded electric energy meter based on the upgrade information. 8.根据权利要求6所述的电能表的自适应程序升级系统,其特征在于,8. The self-adaptive program upgrade system of the electric energy meter according to claim 6, wherein, 所述判断模块用于基于哈希算法将升级包进行摘要运算并生成第一摘要信息,所述升级包包括所述升级文件和所述签名文件;The judging module is configured to perform a digest operation on an upgrade package based on a hash algorithm and generate first digest information, and the upgrade package includes the upgrade file and the signature file; 判断所述第一摘要信息与所述待升级电能表中原先存储的摘要信息是否一致;judging whether the first summary information is consistent with the summary information originally stored in the to-be-upgraded electric energy meter; 若一致,终止所述待升级电能表升级;If they are consistent, terminate the upgrade of the to-be-upgraded electric energy meter; 若不一致,利用数字签名的公钥对所述签名文件进行解密处理。If not, the signature file is decrypted by using the public key of the digital signature.
CN201911136690.2A 2019-11-19 2019-11-19 Self-adaptive program upgrading method and system for electric energy meter Pending CN111078251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911136690.2A CN111078251A (en) 2019-11-19 2019-11-19 Self-adaptive program upgrading method and system for electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911136690.2A CN111078251A (en) 2019-11-19 2019-11-19 Self-adaptive program upgrading method and system for electric energy meter

Publications (1)

Publication Number Publication Date
CN111078251A true CN111078251A (en) 2020-04-28

Family

ID=70311076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911136690.2A Pending CN111078251A (en) 2019-11-19 2019-11-19 Self-adaptive program upgrading method and system for electric energy meter

Country Status (1)

Country Link
CN (1) CN111078251A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112613030A (en) * 2020-12-15 2021-04-06 深圳市燃气集团股份有限公司 Credible safe starting method and system based on Internet of things gas meter
CN113721074A (en) * 2020-11-12 2021-11-30 王沛 Novel intelligent electric energy meter

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106778285A (en) * 2016-12-09 2017-05-31 美的智慧家居科技有限公司 For method, the device upgraded to equipment
US20170180137A1 (en) * 2015-12-21 2017-06-22 Electro Industries/Gauge Tech Providing security in an intelligent electronic device
CN107678763A (en) * 2017-09-28 2018-02-09 杭州海兴电力科技股份有限公司 Electric energy meter upgrade method and system based on digital signature technology
CN108196867A (en) * 2018-03-08 2018-06-22 深圳市文鼎创数据科技有限公司 Device for upgrading firmware, equipment and its firmware upgrade method of equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170180137A1 (en) * 2015-12-21 2017-06-22 Electro Industries/Gauge Tech Providing security in an intelligent electronic device
CN106778285A (en) * 2016-12-09 2017-05-31 美的智慧家居科技有限公司 For method, the device upgraded to equipment
CN107678763A (en) * 2017-09-28 2018-02-09 杭州海兴电力科技股份有限公司 Electric energy meter upgrade method and system based on digital signature technology
CN108196867A (en) * 2018-03-08 2018-06-22 深圳市文鼎创数据科技有限公司 Device for upgrading firmware, equipment and its firmware upgrade method of equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张东: "基于可信计算的虚拟网络计算远程认证系统", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721074A (en) * 2020-11-12 2021-11-30 王沛 Novel intelligent electric energy meter
CN112613030A (en) * 2020-12-15 2021-04-06 深圳市燃气集团股份有限公司 Credible safe starting method and system based on Internet of things gas meter

Similar Documents

Publication Publication Date Title
US11258792B2 (en) Method, device, system for authenticating an accessing terminal by server, server and computer readable storage medium
US12294657B2 (en) Software integrity protection method and apparatus, and software integrity verification method and apparatus
US20200074122A1 (en) Cryptographic operation processing method, apparatus, and system, and method for building measurement for trust chain
CN114884963A (en) Management method and management device of digital certificate
CN105263141A (en) Household electrical appliance and control method thereof
CN110309160B (en) Data in-link transaction processing method, device, computer equipment and storage medium
CN105512538A (en) debugging method and system of intelligent mobile operating system
CN117093423B (en) Data synchronization method, system, electronic equipment and storage medium between trusted DCS terminals
CN111078251A (en) Self-adaptive program upgrading method and system for electric energy meter
CN114640464A (en) Block chain-based subscription data transmission method, device, equipment and storage medium
CN112615723B (en) Source machine code comparison method based on RSA digital signature
CN113360887B (en) An authentication encryption method and module for relay protection equipment
CN115412251A (en) Method and system for setting electronic device and integrated circuit chip
CN110971412A (en) Method for safe network distribution of smart home based on block chain
CN117647965A (en) DCS controller trusted policy downloading method, device, equipment and storage medium
CN102045280B (en) Cable modem (CM) and certificate test method thereof
CN113518071A (en) Robot sensor information security enhancing device and method
CN115242480B (en) Device access method, system and non-volatile computer storage medium
EP3480722A1 (en) Method and apparatus for editing, obtaining, and protecting process of solar cell production device
CN112583594B (en) Data processing method, acquisition device, gateway, trusted platform and storage medium
CN108242997B (en) Method and device for secure communication
CN112073199B (en) Battery authentication method, device, terminal equipment and medium
CN112118209B (en) Account operation method and device of vehicle equipment
CN117014223B (en) Concentrator and data transmission method, device and storage medium thereof
CN110417567A (en) A kind of configuration method and device of internet of things equipment

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200428