Intelligent electric meter data transmission method and system and storage medium

By employing AES encryption and HTTPS protocol on smart meter data, combined with STM32 chips and RS-485 serial communication, the problem of easy leakage of static key management is solved, realizing secure and efficient transmission and analysis of smart meter data, improving the operating efficiency of the power system and protecting user privacy.

CN120979700APending Publication Date: 2025-11-18ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID SHANDONG ELECTRIC POWER COMPANY +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511042830.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

The existing static key management method of smart meters is prone to leakage, cannot meet the high security requirements under complex network attacks, and is difficult to guarantee the privacy and non-repudiation of communication data.

Method used

The user's electricity consumption data is encrypted using the AES symmetric encryption algorithm and transmitted to the power system through the smart home system. Combined with the STM32 chip and RS-485 serial communication, the HTTPS protocol is used to ensure the security and integrity of data transmission.

Benefits of technology

It enables rapid transmission and secure analysis of user electricity consumption data, improves data transmission security, protects user privacy, and optimizes the operating efficiency of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120979700A_ABST
    Figure CN120979700A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent electric meter data transmission method and system and a storage medium, which are used for communication between an intelligent electric meter and a power system, and the method comprises the following steps: extracting user power consumption data collected by the intelligent electric meter; encrypting the user power consumption data by adopting a symmetric encryption algorithm to obtain user power consumption encrypted data; sending the user electricity utilization encrypted data to the smart home system; based on the smart home system, the user electricity consumption encryption data is sent to the power system, the encrypted user electricity consumption data is transmitted to the smart home system of the user from the smart electric meter, rapid data transmission can be achieved, meanwhile, the smart home system can further process and analyze the user electricity consumption data, and the user electricity consumption data can be conveniently and rapidly transmitted. And the power utilization data transmission security of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power grid information security technology, specifically relating to smart meter data transmission methods, systems, and storage media. Background Technology

[0002] In smart grids, smart meters, in addition to the basic metering functions of traditional electricity meters, also have data acquisition, remote communication and control functions. In order to ensure the privacy, legality and non-repudiation of the communication data exchange process when smart meters communicate with the master station through the base station, their security key management is crucial.

[0003] In related technologies, static key management is usually used to manage keys. However, static key management has drawbacks such as keys remaining unchanged for a long time, being prone to leakage, and requiring manual intervention for updates. It is difficult to cope with complex network attacks and cannot meet the high security requirements of smart meter data transmission. Summary of the Invention

[0004] The purpose of this invention is to provide a smart meter data transmission method that can meet the high security requirements of smart meter data transmission, thereby providing guidance for power management, billing, and grid optimization.

[0005] To achieve the above objectives, this invention proposes a smart meter data transmission method for communication between the smart meter and the power system. The method includes: extracting user electricity consumption data collected by the smart meter; encrypting the user electricity consumption data using a symmetric encryption algorithm to obtain encrypted user electricity consumption data; sending the encrypted user electricity consumption data to a smart home system; and sending the encrypted user electricity consumption data to the power system based on the smart home system.

[0006] In one optional implementation, the user's electricity consumption data is encrypted to obtain encrypted user electricity consumption data. Specifically, this includes: verifying the validity of the verification code of the user's electricity consumption data; if valid, encrypting the data using the AES encryption algorithm to obtain the encrypted user electricity consumption data.

[0007] In one optional implementation, the user's electricity consumption data is encrypted using an encryption function combined with the AES encryption algorithm. The encryption function is AES_ECB_Encrypt(plainText, key, cipherText); where plainText represents the user's electricity consumption data to be encrypted, and its length is an integer multiple of the AES block size; key represents the encryption key, which supports a length of 128 bits, 192 bits, or 256 bits; and cipherText represents the output parameter used to store the encrypted ciphertext, and the length of cipherText is the same as the length of plainText.

[0008] In one alternative implementation, the encryption function is located on the communication module of the STM32 chip.

[0009] In one alternative implementation, the user's encrypted power consumption data is transmitted via a DMA mechanism.

[0010] In an optional implementation, any of the smart meter data transmission methods further includes: the smart meter transmitting the user's electricity data to the power system via RS-485 serial communication using the DL / T 645 protocol.

[0011] In one alternative implementation, the smart home system transmits the encrypted user electricity consumption data to the power system based on the HTTP transmission protocol.

[0012] In one optional implementation, the smart home system transmits the encrypted user electricity consumption data to the power system based on the HTTP transmission protocol. Specifically, this includes: when a client initiates a request to the server, the server returns a digital certificate containing a public key; after the client verifies the legitimacy of the digital certificate containing the public key, it uses the public key from the digital certificate to encrypt a randomly generated symmetric key; the encrypted symmetric key is sent to the server; the server uses its private key to decrypt and obtain the symmetric key; and the client and the server use the symmetric key to encrypt the transmitted encrypted user electricity consumption data.

[0013] The present invention also provides a smart meter data transmission system, comprising: a smart meter adapted to collect user electricity consumption data; a communication module communicatively connected to the smart meter, the communication module being adapted to receive the user electricity consumption data and encrypt the user electricity consumption data using a symmetric encryption algorithm to obtain encrypted user electricity consumption data, and sending it to a smart home system; the smart home system being communicatively connected to the communication module and adapted to send the encrypted user electricity consumption data to the power system.

[0014] In one optional implementation, the communication module includes an STM32 chip to verify the validity of the verification code of the user's power consumption data. If valid, the data is encrypted using the AES encryption algorithm to obtain the encrypted user power consumption data, and the encrypted user power consumption data is sent via a DMA mechanism.

[0015] In one optional implementation, the smart meter data transmission system further includes an RS-485 transceiver. The smart meter transmits the user's electricity consumption data to the RS-485 transceiver via an RS-485 bus using differential signal transmission. The RS-485 transceiver converts the differential signal into a TTL level signal and then transmits it to the STM32 chip.

[0016] In one optional implementation, the STM32 chip has GPIO pins, and the RS-485 transceiver has DE / RE pins. The DE / RE pins are communicatively connected to the GPIO pins, so that the STM32 chip controls the transmit and receive modes of the RS-485 transceiver.

[0017] In one optional implementation, the communication module further includes an ESP32 chip to send the encrypted user power consumption data to the smart home system via Bluetooth communication.

[0018] In an optional implementation, the smart meter data transmission system further includes an HTTP transmission protocol network topology, wherein the HTTPS transmission protocol network topology includes: a cloud; a power system client, which communicates with the cloud via the HTTPS protocol to query power data; a smart home system, which communicates with the cloud via the HTTPS protocol to periodically or according to specific events send the encrypted user electricity consumption data collected by the smart meter to the cloud; and a power company, which communicates with the cloud to obtain data uploaded by the smart home system and processed by the cloud.

[0019] In an optional embodiment, the smart meter data transmission system of any one of the claims is characterized in that it further includes an electricity consumption information collection system, wherein the electricity consumption information collection system is communicatively connected to the smart meter and the power system respectively, so that after the smart meter directly sends the collected user electricity consumption data to the electricity consumption information collection system, the electricity consumption information collection system directly sends the user electricity consumption data to the power system.

[0020] The present invention also provides a computer storage medium storing a computer program, wherein the computer program, when executed by a processor, implements any of the smart meter data transmission methods described herein.

[0021] The beneficial effects of this invention are as follows: by transmitting encrypted user electricity consumption data from the smart meter to the user's smart home system, rapid data transmission can be achieved. At the same time, the smart home system can further process and analyze the user's electricity consumption data, thereby improving the security of user electricity data transmission. Attached Figure Description

[0022] Figure 1 A flowchart of a smart meter data transmission method provided for implementation of the present invention;

[0023] Figure 2 A flowchart of AES algorithm encryption for a smart meter data transmission method provided for implementation of the present invention;

[0024] Figure 3 A flowchart illustrating the key expansion process of a smart meter data transmission method provided in this embodiment of the invention;

[0025] Figure 4 A block diagram of a smart meter data transmission system provided in an embodiment of the present invention;

[0026] Figure 5 A circuit diagram illustrating communication between a smart meter and a smart home in a smart meter data transmission system provided in an embodiment of the present invention;

[0027] Figure 6 The following is a communication link diagram between a smart meter and an STM32 microcontroller in a smart meter data transmission system provided by an embodiment of the present invention.

[0028] Figure 7 A network topology diagram of an HTTPS protocol for a smart meter data transmission system provided in an embodiment of the present invention;

[0029] Figure 8 This is a diagram illustrating the fusion of data traversal and existing data transmission modes in a smart meter data transmission system provided by an embodiment of the present invention.

[0030] Explanation of reference numerals in the attached figures:

[0031] 110. Smart meters; 120. Smart home systems; 130. Power companies; 140. STM32 chips; 150. ESP32 chips; 160. RS-485 transceivers; 170. Cloud computing. Detailed Implementation

[0032] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0033] like Figure 1 and Figure 4 As shown, according to an embodiment of the present invention, in one aspect, a data transmission method for a smart meter 110 is provided, comprising the following steps:

[0034] Step S101: Extract user electricity consumption data collected by smart meter 110.

[0035] Step S103: Use a symmetric encryption algorithm to encrypt the user's electricity consumption data to obtain encrypted user electricity consumption data.

[0036] Step S105: Send the encrypted user electricity consumption data to the smart home system 120.

[0037] Step S107: Based on the smart home system 120, send the user's encrypted electricity consumption data to the power system.

[0038] In this embodiment, the power system includes a power company 130. Electricity consumption data of users over a certain period of time is obtained from smart meters 110. This user electricity consumption data includes information such as voltage, current, power, and electricity consumption. Encrypting the collected user electricity consumption data using a symmetric encryption algorithm can improve the security of data transmission and prevent unauthorized third parties from intercepting and deciphering the data during transmission. A key is required during the encryption process, which will be used for both encryption and decryption.

[0039] Encrypted user electricity consumption data is transmitted from smart meter 110 to the user's smart home system 120, enabling rapid data transfer. Simultaneously, the smart home system 120 can further process and analyze the user's electricity consumption data, such as energy consumption monitoring and electricity usage suggestions. The smart home system 120 acts as an intermediary, transmitting the encrypted user electricity consumption data to the power company's management system 130 for centralized data management and analysis. The power company 130 can utilize this data for grid monitoring, demand response, billing, etc., while ensuring user privacy protection.

[0040] Through the steps described above, the data transmission method of the smart meter 110 not only ensures the secure transmission of user electricity consumption data but also provides valuable data support for the smart home system 120 and the power system. This method helps improve the operational efficiency of the power system, optimize energy management, and enhance users' understanding and control over their own electricity consumption behavior. Simultaneously, the application of encryption technology effectively protects user privacy and prevents the risk of data leakage.

[0041] Before encrypting user electricity consumption data, it is necessary to verify the integrity and correctness of the data. This is usually achieved through a checksum, which is a short digest of the data used to quickly detect whether the data has been tampered with or corrupted during transmission.

[0042] Furthermore, based on step S103, a symmetric encryption algorithm is used to encrypt the user's electricity consumption data to obtain encrypted user electricity consumption data, specifically including the following steps:

[0043] Step S1031: Verify the validity of the verification code for the user's electricity consumption data;

[0044] Step S1033: If valid, the data is encrypted using the AES encryption algorithm to obtain the user's encrypted electricity data.

[0045] Once the user's electricity consumption data is verified using the checksum, it is then encrypted using the AES encryption algorithm. Advanced Encryption Standard (AES) is a widely used symmetric encryption algorithm that uses the same key for both encryption and decryption. The encryption process includes steps such as key expansion, round key addition, byte substitution, row shifting, and column obfuscation.

[0046] A finite field is a set of finite elements within which addition, subtraction, multiplication, and their inverses can be performed. The number of elements in a field is called its order. A finite field is an order of a prime power only when m is a prime power, i.e., m = p. n (where n is a positive integer and p is a prime number), only fields of order m exist, and p is called the characteristic of this finite field. AES treats each byte as a finite field GF(2^m). n The elements in ) can be expressed as polynomials in a finite field:

[0047] f(x) = a n-1 x n-1 +a n-2 x n-2 +...+a1x+a0;

[0048] In the formula, f(x) is GF(2 n The element on ) a i ∈GF(2), 0<=i<=n-1, the finite field used by 128-bit AES is GF(2 8 Therefore, the range of i is 0 to 7.

[0049] like Figure 2 As shown, the AES algorithm consists of four structures: byte substitution, row shifting, column obfuscation, and round key addition. Taking 128-bit AES as an example, it goes through 10 rounds of encryption. The first 9 rounds contain all four structures, while the last round does not contain column obfuscation.

[0050] The following is a detailed explanation of the four structures:

[0051] ①Byte substitution: Using a non-linear mapping, first calculate GF(2) 8 The multiplicative inverse in the product is then subjected to an affine transformation.

[0052] SubBytes(x) = A·x -1 +b;

[0053] In the formula, x -1 Is x in GF(2) 8 The multiplicative inverse of ), where the result is 0 when x = 0. A is an 8×8 constant matrix, and b is an 8-bit constant vector.

[0054] ② Row shift: also known as circular shift, shifts the i-th row of the state matrix to the left by i bytes (i = 0, 1, 2, 3).

[0055] ShiftRows([a 0,0 ,a 0,1 ,...,a 3,3 ])=[a 0,0 ,a 1,1 ,a 2,2 ,a 3,3 ,...].

[0056] ③ Column confusion: Using matrix multiplication, each column is treated as GF(2). 8 A 4-dimensional vector on the left is multiplied by a fixed matrix C:

[0057]

[0058] Where the matrix element is GF(2 8 The constants in the finite field are calculated according to the rules of the finite field.

[0059] ④ Round key addition: Perform an XOR operation to XOR the state matrix with the round key byte by byte.

[0060]

[0061] Combining the four structures described above, for input plaintext P and key K, the 128-bit AES algorithm can be expressed by the following formula:

[0062] C = E(P,K)

[0063] =AddRoundKey 10 (MixColumns(ShiftRows(SubBytes(...AddRoundKey0(P,K0)...))));

[0064] k in the formula i It is the round key for the i-th round. There are a total of 10 rounds, with MixColumns omitted in the last round.

[0065] like Figure 3 As shown, AES uses key expansion to extend the master key into multiple round keys to ensure the algorithm's security. Using a 128-bit key requires 10 rounds of iteration, thus expanding the input key into 11 sets of 128-bit keys. The expansion process is as follows:

[0066] 1. Taking four bytes as a unit, which is exactly the column of the state matrix, after expansion, there are a total of 44 bytes.

[0067] 2. Based on the first column of the initialization key (w0, w1, w2, w3).

[0068] 3. w after recursion generation i The range of i is 4 to 43, and the recursive formula is as follows:

[0069]

[0070] RotWord indicates a circular left shift of one byte, SubWord indicates applying SubBytes to each byte, and Rcon is a round constant that is related to the number of rounds

[30] .

[0071] The AES algorithm is a symmetric block cipher capable of encrypting and decrypting 128-bit data blocks. It supports 128-bit, 192-bit, and 256-bit encryption keys and is based on the substitution-permutation network principle, achieving encryption and decryption through a series of transformation operations. This invention employs the AES algorithm primarily based on two considerations. First, the AES algorithm offers high security. Its algorithm design utilizes complex transformations such as byte substitution, row shifting, column obfuscation, and round key addition. These operations work together to effectively obfuscate and spread data, significantly increasing the difficulty of cracking. Moreover, the AES algorithm supports multiple key lengths; as the key length increases, the computational resources and time required for brute-force attacks grow exponentially, further enhancing security. Second, the AES algorithm requires relatively little memory for encryption, making it well-suited to the memory conditions of chips and ensuring stable and efficient operation of the encryption function on the hardware platform.

[0072] Specifically, the user's electricity consumption data is encrypted using an encryption function combined with the AES encryption algorithm. The encryption function is AES_ECB_Encrypt(plainText,key,cipherText); where plainText represents the user's electricity consumption data to be encrypted, and its length is an integer multiple of the AES block size; key represents the encryption key, which supports a length of 128 bits, 192 bits, or 256 bits; and cipherText represents the output parameter used to store the encrypted ciphertext, and the length of cipherText is the same as the length of plainText.

[0073] Upon receiving meter data conforming to the DL / T 645 protocol, the validity of the verification code is first verified. Then, the data is encrypted using the AES encryption algorithm to ensure data integrity and communication security transmitted to the backend system. The encryption function used is AES_ECB_Encrypt(plainText, key, cipherText). In the formula, plainText represents the original user electricity data to be encrypted, and its length must be an integer multiple of the AES block size; if insufficient, padding is usually required. key is the encryption key, supporting lengths of 128 bits (16 bytes), 192 bits (24 bytes), or 256 bits (32 bytes), depending on the specific AES implementation (AES-128 / AES-192 / AES-256). cipherText is the output parameter used to store the encrypted ciphertext, with the same length as plainText.

[0074] Additionally, the encryption function is located on the communication module of the STM32 chip. The STM32 chip's HAL library provides a hardware communication module, which can be used to encrypt data. If an STM32 chip is not provided, the user's electricity consumption data can be encrypted using the aforementioned encryption function AES_ECB_Encrypt(plainText, key, cipherText) combined with the AES encryption algorithm.

[0075] Specifically, encrypted user power consumption data is transmitted via a DMA mechanism. The encrypted data is sent quickly and efficiently through Direct Memory Access (DMA), reducing CPU resource consumption and improving transmission efficiency.

[0076] In practical applications, the data traversal mode may become unusable for various reasons. In such cases, it is necessary to utilize existing data transmission modes to transmit the user's electricity consumption data collected by the smart meter 110 to the power company 130.

[0077] Furthermore, the data transmission method of the smart meter 110 also includes the following steps:

[0078] Step S109: The smart meter 110 transmits the user's electricity data to the power system via RS-485 serial communication using the DL / T 645 protocol.

[0079] Combination Figure 8As shown in the blue line, the smart meter 110 can transmit user electricity data to the electricity information collection system via data traversal mode. If this mode fails, it can also transmit data to the electricity information collection system via the existing mode. In this case, the smart meter 110 transmits data via the DL / T 645 protocol using Recommended Standard 485 (RS-485) serial communication, employing a master-slave polling mechanism. The master station, such as a concentrator, sends command frames containing address, control code, and data fields. Upon receiving an instruction matching its own address, the smart meter 110 parses the control code, such as reading electricity consumption and voltage, and returns response data according to the DL / T 645 data frame format, including a checksum to ensure transmission reliability. The DL / T 698 protocol supports Ethernet / IP or low-power wireless communication and uses object-oriented modeling. The master station accesses meter data through the Common Information Model (CIM), and the meter has a built-in logical data device. Devices (LDs) and object instances organize data according to ASN.1 encoding and upload it to the main station via TCP / IP or wireless network to achieve more efficient and flexible remote meter reading and management.

[0080] Specifically, the smart home system 120 uses the HTTP transmission protocol to send encrypted user electricity data to the power system.

[0081] HTTPS, short for HyperText Transfer Protocol over Secure Socket Layer, is used to implement data transmission between smart home devices and the power company (e.g., 130). This protocol is an application layer protocol in the TCP / IP protocol suite, operating by default on TCP port 443. It's a transport protocol for secure communication over computer networks. While it communicates via HTTP, it introduces an encryption layer on top of HTTP, using SSL / TLS to encrypt data packets. SSL and TLS are both transport layer security protocols; TLS is an upgrade of SSL. This provides authentication of the website server and protects the privacy and integrity of exchanged data.

[0082] Furthermore, the HTTPS transport protocol encrypts the transmitted user data using a symmetric key between the client and the server.

[0083] In this embodiment, the HTTPS protocol is built on a request-response model. The client sends an HTTP request to the server and waits for the server's response. The request includes a request line, request headers, and an optional request body. The request line contains the request method, URL, and protocol version. The response includes a status line, response headers, and a response body. The status line contains a status code and status text.

[0084] The content included in the request and response:

[0085] (1) Uniform Resource Locator (URL), also known as a "web address," is a unique identifier for every file on the Internet. It contains information indicating the file's location and how the browser should handle it. The standard format of a URL is as follows:

[0086] Protocol type: [ / / server address[:port number]][ / resource level UNIX file path]filename[?query string][#fragment identifier].

[0087] The complete format of a URL is as follows:

[0088] Protocol type: [ / / [credential information required to access the resource@] server address[:port number]][ / resource level UNIX file path] filename[? query string][#fragment identifier].

[0089] (2) Method: The first part of the first line of an HTTP request message. Different methods can express different semantics; the most commonly used are GET and POST.

[0090] (3) Request header and response header: The overall format is a key-value pair structure, with each key-value pair occupying one line. The key and value are separated by a colon and a space. Common headers include Host, where the value of HOST indicates the address and port of the server host. The address can be a domain name or an IP address; the port number can be omitted or specified manually. Content-Length indicates the length of the body data, and the length unit is bytes. Content-Type indicates the data format of the body.

[0091] (4) Status code: The status code indicates the result of accessing a page, such as access success, failure, or other situations. The status code is a 3-digit integer, divided into five categories from 1xx, 2xx, 3xx, 4xx, and 5xx, each with a different meaning.

[0092] HTTPS uses encrypted transmission to ensure user information security. The encryption process combines asymmetric and symmetric encryption to achieve secure communication, and also introduces a digital certificate mechanism to solve the public key trust problem. The specific process is as follows:

[0093] 1. Asymmetric Encryption Phase: When the client sends a request to the server, the server returns its digital certificate containing the public key, issued by a trusted third-party authority. After verifying the certificate's validity, the client uses the public key from the certificate to encrypt a randomly generated symmetric key.

[0094] 2. Symmetric Encryption Phase: The encrypted symmetric key is sent to the server, which uses its private key to decrypt and obtain the symmetric key. Subsequently, both parties use this symmetric key to encrypt transmitted data, such as with AES encryption, ensuring efficient and secure data transmission.

[0095] 3. Digital certificate verification mechanism: Digital certificates are verified by the signature of a third-party organization to prevent man-in-the-middle attacks from tampering with the public key, thereby ensuring the secure exchange of symmetric keys.

[0096] like Figure 4 As shown, the present invention also proposes a data transmission system for a smart meter 110, comprising: a smart meter 110, adapted to collect user electricity consumption data; a communication module, communicatively connected to the smart meter 110, the communication module being adapted to receive the user electricity consumption data and encrypt the user electricity consumption data using a symmetric encryption algorithm to obtain encrypted user electricity consumption data, and sending it to a smart home system 120; and a smart home system 120, communicatively connected to the communication module, adapted to send the encrypted user electricity consumption data to the power system.

[0097] The communication module includes an STM32 chip 140 to verify the validity of the verification code for user power consumption data. If valid, the data is encrypted using the AES encryption algorithm to obtain encrypted user power consumption data, which is then sent via a DMA mechanism.

[0098] The STM32 series chips, especially the STM32F103C8T6, are microcontrollers featuring a 32-bit ARM Cortex-M3 core processor. This chip uses an LQFP48 package, offering abundant pins while maintaining a moderate package size. This satisfies the I / O interface requirements of the smart meter 110 system without significantly increasing PCB area or manufacturing costs. In terms of performance, the STM32F103C8T6 has sufficient processing power to meet the data transmission needs of the smart meter 110. Its power management capabilities make it well-suited for long-term applications like data transmission in smart meters 110. The chip supports multiple low-power modes, allowing it to enter sleep mode during non-data transmission periods, effectively reducing system power consumption and extending the lifespan of battery-powered devices.

[0099] The STM32F103C8T6 chip has limited memory resources and cannot support encryption algorithms with large memory requirements. In contrast, the AES algorithm requires relatively less memory, which is well-suited to the memory conditions of the STM32F103C8T6 chip, ensuring that the encryption function runs stably and efficiently on the hardware platform.

[0100] The data transmission system of the smart meter 110 also includes an RS-485 transceiver 160. The smart meter 110 sends the user's electricity consumption data to the RS-485 transceiver 160 via the RS-485 bus using differential signal transmission. The RS-485 transceiver 160 converts the differential signal into a TTL level signal and then transmits it to the STM32 chip 140.

[0101] Among them, the smart meter 110 uses the DL / T 645 communication protocol to collect user electricity data in real time, and transmits the standardized data frame format to the STM32 chip 140 through the RS-485 communication standard.

[0102] The smart meter 110 transmits data to the STM32 via the RS-485 communication standard. RS-485 is a serial communication standard based on differential signal transmission. It uses a pair of differential signal lines, namely A / B lines, to achieve half-duplex or multi-point communication. Its core principle is to use a differential amplifier to convert single-ended signals into differential signals for transmission, and then restore them to single-ended signals at the receiving end. This differential transmission method can effectively suppress common-mode noise such as electromagnetic interference and ground potential differences, significantly improving the anti-interference capability and transmission distance of the communication. At the physical layer, RS-485 uses a balanced driver and a differential receiver. The transmitting end converts logic levels into differential voltages through the driver. A voltage higher than B line indicates logic 1, and vice versa for logic 0. The receiving end determines the signal status by comparing the voltage difference between the two lines. Its electrical characteristics specify a differential voltage ≥ +200mV for logic 1 and ≤ -200mV for logic 0. The typical drive voltage range is ±1.5V to ±5V. The protocol layer supports flexible topologies, such as bus, tree, and multi-node communication, and avoids signal reflection by matching bus impedance through terminating resistors. This invention utilizes the RS-485 communication standard primarily based on the following advantages: 1. Strong anti-interference capability: Common-mode interference in industrial environments, such as power frequency magnetic fields and switching power supply noise, is canceled out by the differential receiver, ensuring data accuracy; 2. Low power consumption and stability: Half-duplex mode reduces power consumption, and the bus automatically enters a high-impedance state when idle, avoiding bus conflicts. Simultaneously, the differential signal has a large voltage swing (±5V), providing greater tolerance for poor contact or cable aging; 3. Protocol compatibility: Naturally compatible with industrial protocols such as Modbus RTU, allowing meter manufacturers to standardize data frame formats, facilitating rapid parsing of parameters such as power consumption, voltage, and current by the STM32 chip 140, reducing development costs. The communication link using the RS-485 standard for data transmission is as follows: Figure 6 As shown.

[0103] Furthermore, the STM32 chip 140 is provided with GPIO pins, and the RS-485 transceiver 160 is provided with DE / RE pins. The DE / RE pins are communicatively connected to the GPIO pins, so that the STM32 chip 140 can control the transmit and receive modes of the RS-485 transceiver 160.

[0104] The smart meter 110 transmits electricity consumption data and other information to the RS-485 transceiver 160 via the RS-485 bus using differential signal transmission. The transceiver converts the differential signal into a TTL level signal and transmits it to the UART RX pin of the STM32. At the same time, the STM32 controls the transmit and receive modes of the RS-485 transceiver 160 through GPIO pins to ensure that the data can be transmitted accurately and reliably between the two, thus meeting the requirements of this invention.

[0105] Furthermore, such as Figure 5As shown, the communication module also includes an ESP32 chip to send encrypted user power consumption data to the smart home system 120 via Bluetooth communication.

[0106] Bluetooth communication between the smart meter 110 and smart home devices. (Circuit) Figure 5 The computer TXD acts as a smart meter 110, used to send users' electricity consumption information; the computer RXD acts as a smart home device, used to receive the transmitted user electricity consumption data. The STM32 is used as the control chip; its PB11 port is used to receive users' electricity consumption information, while its PB10 port sends the received data to the ESP chip 150. The ESP chip 150 is connected to the Bluetooth module and is responsible for transmitting the collected data to the computer RXD.

[0107] The ESP32 chip integrates dual-mode Bluetooth and Wi-Fi. The ESP32-WROOM-32U, in particular, integrates both Wi-Fi and Bluetooth wireless communication functions, meeting the communication needs of a smart home system. In terms of performance, the ESP32-WROOM-32U chip's Bluetooth module supports classic Bluetooth BR / EDR and BLE dual-mode communication; this solution only uses the BLE function.

[0108] Furthermore, the data transmission system of the smart meter 110 also includes an HTTP transmission protocol network topology, which includes: a cloud 170; a power system client, which communicates with the cloud 170 via the HTTP protocol to query power data; a smart home system 120, which communicates with the cloud 170 via the HTTP protocol to periodically or according to specific events send encrypted user electricity consumption data collected by the smart meter 110 to the cloud 170; and a power company 130, which communicates with the cloud 170 to obtain data uploaded by the smart home system 120 and processed by the cloud 170.

[0109] like Figure 7 As shown, the Power Company 130 query is an external client application or system used by the power company's management, customer service personnel, or other authorized personnel. It communicates with the cloud (170) via HTTP to query relevant power data, user information, or the status of smart home devices. For example, power company 130 staff might use this client to query the real-time power consumption of all electrical devices in a specific area for power allocation, troubleshooting, or providing customer service.

[0110] Smart Home A, Smart Home B, and Smart Home C are all smart home device clients, representing various smart devices in the home, such as smart meter 110, smart light bulbs, and smart sockets. They communicate with the cloud 170 via the HTTP protocol, periodically or based on specific events, sending electricity consumption data collected by smart meter 110 to the cloud 170.

[0111] The power company 130, located on the far right of the architecture, represents the actual power operating company. It interacts with the cloud 170 through its internal system to obtain data uploaded by smart home devices and processed by the cloud 170 for purposes such as power management, billing, and grid optimization.

[0112] In practical applications, the data traversal mode may become unusable for various reasons. In such cases, it is necessary to use the existing data transmission mode to transmit the user's electricity consumption data collected by the smart meter 110 to the power company 130.

[0113] Furthermore, such as Figure 8 As shown, the data transmission system of the smart meter 110 also includes an electricity consumption information collection system. The electricity consumption information collection system is communicatively connected to the smart meter 110 and the power system, so that after the smart meter 110 directly sends the collected user electricity consumption data to the electricity consumption information collection system, the electricity consumption information collection system directly sends the user electricity consumption data to the power system.

[0114] As shown by the blue line, the smart meter 110 can transmit data to the electricity consumption information collection system through the data crossover mode. If this mode malfunctions, as shown by the red line, it can also transmit data to the electricity consumption information collection system through the existing mode. In this case, the smart meter 110 transmits data via RS-485 serial communication using the DL / T 645 protocol.

[0115] On the other hand, the present invention also proposes a computer storage medium storing a computer program, wherein the computer program, when executed by a processor, implements any one of the following smart meter data transmission methods.

[0116] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Dual Data SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM). The various embodiments described in this specification are presented in a progressive manner, and similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, for embodiments of apparatus, devices, and non-volatile computer storage media, since they are substantially similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to the description of the method embodiments.

[0117] The above embodiments are merely illustrative examples and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A data transmission method for smart meters, used for communication between smart meters and power systems, characterized in that, The method includes: Extract user electricity consumption data collected by smart meters; The user's electricity consumption data is encrypted using a symmetric encryption algorithm to obtain encrypted user electricity consumption data. The encrypted user electricity consumption data is sent to the smart home system; Based on the smart home system, the encrypted user electricity consumption data is sent to the power system.

2. The smart meter data transmission method according to claim 1, characterized in that, The user's electricity consumption data is encrypted using a symmetric encryption algorithm to obtain encrypted user electricity consumption data, specifically including: Verify the validity of the verification code for the user's electricity consumption data; If valid, the data is encrypted using the AES encryption algorithm to obtain the encrypted user electricity consumption data.

3. The smart meter data transmission method according to claim 2, characterized in that, The user's electricity consumption data is encrypted using an encryption function combined with the AES encryption algorithm. The encryption function is AES_ECB_Encrypt(plainText, key, cipherText); where plainText represents the user's electricity consumption data to be encrypted, and its length is an integer multiple of the AES block size; key represents the encryption key, which supports a length of 128 bits, 192 bits, or 256 bits; and cipherText represents the output parameter used to store the encrypted ciphertext, and the length of cipherText is the same as the length of plainText.

4. The smart meter data transmission method according to claim 3, characterized in that, The encryption function is located on the communication module of the STM32 chip.

5. The smart meter data transmission method according to any one of claims 1 to 4, characterized in that, The encrypted user electricity data is transmitted via a DMA mechanism.

6. The smart meter data transmission method according to any one of claims 1 to 4, characterized in that, Also includes: The smart meter transmits the user's electricity data to the power system via RS-485 serial communication using the DL / T 645 protocol.

7. The smart meter data transmission method according to any one of claims 1 to 4, characterized in that, The smart home system uses the HTTPS transmission protocol to send the user's encrypted electricity consumption data to the power system.

8. The smart meter data transmission method according to claim 7, characterized in that, The HTTPS transmission protocol uses a symmetric key between the client and the server to encrypt the transmitted user electricity data.

9. A smart meter data transmission system, characterized in that, include: Smart meters are suitable for collecting users' electricity consumption data; A communication module is connected to the smart meter. The communication module is adapted to receive the user's electricity consumption data and use a symmetric encryption algorithm to encrypt the user's electricity consumption data to obtain encrypted user electricity consumption data, and then send it to the smart home system. The smart home system is connected to the communication module and is adapted to send the user's encrypted electricity consumption data to the power system.

10. The smart meter data transmission system according to claim 9, characterized in that, The communication module includes an STM32 chip to verify the validity of the verification code of the user's electricity consumption data. If valid, the data is encrypted using the AES encryption algorithm to obtain the encrypted user electricity consumption data, and the encrypted user electricity consumption data is sent via a DMA mechanism.

11. The smart meter data transmission system according to claim 10, characterized in that, It also includes an RS-485 transceiver. The smart meter sends the user's electricity consumption data to the RS-485 transceiver via the RS-485 bus using differential signal transmission. The RS-485 transceiver converts the differential signal into a TTL level signal and then transmits it to the STM32 chip.

12. The smart meter data transmission system according to claim 11, characterized in that, The STM32 chip has GPIO pins, and the RS-485 transceiver has DE / RE pins. The DE / RE pins are communicatively connected to the GPIO pins, so that the STM32 chip can control the transmit and receive modes of the RS-485 transceiver.

13. The smart meter data transmission system according to claim 10, characterized in that, The communication module also includes an ESP32 chip to send the encrypted user power consumption data to the smart home system via Bluetooth communication.

14. The smart meter data transmission system according to any one of claims 9 to 13, characterized in that, It also includes an HTTPS transport protocol network topology, which includes: Cloud; The power system client communicates with the cloud via HTTPS protocol to query power data; The smart home system communicates with the cloud via the HTTPS protocol to periodically or according to specific events send encrypted user electricity consumption data collected by the smart meter to the cloud. The power company communicates with the cloud to obtain data uploaded by the smart home system and processed by the cloud.

15. The smart meter data transmission system according to any one of claims 9 to 13, characterized in that, It also includes an electricity consumption information collection system, which is communicatively connected to the smart meter and the power system, so that after the smart meter directly sends the collected user electricity consumption data to the electricity consumption information collection system, the electricity consumption information collection system directly sends the user electricity consumption data to the power system.

16. A storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the smart meter data transmission method according to any one of claims 1 to 8.