WO2022083046A1 - 智能电表校验方法、装置、智能电表及计算机存储介质 - Google Patents

智能电表校验方法、装置、智能电表及计算机存储介质 Download PDF

Info

Publication number
WO2022083046A1
WO2022083046A1 PCT/CN2021/080260 CN2021080260W WO2022083046A1 WO 2022083046 A1 WO2022083046 A1 WO 2022083046A1 CN 2021080260 W CN2021080260 W CN 2021080260W WO 2022083046 A1 WO2022083046 A1 WO 2022083046A1
Authority
WO
WIPO (PCT)
Prior art keywords
smart meter
program
verification
code
check code
Prior art date
Application number
PCT/CN2021/080260
Other languages
English (en)
French (fr)
Inventor
杨勇
张宇
宋慧娜
李军
石理宁
李强
李斌
Original Assignee
威胜集团有限公司
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 威胜集团有限公司 filed Critical 威胜集团有限公司
Publication of WO2022083046A1 publication Critical patent/WO2022083046A1/zh

Links

Classifications

    • 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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the present application relates to the field of smart meters, and in particular, to a smart meter calibration method, device, smart meter, and computer storage medium.
  • the main purpose of this application is to provide a smart meter verification method, device, smart meter and storage medium, aiming to solve the technical problem of how to prevent the smart meter from being tampered with.
  • the present application provides a smart meter verification method, the method includes the following steps:
  • the first check code is obtained by calculating the ICM program of the integrity check module
  • the smart meter is verified according to the first verification code and the second verification code.
  • the method further includes: before the first check code is obtained by calculating the ICM program of the integrity check module according to the current program of the smart meter, obtaining a program of the level of the smart meter.
  • the first check code varies according to the level of the program of the smart meter.
  • the second check code is updated and stored after each upgrade of the smart meter.
  • the step of verifying the smart meter according to the first verification code and the second verification code includes:
  • the first verification code is the same as the second verification code, it is determined that the smart meter is successfully verified
  • the method before the step of obtaining the first check code according to the current program of the smart meter through the ICM program of the integrity check module, the method includes:
  • the smart meter will be controlled to upgrade
  • the second check code after the upgrade of the smart meter is obtained by calculating through the ICM program.
  • the step of controlling the smart meter to upgrade includes:
  • the step of obtaining the second check code after the upgrade of the smart meter by calculating through the ICM program according to the upgraded program of the smart meter includes:
  • the upgraded second check code of the smart meter is obtained by calculating through the ICM program according to the upgraded program in the internal flash of the MCU.
  • the method includes:
  • the upgraded second check code of the smart meter is stored in the electrified erasable programmable read-only memory EEPROM.
  • the step of obtaining the upgraded second check code of the smart meter by calculating through the ICM program according to the upgraded program of the smart meter further includes:
  • the second check code is obtained by calculating one of three encryption algorithms of SHA1, SHA224 and SHA256.
  • the first check code is encrypted and calculated by using a hardware secure hash algorithm module.
  • the present application also provides a smart meter calibration device
  • the smart meter calibration device includes: a memory, a processor, and a smart meter calibration device stored in the memory and running on the processor.
  • a verification program is implemented, and when the smart meter verification program is executed by the processor, the steps of the smart meter verification method described in any one of the above are implemented.
  • the present application also provides a smart meter, the smart meter includes the smart meter verification device as described above.
  • the present application also provides a computer storage medium, where a smart meter verification program is stored on the storage medium, and when the smart meter verification program is executed by a processor, the above-mentioned smart meter is realized Steps of the verification method.
  • a smart meter verification method proposed in the embodiment of the present application is to obtain a first verification code calculated by an integrity checking module ICM program according to the current program of the smart meter;
  • the second check code is calculated according to the ICM program;
  • the smart meter is checked according to the first check code and the second check code, so that the smart meter can be checked every time.
  • the smart meter can be verified in real time and effectively to obtain the internal integrity of the smart meter, thereby avoiding the risk of tampering with the smart meter program, and improving the verification effectiveness and efficiency of the smart meter.
  • Fig. 1 is the terminal ⁇ device structure schematic diagram of the hardware operating environment involved in the solution of the embodiment of the present application;
  • FIG. 2 is a schematic flowchart of the first embodiment of the smart meter verification method of the present application
  • FIG. 3 is a schematic flowchart of a refinement of the steps of verifying the smart meter according to the first verification code and the second verification code in FIG. 2;
  • FIG. 4 is a schematic flowchart of a second embodiment of a smart meter verification method of the present application.
  • the present application provides a solution, so that the first check code calculated by the integrity checking module ICM program according to the current program of the smart meter is obtained; the second check code pre-stored by the current smart meter is obtained, and the The second check code is calculated according to the ICM program; the smart meter is checked according to the first check code and the second check code, so that the smart meter can be checked every time it is powered on.
  • the smart meter is verified in real time and effectively to obtain the internal integrity of the smart meter, thereby avoiding the risk of tampering with the smart meter program, and improving the verification effectiveness and efficiency of the smart meter.
  • FIG. 1 is a schematic structural diagram of a terminal of a hardware operating environment involved in the solution of the embodiment of the present application.
  • the terminal in the embodiment of the present application is a smart meter, and the smart meter includes a smart meter detection device.
  • the smart meter may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, memory 1005.
  • the communication bus 1002 is used to realize the connection and communication between these components.
  • the user interface 1003 may be an infrared receiving module for receiving a control instruction triggered by a user through a remote control, and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may include a standard wired interface and a wireless interface (eg, a WI-FI interface).
  • the memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory). memory), such as disk storage.
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .
  • the structure of the smart meter shown in FIG. 1 does not constitute a limitation to the smart meter, and may include more or less components than the one shown, or combine some components, or arrange different components.
  • the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a smart meter verification program.
  • the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server;
  • the user interface 1003 is mainly used to connect to the client (client) and perform data communication with the client;
  • the processor 1001 can be used to invoke the smart meter verification program stored in memory 1005 and perform the following operations:
  • the first check code is obtained by calculating the ICM program of the integrity check module
  • the smart meter is verified according to the first verification code and the second verification code.
  • the processor 1001 may call the smart meter verification program stored in the memory 1005, and further perform the following operations:
  • the first verification code is the same as the second verification code, it is determined that the smart meter is successfully verified
  • the processor 1001 may call the smart meter verification program stored in the memory 1005, and further perform the following operations:
  • the smart meter will be controlled to upgrade
  • the second check code after the upgrade of the smart meter is obtained by calculating through the ICM program.
  • the processor 1001 may call the smart meter verification program stored in the memory 1005, and further perform the following operations:
  • the processor 1001 may call the smart meter verification program stored in the memory 1005, and further perform the following operations:
  • the upgraded second check code of the smart meter is obtained by calculating through the ICM program according to the upgraded program in the internal flash of the MCU.
  • the processor 1001 may call the smart meter verification program stored in the memory 1005, and further perform the following operations:
  • the upgraded second check code of the smart meter is stored in the electrified erasable programmable read-only memory EEPROM.
  • the processor 1001 may call the smart meter verification program stored in the memory 1005, and further perform the following operations:
  • the second check code is obtained by calculating one of three encryption algorithms of SHA1, SHA224 and SHA256.
  • FIG. 2 is a schematic flowchart of the first embodiment of the present application, the method includes the following steps:
  • Step S100 according to the current program of the smart meter, the first check code calculated by the program of the integrity checking module ICM.
  • the smart meter after the smart meter is powered on, first obtain the program of the current level of the smart meter, and pass the integrity check module ICM (Integrity Check Module) according to the current program. Module) program to perform verification calculation.
  • ICM Intelligent Code Module
  • the ICM value A of the program in which the current smart meter is located is obtained by calculating the ICM program, that is, the first verification code.
  • the first verification code will be based on the current location of the internal program of the smart meter.
  • the levels vary. Among them, the first verification code of the current smart meter needs to be obtained after each power-on of the smart meter. At the same time, in order to ensure the security of the smart meter, the verification code needs to be encrypted.
  • the adopted hardware security hash algorithm module is used for encryption calculation, and the calculation speed is very fast, which is basically about 50 milliseconds, and the user is basically undetectable.
  • the decryption and cracking time of this encryption algorithm basically exceeds the entire life cycle of the smart meter, thus ensuring that
  • the commonly used encryption algorithms include SHA1, SHA224 and SHA256, which can be chosen in this case.
  • Step S200 obtaining a second check code pre-stored by the current smart meter, where the second check code is calculated according to an ICM program;
  • Step S300 verifying the smart meter according to the first verification code and the second verification code.
  • the pre-stored ICM value B that is, the second check code
  • the pre-stored ICM value B is directly obtained from the memory in the smart meter.
  • the ICM program it is also calculated according to the ICM program; therefore, after each smart meter is powered on, it is necessary to judge the relationship between the first check code and the second check code to achieve correct Verification of the smart meter.
  • the first check code is calculated by the ICM program of the integrity checking module according to the current program of the smart meter; the second check code pre-stored by the current smart meter is obtained. It is calculated according to the ICM program; the smart meter is verified according to the first check code and the second check code, so that the smart meter can be effectively checked in real time after each power-on. The smart meter is verified to obtain the internal integrity of the smart meter, thereby avoiding the risk of tampering with the smart meter program, and improving the verification effectiveness and efficiency of the smart meter.
  • the present application is a detailed flowchart of the steps of verifying the smart meter according to the first verification code and the second verification code, based on the implementation shown in FIG. 2 above.
  • the step of verifying the smart meter according to the first verification code and the second verification code includes:
  • Step S310 judging whether the first check code and the second check code are the same.
  • the smart meter compares whether the first check code and the second check code are the same.
  • Step S320 it is determined that the smart meter is successfully verified.
  • step S310 if the first check code is the same as the second check code, it is determined that the smart meter is successfully verified, and at this time, it is determined that the smart meter's internal The program has not been tampered with and the smart meter will function normally.
  • Step S330 Otherwise, it is determined that the verification of the smart meter has failed.
  • step S310 if the first check code is different from the second check code, it is determined that the smart meter has failed to check. At this time, the smart meter that fails the verification will not be able to continue to be used. It needs to be replaced with a backup smart meter in time to continuously record the power consumption. When using the backup smart meter, the usage time of the backup smart meter needs to be limited. At the same time, when the smart meter is displayed After the verification fails, a verification failure reminder message will be sent to the user to remind the user to deal with the failure of the smart meter in time, and will also feed back to the relevant technical personnel for processing as needed.
  • the smart meter by judging whether the first check code of the current smart meter is the same as the first check code of the pre-stored smart meter, different countermeasures are made under different judgment results.
  • the first check code is the same as the first check code of the pre-stored smart meter, and the user does not perform any processing at this time. The same, at this time, the user needs to take relevant measures for the current verification smart meter; thus, the smart meter can effectively verify the smart meter in real time after it is powered on, and obtain the internal integrity of the smart meter. It is convenient for users to take countermeasures in time, so as to avoid the risk of tampering with the smart meter program in time, and improve the verification effectiveness and verification efficiency of the smart meter.
  • FIG. 4 is a schematic flowchart of the second embodiment of the present application, based on the embodiment shown in FIG. 2 above, before the steps of calculating the first check code through the ICM program of the integrity check module according to the current program of the smart meter, the steps include: :
  • Step S400 if an upgrade request initiated by the user is received, the smart meter is controlled to upgrade.
  • step S100 is executed.
  • the internal module of a general smart meter includes three parts: Boot, legal legal, and non-legal Non-Legally.
  • Legal mainly includes the measurement part, which is not allowed to be modified once certified by the certification body, and the Boot cannot be upgraded after leaving the factory.
  • the legal part Legally needs to be certified and authorized by the certification body to allow the upgrade.
  • Non-legal Non-Legally can be upgraded after the customer's authorization, including six modules of COSEM, protocol, G3-PLC, APP, driver, and display, and each module has its own independent and the verification algorithm must meet the authentication requirements, and control the different functions of the smart meter accordingly.
  • all modules can be upgraded.
  • the upgrade package corresponding to the corresponding function module will be called and downloaded at the same time.
  • Step S500 according to the upgraded program of the smart electric meter, the second check code of the upgraded smart electric meter is obtained by calculating through the ICM program.
  • step S400 after the smart meter upgrade is performed according to step S400, since each module inside the smart meter has its own independent check code, after the smart meter is upgraded, it is necessary to obtain the calibration code of the corresponding module of the upgraded smart meter in time. Verify the code and store it for backup, and calculate and obtain the second check code after the smart meter is upgraded according to the ICM program. Specifically, after the smart meter is upgraded, the program in the external flash memory needs to be written into the micro-control unit at this time. In the internal flash of the MCU, and according to the upgraded program in the internal flash of the MCU, the second check code of the upgraded smart meter is calculated and obtained according to the ICM program, and the upgraded second check code of the smart meter is stored in a live battery.
  • the check code needs to be encrypted.
  • the hardware security hash algorithm module used in the first check code and the second check code obtained in this case is encrypted and calculated, and the calculation speed is very fast. , basically in about 50 milliseconds, the user is basically undetectable, and the decryption and cracking time of this encryption algorithm basically exceeds the entire life cycle of the smart meter, thus ensuring the security of the smart meter, and the first check code, the second
  • the verification code adopts the same encryption algorithm.
  • SHA1, SHA224 and SHA256 are commonly used. In this case, you can choose one.
  • a program upgrade of a smart meter is provided. After receiving an upgrade request from a user, the upgrade program package is downloaded and verified, and a flag is set in the application program, and the identifier is determined by starting the program. Whether the flag exists, so that the smart meter can complete the upgrade according to the user's needs according to the identification, and further obtain the second verification code of the upgraded smart meter through the ICM program and store it for backup, and further realize the verification through a variety of secure hash algorithms.
  • the encryption of the code enhances the security of the smart meter, thereby avoiding the risk of tampering with the smart meter.
  • an embodiment of the present application further proposes a computer storage medium, where a smart meter verification program is stored on the computer-readable storage medium, and the smart meter verification program is executed by a processor to implement the above-mentioned smart meter verification method A step of.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Stored Programmes (AREA)

Abstract

一种智能电表校验方法,根据智能电表的当前程序通过完整性检查模块ICM程序计算得到的第一校验码(S100);获取当前所述智能电表预先存储的第二校验码,所述第二校验码是根据ICM程序计算得到的(S200);根据所述第一校验码与所述第二校验码以对所述智能电表进行校验(S300)。还公开了一种智能电表校验装置、智能电表及计算机存储介质。

Description

智能电表校验方法、装置、智能电表及计算机存储介质
本申请要求:2020年10月20日申请的、申请号为202011130119.2、名称为“智能电表校验方法、装置、智能电表及存储介质”的中国专利申请的优先权,,其全部内容通过引用结合在申请中。
技术领域
本申请涉及智能电表领域,尤其涉及一种智能电表校验方法、装置、智能电表及计算机存储介质。
背景技术
随着电表的智能化,目前使用的智能电表均采用代码控制,而在现场运行过程中智能电表中的程序代码存在被篡改的风险,其中,如果修改计量部分代码,此时电能表还能正常运行,但同时会给用户或国家造成不可估量的经济损失,因此需要对智能电表进行校验。目前,一般采用循环冗余校验(Cyclic Redundancy Check, CRC),并将校验码保存在带电可擦可编程只读存储器 (Electrically Erasable Programmable read only memory,EEPROM)里面,但由于智能电表的程序代码是保存在外部闪速存储器(flash)里面,而每次智能电表升级都会擦除掉内部flash,并将外部flash拷贝到内部flash,因此通过现有采用的智能电表的校验方式,根本无法获取智能电表被纂改的记录,从而也检测不到智能电表被篡改的信息。
技术问题
本申请的主要目的在于提供一种智能电表校验方法、装置、智能电表及存储介质,旨在解决如何防止智能电表被篡改的技术问题。
技术解决方案
为实现上述目的,本申请提供一种智能电表校验方法,所述方法包括以下步骤:
根据智能电表的当前程序通过完整性检查模块ICM程序计算得到第一校验码;
获取当前所述智能电表预先存储的第二校验码,所述第二校验码是根据ICM程序计算得到的;
根据所述第一校验码与所述第二校验码以对所述智能电表进行校验。
在一实施例中,所述方法还包括:在所述根据智能电表的当前程序通过完整性检查模块ICM程序计算得到第一校验码之前,获取所述智能电表所处等级的程序。
在一实施例中,所述第一校验码根据所述智能电表的所述程序的所处等级而变化。
在一实施例中,所述第二校验码在所述智能电表每次升级后进行更新存储。
在一实施例中,所述根据所述第一校验码与所述第二校验码以对所述智能电表进行校验的步骤,包括:
判断所述第一校验码与所述第二校验码是否相同;
若是所述第一校验码与所述第二校验码相同,则判定所述智能电表校验成功;
否则,则判定所述智能电表校验失败。
在一实施例中,所述根据智能电表的当前程序通过完整性检查模块ICM程序计算得到第一校验码的步骤之前,包括:
若是接收到用户发起的升级请求,则控制智能电表进行升级;
根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码。
在一实施例中,所述控制智能电表进行升级的步骤,包括:
下载升级程序包;
校验所述升级程序包;
校验后置上标识flag;
根据启动程序判断所述标识flag是否存在;
若存在,则启动智能电表程序升级。
在一实施例中,所述根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码的步骤,包括:
将外部闪速存储器flash中的程序写入微控制单元MCU内部flash中;
根据所述MCU内部flash中升级后的程序通过所述ICM程序计算得到所述智能电表升级后的第二校验码。
在一实施例中,所述根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码的步骤之后,包括:
将所述智能电表升级后的第二校验码保存在带电可擦可编程只读存储器 EEPROM中。
在一实施例中,所述根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码的步骤还包括:
通过采用SHA1、 SHA224和 SHA256三种中一种的加密算法计算获取所述第二校验码。
在一实施例中,所述第一校验码采用硬件安全哈希算法模块进行加密计算。
此外,为实现上述目的,本申请还提供一种智能电表校验装置,所述智能电表校验装置包括:存储器、处理器及存储在存储器上并可在所述处理器上运行的智能电表校验程序,所述智能电表校验程序被所述处理器执行时实现如上述任一项所述的智能电表校验方法的步骤。
此外,为实现上述目的,本申请还提供一种智能电表,所述智能电表包括如上述所述的智能电表校验装置。
此外,为实现上述目的,本申请还提供一种计算机存储介质,所述存储介质上存储有智能电表校验程序,所述智能电表校验程序被处理器执行时实现如上述所述的智能电表校验方法的步骤。
有益效果
本申请实施例提出的一种智能电表校验方法,通过根据智能电表的当前程序通过完整性检查模块ICM程序计算得到的第一校验码;获取当前所述智能电表预先存储的第二校验码,所述第二校验码是根据ICM程序计算得到的;根据所述第一校验码与所述第二校验码以对所述智能电表进行校验,实现了在智能电表每次上电后都能实时有效的对智能电表进行校验,获取智能电表内部的完整性情况,从而避免了智能电表程序被篡改的风险,提升了智能电表校验有效性及校验效率。
附图说明
图1是本申请实施例方案涉及的硬件运行环境的终端\装置结构示意图;
图2为本申请智能电表校验方法第一实施例的流程示意图;
图3为图2中根据所述第一校验码与所述第二校验码以对所述智能电表进行校验的步骤的细化流程示意图;
图4为本申请智能电表校验方法第二实施例的流程示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例的主要解决方案是:
由于现有技术一般采用循环冗余校验(Cyclic Redundancy Check, CRC),并将校验码保存在带电可擦可编程只读存储器 (Electrically Erasable Programmable read only memory,EEPROM)里面,但由于电能表的程序代码是保存在外部闪速存储器(flash)里面,而每次电能表升级都会擦除掉内部flash,并将外部flash拷贝到内部flash,因此通过电能表的校验,根本无法获取先前电能表被纂改的记录,从而也检测不到电能表被篡改的信息。
本申请提供一种解决方案,使通过根据智能电表的当前程序通过完整性检查模块ICM程序计算得到的第一校验码;获取当前所述智能电表预先存储的第二校验码,所述第二校验码是根据ICM程序计算得到的;根据所述第一校验码与所述第二校验码以对所述智能电表进行校验,实现了在智能电表每次上电后都能实时有效的对智能电表进行校验,获取智能电表内部的完整性情况,从而避免了智能电表程序被篡改的风险,提升了智能电表校验有效性及校验效率。
如图1所示,图1是本申请实施例方案涉及的硬件运行环境的终端结构示意图。
本申请实施例终端为智能电表,所述智能电表包括智能电表检测装置,如图1所示,该智能电表可以包括:处理器1001,例如CPU,通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以红外接收模块,用于接收用户通过遥控器触发的控制指令,可选的用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的智能电表结构并不构成对智能电表的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及智能电表校验程序。
在图1所示的终端中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的智能电表校验程序,并执行以下操作:
根据智能电表的当前程序通过完整性检查模块ICM程序计算得到第一校验码;
获取当前所述智能电表预先存储的第二校验码,所述第二校验码是根据ICM程序计算得到的;
根据所述第一校验码与所述第二校验码以对所述智能电表进行校验。
在一实施例中,处理器1001可以调用存储器1005中存储的智能电表校验程序,还执行以下操作:
判断所述第一校验码与所述第二校验码是否相同;
若是所述第一校验码与所述第二校验码相同,则判定所述智能电表校验成功;
否则,则判定所述智能电表校验失败。
在一实施例中,处理器1001可以调用存储器1005中存储的智能电表校验程序,还执行以下操作:
若是接收到用户发起的升级请求,则控制智能电表进行升级;
根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码。
在一实施例中,处理器1001可以调用存储器1005中存储的智能电表校验程序,还执行以下操作:
下载升级程序包;
校验所述升级程序包;
校验后置上标识flag;
根据启动程序判断所述标识flag是否存在;
若存在,则启动智能电表程序升级。
在一实施例中,处理器1001可以调用存储器1005中存储的智能电表校验程序,还执行以下操作:
将外部闪速存储器flash中的程序写入微控制单元MCU内部flash中;
根据所述MCU内部flash中升级后的程序通过所述ICM程序计算得到所述智能电表升级后的第二校验码。
在一实施例中,处理器1001可以调用存储器1005中存储的智能电表校验程序,还执行以下操作:
将所述智能电表升级后的第二校验码保存在带电可擦可编程只读存储器 EEPROM中。
在一实施例中,处理器1001可以调用存储器1005中存储的智能电表校验程序,还执行以下操作:
通过采用SHA1、 SHA224和 SHA256三种中一种的加密算法计算获取所述第二校验码。
本申请智能电表检测设备、智能电表的具体实施例与下述智能电表校验方法各实施例基本相同,在此不作赘述。
参照图2,本申请第一实施例的流程示意图,所述方法包括以下步骤:
步骤S100,根据智能电表的当前程序通过完整性检查模块ICM程序计算得到的第一校验码。
本实施例中,在智能电表上电后,首先获取当前智能电表所处等级的程序,并根据当前所处的程序通过完整性检查模块ICM(Integrity Check Module)程序进行校验计算,具体的,通过ICM程序计算获取当前智能电表所处程序的ICM值A即第一校验码,所述第一校验码将根据当前智能电表的内部程序所处等级的不同而不同,其中,在智能电表每次上电之后都需要获取当前智能电表的的第一校验码,同时,为了保障保障智能电表的安全,需要对校验码进行加密,本案中采用的硬件安全哈希算法模块进行加密计算的,运算速度非常快,基本在50毫秒左右,用户基本上无法察觉,该种加密算法的解密破解时间基本超过智能电表的整个生命周期,从而确保了智能电表的安全性,常用的加密算法包括SHA1、 SHA224和 SHA256三种,本案中可以择一选择。
步骤S200,获取当前所述智能电表预先存储的第二校验码,所述第二校验码是根据ICM程序计算得到的;
步骤S300,根据所述第一校验码与所述第二校验码以对所述智能电表进行校验。
本实施例中,在智能电表上电后,直接从智能电表中的存储器中获取预先存储的ICM值B即第二校验码,其中的第二校验码是智能电表在每次升级后都要进行更新存储的,同时也是根据ICM程序计算得到的;因此,在每次智能电表上电后都需要判断所述第一校验码与所述第二校验码之间的关系,实现对所述智能电表的校验。
在本实施例中通过根据智能电表的当前程序通过完整性检查模块ICM程序计算得到的第一校验码;获取当前所述智能电表预先存储的第二校验码,所述第二校验码是根据ICM程序计算得到的;根据所述第一校验码与所述第二校验码以对所述智能电表进行校验,实现了在智能电表每次上电后都能实时有效的对智能电表进行校验,获取智能电表内部的完整性情况,从而避免了智能电表程序被篡改的风险,提升了智能电表校验有效性及校验效率。
进一步的,参照图3,本申请根据所述第一校验码与所述第二校验码以对所述智能电表进行校验的步骤的细化流程示意图,基于上述图2所示的实施例,所述根据所述第一校验码与所述第二校验码以对所述智能电表进行校验的步骤,包括:
步骤S310,判断所述第一校验码与所述第二校验码是否相同。
本实施例中,根据步骤S100获取的第一校验码、以及根据步骤S200获取的第二校验码,通过在智能电表内部比较第一校验码和第二校验码是否相同。
步骤S320,判定所述智能电表校验成功。
本实施例中,根据步骤S310中得到的比较结果,若是所述第一校验码与所述第二校验码相同,则判定所述智能电表校验成功,并且此时认定智能电表的内部程序没有被篡改,所述智能电表将正常运行。
步骤S330:否则,则判定所述智能电表校验失败。
本实施例中,根据步骤S310中得到的比较结果,若是所述第一校验码与所述第二校验码不相同,则判定所述智能电表校验失败。此时针对校验失败的智能电表,将不能继续使用,需要及时更换到备用智能电表持续记录电量消耗,针对使用备用智能电表时需要限定智能电表的备用电表的使用时间,同时,在显示智能电表校验失败后,将发出校验失败提醒信息至用户,提醒用户及时处理此次智能电表出现故障的情况,并且根据需要还将反馈到相关技术人员处理。
本实施例中,通过判断当前智能电表的第一校验码与预先存储的智能电表的第一校验码是否相同,在不同的判断结果下,作出不同的应对手段,其中若是当前智能电表的第一校验码与预先存储的智能电表的第一校验码相同,此时用户不做处理,而若是当前智能电表的第一校验码与预先存储的智能电表的第一校验码不相同,那么此时针对当前校验的智能电表,用户需采取相关措施应对;从而实现了智能电表在上电后能实时有效的对智能电表进行校验,获取智能电表内部的完整性情况,以方便用户及时才去应对措施,以至于及时避免智能电表程序被篡改的风险,提升了智能电表校验有效性及校验效率。
参照图4,本申请第二实施例的流程示意图,基于上述图2所示的实施例,根据智能电表的当前程序通过完整性检查模块ICM程序计算得到的第一校验码的步骤之前,包括:
步骤S400,若是接收用户发起的升级请求,则控制智能电表进行升级。
本实施例中,在智能电表上电之后,根据用户的选择是否需要升级智能电表程序,其中,若是接收到用户发起的升级请求,则控制智能电表进行升级。否则,则执行步骤S100。
具体的,针对智能电表的升级,需要提前根据用户的需求对应控制智能电表内部的不同功能模块的升级,其中不同功能模块将对应着不同的升级程序包,并且根据不同模块功能的优先级差异,实现控制不同模块的升级。例如,一般智能电表内部模块包括启动Boot,法定legally, 非法定Non-Legally三部分,其中,Legally主要包含计量部分,一旦通过认证机构认证后不允许修改,而Boot在出厂后无法升级,法定部分Legally需要通过认证机构认证并授权才允许升级,非法定Non-Legally在客户授权后可以升级,包含COSEM、protocol、G3-PLC、APP、driver、display六个模块,且每一模块都有自己独立的校验码,且校验的算法必须符合认证要求,并相应控制着智能电表的不同功能。
进一步的,在智能电表内存空闲空间足够的情况下,可以全部模块进行升级,在用户确定某一功能模块或多个功能模块确定升级时,将同时调用并下载对应功能模块对应的升级程序包,并且通过数字签名的方式实现整体检验升级程序包,并在校验完成之后在智能电表的应用程序中置上标识flag,同时控制智能电表程序重启,在智能电表重启之后根据启动程序判断所述应用程序中置上的标识flag是否存在,若应用程序中存在所述标识flag,则启动智能电表程序相应模块的升级。否则,则不允许智能电表程序的相应模块进行升级。
步骤S500,根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码。
本实施例中,根据步骤S400执行智能电表升级之后,由于智能电表内部每个模块都有着自己独立的校验码,所以在智能电表升级之后,需要及时的获取升级之后的智能电表相应模块的校验码并存储备用,根据ICM程序计算得到所述智能电表升级后的第二校验码,具体的,在智能电表升级之后,此时需要将外部闪速存储器flash中的程序写入微控制单元MCU内部flash中,并根据MCU内部flash中升级后的程序根据ICM程序计算得到升级后的智能电表的第二校验码,并将所述智能电表升级后的第二校验码保存在带电可擦可编程只读存储器EEPROM中。同时,为了保障保障智能电表的安全,需要对校验码进行加密,本案中获取的第一校验码、第二校验码采用的硬件安全哈希算法模块进行加密计算的,运算速度非常快,基本在50毫秒左右,用户基本上无法察觉,并且该种加密算法的解密破解时间基本超过智能电表的整个生命周期,从而确保了智能电表的安全性,并且第一校验码、第二校验码采用相同的加密算法,一般常用的是SHA1、SHA224和 SHA256三种,本案中可以择一选择。
本实施例中提供一种智能电表的程序升级,在接收到用户的升级请求之后,通过下载及校验升级程序包,并通过在应用程序中置上标识flag,以及通过启动程序判断所述标识flag是否存在,从而使得智能电表根据标识完成用户需求的升级,并进一步通过ICM程序获取升级后的智能电表的第二校验码并存储备用,并进一步通过多种安全哈希算法实现对校验码的加密,增强了智能电表的安全性,进而避免了智能电表被篡改的风险。
此外,本申请实施例还提出一种计算机存储介质,所述计算机可读存储介质上存储有智能电表校验程序,所述智能电表校验程序被处理器执行时实现如上述智能电表校验方法的步骤。
本申请计算机存储介质的具体实施例与上述智能电表校验方法各实施例基本相同,在此不作赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台智能电表执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (14)

  1. 一种智能电表校验方法,其中,所述方法包括以下步骤:
    根据智能电表的当前程序通过完整性检查模块ICM程序计算得到第一校验码;
    获取当前所述智能电表预先存储的第二校验码,所述第二校验码是根据ICM程序计算得到的;
    根据所述第一校验码与所述第二校验码以对所述智能电表进行校验。
  2. 如权利要求1所述的智能电表校验方法,其中,所述方法还包括:
    在所述根据智能电表的当前程序通过完整性检查模块ICM程序计算得到第一校验码之前,获取所述智能电表所处等级的程序。
  3. 如权利要求2所述的智能电表校验方法,其中,所述第一校验码根据所述智能电表的所述程序的所处等级而变化。
  4. 如权利要求1所述的智能电表校验方法,其中,所述第二校验码在所述智能电表每次升级后进行更新存储。
  5. 如权利要求1所述的智能电表校验方法,其中,所述根据所述第一校验码与所述第二校验码以对所述智能电表进行校验的步骤,包括:
    判断所述第一校验码与所述第二校验码是否相同;
    若是所述第一校验码与所述第二校验码相同,则判定所述智能电表校验成功;
    否则,则判定所述智能电表校验失败。
  6. 如权利要求1所述的智能电表校验方法,其中,所述根据智能电表的当前程序通过完整性检查模块ICM程序计算得到第一校验码的步骤之前,包括:
    若是接收到用户发起的升级请求,则控制智能电表进行升级;
    根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码。
  7. 如权利要求6所述的智能电表校验方法,其中,所述控制智能电表进行升级的步骤,包括:
    下载升级程序包;
    校验所述升级程序包;
    校验后置上标识flag;
    根据启动程序判断所述标识flag是否存在;
    若存在,则启动智能电表程序升级。
  8. 如权利要求6所述的智能电表校验方法,其中,所述根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码的步骤,包括:
    将外部闪速存储器flash中的程序写入微控制单元MCU内部flash中;
    根据所述MCU内部flash中升级后的程序通过所述ICM程序计算得到所述智能电表升级后的第二校验码。
  9. 如权利要求6所述的智能电表校验方法,其中,所述根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码的步骤之后,包括:
    将所述智能电表升级后的第二校验码保存在带电可擦可编程只读存储器 EEPROM中。
  10. 如权利要求6所述的智能电表校验方法,其中,所述根据所述智能电表升级后的程序通过ICM程序计算得到所述智能电表升级后的第二校验码的步骤,还包括:
    通过采用SHA1、 SHA224和 SHA256三种中一种的加密算法计算获取所述第二校验码。
  11. 如权利要求1所述的智能电表校验方法,其中,所述第一校验码采用硬件安全哈希算法模块进行加密计算。
  12. 一种智能电表校验装置,其中,所述智能电表校验装置包括:存储器、处理器及存储在存储器上并可在所述处理器上运行的智能电表校验程序,所述智能电表校验程序被所述处理器执行时实现如权利要求1至11中任一项所述的智能电表校验方法的步骤。
  13. 一种智能电表,其中,所述智能电表包括如上述权利要求12所述的智能电表校验装置。
  14. 一种计算机存储介质,其中,所述存储介质上存储有智能电表校验程序,所述智能电表校验程序被处理器执行时实现如权利要求1至11中任一项所述的智能电表校验方法的步骤。
PCT/CN2021/080260 2020-10-20 2021-03-11 智能电表校验方法、装置、智能电表及计算机存储介质 WO2022083046A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011130119.2 2020-10-20
CN202011130119.2A CN112346904A (zh) 2020-10-20 2020-10-20 智能电表校验方法、装置、智能电表及存储介质

Publications (1)

Publication Number Publication Date
WO2022083046A1 true WO2022083046A1 (zh) 2022-04-28

Family

ID=74359356

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/080260 WO2022083046A1 (zh) 2020-10-20 2021-03-11 智能电表校验方法、装置、智能电表及计算机存储介质

Country Status (2)

Country Link
CN (1) CN112346904A (zh)
WO (1) WO2022083046A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346904A (zh) * 2020-10-20 2021-02-09 威胜集团有限公司 智能电表校验方法、装置、智能电表及存储介质
CN113037832A (zh) * 2021-03-04 2021-06-25 杭州海兴电力科技股份有限公司 一种电能表文件校验方法和系统
CN112988205A (zh) * 2021-03-09 2021-06-18 威胜集团有限公司 电能表升级方法、电能表及计算机可读存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070211401A1 (en) * 2006-03-08 2007-09-13 Distribution Control Systems Intelligent fault detector system and method
CN110596636A (zh) * 2019-09-10 2019-12-20 江阴长仪集团有限公司 一种智能电表上电加载校正方法
CN111259387A (zh) * 2018-12-03 2020-06-09 上海掌门科技有限公司 一种检测被篡改的应用的方法及设备
CN111314133A (zh) * 2020-02-14 2020-06-19 宁波三星智能电气有限公司 电表通信模块升级方法、电表控制模块和电表通信模块
CN111488166A (zh) * 2020-04-28 2020-08-04 南方电网数字电网研究院有限公司 双芯智能电表管理单元软件的升级方法、装置及存储介质
CN111562952A (zh) * 2020-07-16 2020-08-21 南方电网数字电网研究院有限公司 双芯智能电表管理单元的动态装载方法、动态装载装置
CN112346904A (zh) * 2020-10-20 2021-02-09 威胜集团有限公司 智能电表校验方法、装置、智能电表及存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105844901A (zh) * 2016-05-23 2016-08-10 光科技股份有限公司 一种基于防篡改技术的安全能效监测终端及其监测方法
CN106325955A (zh) * 2016-08-30 2017-01-11 威胜集团有限公司 Sts预付费电能表的远程升级方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070211401A1 (en) * 2006-03-08 2007-09-13 Distribution Control Systems Intelligent fault detector system and method
CN111259387A (zh) * 2018-12-03 2020-06-09 上海掌门科技有限公司 一种检测被篡改的应用的方法及设备
CN110596636A (zh) * 2019-09-10 2019-12-20 江阴长仪集团有限公司 一种智能电表上电加载校正方法
CN111314133A (zh) * 2020-02-14 2020-06-19 宁波三星智能电气有限公司 电表通信模块升级方法、电表控制模块和电表通信模块
CN111488166A (zh) * 2020-04-28 2020-08-04 南方电网数字电网研究院有限公司 双芯智能电表管理单元软件的升级方法、装置及存储介质
CN111562952A (zh) * 2020-07-16 2020-08-21 南方电网数字电网研究院有限公司 双芯智能电表管理单元的动态装载方法、动态装载装置
CN112346904A (zh) * 2020-10-20 2021-02-09 威胜集团有限公司 智能电表校验方法、装置、智能电表及存储介质

Also Published As

Publication number Publication date
CN112346904A (zh) 2021-02-09

Similar Documents

Publication Publication Date Title
CN108399339B (zh) 一种基于安全芯片的可信启动方法
WO2022083046A1 (zh) 智能电表校验方法、装置、智能电表及计算机存储介质
TWI667586B (zh) 用以核對uefi認證變量變化之系統及方法
CN108287999A (zh) 一种基于TrustZone的系统可信启动方法
TW201935234A (zh) Bios刷寫方法及bios鏡像檔案的處理方法
US11886593B2 (en) Verification of a provisioned state of a platform
CN103080904A (zh) 提供多阶段锁步完整性报告机构
CN106156635A (zh) 终端启动方法和装置
CN110795126A (zh) 一种固件安全升级系统
CN104866768A (zh) 自动柜员机操作系统启动控制方法及装置
CN112148314A (zh) 一种嵌入式系统的镜像验证方法、装置、设备及存储介质
EP4075309A1 (en) Secure boot device
CN112653559B (zh) 一种电控单元启动方法、装置及存储介质
CN114925336A (zh) 一种激活软件的方法及系统
CN110781478A (zh) 临时授权Root实现调试的方法和装置
CN111523124B (zh) 一种云音箱固件保护方法及系统
TWI605357B (zh) 電腦系統以及電腦系統操作方法
CN110730079B (zh) 基于可信计算模块的嵌入式系统安全启动和可信度量的系统
WO2020233044A1 (zh) 一种插件校验方法、设备、服务器及计算机可读存储介质
CN103795905A (zh) 一种网络摄像机可信启动方法
US20060020819A1 (en) Information processing apparatus and system startup method
CN115618360A (zh) 一种服务器防篡改安全启动方法及装置
CN111241548A (zh) 计算机启动方法
CN110740041B (zh) 基于可信计算模块的嵌入式系统安全启动与可信度量的方法
JP2020027341A (ja) ストレージ装置およびデータ改ざん検証方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21881472

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21881472

Country of ref document: EP

Kind code of ref document: A1