A secure communication authentication method for Bluetooth communication electric energy meter based on 3DES
Through the Bluetooth communication authentication method based on 3DES, the problems of inconvenience and data insecurity of power meter communication are solved, the convenience of electricity bill payment and data protection are realized, the security of power meter data is ensured, and the cost is reduced.
Patent Information
- Application Number
- CN202211207016.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-09-30
AI Technical Summary
In the prior art, power meter communication is inconvenient and data is insecure, which makes it impossible to achieve convenient power purchase operations while ensuring data protection and encryption.
Using the Bluetooth communication authentication method based on 3DES, the MAC address and BCD address encoding of the power meter are obtained through the mobile terminal, the Bluetooth communication channel is established, and the secure communication authentication is performed. The data is encrypted using the 3DES algorithm to ensure the security of the power meter data.
It realizes the convenience of electricity bill payment and data security, ensures the protection of electricity meter data, strengthens communication security, and reduces costs.
Smart Images

Figure CN115915078B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart electric meters, and in particular relates to a secure communication authentication method for a Bluetooth communication electric energy meter based on 3DES. Background Art
[0002] At present, the widely used IC card prepaid energy meter function requires users to take the card to a designated location to recharge and pay, and then insert the card into the card slot of the energy meter to charge the energy meter with electricity or electricity fees. This method is not only inconvenient for users to purchase electricity, but also requires the electricity seller to be equipped with special card reading and writing equipment and electricity sales software, and also needs to arrange special electricity sales personnel to perform electricity sales operations, which is relatively costly.
[0003] As a small-range wireless connection technology, Bluetooth can realize convenient, fast, flexible, safe, low-cost, and low-power data and voice communications between devices. Therefore, it is one of the mainstream technologies for realizing wireless personal area network communications. Connecting with other networks can bring wider applications. It is a cutting-edge open wireless communication that enables various digital devices to communicate wirelessly. It is a kind of wireless network transmission technology. The new generation of electric energy meters usually use Bluetooth communication to purchase electricity and view electricity consumption. Although this method is convenient, the security of electric energy meter data cannot be guaranteed. The patent with publication number CN112399393A provides an intelligent electric energy meter device and its communication method. The system includes an electric energy meter, an intelligent miniature circuit breaker, a terminal module and a Bluetooth module; the Bluetooth module adopts two modes of Bluetooth module or SOC, wherein the SOC mode is that the electric energy meter itself integrates the Bluetooth protocol stack; the Bluetooth module includes a first Bluetooth module and a second Bluetooth module. When the Bluetooth module is used, the electric energy meter is connected to the intelligent miniature circuit breaker and the slave device through the first Bluetooth module; the electric energy meter is connected to the terminal module through the first Bluetooth module and the second Bluetooth module in turn. This patent relies on Bluetooth technology to achieve data interaction, but there is no solution for encryption and protection of electricity meter data.
[0004] Therefore, how to achieve convenient communication and electricity purchase of electric energy meters while protecting and encrypting the electric energy meter data is an urgent problem to be solved by personnel in this technical field. Summary of the invention
[0005] In view of the deficiencies in the prior art, the purpose of the present invention is to provide a Bluetooth communication electric energy meter security communication authentication method based on 3DES to solve the problems in the prior art of inconvenient communication and electricity purchase of electric energy meters and insecure data of electric energy meters.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] The present invention provides a Bluetooth communication electric energy meter security communication authentication method based on 3DES, comprising the following steps:
[0008] S10, the mobile terminal obtains the MAC address of the Bluetooth communication module inside the electric energy meter and the BCD electric energy meter address code of the system displacement;
[0009] S20, the mobile terminal establishes a Bluetooth communication channel with the electric energy meter;
[0010] S30, the mobile terminal initiates a secure communication authentication application data frame to the electric energy meter, and the electric energy meter that receives the application returns a random number R0 with a specified byte to the mobile terminal;
[0011] S40, after receiving the designated byte random number R0, the mobile terminal mixes the received R0 with the designated byte's own date and time T0 byte by byte to obtain a data segment M0 with double the designated bytes;
[0012] S50, the mobile terminal encrypts the M0 using a 3DES algorithm to form an encrypted data segment P0 of double designated bytes;
[0013] S60, after receiving P0, the electric energy meter decrypts P0 according to the 3DES algorithm to obtain a data segment M1 with double designated bytes;
[0014] S70, reversely unmixing the M1 to obtain a designated byte random number R1 and the designated byte's own date and time T1;
[0015] S80, performing secure communication authentication by comparing R1 and R0, T1 and T0, and returning an authentication failure data frame or performing subsequent application communication.
[0016] Furthermore, R1 is compared with R0. If they are different, an authentication failure data frame is replied and the Bluetooth communication connection is disconnected. If they are the same, T1 and T0 are continued to be compared. If the difference between T1 and T0 is within 5 minutes, a confirmation frame is replied and subsequent application communication is performed. If the difference between T1 and T0 is greater than or equal to 5 minutes or the date and time is illegal, an authentication failure data frame is replied and the Bluetooth communication connection is disconnected.
[0017] Furthermore, in step S40, the mixed method is to use the highest byte of R0 as the highest byte of M0, and the lowest byte of T0 as the second highest byte of M0, and so on to obtain the M0 of the data segment of double the specified bytes.
[0018] Furthermore, in step S50, the key used for 3DES algorithm encryption in the mobile terminal is sent to the mobile terminal by the remote server through 4G / 5G communication according to the keys K1, K2, and K3 in the electric energy meter recorded in the database.
[0019] Furthermore, the data frames of subsequent application communications are encrypted in accordance with the 3DES encryption method, using the K1, K2, and K3 as encryption keys to encrypt user data in units of specified bytes.
[0020] Furthermore, in step S80, after the mobile terminal and the electric energy meter complete the secure communication authentication, the remote server can send the new keys S1, S2, and S3 to the mobile terminal through 4G / 5G communication, and the mobile terminal sends them to the electric energy meter through Bluetooth communication. The electric energy meter stores the new keys S1, S2, and S3 and uses them as encryption keys during the next Bluetooth authentication communication.
[0021] Furthermore, in step S40, T0 is year, month, day, hour, minute, second, and week in the form of BCD code.
[0022] Furthermore, before step S10, the Bluetooth device needs to be set to a host mode through the mobile terminal.
[0023] Furthermore, the electric energy meter adopts the SOC microcontroller RN8211B with an ARM Cortex M0 CPU core as a main controller, and has a built-in metering IP core and an RTC module with temperature compensation.
[0024] Furthermore, the model of the Bluetooth communication module in the electric energy meter is WS8100.
[0025] Compared with the prior art, the 3DES-based Bluetooth communication electric energy meter security communication authentication method provided by the present invention has at least the following beneficial effects:
[0026] The present invention has simple steps and a quick process. A connection is established with a mobile terminal through a low-power Bluetooth communication module. A user can view the electric energy meter data in real time and pay the electricity bill through the mobile terminal. The 3DES algorithm is used to encrypt the electric energy meter data to ensure the security of the electric energy meter data. The entire method is safe and convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the scheme of the present invention, a brief introduction is given below to the figures required for use in the description of the embodiments. Obviously, the figures described below are some embodiments of the present invention. For ordinary technicians in this field, other figures can be obtained based on these figures without paying any creative work.
[0028] Figure 1 A flowchart of a 3DES-based Bluetooth communication electric energy meter security communication authentication method provided in an embodiment of the present invention;
[0029] Figure 2A schematic diagram of a hybrid method in step S40 of a 3DES-based Bluetooth communication electric energy meter secure communication authentication method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0032] The present invention provides a Bluetooth communication electric energy meter security communication authentication method based on 3DES, which is applied to the communication and measurement of smart electric meters. The Bluetooth communication electric energy meter security communication authentication method based on 3DES includes the following steps:
[0033] S10, the mobile terminal obtains the MAC address of the Bluetooth communication module inside the electric energy meter and the BCD electric energy meter address code of the system displacement;
[0034] S20, the mobile terminal establishes a Bluetooth communication channel with the electric energy meter;
[0035] S30, the mobile terminal initiates a secure communication authentication application data frame to the electric energy meter, and the electric energy meter that receives the application returns a random number R0 with a specified byte to the mobile terminal;
[0036] S40, after receiving the designated byte random number R0, the mobile terminal mixes the received R0 with the designated byte's own date and time T0 byte by byte to obtain a data segment M0 with double the designated bytes;
[0037] S50, the mobile terminal encrypts the M0 using a 3DES algorithm to form an encrypted data segment P0 of double designated bytes;
[0038] S60, after receiving P0, the electric energy meter decrypts P0 according to the 3DES algorithm to obtain a data segment M1 with double designated bytes;
[0039] S70, reversely unmixing the M1 to obtain a designated byte random number R1 and the designated byte's own date and time T1;
[0040] S80, performing secure communication authentication by comparing R1 and R0, T1 and T0, and returning an authentication failure data frame or performing subsequent application communication.
[0041] The present invention has simple steps and a quick process. A connection is established with a mobile terminal through a low-power Bluetooth communication module. A user can view the electric energy meter data in real time and pay the electricity bill through the mobile terminal. The 3DES algorithm is used to encrypt the electric energy meter data to ensure the security of the electric energy meter data. The entire method is safe and convenient.
[0042] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings.
[0043] The present invention provides a method for secure communication authentication of a Bluetooth communication energy meter based on 3DES. 3DES (or Triple DES) is the general name for a triple data encryption algorithm (TDEA) block cipher, which is applied to the communication and metering of smart meters. In this embodiment, the Bluetooth prepaid electronic energy meter for secure communication authentication uses the SOC single-chip microcomputer RN8211B with an ARM Cortex M0 CPU core as the main controller, with a built-in metering IP core and an RTC module with temperature compensation. There is no need to configure a dedicated energy metering chip and a real-time clock chip. The real-time clock is powered by a lithium battery. In terms of communication mode, the commonly used RS-485 bus communication mode is cancelled and replaced by Bluetooth communication. The Bluetooth communication module uses Yongfengxiang's WS8100. The Bluetooth module is a slave device that continuously broadcasts outward and waits for the host to connect. A QR code containing the MAC address of the built-in Bluetooth module of the energy meter and the address code of the energy meter is printed on the panel of the energy meter. The mobile terminal is a mobile phone, and the specific operation is in the mobile phone APP. The mobile phone APP is a WeChat applet. Figure 1 and Figure 2 The 3DES-based Bluetooth communication electric energy meter security communication authentication method comprises the following steps:
[0044] S10. The WeChat applet obtains the MAC address of the Bluetooth communication module inside the electric energy meter and the system's unique 12-bit BCD electric energy meter address code by scanning the QR code on the electric energy meter nameplate;
[0045] Before this step, the Bluetooth communication module on the energy meter is in slave broadcast state, and the WeChat applet first sets the Bluetooth device to host mode.
[0046] S20, the user establishes a Bluetooth communication connection with the built-in Bluetooth communication module of the electric energy meter through the WeChat applet according to the normal connection process of Bluetooth communication specified in IEEE 802.15.1 to form a Bluetooth communication channel;
[0047] In this scenario, the electric energy meter needs to respond to the Bluetooth connection request of the WeChat applet. At this time, the Bluetooth communication PIN code is known to the WeChat applet. The Bluetooth communication PIN code alone is not sufficient to encrypt the communication. Any external device can communicate with the electric energy meter, posing a security risk to the stable operation of the electric energy meter. Therefore, appropriate methods must be adopted to encrypt the user data frames during communication, that is, to ensure that the WeChat applet or external device that communicates with the electric energy meter through Bluetooth is authorized, and unauthorized external devices are not allowed to operate the electric energy meter through Bluetooth communication.
[0048] The WeChat applet transmits the address code of the Bluetooth prepaid electronic electricity meter to the remote server through the 4G / 5G communication network. The remote server obtains the 3DES key data K1, K2, and K3 stored in the Bluetooth prepaid electronic electricity meter from the database based on the electricity meter address code, and then transmits it to the WeChat applet.
[0049] S30: The WeChat applet actively initiates a secure communication authentication application data frame. If there is no response for more than 3 seconds, the Bluetooth communication connection is disconnected.
[0050] At this time, the data frame is sent in plain text. After the Bluetooth prepaid electronic energy meter receives the secure communication authentication application data frame, it will return a data frame with an 8-byte random number R0 to the WeChat applet.
[0051] S40, after receiving the 8-byte random number R0, the WeChat applet mixes the received 8-byte random number R0 with the 8-byte date and time T0 byte by byte;
[0052] Mixed methods such as Figure 2 As shown, the highest byte of the random number R0 is used as the highest byte of M0, the lowest byte of T0 is used as the second highest byte of M0, and so on. In this way, a 16-byte mixed data segment M0 is obtained. The 8-byte real-time date and time T0 is a BCD code format of year (2 bytes, such as 2022), month (1 byte, such as September), day (1 byte), hour (1 byte), minute (1 byte), second (1 byte), and day of the week (1 byte, such as 01 for Monday).
[0053] S50. The WeChat applet uses the 3DES algorithm to encrypt the 16-byte data segment M0 to form an encrypted 16-byte data segment P0. The three-level keys K1, K2, and K3 used in the 3DES encryption process are all different. The mobile phone APP then sends the encrypted 16-byte data segment P0 to the electric energy meter in the form of a communication data frame.
[0054] S60. After receiving the 16-byte encrypted data segment P0, the electric energy meter decrypts P0 according to the 3DES algorithm, and obtains the 16-byte data segment M1 after decryption;
[0055] S70, and then the 16-byte data segment M1 is processed according to Figure 2 The method shown is used to perform reverse unmixing to obtain an 8-byte random number R1 and an 8-byte date and time T1;
[0056] S80. After the electric energy meter obtains R1, it compares it with R0. If they are the same, it proceeds to the next step. If they are different, it replies with an authentication failure data frame and disconnects the Bluetooth communication connection. When R0 and R1 are the same, the electric energy meter will obtain T1 and compare it with its own 8-byte date and clock T2. If the difference between T1 and T2 is within 5 minutes, it replies with a confirmation frame. If the difference is greater than or equal to 5 minutes or the date and time is illegal, it replies with an authentication failure data frame and disconnects the Bluetooth communication connection, ending this security communication authentication. The mobile phone APP should prompt the user to synchronize the GPS time of the mobile phone. After completing the security communication authentication, subsequent application communications can be carried out. The data frames of subsequent application communications are encrypted in accordance with the above-mentioned 3DES encryption method, with K1, K2, and K3 as encryption keys, to encrypt user data in units of 8 bytes. The above-mentioned 3DES encryption algorithm meets the requirements of FIPS46-3.
[0057] In addition, if the electric energy meter does not detect the data frame of the Bluetooth communication within 5 minutes or detects that the Bluetooth communication connection is disconnected, the Bluetooth communication module is reset and restarted.
[0058] To further ensure the security of Bluetooth communication, after the WeChat applet completes secure communication authentication with the energy meter, during normal application communication, the server can replace the 3DES encryption key stored in the energy meter. For example, after the WeChat applet completes secure communication authentication with the energy meter, during normal application communication, the remote server can send new keys S1, S2, and S3 to the WeChat applet through 4G / 5G communication, and the WeChat applet then sends the new keys S1, S2, and S3 to the energy meter through Bluetooth communication. The energy meter stores this set of keys S1, S2, and S3, and uses them as encryption keys during the next Bluetooth authentication communication.
[0059] The 3DES-based Bluetooth communication electric energy meter security communication authentication method in the above embodiment has simple steps and a quick process. It establishes a connection with the mobile phone APP through a low-power Bluetooth communication module. The user can view the electric energy meter data in real time and pay the electricity bill through the mobile phone APP. The 3DES algorithm is used to encrypt the electric energy meter data to ensure the security of the electric energy meter data. When the Bluetooth communication connection is disconnected and reconnected, the authentication process needs to be re-performed and a new key is required, which further enhances the security of the electric energy meter data. The entire method has high safety performance and meets the daily operation needs and data protection needs of the user's electric energy meter.
[0060] Obviously, the embodiments described above are only preferred embodiments of the present invention, rather than all embodiments. The preferred embodiments of the present invention are shown in the accompanying drawings, but they do not limit the patent scope of the present invention. The present invention can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive. Although the present invention has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific embodiments, or to perform equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of the present invention, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present invention.
Claims
1. A Bluetooth communication electric energy meter security communication authentication method based on 3DES, characterized in that: The following steps are involved: S10, the mobile terminal obtains the MAC address of the Bluetooth communication module inside the electric energy meter and the BCD electric energy meter address code of the system displacement; S20, the mobile terminal establishes a Bluetooth communication channel with the electric energy meter; S30, the mobile terminal initiates a secure communication authentication application data frame to the electric energy meter, and the electric energy meter that receives the application returns a random number R0 with a specified byte to the mobile terminal; S40, after receiving the designated byte random number R0, the mobile terminal mixes the received R0 with the designated byte's own date and time T0 byte by byte to obtain a data segment M0 with double the designated bytes; S50, the mobile terminal encrypts the M0 using a 3DES algorithm to form an encrypted data segment P0 of double designated bytes; S60, after receiving P0, the electric energy meter decrypts P0 according to the 3DES algorithm to obtain a data segment M1 with double designated bytes; S70, reversely unmixing the M1 to obtain the specified byte random number R1 and the specified byte's own date and time T1; S80, performing secure communication authentication by comparing R1 and R0, T1 and T0, and returning an authentication failure data frame or performing subsequent application communication.
2. According to claim 1, a Bluetooth communication electric energy meter security communication authentication method based on 3DES is characterized in that: In step S80, R1 is compared with R0. If they are different, an authentication failure data frame is replied and the Bluetooth communication connection is disconnected. If they are the same, T1 and T0 are continued to be compared. If the difference between T1 and T0 is within 5 minutes, a confirmation frame is replied and subsequent application communication is performed. If the difference between T1 and T0 is greater than or equal to 5 minutes or the date and time is illegal, an authentication failure data frame is replied and the Bluetooth communication connection is disconnected.
3. A 3DES Bluetooth communication electric energy meter security communication authentication method according to claim 1, characterized in that: In step S40, the received R0 and the specified byte's own date and time T0 are mixed byte by byte by using the highest byte of R0 as the highest byte of M0, and the lowest byte of T0 as the second highest byte of M0, and so on to obtain the M0 of the data segment with double the specified bytes.
4. According to claim 1, a Bluetooth communication electric energy meter security communication authentication method based on 3DES is characterized in that: In step S50, the key used for 3DES algorithm encryption in the mobile terminal is sent to the mobile terminal by the remote server through 4G / 5G communication according to the keys K1, K2, and K3 in the electric energy meter recorded in the database.
5. A 3DES Bluetooth communication electric energy meter security communication authentication method according to claim 4, characterized in that: The data frames of subsequent application communications are encrypted in accordance with the 3DES encryption method, using the K1, K2, and K3 as encryption keys to encrypt user data in units of specified bytes.
6. A 3DES Bluetooth communication electric energy meter security communication authentication method according to claim 1, characterized in that: In step S80, after the mobile terminal and the electric energy meter complete the secure communication authentication, the remote server can send the new keys S1, S2, and S3 to the mobile terminal through 4G / 5G communication, and the mobile terminal sends them to the electric energy meter through Bluetooth communication. The electric energy meter stores the new keys S1, S2, and S3 and uses them as encryption keys during the next Bluetooth authentication communication.
7. A 3DES Bluetooth communication electric energy meter security communication authentication method according to claim 1, characterized in that: In step S40, T0 is year, month, day, hour, minute, second, and week in BCD code format.
8. A 3DES Bluetooth communication electric energy meter security communication authentication method according to claim 1, characterized in that: Before step S10, the Bluetooth device needs to be set to host mode through the mobile terminal.
9. A 3DES Bluetooth communication electric energy meter security communication authentication method according to claim 1, characterized in that: The electric energy meter adopts the SOC single-chip microcomputer RN8211B with ARM Cortex M0 CPU core as the main controller, and has a built-in metering IP core and an RTC module with temperature compensation.
10. A 3DES Bluetooth communication electric energy meter security communication authentication method according to claim 9, characterized in that: The model of the Bluetooth communication module in the electric energy meter is WS8100.
