CN112688942B - Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM - Google Patents

Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM Download PDF

Info

Publication number
CN112688942B
CN112688942B CN202011539419.6A CN202011539419A CN112688942B CN 112688942 B CN112688942 B CN 112688942B CN 202011539419 A CN202011539419 A CN 202011539419A CN 112688942 B CN112688942 B CN 112688942B
Authority
CN
China
Prior art keywords
electric energy
energy meter
upgrade
upgrading
information
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.)
Active
Application number
CN202011539419.6A
Other languages
Chinese (zh)
Other versions
CN112688942A (en
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.)
China Southern Power Grid Power Technology Co Ltd
Original Assignee
China Southern Power Grid Power Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Southern Power Grid Power Technology Co Ltd filed Critical China Southern Power Grid Power Technology Co Ltd
Priority to CN202011539419.6A priority Critical patent/CN112688942B/en
Publication of CN112688942A publication Critical patent/CN112688942A/en
Application granted granted Critical
Publication of CN112688942B publication Critical patent/CN112688942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the invention relates to an electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM, the upgrade file information is transmitted through the identity authentication of the master station and the electric energy meter, the upgrade file information transmitted by the master station and the upgrade file information received by the electric energy meter are encrypted and decrypted by adopting an ESAM (electronic security access module) safety module, so that after the electric energy meter can only receive legal and correct upgrade file information, the master station transmits the upgrade data packet to the electric energy meter, the electric energy meter can upgrade the firmware program after decrypting and checking the upgrade data packet, integrity and reliability of the upgrade data packet are checked, data loss of the upgrade data packet is avoided, the firmware program of the electric energy meter cannot be upgraded, and risks of abnormal attacks such as information interception, illegal code attack, repeated upgrade attack, resource repeated application attack, electric energy meter data tampering and the like in the upgrade process are also avoided.

Description

Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM
Technical Field
The invention relates to the technical field of instrument data safety, in particular to an electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM.
Background
A safety module and associated key management of a master station are added in an existing electric energy meter centralized reading system, the master station sends upgrade packet data processed by an asymmetric encryption algorithm to a concentrator, the master station sends a broadcast use key to an electric energy meter, the concentrator broadcasts and sends the electric energy meter upgrade packet data to the electric energy meter, the electric energy meter receives an upgrade data packet, the validity of data is verified by the asymmetric algorithm, the upgrade packets are received one by one until all the upgrade packets are received, the electric energy meter also verifies the validity and integrity of the data packet by the asymmetric algorithm, if all the data are legal and the data are complete, an electric energy meter firmware program is started for replacement, an upgraded electric energy meter firmware program is started and used, and the upgrade is completed.
The upgrade packet data comprises upgrade file information such as the size of an electric energy meter firmware upgrade packet, the size of an upgrade data frame and the like; the electric energy meter upgrading is mainly characterized in that an upgrading command is started through a master station, the master station transmits upgrading packet data to the electric energy meter, the master station sends and completes all data frames, the master station inquires upgrading bitmap information of the electric energy meter, checks whether unreceived data frames exist or not, conducts breakpoint continuous transmission until the complete upgrading packet data are completely received, the master station sets activation time of the electric energy meter, and the electric energy meter updates and uses a new program according to the set activation time. The upgrading packet data in the electric energy meter upgrading process is easy to be intercepted and falsified, so that abnormity is caused when the electric energy meter is started to be upgraded; point-to-point upgrading is adopted, upgrading efficiency is low, and batch upgrading time is long; the energy meter activation time is set in the master station, and the activation time is tampered, so that the energy meter activation time is abnormal.
Disclosure of Invention
The invention provides an electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM, which are used for solving the technical problems of abnormal attacks such as information interception, illegal code attack, repeated upgrading attack, repeated resource application attack, electric energy meter data tampering and the like in the existing electric energy meter firmware program upgrading process.
In order to achieve the above purpose, the invention provides the following technical scheme:
an ESAM-based electric energy meter firmware program upgrading method comprises the following steps:
s10, identity authentication is carried out between a master station and the electric energy meter, and if the master station passes the identity authentication, the master station transmits upgrade file information to the electric energy meter in a single point manner;
s20, the electric energy meter receives the upgrade file information, decrypts the upgrade file information and then performs MAC verification;
s30, if the upgrade file information passes MAC verification, the master station transmits an upgrade data packet of a firmware program to the electric energy meter in a broadcast mode;
s40, the electric energy meter receives the upgrading data packet, decrypts and verifies the upgrading data packet, and if verification is passed, the electric energy meter upgrades the firmware program according to the upgrading data packet;
in step S10, the master station encrypts the upgrade file information by using an ESAM security module and transmits the encrypted upgrade file information to the electric energy meter; in step S20, the electric energy meter decrypts the received upgrade file information by using the ESAM security module, and then performs MAC verification.
Preferably, in step S20, the step of receiving, by the electric energy meter, the upgrade file information, decrypting the upgrade file information, and then performing MAC verification includes:
decrypting the received upgrade file information by adopting an ESAM security module to obtain decrypted file information;
verifying whether the file information of the decrypted file information is consistent with the file information of the upgraded file information or not according to the file information;
if the decrypted file information is consistent with the file information of the upgrading file information, the upgrading file information passes MAC verification;
the file information comprises a file name, a file size, a file check code and a file transmission block.
Preferably, in step S30, if the decrypted file information is inconsistent with the file information of the upgrade file information, the upgrade file information is not verified by the MAC, and the electric energy meter cannot receive the upgrade data packet.
Preferably, after step S30, the step of the master station transmitting the upgrade data packet of the firmware program to the electric energy meter by broadcasting includes:
the master station acquires the upgrading data packet from the concentrator;
the master station blocks the upgrading data packet according to the transmission size and the transmission frame size to obtain blocked upgrading data;
and the master station transmits the serial number of the upgrading data, the CRC32 check code and the data content message to the electric energy meter in a broadcasting mode.
Preferably, in step S40, the step of receiving the upgrade data packet by the electric energy meter and verifying the upgrade data packet includes:
s41, the electric energy meter decrypts the received upgrading data packet to obtain a data frame CRC32 check code of the upgrading data, and also checks a CRC32 check code of the upgrading data;
and S42, checking the CRC32 check code of the upgrade data, storing the upgrade data with corresponding sequence numbers to a data file area of the electric energy meter according to the sequence numbers of the upgrade data to obtain upgrade bitmap information with corresponding sequence numbers, namely, the upgrade data packet passes the check.
Preferably, in step S42, the method further includes: and missing check is carried out on the data frames in the upgrade bitmap information, and the method specifically comprises the following steps:
according to the upgrade bitmap information, the electric energy meter sends an information check request to the master station, and the master station acquires electric energy meter bitmap information with corresponding serial numbers from the concentrator according to the information check request;
comparing the electric energy meter position map information with the data frames in the upgrade bitmap information, and if the data frames in the upgrade bitmap information are inconsistent with the electric energy meter position map information, completing the missing data frames in the upgrade bitmap information according to the step S30.
Preferably, in step S40, before the upgrading the firmware program according to the upgrade data package, the method further includes: the master station sets the upgrading time for activating the electric energy meter by adopting an ESAM (electronic security access module), and after the upgrading time, the electric energy meter is activated to upgrade the firmware program.
The invention also provides an electric energy meter firmware program upgrading device based on the ESAM, which comprises an identity authentication module, an information verification module, a file transmission module and a firmware upgrading module;
the identity authentication module is used for performing identity authentication between the master station and the electric energy meter, and if the identity authentication is passed, the master station transmits upgrade file information to the electric energy meter in a single point;
the information verification module is used for receiving the upgrade file information by the electric energy meter, decrypting the upgrade file information and then performing MAC verification;
the file transmission module is used for transmitting an upgrading data packet of a firmware program to the electric energy meter by the master station in a broadcasting mode according to the upgrading file information passing the MAC verification;
the firmware upgrading module is used for receiving the upgrading data packet by the electric energy meter, decrypting and verifying the upgrading data packet, and if the verification is passed, upgrading the firmware program according to the upgrading data packet by the electric energy meter;
in the identity authentication module, the ESAM security module is adopted in the master station to encrypt the upgrade file information and transmit the information to the electric energy; in the information verification module, the electric energy meter decrypts the received upgrade file information by adopting an ESAM security module and then performs MAC verification.
The present invention also provides a computer-readable storage medium for storing computer instructions, which, when run on a computer, cause the computer to perform the aforementioned method for updating an ESAM-based power meter firmware program.
The invention also provides terminal equipment, which comprises a processor and a memory;
the memory is used for storing program codes and transmitting the program codes to the processor;
and the processor is used for executing the ESAM-based electric energy meter firmware program upgrading method according to the instructions in the program codes.
According to the technical scheme, the embodiment of the invention has the following advantages: the electric energy meter firmware program upgrading method, device, medium and equipment based on the ESAM carry out transmission of upgrading file information through identity authentication of a master station and an electric energy meter, the upgrading file information transmitted by the master station and the upgrading file information received by the electric energy meter are encrypted and decrypted by adopting an ESAM safety module, the electric energy meter is ensured to receive only legal and correct upgrading file information, the master station transmits the upgrade data packet to the electric energy meter, the electric energy meter can upgrade the firmware program after decrypting and checking the upgrade data packet, integrity and reliability check of the upgrade data packet are realized, data loss of the upgrade data packet is avoided, the firmware program of the electric energy meter cannot be upgraded, and risks of abnormal attacks such as information interception, illegal code attack, repeated upgrade attack, resource repeated application attack, electric energy meter data tampering and the like in the upgrade process are also avoided; the technical problems of abnormal attacks such as information interception, illegal code attack, repeated upgrading attack, repeated resource application attack, electric energy meter data tampering and the like in the upgrading process of the firmware program of the conventional electric energy meter are solved.
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, and 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 these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating steps of a method for upgrading an electric energy meter firmware program based on an ESAM according to an embodiment of the present invention.
Fig. 2 is a flowchart of the step of verifying the upgrade data packet of the electric energy meter firmware program upgrading method based on the ESAM according to the embodiment of the present invention.
Fig. 3 is a block diagram of an electric energy meter firmware program upgrading device based on an ESAM according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below 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.
The embodiment of the application provides an electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM, and solves the technical problems of abnormal attacks such as information interception, illegal code attack, repeated upgrading attack, repeated resource application attack, electric energy meter data tampering and the like in the existing electric energy meter firmware program upgrading process.
The first embodiment is as follows:
fig. 1 is a flowchart illustrating steps of a method for upgrading an electric energy meter firmware program based on an ESAM according to an embodiment of the present invention.
As shown in fig. 1, an embodiment of the present invention provides an electric energy meter firmware program upgrading method based on an ESAM, including the following steps:
s10, identity authentication is carried out between the master station and the electric energy meter, and if the master station passes the identity authentication, the master station transmits upgrade file information to the electric energy meter in a single point manner;
s20, the electric energy meter receives the upgrade file information, decrypts the upgrade file information and then performs MAC verification;
s30, if the upgrade file information passes MAC verification, the master station transmits an upgrade data packet of the firmware program to the electric energy meter in a broadcasting mode;
s40, the electric energy meter receives the upgrading data packet, decrypts and verifies the upgrading data packet, and if verification is passed, the electric energy meter upgrades the firmware program according to the upgrading data packet;
in step S10, the master station encrypts the upgrade file information using the ESAM security module and transmits the encrypted upgrade file information to the electric energy meter; in step S20, the electric energy meter decrypts the received upgrade file information by using the ESAM security module, and then performs MAC verification.
In the embodiment of the invention, the ESAM-based electric energy meter firmware program upgrading method is mainly used for safety protection in the batch upgrading process of the electric energy meter firmware program, prevents the upgrading data packet from being falsified or illegal data attack, and improves the safety. The ESAM-based electric energy meter firmware program upgrading method adopts a broadcasting mode to upgrade in batches, and upgrading efficiency is improved.
In step S10 of the embodiment of the present invention, mainly, after the identity authentication between the master station and the electric energy meter is successful, the master station transmits the upgrade file information to the electric energy meter.
It should be noted that, the master station uses the ESAM security module to encrypt the transmitted upgrade file information, where the file information includes: file name, file size, file check code, file transfer block size, etc. In this embodiment, the master station mainly transmits the upgrade file information in a point-to-point manner through a data frame.
In step S20 of the embodiment of the present invention, the decryption and verification of the upgrade file information are mainly performed to identify whether the electric energy meter can receive the upgrade data packet, and the verification of the upgrade file information is mainly performed to determine whether the decrypted upgrade file information is consistent with the upgrade file information transmitted by the master station.
It should be noted that the setting of step S20 is mainly to prevent the upgrade file information itself from being tampered, and if the electric energy meter directly receives the upgrade data packet, the tampered upgrade data packet is easily received, so that the firmware program of the electric energy meter cannot be upgraded.
In step S30 of the embodiment of the present invention, the master station may transmit the upgrade data packet to the electric energy meter only if the upgrade file information passes the MAC verification of the electric energy meter.
In step S40 of the embodiment of the present invention, the electric energy meter mainly receives the upgrade data packet transmitted by the master station, the electric energy meter decrypts the upgrade data packet by using the ESAM security module, the decrypted upgrade data packet is verified, and only if the upgrade data packet passes the verification, the electric energy meter can upgrade the firmware program according to the upgrade data packet.
In the embodiment of the invention, the ESAM security module has the functions of identity authentication, data encryption and decryption, secure storage, communication confidentiality and the like, so that the data security performance can be controlled according to requirements.
It should be noted that the ESAM security module is a security access module formed by encapsulating a security chip with an operating system (COS) in a DIP8 or SOP8 module. The intelligent card is embedded into a water, electricity, gas and warm intelligent (card) meter, a set-top box, an intelligent electric appliance or other special equipment, and can complete various functions of encryption and decryption of data, bidirectional identity authentication, access authority control, communication line protection, temporary key export, data file storage and the like. For example, the security chips used by the high-tech ESAM security module are CIU51G16B chips.
The invention provides an electric energy meter firmware program upgrading method based on ESAM, which transmits upgrading file information through the identity authentication of a master station and an electric energy meter, wherein the upgrading file information transmitted by the master station and the upgrading file information received by the electric energy meter are encrypted and decrypted by an ESAM security module, so that the master station transmits an upgrading data packet to the electric energy meter only after the electric energy meter receives legal and correct upgrading file information, the electric energy meter decrypts and verifies the upgrading data packet and then upgrades the firmware program, the integrity and reliability of the upgrading data packet are checked, the data loss of the upgrading data packet is avoided, the firmware program of the electric energy meter cannot be upgraded, and the risks of abnormal attacks such as information interception, illegal code attack, repeated upgrading attack, resource repeated application attack, electric energy meter data tampering and the like in the upgrading process are also avoided; the technical problems of abnormal attacks such as information interception, illegal code attack, repeated upgrading attack, repeated resource application attack, electric energy meter data tampering and the like in the upgrading process of the firmware program of the conventional electric energy meter are solved.
In an embodiment of the present invention, in step S20, the step of receiving the upgrade file information and decrypting the upgrade file information by the electric energy meter and then performing MAC verification includes:
decrypting the received upgrade file information by adopting an ESAM security module to obtain decrypted file information;
verifying whether the file information of the decrypted file information is consistent with the file information of the upgraded file information or not according to the file information;
if the decrypted file information is consistent with the file information of the upgrading file information, the upgrading file information passes the MAC verification;
the file information comprises a file name, a file size, a file check code and a file transmission block.
In the embodiment of the present invention, in step S30, if the decrypted file information is inconsistent with the file information of the upgrade file information, the upgrade file information does not pass the MAC verification, and the electric energy meter cannot receive the upgrade data packet.
It should be noted that, whether the decrypted file information is consistent with the file information of the upgraded file information is verified according to the file name in the file information, so as to prevent the illegal file from attacking. The file size is used for distinguishing the file size of the file information transmission of the upgrade and confirming the file storage space. The file check code is mainly used for checking the content of the whole file after the electric energy meter receives all files of the upgrading data packet transmitted in a main station broadcasting mode, and therefore the situation that the upgrading file in the upgrading data packet is tampered, and the electric energy meter is illegally upgraded is avoided. In this embodiment, the electric energy meter receives the upgrade file information, decrypts the data content in the upgrade file information according to the ESAM security module, and then performs MAC verification, and only after the electric energy meter obtains correct upgrade file information, the electric energy meter starts upgrading to prepare for receiving the file content of the upgrade data packet transmitted by the master station, thereby ensuring the security of the upgrade data packet received by the electric energy meter, preventing illegal tampering, and ensuring the upgrade security.
In an embodiment of the present invention, after step S30, the step of the master station transmitting the upgrade data packet of the firmware program to the electric energy meter in a broadcast manner includes:
the master station acquires an upgrading data packet from the concentrator;
the master station blocks the upgrading data packet according to the transmission size and the transmission frame size to obtain blocked upgrading data;
and the master station transmits the serial number of the upgrading data, the CRC32 check code and the data content message to the electric energy meter in a broadcasting mode.
It should be noted that the master station blocks the file in the upgrade data packet according to the transmission size and the transmission frame size to obtain upgrade data, generates the serial number, the CRC32 check code, and the data content packet in the upgrade data into a corresponding data frame according to the file transmission block size, and transmits the data frame corresponding to the serial number, the CRC32 check code, and the data content packet to the electric energy meter by using a broadcast method. The concentrator is a central management device and a control device of a remote centralized meter reading system and is responsible for regularly reading terminal data, command transmission of the system, data communication, network management, event recording, transverse transmission of data and other functions.
Fig. 2 is a flowchart of the step of verifying the upgrade data packet of the electric energy meter firmware program upgrading method based on the ESAM according to the embodiment of the present invention.
As shown in fig. 2, in an embodiment of the present invention, in step S40, the step of receiving the upgrade data packet by the power meter and verifying the upgrade data packet includes:
s41, the electric energy meter decrypts the received upgrading data packet to obtain a data frame CRC32 check code of the upgrading data, and also checks a CRC32 check code of the upgrading data;
and S42, checking the CRC32 check code of the upgrade data, storing the upgrade data with the corresponding serial number into a data file area of the electric energy meter according to the serial number of the upgrade data to obtain upgrade bitmap information with the corresponding serial number, namely, the upgrade data packet passes the check.
It should be noted that, in step S41 and step S42, the CRC32 check code of the upgrade data is mainly checked to ensure the integrity of the upgrade data.
In step S42, the method further includes: missing check is performed on the data frames in the upgrade bitmap information, which specifically comprises the following steps:
according to the upgrade bitmap information, the electric energy meter sends an information check request to the master station, and the master station acquires the electric energy meter bitmap information with the corresponding serial number from the concentrator according to the information check request;
and comparing the electric energy meter bitmap information with the data frames in the upgrade bitmap information, and if the data frames in the upgrade bitmap information are inconsistent with the electric energy meter bitmap information, completing the missing data frames in the upgrade bitmap information according to the step S30.
It should be noted that, the electric energy meter firmware program upgrading method based on the ESAM adopts the checksum omission check in step S40 to ensure the information integrity of the upgrade data packet and the integrity and reliability of the file information in the upgrade data packet.
In the embodiment of the present invention, in step S40, before the upgrading the firmware program according to the upgrade data package, the method further includes: and the master station sets the upgrading time for activating the electric energy meter by adopting the ESAM safety module, and after the upgrading time, the electric energy meter is activated to upgrade the firmware program.
The electric energy meter can start the upgrading of the firmware program through activation, and the safety of the electric energy meter upgrading process is ensured.
Example two:
fig. 3 is a block diagram of an electric energy meter firmware program upgrading device based on an ESAM according to an embodiment of the present invention.
As shown in fig. 3, an embodiment of the present invention further provides an electric energy meter firmware program upgrading apparatus based on an ESAM, which includes an identity authentication module 10, an information verification module 20, a file transmission module 30, and a firmware upgrading module 40;
the identity authentication module 10 is used for performing identity authentication between the master station and the electric energy meter, and if the identity authentication is passed, the master station transmits upgrade file information to the electric energy meter in a single point;
the information verification module 20 is used for receiving the upgrade file information by the electric energy meter, decrypting the upgrade file information and then performing MAC verification;
the file transmission module 30 is used for transmitting the upgrading data packet of the firmware program to the electric energy meter by the master station in a broadcasting mode when the upgrading file information passes the MAC verification;
the firmware upgrading module 40 is used for receiving the upgrading data packet by the electric energy meter, decrypting and verifying the upgrading data packet, and if the verification is passed, upgrading the firmware program according to the upgrading data packet by the electric energy meter;
in the identity authentication module, the ESAM security module is adopted in the master station to encrypt the upgrade file information and transmit the information to the electric energy; in the information verification module, the electric energy meter decrypts the received upgrade file information by adopting an ESAM security module and then performs MAC verification.
It should be noted that the modules in the second embodiment correspond to the steps in the first embodiment, and the steps in the first embodiment have been described in detail in the first embodiment, and the contents of the modules in the second embodiment are not described in detail in this second embodiment.
Example three:
the embodiment of the invention provides a computer-readable storage medium, which is used for storing computer instructions, and when the computer-readable storage medium runs on a computer, the computer is enabled to execute the ESAM-based electric energy meter firmware program upgrading method.
Example four:
the embodiment of the invention provides terminal equipment, which comprises a processor and a memory;
a memory for storing the program code and transmitting the program code to the processor;
and the processor is used for executing the ESAM-based electric energy meter firmware program upgrading method according to the instructions in the program codes.
It should be noted that the processor is configured to execute the steps in the aforementioned embodiment of the method for upgrading the firmware program of the electric energy meter based on the ESAM according to the instructions in the program code. Alternatively, the processor, when executing the computer program, implements the functions of each module/unit in each system/apparatus embodiment described above.
Illustratively, a computer program may be partitioned into one or more modules/units, which are stored in a memory and executed by a processor to accomplish the present application. One or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the terminal device.
The terminal device may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that the terminal device is not limited and may include more or fewer components than those shown, or some components may be combined, or different components, e.g., the terminal device may also include input output devices, network access devices, buses, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage may be an internal storage unit of the terminal device, such as a hard disk or a memory of the terminal device. The memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal device. Further, the memory may also include both an internal storage unit of the terminal device and an external storage device. The memory is used for storing computer programs and other programs and data required by the terminal device. The memory may also be used to temporarily store data that has been output or is to be output.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. An ESAM-based electric energy meter firmware program upgrading method is characterized by comprising the following steps:
s10, identity authentication is carried out between a master station and the electric energy meter, and if the master station passes the identity authentication, the master station transmits upgrade file information to the electric energy meter in a single point manner;
s20, the electric energy meter receives the upgrade file information, decrypts the upgrade file information and then performs MAC verification;
s30, if the upgrade file information passes MAC verification, the master station transmits an upgrade data packet of a firmware program to the electric energy meter in a broadcast mode;
s40, the electric energy meter receives the upgrading data packet, decrypts and verifies the upgrading data packet, and if verification is passed, the electric energy meter upgrades the firmware program according to the upgrading data packet;
in step S10, the master station encrypts the upgrade file information by using an ESAM security module and transmits the encrypted upgrade file information to the electric energy meter; in step S20, the electric energy meter decrypts the received upgrade file information by using an ESAM security module and then performs MAC verification;
in step S20, the step of receiving the upgrade file information by the electric energy meter, decrypting the upgrade file information, and performing MAC verification includes:
decrypting the received upgrade file information by adopting an ESAM security module to obtain decrypted file information;
verifying whether the file information of the decrypted file information is consistent with the file information of the upgraded file information or not according to the file information;
if the decrypted file information is consistent with the file information of the upgrading file information, the upgrading file information passes MAC verification;
the file information comprises a file name, a file size, a file check code and a file transmission block;
in step S30, the step of the master station transmitting the upgrade data packet of the firmware program to the electric energy meter in a broadcast manner includes:
the master station acquires the upgrading data packet from the concentrator;
the master station blocks the upgrading data packet according to the transmission size and the transmission frame size to obtain blocked upgrading data;
the master station transmits the serial number of the upgrading data, the CRC32 check code and the data content message to the electric energy meter in a broadcasting mode;
in step S40, the step of receiving the upgrade data packet by the electric energy meter and verifying the upgrade data packet includes:
s41, the electric energy meter decrypts the received upgrading data packet to obtain a data frame CRC32 check code of the upgrading data, and also checks a CRC32 check code of the upgrading data;
s42, checking the CRC32 check code of the upgrade data, storing the upgrade data with corresponding sequence numbers to a data file area of the electric energy meter according to the sequence numbers of the upgrade data to obtain upgrade bitmap information with corresponding sequence numbers, namely, the upgrade data packet passes the check;
in step S42, the method further includes: and missing check is carried out on the data frames in the upgrade bitmap information, and the method specifically comprises the following steps:
according to the upgrade bitmap information, the electric energy meter sends an information check request to the master station, and the master station acquires electric energy meter bitmap information with corresponding serial numbers from the concentrator according to the information check request;
comparing the electric energy meter position map information with the data frames in the upgrade bitmap information, and if the data frames in the upgrade bitmap information are inconsistent with the electric energy meter position map information, completing the missing data frames in the upgrade bitmap information according to the step S30.
2. The ESAM-based power meter firmware program upgrading method according to claim 1, wherein in step S30, if the decrypted file information is not consistent with the file information of the upgrade file information, the upgrade file information is not verified by MAC, and the power meter cannot receive the upgrade data packet.
3. The ESAM-based power meter firmware program upgrading method according to claim 1, wherein in step S40, before the step of upgrading the firmware program by the power meter according to the upgrade data package, the method further comprises: the master station sets the upgrading time for activating the electric energy meter by adopting an ESAM (electronic security access module), and after the upgrading time, the electric energy meter is activated to upgrade the firmware program.
4. An electric energy meter firmware program upgrading device based on ESAM is characterized by comprising an identity authentication module, an information verification module, a file transmission module and a firmware upgrading module;
the identity authentication module is used for performing identity authentication between the master station and the electric energy meter, and if the identity authentication is passed, the master station transmits upgrade file information to the electric energy meter in a single point;
the information verification module is used for receiving the upgrade file information by the electric energy meter, decrypting the upgrade file information and then performing MAC verification;
the file transmission module is used for transmitting an upgrading data packet of a firmware program to the electric energy meter by the master station in a broadcasting mode according to the upgrading file information passing the MAC verification;
the firmware upgrading module is used for receiving the upgrading data packet by the electric energy meter, decrypting and verifying the upgrading data packet, and if the verification is passed, upgrading the firmware program according to the upgrading data packet by the electric energy meter;
in the identity authentication module, the ESAM security module is adopted in the master station to encrypt the upgrade file information and transmit the information to the electric energy meter; in the information verification module, the electric energy meter decrypts the received upgrade file information by adopting an ESAM (electronic service access module) security module and then performs MAC verification, the information verification module decrypts the received upgrade file information by adopting the ESAM security module to obtain decrypted file information, and if the decrypted file information is verified to be consistent with the file information of the upgrade file information according to the file information, the upgrade file information passes MAC verification;
the file information comprises a file name, a file size, a file check code and a file transmission block;
the step that the master station transmits the upgrading data packet of the firmware program to the electric energy meter in a broadcasting mode comprises the following steps:
the master station acquires the upgrading data packet from the concentrator;
the master station blocks the upgrading data packet according to the transmission size and the transmission frame size to obtain blocked upgrading data;
the master station transmits the serial number of the upgrading data, the CRC32 check code and the data content message to the electric energy meter in a broadcasting mode;
the step of receiving the upgrade data packet by the electric energy meter and checking the upgrade data packet comprises the following steps:
the electric energy meter decrypts the received upgrading data packet to obtain a data frame CRC32 check code of the upgrading data, and also checks a CRC32 check code of the upgrading data;
the CRC32 check code of the upgrade data passes the check, the upgrade data with the corresponding serial number is stored in the data file area of the electric energy meter according to the serial number of the upgrade data, and the upgrade bitmap information with the corresponding serial number is obtained, namely the upgrade data packet passes the check;
and missing check is carried out on the data frames in the upgrade bitmap information, and the method specifically comprises the following steps:
according to the upgrade bitmap information, the electric energy meter sends an information check request to the master station, and the master station acquires electric energy meter bitmap information with corresponding serial numbers from the concentrator according to the information check request;
and comparing the electric energy meter position map information with the data frames in the upgrading bitmap information, and if the data frames in the upgrading bitmap information are inconsistent with the electric energy meter position map information, completing the missing data frames in the upgrading bitmap information according to the file transmission module.
5. A computer-readable storage medium for storing computer instructions which, when executed on a computer, cause the computer to perform the ESAM-based power meter firmware program upgrade method according to any one of claims 1 to 3.
6. A terminal device comprising a processor and a memory;
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is used for executing the ESAM-based electric energy meter firmware program upgrading method according to any one of claims 1 to 3 according to the instructions in the program codes.
CN202011539419.6A 2020-12-23 2020-12-23 Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM Active CN112688942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011539419.6A CN112688942B (en) 2020-12-23 2020-12-23 Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011539419.6A CN112688942B (en) 2020-12-23 2020-12-23 Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM

Publications (2)

Publication Number Publication Date
CN112688942A CN112688942A (en) 2021-04-20
CN112688942B true CN112688942B (en) 2022-02-11

Family

ID=75451199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011539419.6A Active CN112688942B (en) 2020-12-23 2020-12-23 Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM

Country Status (1)

Country Link
CN (1) CN112688942B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113949733B (en) * 2021-08-31 2023-08-01 宁波三星智能电气有限公司 Firmware upgrading method of electric energy meter

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717252A (en) * 2013-12-16 2015-06-17 国家电网公司 Power line carrier remote upgrading method and terminal
CN105930193A (en) * 2016-05-05 2016-09-07 国网重庆市电力公司电力科学研究院 Operating system based energy meter software online upgrade method and system
CN106485140A (en) * 2016-10-17 2017-03-08 中国电力科学研究院 A kind of upgrade method of electric energy meter and upgrade-system
CN111030817A (en) * 2019-12-27 2020-04-17 广东电科院能源技术有限责任公司 Method for safely transmitting file between transformer area terminal and electric energy meter and transformer area terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10430263B2 (en) * 2016-02-01 2019-10-01 Electro Industries/Gauge Tech Devices, systems and methods for validating and upgrading firmware in intelligent electronic devices
CN111225414B (en) * 2018-11-26 2023-09-08 中兴通讯股份有限公司 Multimode communication device, communication method thereof and multimode communication system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717252A (en) * 2013-12-16 2015-06-17 国家电网公司 Power line carrier remote upgrading method and terminal
CN105930193A (en) * 2016-05-05 2016-09-07 国网重庆市电力公司电力科学研究院 Operating system based energy meter software online upgrade method and system
CN106485140A (en) * 2016-10-17 2017-03-08 中国电力科学研究院 A kind of upgrade method of electric energy meter and upgrade-system
CN111030817A (en) * 2019-12-27 2020-04-17 广东电科院能源技术有限责任公司 Method for safely transmitting file between transformer area terminal and electric energy meter and transformer area terminal

Also Published As

Publication number Publication date
CN112688942A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
EP2884692B1 (en) Updating software on a secure element
CN109743176B (en) POS terminal certificate updating method, server and POS terminal
CN101828357B (en) Credential provisioning method and device
CN110621014B (en) Vehicle-mounted equipment, program upgrading method thereof and server
CN103136463A (en) System and method for temporary secure boot process of an electronic device
CN111162911B (en) PLC firmware upgrading system and method
CN110598429B (en) Data encryption storage and reading method, terminal equipment and storage medium
CN103269271A (en) Method and system for back-upping private key in electronic signature token
CN112217795B (en) Method and device for managing communication security of intelligent electric meter
CN111143856A (en) PLC remote firmware upgrading system and method
CN112882750A (en) OTA upgrade package processing method and device and electronic equipment
CN105099705A (en) Safety communication method and system based on USB protocol
CN106067205A (en) A kind of gate inhibition's method for authenticating and device
CN109214221B (en) Authentication method of identity card reader, upper computer and identity card reader
CN112346759A (en) Firmware upgrading method and device and computer readable storage medium
CN112311718A (en) Method, device and equipment for detecting hardware and storage medium
CN111147259B (en) Authentication method and device
CN109508529B (en) Method for realizing safety starting verification of payment terminal
CN112688942B (en) Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM
CN102831357B (en) Encryption and authentication protection method and system of secondary development embedded type application program
CN107026730A (en) Data processing method, apparatus and system
CN109194467A (en) A kind of safe transmission method and system of encryption data
CN102012978B (en) Method and system for safely upgrading ISO (International Standard Code) file
CN111783120A (en) Data interaction method, computing device, BMC chip and electronic device
CN112769764A (en) Metering data transmission key storage method of instrument and transmission method and device thereof

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
GR01 Patent grant
GR01 Patent grant