Plug-and-play security encryption and data interaction method

Through the plug-and-play secure encryption module, the processor chip and encryption chip are used to realize secure communication between the terminal equipment and the main grid station in the new power system, solving the problem of high encrypted communication costs and reducing the overall cost. Ensures communication security.

CN119094125APending Publication Date: 2024-12-06ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411336201.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, the encrypted communication cost between the access side terminal of the new power system and the power grid is relatively high, resulting in the problem of excessively high encrypted communication cost.

Method used

Using plug-and-play secure encryption method, the secure encryption module is detachably connected to the terminal device through the secure encryption module, and the processor chip and encryption chip are used to achieve random number generation, encryption and authentication, ensuring the terminal device and the main grid station. Secure communication.

Benefits of technology

It reduces the cost of encrypted communication, realizes secure and reliable data transmission between the terminal equipment and the main power grid station, and avoids the use of high-value secure encrypted boxes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094125A_ABST
    Figure CN119094125A_ABST
Patent Text Reader

Abstract

The invention provides a plug-and-play security encryption and data interaction method. The encryption method comprises the following steps: a security encryption module receives a first random number acquisition request sent by terminal equipment; the security encryption module generates a first random number in response to the first random number acquisition request and forwards the first random number to the power grid master station through the terminal equipment, so that the power grid master station encrypts the first random number to obtain first encrypted data and issues the first encrypted data to the terminal equipment, the terminal equipment is in wireless communication with the power grid master station; and the security encryption module receives first encrypted data sent by the terminal equipment and authenticates the first encrypted data, and indicates that the terminal equipment can upload the power data to the power grid master station if the authentication is passed. A low-cost security encryption module is used to realize encryption communication between the terminal device and the power grid master station.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electricity, and more specifically, to a plug-and-play secure encryption method, a data interaction method, a secure encryption module, an encryption system, a computer-readable storage medium, and an electronic device. Background Art

[0002] The access terminal side of the new power system, including the virtual power plant system, covers the coordinated processing of services such as photovoltaics, energy storage, adjustable loads, and charging piles. Therefore, it is necessary to meet the secure communication between various terminals and the power grid.

[0003] There are two common communication methods in the related technologies: method 1: built-in encryption chip in the terminal; method 2: external security encryption box to achieve encrypted communication between the terminal and the power grid. The first method requires the structure of the circuit board in the terminal to be modified, which is costly and requires the terminal to be disassembled for processing. The second method requires an external box to be added to any terminal that communicates with the power grid. Generally, the cost of the security encryption box is high, and this method requires a large number of security encryption boxes, which is too costly.

[0004] Using a more expensive scheme for encrypted communication results in a higher cost for encrypted communication. Summary of the invention

[0005] The main purpose of this application is to provide a plug-and-play security encryption method, a data interaction method, a security encryption module, an encryption system, a computer-readable storage medium and an electronic device, so as to at least solve the problem of using a high-cost solution in the related technology to perform encrypted communication between a new power system access side terminal and a power grid, resulting in high cost of encrypted communication.

[0006] In order to achieve the above-mentioned purpose, according to the first aspect of the present application, a plug-and-play security encryption method is provided, the security encryption module includes a processor chip and an encryption chip connected to the processor chip, the security encryption module is detachably connected to the terminal device, the method is applied to the security encryption module, the method includes: the security encryption module receives a first random number acquisition request sent by the terminal device; the security encryption module generates a first random number in response to the first random number acquisition request and forwards the first random number to the power grid master station through the terminal device, so that the power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station; the security encryption module receives the first encrypted data sent by the terminal device and authenticates the first encrypted data. If the authentication is passed, it indicates that the terminal device can upload power data to the power grid master station.

[0007] Optionally, the method also includes: the security encryption module receives a second random number sent by the terminal device, wherein the second random number is generated by the power grid master station in response to a second random number acquisition request of the terminal device; the security encryption module encrypts the second random number to obtain second encrypted data, and forwards the second encrypted data to the power grid master station through the terminal device, so that the power grid master station authenticates the second encrypted data. If the authentication is passed, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

[0008] Optionally, the method also includes: after the power grid master station and the terminal device are both authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain first encrypted power data; the security encryption module sends the first encrypted power data to the terminal device, and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain first decrypted power data.

[0009] Optionally, after the security encryption module sends the first encrypted power data to the terminal device and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain first decrypted power data, the method also includes: the security encryption module receives second encrypted power data sent by the terminal device, the second encrypted power data is obtained by the power grid master station calling the cryptographic machine to encrypt the second power data to be encrypted; the security encryption module uses the encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device.

[0010] Optionally, after the power grid master station and the terminal device are both authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain the first encrypted power data, including: after the power grid master station and the terminal device are both authenticated, the security encryption module sequentially receives multiple first encapsulated data packets to be encrypted sent by the terminal device, and extracts multiple first data packets to be encrypted from the multiple first encapsulated data packets to be encrypted, and uses the encryption chip to encrypt the multiple first data packets to be encrypted in turn to obtain multiple first encrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple first encrypted data packets to obtain multiple first encrypted encapsulated data packets, wherein the multiple first data packets to be encrypted constitute the first power data packets to be encrypted. power data, a plurality of the first encrypted data packets constitute the first encrypted power data; and / or, the security encryption module sends the first encrypted power data to the terminal device, and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, including: the security encryption module sends a plurality of the first encrypted encapsulated data packets to the terminal device, so that the terminal device extracts a plurality of the first encrypted data packets from a plurality of the first encrypted encapsulated data packets and merges a plurality of the first encrypted data packets into the first encrypted power data and then uploads them to the power grid master station, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

[0011] Optionally, the security encryption module receives second encrypted power data sent by the terminal device, and the second encrypted power data is obtained by the power grid master station calling the cryptographic machine to encrypt the second power data to be encrypted, including: the security encryption module receives multiple second encrypted encapsulated data packets sent by the terminal device, and extracts multiple second encrypted data packets from the multiple second encrypted encapsulated data packets, wherein the multiple second encrypted data packets constitute the second encrypted power data; and / or, the security encryption module uses the encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device, including: the security encryption module uses the encryption chip to decrypt multiple second encrypted data packets in sequence to obtain multiple second decrypted data packets, and uses the communication protocol of the security encryption module to encapsulate multiple second decrypted data packets to obtain multiple second decrypted encapsulated data packets, and sends multiple second decrypted encapsulated data packets to the terminal device, wherein multiple second decrypted data packets constitute the second decrypted power data.

[0012] Optionally, the format of the request frame used in the encryption and decryption process is the first starting byte + the first command + the first index + the first length + the first data, and the format of the response frame used is the second starting byte + the second command + the second index + the result + the second length + the second data, wherein the first command indicates the type of command of the request frame, the first index indicates the index of the command of the request frame, the first length indicates the length of the data of the request frame, the first data indicates the data part of the command of the request frame, the second command indicates the type of command of the response frame, the second index indicates the index of the command of the response frame, the second length indicates the length of the data of the response frame, the second data indicates the data part of the command of the response frame, and the result indicates whether the response structure is normal.

[0013] According to the second aspect of the present application, a plug-and-play data interaction method is provided, wherein a security encryption module comprises a processor chip and an encryption chip connected to the processor chip, and the security encryption module is detachably connected to a terminal device, and the method comprises: the terminal device sends a first random number acquisition request to the security encryption module; the security encryption module generates a first random number in response to the first random number acquisition request and sends the first random number to the terminal device; the terminal device sends the first random number to a power grid master station; the power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station; the security encryption module receives the first encrypted data sent by the terminal device and authenticates the first encrypted data, and if the authentication is passed, it indicates that the terminal device can upload power data to the power grid master station.

[0014] Optionally, the method also includes: the terminal device sends a second random number acquisition request to the power grid master station; the power grid master station generates a second random number in response to the second random number acquisition request of the terminal device, and sends the second random number to the terminal device; the terminal device sends the second random number to the security encryption module; the security encryption module encrypts the second random number to obtain second encrypted data, and sends the second encrypted data to the terminal device; the terminal device uploads the second encrypted data to the power grid master station; the power grid master station authenticates the second encrypted data, and if the authentication is passed, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

[0015] Optionally, the method also includes: after the power grid master station and the terminal device are both authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain first encrypted power data; the security encryption module sends the first encrypted power data to the terminal device; the terminal device uploads the first encrypted power data to the power grid master station; the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain first decrypted power data.

[0016] Optionally, after the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain first decrypted power data, the method also includes: the power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain second encrypted power data, and sends the second encrypted power data to the terminal device; the terminal device sends the second encrypted power data to the security encryption module; the security encryption module uses the encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device.

[0017] Optionally, after both the power grid master station and the terminal device are authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain the first encrypted power data, including: after both the power grid master station and the terminal device are authenticated, the terminal device splits the first power data to be encrypted into multiple first data packets to be encrypted, and uses the communication protocol of the security encryption module to encapsulate the multiple first data packets to be encrypted to obtain multiple first encapsulated data packets to be encrypted, and sends the multiple first encapsulated data packets to the security encryption module; the security encryption module extracts multiple first data packets to be encrypted from the multiple first encapsulated data packets to be encrypted, and uses the encryption chip to encrypt the multiple first data packets to be encrypted in turn to obtain multiple first encrypted data Package, and use the communication protocol of the security encryption module to encapsulate multiple first encrypted data packets to obtain multiple first encrypted encapsulated data packets; and / or, the security encryption module sends the first encrypted power data to the terminal device; the terminal device uploads the first encrypted power data to the power grid master station; the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain first decrypted power data, including: the security encryption module sends multiple first encrypted encapsulated data packets to the terminal device, the terminal device extracts multiple first encrypted data packets from the multiple first encrypted encapsulated data packets and merges the multiple first encrypted data packets into the first encrypted power data and then uploads it to the power grid master station; the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain first decrypted power data.

[0018] Optionally, the power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain second encrypted power data, and sends the second encrypted power data to the terminal device; the terminal device sends the second encrypted power data to the security encryption module; including: the power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain second encrypted power data, and sends the second encrypted power data to the terminal device; the terminal device subpackets the second encrypted power data into multiple second encrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple second encrypted data packets to obtain multiple second encrypted encapsulated data packets, and sends the multiple second encrypted encapsulated data packets to the terminal device. The security encryption module; and / or, the security encryption module uses the encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device, including: the security encryption module extracts multiple second encrypted data packets from multiple second encrypted encapsulated data packets, and uses the encryption chip to decrypt multiple second encrypted data packets in turn to obtain multiple second decrypted data packets, and uses the communication protocol of the security encryption module to encapsulate multiple second decrypted data packets to obtain multiple second decrypted encapsulated data packets, and sends multiple second decrypted encapsulated data packets to the terminal device, wherein multiple second decrypted data packets constitute the second decrypted power data.

[0019] According to the third aspect of the present application, a security encryption module is provided, which includes a processor chip and an encryption chip connected to the processor chip, and the security encryption module is detachably connected to a terminal device, including: a first receiving unit, used to receive a first random number acquisition request sent by the terminal device; a generating unit, used to generate a first random number in response to the first random number acquisition request and forward the first random number to a power grid master station through the terminal device, so that the power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station; a receiving authentication unit, used to receive the first encrypted data sent by the terminal device and authenticate the first encrypted data, and if the authentication is passed, it indicates that the terminal device can upload power data to the power grid master station.

[0020] According to the fourth aspect of the present application, an encryption system is provided, comprising: a plug-and-play security encryption module, which executes any one of the plug-and-play security encryption methods; a power grid master station; and a terminal device, which wirelessly communicates with the power grid master station, wherein the plug-and-play security encryption module has a plug, and the terminal device has a socket adapted to the plug.

[0021] According to a fifth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the described methods.

[0022] According to the sixth aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the methods described.

[0023] By applying the technical solution of the present application, a security encryption module that is detachably connected to the terminal device is adopted to authenticate the identity of the power grid master station by sending random numbers and encrypting and authenticating the random numbers. If the authentication is passed, the terminal device can upload power data to the power grid master station. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0025] Figure 1 A schematic diagram of a flow chart of a plug-and-play secure encryption method provided according to an embodiment of the present application is shown;

[0026] Figure 2 A specific master station authentication process and a terminal authentication process provided according to an embodiment of the present application are shown;

[0027] Figure 3 A schematic diagram of a specific encryption and decryption process provided according to an embodiment of the present application is shown;

[0028] Figure 4 A flow chart of a plug-and-play data interaction method provided according to an embodiment of the present application is shown;

[0029] Figure 5 A schematic diagram of a security encryption module provided according to an embodiment of the present application is shown;

[0030] Figure 6 A schematic diagram of an encryption system provided according to an embodiment of the present application is shown;

[0031] Figure 7 A schematic diagram of a specific security encryption module provided according to an embodiment of the present application is shown;

[0032] Figure 8A schematic diagram of an interrupt design according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0033] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0034] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0036] As introduced in the background technology, the prior art uses a high-cost solution for encrypted communication, resulting in high cost of encrypted communication. In order to solve the problem of using a high-cost solution for encrypted communication, resulting in high cost of encrypted communication, the embodiments of the present application provide a plug-and-play secure encryption method, a data interaction method, a secure encryption module, an encryption system, a computer-readable storage medium and an electronic device.

[0037] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0038] First aspect embodiment:

[0039] The first aspect embodiment of the present application provides a plug-and-play secure encryption method for a plug-and-play secure encryption module running in an encryption system. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0040] Figure 1 It is a flow chart of a plug-and-play secure encryption method according to an embodiment of the present application. The secure encryption module includes a processor chip and an encryption chip connected to the processor chip, and the secure encryption module is detachably connected to the terminal device. The method is applied to the secure encryption module, wherein the detachable connection between the secure encryption module and the terminal device means that the secure encryption module exists independently of the terminal device, that is, it is not part of the terminal device, that is, after the same secure encryption module completes encryption for one terminal device, it can be detached to perform encryption authentication and then perform encrypted communication with other terminal devices.

[0041] like Figure 1 As shown, the method comprises the following steps:

[0042] Step S101, the security encryption module receives a first random number acquisition request sent by a terminal device;

[0043] Specific as Figure 2 As shown, the security encryption module receives a first random number acquisition request sent by the terminal device;

[0044] Step S102, the security encryption module generates a first random number in response to the first random number acquisition request and forwards the first random number to the power grid master station through the terminal device, so that the power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station;

[0045] Specific as Figure 2 As shown, the security encryption module generates a random number A in response to the first random number acquisition request, the power grid master station encrypts the random number A to obtain a ciphertext A', and sends the ciphertext A' to the terminal device;

[0046] Step S103, the security encryption module receives the first encrypted data sent by the terminal device and authenticates the first encrypted data. If the authentication is successful, it indicates that the terminal device can upload the power data to the power grid master station.

[0047] Specific as Figure 2 As shown, the security encryption module receives the ciphertext A' sent by the terminal device and authenticates the ciphertext A'. If the authentication is passed, it indicates that the terminal device can upload the power data to the power grid master station.

[0048] The above method of sending random numbers and encrypting and authenticating the random numbers realizes the authentication of the identity of the power grid master station. If the authentication is passed, the terminal device can upload the power data to the power grid master station.

[0049] Furthermore, the method further comprises:

[0050] The security encryption module receives a second random number sent by the terminal device, wherein the second random number is generated by the power grid master station in response to a second random number acquisition request of the terminal device;

[0051] Specific as Figure 2 As shown, the security encryption module receives the random number B sent by the terminal device, and the random number B is generated by the power grid master station in response to the second random number acquisition request of the terminal device;

[0052] The security encryption module encrypts the second random number to obtain second encrypted data, and forwards the second encrypted data to the power grid master station through the terminal device, so that the power grid master station authenticates the second encrypted data. If the authentication is successful, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

[0053] Specific as Figure 2 As shown, the security encryption module encrypts the random number B to obtain the ciphertext B', and forwards the ciphertext B' to the power grid master station through the terminal device, so that the power grid master station authenticates the ciphertext B'. If the authentication is successful, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

[0054] The above method of sending random numbers and encrypting and authenticating the random numbers realizes the authentication of the identity of the terminal device. If the authentication is passed, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

[0055] The above two-way authentication process can ensure that the security encryption module is bound after being inserted into the terminal device and cannot be moved to other terminal devices for use.

[0056] Figure 2 The overall identity authentication of the power grid master station and the identity authentication of the terminal device is realized. When both identity authentications are passed, data can be encrypted and transmitted between the terminal device and the power grid master station.

[0057] Furthermore, the method further comprises:

[0058] After both the power grid master station and the terminal device are authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain the first encrypted power data;

[0059] The security encryption module sends the first encrypted power data to the terminal device, and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

[0060] The encryption and decryption process of the first power data to be encrypted sent from the terminal device is realized.

[0061] Further, after the security encryption module sends the first encrypted power data to the terminal device, and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, the method further includes:

[0062] The security encryption module receives the second encrypted power data sent by the terminal device, where the second encrypted power data is obtained by the power grid master station calling the cipher machine to encrypt the second power data to be encrypted;

[0063] The security encryption module uses an encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device.

[0064] The process of decrypting the second encrypted power data sent from the power grid master station is implemented.

[0065] Specifically, after both the power grid master station and the terminal device are authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain the first encrypted power data, including: after both the power grid master station and the terminal device are authenticated, the security encryption module sequentially receives multiple first encapsulated data packets to be encrypted sent by the terminal device, and extracts multiple first data packets to be encrypted from the multiple first encapsulated data packets to be encrypted, and uses the encryption chip to encrypt the multiple first data packets to be encrypted in turn to obtain multiple first encrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple first encrypted data packets to obtain multiple first encrypted encapsulated data packets, wherein the multiple first data packets to be encrypted constitute the first power data to be encrypted, and the multiple first encrypted data packets constitute the first encrypted power data;

[0066] Specific as Figure 3 As shown, after the power grid master station and the terminal device are authenticated, the security encryption module receives subdataA1...subdataAn sent by the terminal device in sequence, and extracts subdata1...subdata n from subdataA1...subdataAn, and uses the encryption chip to encrypt subdata1...subdata n in sequence to obtain subdata1'...subdata n', and uses the communication protocol of the security encryption module to encapsulate subdata1'...subdata n' to obtain subdataA1'...subdataAn' and then returns it to the terminal device;

[0067] and / or,

[0068] The security encryption module sends the first encrypted power data to the terminal device, and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, including: the security encryption module sends multiple first encrypted encapsulated data packets to the terminal device, so that the terminal device extracts multiple first encrypted data packets from the multiple first encrypted encapsulated data packets and merges the multiple first encrypted data packets into the first encrypted power data and then uploads them to the power grid master station, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

[0069] Specific as Figure 3 As shown, the security encryption module sends subdataA1'...subdataAn' to the terminal device, so that the terminal device extracts subdata1'...subdata n' from subdataA1'...subdataAn', and then merges subdata1'...subdata n' to obtain the first encrypted power data ciphertext C', and then uploads the ciphertext C' to the power grid master station, and the power grid master station decrypts the ciphertext C' to obtain the plaintext data C.

[0070] Among them, the power grid master station calls the decryption interface of the cipher machine. The cipher machine determines which device the message comes from and uses the local corresponding decryption key to decrypt and generate plaintext data C.

[0071] The above-mentioned packet sub-processing is because the length of the data exceeds the maximum byte length that the corresponding device can process at one time.

[0072] In the above, the encryption and decryption of the power data transmitted between the terminal device and the power grid master station are realized through operations such as subpackaging, encapsulation, encryption, and decryption.

[0073] Specifically, the security encryption module receives the second encrypted power data sent by the terminal device, where the second encrypted power data is obtained by the power grid master station calling the cryptographic machine to encrypt the second power data to be encrypted, including: the security encryption module receives multiple second encrypted encapsulated data packets sent by the terminal device, and extracts multiple second encrypted data packets from the multiple second encrypted encapsulated data packets, wherein the multiple second encrypted data packets constitute the second encrypted power data;

[0074] Specific as Figure 3As shown, the second power data to be encrypted is plain text D. The main station of the power grid calls the cryptographic machine to encrypt the plain text D to obtain the ciphertext D'. The encryption key is the encryption key M of the main station. After receiving the ciphertext D', the terminal device sub-packets it into subdatad1'...subdatadn', encapsulates it into a request frame subdataB1'...subdataBn' of the security encryption module communication protocol and sends it to the security encryption module. The security encryption module extracts subdatad1'...subdatadn' from subdataB1'...subdataBn'.

[0075] and / or,

[0076] The security encryption module uses an encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device, including: the security encryption module uses an encryption chip to decrypt multiple second encrypted data packets in sequence to obtain multiple second decrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple second decrypted data packets to obtain multiple second decrypted encapsulated data packets, and sends the multiple second decrypted encapsulated data packets to the terminal device, wherein the multiple second decrypted data packets constitute the second decrypted power data.

[0077] Specific as Figure 3 As shown, the security encryption module uses the encryption chip to send subdatad1'...subdatadn' to the encryption chip in sequence. The encryption chip decrypts in sequence and encapsulates the decrypted data subdatad1...subdatadn into the response frame message subdataD1...subdataDn of the security encryption module communication protocol, and the security encryption module returns it to the terminal device.

[0078] In the above, the encryption and decryption of the power data transmitted between the terminal device and the power grid master station are realized through operations such as subpackaging, encapsulation, encryption, and decryption.

[0079] Specifically, the format of the request frame used in the encryption and decryption process is the first start byte + first command + first index + first length + first data, and the format of the response frame used is the second start byte + second command + second index + result + second length + second data.

[0080] Among them, the first command indicates the type of command of the request frame, the first index indicates the index of the command of the request frame, the first length indicates the length of the data of the request frame, the first data indicates the data part of the command of the request frame, the second command indicates the type of command of the response frame, the second index indicates the index of the command of the response frame, the second length indicates the length of the data of the response frame, the second data indicates the data part of the command of the response frame, and the result indicates whether the response structure is normal.

[0081] Specifically, the first starting byte: 0x68;

[0082] First command: 1 byte, indicating the type of command, see command list;

[0083] First index: 1 byte, indicating the index of the command, ranging from 0 to 127; bit7 is set to 1 to indicate that there is more data to be sent; set to 0 to indicate that the sending is complete.

[0084] First length: 2 bytes, indicating the data length;

[0085] The first data: N bytes, representing the data part of the command, see the command list.

[0086] Specifically, the second starting byte: 1 byte, 0x68;

[0087] Second command: 1 byte, indicating the type of command, see command list;

[0088] Second index: 1 byte, indicating the index of the command, ranging from 0 to 127; set to 1 to indicate that there is response data to follow; set to 0 to indicate that the response is complete.

[0089] Result: 0 means normal, others mean error;

[0090] Second length: 2 bytes, indicating the data length;

[0091] Second data: N bytes, representing the data part of the command, see command list.

[0092] The specific command list is shown in Table 1: The command, index, length, and data in Table 1 are applicable to both the format of the request frame and the format of the response frame;

[0093] Table 1 Command list

[0094]

[0095]

[0096]

[0097] Second aspect embodiment:

[0098] The second aspect of the present application provides a plug-and-play data interaction method, wherein the security encryption module includes a processor chip and an encryption chip connected to the processor chip, and the security encryption module is detachably connected to the terminal device, such as Figure 4 As shown, the method includes:

[0099] Step S401, the terminal device sends a first random number acquisition request to the security encryption module;

[0100] Step S402: the security encryption module generates a first random number in response to the first random number acquisition request and sends the first random number to the terminal device;

[0101] Step S403, the terminal device sends the first random number to the power grid master station;

[0102] Step S404, the power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station;

[0103] Step S405, the security encryption module receives the first encrypted data sent by the terminal device and authenticates the first encrypted data. If the authentication is successful, it indicates that the terminal device can upload the power data to the power grid master station.

[0104] Specific as Figure 2 The master station authentication process has been introduced in the first aspect of the embodiment and will not be repeated here;

[0105] The above method of sending random numbers and encrypting and authenticating the random numbers realizes the authentication of the identity of the power grid master station. If the authentication is passed, the terminal device can upload the power data to the power grid master station.

[0106] Furthermore, the method further comprises:

[0107] The terminal device sends a second random number acquisition request to the power grid master station;

[0108] The power grid master station generates a second random number in response to a second random number acquisition request of the terminal device, and sends the second random number to the terminal device;

[0109] The terminal device sends the second random number to the security encryption module;

[0110] The security encryption module encrypts the second random number to obtain second encrypted data, and sends the second encrypted data to the terminal device;

[0111] The terminal device uploads the second encrypted data to the power grid master station;

[0112] The power grid master station authenticates the second encrypted data. If the authentication is successful, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

[0113] Specific as Figure 2 The terminal authentication process in the embodiment of the first aspect has been introduced and will not be repeated here;

[0114] The above method of sending random numbers and encrypting and authenticating the random numbers realizes the authentication of the identity of the terminal device. If the authentication is passed, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

[0115] Furthermore, the method further comprises:

[0116] After both the power grid master station and the terminal device are authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain the first encrypted power data;

[0117] The security encryption module sends the first encrypted power data to the terminal device;

[0118] The terminal device uploads the first encrypted power data to the power grid master station;

[0119] The power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

[0120] Furthermore, after the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, the method further includes:

[0121] The power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain second encrypted power data, and sends the second encrypted power data to the terminal device;

[0122] The terminal device sends the second encrypted power data to the security encryption module;

[0123] The security encryption module uses an encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device.

[0124] Further, after both the power grid master station and the terminal device are authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain the first encrypted power data, including: after both the power grid master station and the terminal device are authenticated, the terminal device splits the first power data to be encrypted into multiple first data packets to be encrypted, and uses the communication protocol of the security encryption module to encapsulate the multiple first data packets to be encrypted to obtain multiple first encapsulated data packets to be encrypted, and sends the multiple first encapsulated data packets to the security encryption module; the security encryption module extracts multiple first data packets to be encrypted from the multiple first encapsulated data packets to be encrypted, and uses the encryption chip to encrypt the multiple first data packets to be encrypted in turn to obtain multiple first encrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple first encrypted data packets to obtain multiple first encrypted encapsulated data packets;

[0125] Specific as Figure 3 As shown, the first embodiment has been introduced and will not be described again;

[0126] and / or,

[0127] The security encryption module sends the first encrypted power data to the terminal device; the terminal device uploads the first encrypted power data to the power grid main station; the power grid main station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, including: the security encryption module sends multiple first encrypted encapsulated data packets to the terminal device, the terminal device extracts multiple first encrypted data packets from the multiple first encrypted encapsulated data packets and merges the multiple first encrypted data packets into the first encrypted power data and then uploads it to the power grid main station; the power grid main station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

[0128] Specific as Figure 3 As shown, the first embodiment has been introduced and will not be described again;

[0129] Specifically, the power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain the second encrypted power data, and sends the second encrypted power data to the terminal device; the terminal device sends the second encrypted power data to the security encryption module; including: the power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain the second encrypted power data, and sends the second encrypted power data to the terminal device; the terminal device subpackets the second encrypted power data into multiple second encrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple second encrypted data packets to obtain multiple second encrypted encapsulated data packets, and sends the multiple second encrypted encapsulated data packets to the security encryption module;

[0130] Specific as Figure 3 As shown, the first embodiment has been introduced and will not be described again;

[0131] and / or,

[0132] The security encryption module uses an encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device, including:

[0133] The security encryption module extracts multiple second encrypted data packets from the multiple second encrypted encapsulated data packets, and uses an encryption chip to decrypt the multiple second encrypted data packets in sequence to obtain multiple second decrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple second decrypted data packets to obtain multiple second decrypted encapsulated data packets, and sends the multiple second decrypted encapsulated data packets to the terminal device, wherein the multiple second decrypted data packets constitute second decrypted power data.

[0134] Specific as Figure 3 As shown, the first embodiment has been introduced and will not be described again;

[0135] The third aspect embodiment:

[0136] The third aspect of the present application provides a security encryption module, the security encryption module includes a processor chip and an encryption chip connected to the processor chip, and the security encryption module is detachably connected to the terminal device, such as Figure 5 As shown, including:

[0137] A first receiving unit 51 is used to receive a first random number acquisition request sent by a terminal device;

[0138] A generating unit 52, configured to generate a first random number in response to a first random number acquisition request and forward the first random number to a power grid master station through a terminal device, so that the power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station;

[0139] The receiving authentication unit 53 is used to receive the first encrypted data sent by the terminal device and authenticate the first encrypted data. If the authentication is successful, it indicates that the terminal device can upload the power data to the power grid master station.

[0140] Optionally, the security encryption module also includes a second receiving unit and an encryption unit, the second receiving unit is used to receive a second random number sent by the terminal device, wherein the second random number is generated by the power grid master station in response to a second random number acquisition request of the terminal device; the encryption unit is used to encrypt the second random number to obtain second encrypted data, and forward the second encrypted data to the power grid master station through the terminal device, so that the power grid master station authenticates the second encrypted data. If the authentication is passed, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

[0141] Optionally, the security encryption module also includes a third receiving unit and a sending unit. The third receiving unit is used to receive the first power data to be encrypted sent by the terminal device after the power grid master station and the terminal device are authenticated, and use an encryption chip to encrypt the first power data to be encrypted to obtain first encrypted power data; the sending unit is used to send the first encrypted power data to the terminal device, and forward the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

[0142] Optionally, the security encryption module also includes a fourth receiving unit and a decryption unit. The fourth receiving unit is used to send the first encrypted power data to the terminal device, and forward the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data. Then, the security encryption module receives the second encrypted power data sent by the terminal device, and the second encrypted power data is obtained by the power grid master station calling the cryptographic machine to encrypt the second power data to be encrypted; the decryption unit is used to use the encryption chip to decrypt the second encrypted power data to obtain the second decrypted power data and send the second decrypted power data to the terminal device.

[0143] Optionally, the third receiving unit is used to receive multiple first encapsulated data packets to be encrypted sent by the terminal device in sequence after the power grid master station and the terminal device are both authenticated, and extract multiple first data packets to be encrypted from the multiple first encapsulated data packets to be encrypted, and use an encryption chip to encrypt the multiple first data packets to be encrypted in sequence to obtain multiple first encrypted data packets, and use the communication protocol of the security encryption module to encapsulate the multiple first encrypted data packets to obtain multiple first encrypted encapsulated data packets, wherein the multiple first data packets to be encrypted constitute first power data to be encrypted, and the multiple first encrypted data packets constitute first encrypted power data; and / or, the sending unit is used to send multiple first encrypted encapsulated data packets to the terminal device, so that the terminal device extracts multiple first encrypted data packets from the multiple first encrypted encapsulated data packets and merges the multiple first encrypted data packets into first encrypted power data and then uploads them to the power grid master station, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain first decrypted power data.

[0144] Optionally, the fourth receiving unit is used to receive multiple second encrypted encapsulated data packets sent by the terminal device, and extract multiple second encrypted data packets from the multiple second encrypted encapsulated data packets, wherein the multiple second encrypted data packets constitute second encrypted power data; and / or, the decryption unit is used to use an encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and send the second decrypted power data to the terminal device, including: the security encryption module uses an encryption chip to decrypt the multiple second encrypted data packets in sequence to obtain multiple second decrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple second decrypted data packets to obtain multiple second decrypted encapsulated data packets, and sends the multiple second decrypted encapsulated data packets to the terminal device, wherein the multiple second decrypted data packets constitute the second decrypted power data.

[0145] Optionally, the format of the request frame used in the encryption and decryption process is the first start byte + first command + first index + first length + first data, and the format of the response frame used is the second start byte + second command + second index + result + second length + second data, wherein the first command indicates the type of command of the request frame, the first index indicates the index of the command of the request frame, the first length indicates the length of the data of the request frame, the first data indicates the data part of the command of the request frame, the second command indicates the type of command of the response frame, the second index indicates the index of the command of the response frame, the second length indicates the length of the data of the response frame, the second data indicates the data part of the command of the response frame, and the result indicates whether the response structure is normal.

[0146] The security encryption module includes a processor and a memory. The first receiving unit, the generating unit, etc. are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.

[0147] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and low-cost encrypted communication can be achieved by adjusting kernel parameters.

[0148] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0149] Fourth aspect embodiment:

[0150] The fourth aspect of the present application provides an encryption system, such as Figure 6 As shown, it includes: a plug-and-play security encryption module, which executes any plug-and-play security encryption method; a power grid master station; and a terminal device, which wirelessly communicates with the power grid master station. The plug-and-play security encryption module has a plug, and the terminal device has a socket that is compatible with the plug.

[0151] Among them, the plug-and-play security encryption module and the terminal device are connected through a USB interface, and there is no need to modify the PCB circuit board of the terminal device or add a whole encryption box. It is low-cost, easy to transform, plug-and-play, and realizes the needs of secure interaction between multiple load-side resources and the power grid. And through the integrated design of the USB embedded encryption module, it realizes information security interaction and remote security management with the power grid, and can analyze the access status of the module and monitor the data security status, meeting the needs of distributed resources to securely access the power business master station.

[0152] The security encryption module is as follows Figure 7 As shown, the processor chip is connected to the encryption chip via one interface, and the processor chip is connected to the terminal device via another interface, thereby realizing plug-and-play of the terminal device of the security encryption module.

[0153] Fifth aspect embodiment:

[0154] The fifth aspect embodiment of the present application relates to the specific structure of the security encryption module mentioned in the other embodiments. Specifically, the security encryption module includes a processor chip and an encryption chip. The processor chip has a first interface and a second interface, and the first interface is used to connect to the terminal device; the encryption chip is connected to the processor chip through the second interface, and the encryption chip is integrated with an encryption algorithm. The processor chip is used to call the encryption algorithm to realize encrypted communication between the terminal device and the power grid master station.

[0155] Specifically, the processor chip of the present application can be selected from CH563 series CH563L single-chip microcomputer chips or single-chip microcomputer chips of the same type. The CH563L chip is a 32-bit RISC (Reduced Instruction Set Computer) CPU (Central Processing Unit), with a default system main frequency of 100MHZ and a maximum of 130MHZ. The high-speed USB interface and 10 / 100M network interface (built-in PHY (Physical Layer)) supporting DMA (Direct Memory Access) are integrated on the chip, and the highly integrated peripherals and high performance make it widely used in various embedded applications.

[0156] Specifically, the encryption chip of the present application can be selected from Microchip ATECC508A chip, Cypress PSoC6 chip, and WCH CH9307 chip.

[0157] Of course, the plug-and-play security encryption module of the present application can also directly select a microcontroller chip with encryption function, without using an external encryption chip, for example, STMicroelectronics STSAFE-A100 microcontroller, NXP LPC4300 Series microcontroller, Infineon SLB 9635 security controller, Renesas RX62TGroup microcontroller, Cypress PSoC 6 programmable system-level chip;

[0158] Furthermore, the processor chip also has a third interface, which is a program burning interface. The program in the processor chip is written from the program burning interface. In addition, the update of the encryption algorithm in the encryption chip can also be written from this program burning interface.

[0159] Optionally, the first interface is a USB (Universal Serial Bus) interface, the second interface is a first SPI interface (Serial Peripheral Interface), and the third interface is a second SPI interface. Since general terminal devices have USB interfaces, the first interface uses a USB interface to achieve connection to most terminal devices. A plug-and-play USB embedded encryption module is designed using the common USB physical interface in terminal devices. There is no need for the terminal device to modify the PCB circuit board or add an entire encryption box. It has low cost, easy modification, plug-and-play, and meets the needs of secure interaction between multiple load-side resources and power grids.

[0160] Optionally, a display device is integrated in the processor chip, and different display results of the display device indicate different states of the encryption chip, and the states of the encryption chip include an encrypting state and an idle state.

[0161] Optionally, the display device is an LED (Light Emitting Diode) indicator light. For example, if the LED indicator light is off, it indicates an idle state, and if the LED indicator light is on, it indicates an encryption state; for example, if the LED indicator light is red, it indicates an idle state, and if the LED indicator light is green, it indicates an encryption state.

[0162] Optionally, the security encryption module further includes a voltage conversion unit, which includes at least one voltage conversion module, and the output ends of the voltage conversion modules are electrically connected to the power supply ends of the processor chip and the encryption chip respectively.

[0163] Optionally, the operating voltage of the processor chip is a first operating voltage, the operating voltage of the encryption chip is a second operating voltage, the first operating voltage is greater than or less than the second operating voltage; the voltage conversion module includes a first voltage conversion module and a second voltage conversion module connected in series, when the first operating voltage is greater than the second operating voltage, the first voltage conversion module outputs the first operating voltage and the second voltage conversion module outputs the second operating voltage, when the first operating voltage is less than the second operating voltage, the first voltage conversion module outputs the second operating voltage and the second voltage conversion module outputs the first operating voltage. Specifically, the first operating voltage is 3.3V and the second operating voltage is 1.8V.

[0164] Optionally, the voltage conversion module is a step-down module.

[0165] Optionally, the security encryption module further comprises a housing, the housing has a housing cavity, the processor chip and the encryption chip are placed in the housing cavity, the housing has two holes, the first hole is aligned with the first interface, and the second hole is aligned with the third interface. The processor chip and the encryption chip can be placed in a housing and corresponding holes can be opened on the housing to facilitate the connection of the interfaces.

[0166] Optionally, the software part of the processor chip includes a driver layer software and an application layer software, the driver layer software includes software for driving the first interface, software for driving the second interface and software for supporting communication between serial ports, and the application layer software includes software for supporting the security encryption module to upload data to the terminal device, and software for supporting the terminal device to send data to the security encryption module.

[0167] Specifically, Figure 8 As shown in the figure, the data upload and download between the secure encryption module and the terminal device are completed through the CDC (Communication Device Class) device class and the BULK (Bulk Transfer Protocol) transmission method. The steps are as follows:

[0168] Step 1: Configure the security encryption module and terminal device as CDC device class;

[0169] Step 2: Assign a configuration and two interfaces; Interface 1 has one interrupt, type 81 interrupt; Interface 2 has two interrupts, namely ENP2 (input) bulk transmission and ENP2 (output) bulk. Among them, port 0x82 is used for data transmission from the security encryption module to the terminal device, and port 02 is used for data transmission from the terminal device to the security encryption module. The Setup and bulk input and output communications of the device are completed through the USB interrupt.

[0170] Sixth aspect embodiment:

[0171] The sixth aspect embodiment of the present application provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any of the plug-and-play security encryption methods and data interaction methods.

[0172] Seventh aspect embodiment:

[0173] The seventh aspect embodiment of the present application provides an electronic device, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any of the plug-and-play security encryption methods and data interaction methods.

[0174] Eighth aspect embodiment:

[0175] An eighth aspect embodiment of the present application provides an embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the plug-and-play security encryption method and the plug-and-play data interaction method are executed when the program is running.

[0176] Ninth aspect embodiment:

[0177] The ninth aspect embodiment of the present application provides a computer program product which, when executed on a data processing device, is suitable for executing a program that initializes the plug-and-play security encryption method and the plug-and-play data interaction method steps.

[0178] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0179] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0180] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0181] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0183] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0184] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0185] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape and disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0186] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0187] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A plug-and-play secure encryption method, characterized in that: The security encryption module includes a processor chip and an encryption chip connected to the processor chip, the security encryption module is detachably connected to the terminal device, the method is applied to the security encryption module, and the method includes: The security encryption module receives a first random number acquisition request sent by the terminal device; The security encryption module generates a first random number in response to the first random number acquisition request and forwards the first random number to the power grid master station through the terminal device, so that the power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station; The security encryption module receives the first encrypted data sent by the terminal device and authenticates the first encrypted data. If the authentication is successful, it indicates that the terminal device can upload the power data to the power grid master station.

2. The method according to claim 1, characterized in that The method further comprises: The security encryption module receives a second random number sent by the terminal device, wherein the second random number is generated by the power grid master station in response to a second random number acquisition request of the terminal device; The security encryption module encrypts the second random number to obtain second encrypted data, and forwards the second encrypted data to the power grid master station through the terminal device, so that the power grid master station authenticates the second encrypted data. If the authentication is successful, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

3. The method according to claim 2, characterized in that The method further comprises: After the power grid master station and the terminal device are both authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain first encrypted power data; The security encryption module sends the first encrypted power data to the terminal device, and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

4. The method according to claim 3, characterized in that After the security encryption module sends the first encrypted power data to the terminal device, and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, the method further includes: The security encryption module receives the second encrypted power data sent by the terminal device, where the second encrypted power data is obtained by the power grid master station calling the cryptographic machine to encrypt the second power data to be encrypted; The security encryption module uses the encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device.

5. The method according to claim 3, characterized in that: After the power grid master station and the terminal device are both authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain the first encrypted power data, including: after the power grid master station and the terminal device are both authenticated, the security encryption module sequentially receives multiple first encapsulated data packets to be encrypted sent by the terminal device, and extracts multiple first data packets to be encrypted from the multiple first encapsulated data packets to be encrypted, and uses the encryption chip to encrypt the multiple first data packets to be encrypted in turn to obtain multiple first encrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple first encrypted data packets to obtain multiple first encrypted encapsulated data packets, wherein the multiple first data packets to be encrypted constitute the first power data to be encrypted, and the multiple first encrypted data packets constitute the first encrypted power data; and / or, The security encryption module sends the first encrypted power data to the terminal device, and forwards the first encrypted power data to the power grid master station through the terminal device, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, including: the security encryption module sends multiple first encrypted encapsulated data packets to the terminal device, so that the terminal device extracts multiple first encrypted data packets from the multiple first encrypted encapsulated data packets and merges the multiple first encrypted data packets into the first encrypted power data and then uploads them to the power grid master station, so that the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

6. The method according to claim 4, characterized in that The security encryption module receives the second encrypted power data sent by the terminal device, where the second encrypted power data is obtained by the power grid master station calling the cryptographic machine to encrypt the second power data to be encrypted, including: the security encryption module receives a plurality of second encrypted encapsulated data packets sent by the terminal device, and extracts a plurality of second encrypted data packets from the plurality of second encrypted encapsulated data packets, wherein the plurality of second encrypted data packets constitute the second encrypted power data; and / or, The security encryption module uses the encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device, including: the security encryption module uses the encryption chip to decrypt multiple second encrypted data packets in sequence to obtain multiple second decrypted data packets, and uses the communication protocol of the security encryption module to encapsulate multiple second decrypted data packets to obtain multiple second decrypted encapsulated data packets, and sends multiple second decrypted encapsulated data packets to the terminal device, wherein multiple second decrypted data packets constitute the second decrypted power data.

7. The method according to any one of claims 1 to 6, characterized in that The format of the request frame used in the encryption and decryption process is the first start byte + first command + first index + first length + first data, and the format of the response frame used is the second start byte + second command + second index + result + second length + second data. Among them, the first command indicates the type of command of the request frame, the first index indicates the index of the command of the request frame, the first length indicates the length of the data of the request frame, the first data indicates the data part of the command of the request frame, the second command indicates the type of command of the response frame, the second index indicates the index of the command of the response frame, the second length indicates the length of the data of the response frame, the second data indicates the data part of the command of the response frame, and the result indicates whether the response structure is normal.

8. A plug-and-play data interaction method, characterized in that: The security encryption module includes a processor chip and an encryption chip connected to the processor chip, the security encryption module is detachably connected to the terminal device, and the method includes: The terminal device sends a first random number acquisition request to the security encryption module; The security encryption module generates a first random number in response to the first random number acquisition request and sends the first random number to the terminal device; The terminal device sends the first random number to a power grid master station; The power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station; The security encryption module receives the first encrypted data sent by the terminal device and authenticates the first encrypted data. If the authentication is successful, it indicates that the terminal device can upload the power data to the power grid master station.

9. The method according to claim 8, characterized in that The method further comprises: The terminal device sends a second random number acquisition request to the power grid master station; The power grid master station generates a second random number in response to a second random number acquisition request of the terminal device, and sends the second random number to the terminal device; The terminal device sends the second random number to the security encryption module; The security encryption module encrypts the second random number to obtain second encrypted data, and sends the second encrypted data to the terminal device; The terminal device uploads the second encrypted data to the power grid master station; The power grid master station authenticates the second encrypted data. If the authentication is successful, it indicates that the power grid master station can receive the power data uploaded by the terminal device.

10. The method according to claim 9, characterized in that The method further comprises: After the power grid master station and the terminal device are both authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain first encrypted power data; The security encryption module sends the first encrypted power data to the terminal device; The terminal device uploads the first encrypted power data to the power grid master station; The power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain first decrypted power data.

11. The method according to claim 10, characterized in that After the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, the method further includes: The power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain second encrypted power data, and sends the second encrypted power data to the terminal device; The terminal device sends the second encrypted power data to the security encryption module; The security encryption module uses the encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device.

12. The method according to claim 10, characterized in that After both the power grid master station and the terminal device are authenticated, the security encryption module receives the first power data to be encrypted sent by the terminal device, and uses the encryption chip to encrypt the first power data to be encrypted to obtain the first encrypted power data, including: after both the power grid master station and the terminal device are authenticated, the terminal device splits the first power data to be encrypted into multiple first data packets to be encrypted, and uses the communication protocol of the security encryption module to encapsulate the multiple first data packets to be encrypted to obtain multiple first encapsulated data packets to be encrypted, and sends the multiple first encapsulated data packets to the security encryption module; the security encryption module extracts multiple first data packets to be encrypted from the multiple first encapsulated data packets to be encrypted, and uses the encryption chip to encrypt the multiple first data packets to be encrypted in turn to obtain multiple first encrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple first encrypted data packets to obtain multiple first encrypted encapsulated data packets; and / or, The security encryption module sends the first encrypted power data to the terminal device; the terminal device uploads the first encrypted power data to the power grid master station; the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data, including: the security encryption module sends multiple first encrypted encapsulated data packets to the terminal device, the terminal device extracts multiple first encrypted data packets from the multiple first encrypted encapsulated data packets and merges the multiple first encrypted data packets into the first encrypted power data and then uploads them to the power grid master station; the power grid master station calls the decryption interface of the cryptographic machine to decrypt the first encrypted power data to obtain the first decrypted power data.

13. The method according to claim 11, characterized in that The power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain second encrypted power data, and sends the second encrypted power data to the terminal device; The terminal device sends the second encrypted power data to the security encryption module; including: the power grid master station calls the cryptographic machine to encrypt the second power data to be encrypted to obtain the second encrypted power data, and sends the second encrypted power data to the terminal device; the terminal device subpackets the second encrypted power data into a plurality of second encrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the plurality of second encrypted data packets to obtain a plurality of second encrypted encapsulated data packets, and sends the plurality of second encrypted encapsulated data packets to the security encryption module; and / or, The security encryption module uses the encryption chip to decrypt the second encrypted power data to obtain second decrypted power data and sends the second decrypted power data to the terminal device, including: The security encryption module extracts multiple second encrypted data packets from multiple second encrypted encapsulated data packets, and uses the encryption chip to decrypt the multiple second encrypted data packets in sequence to obtain multiple second decrypted data packets, and uses the communication protocol of the security encryption module to encapsulate the multiple second decrypted data packets to obtain multiple second decrypted encapsulated data packets, and sends the multiple second decrypted encapsulated data packets to the terminal device, wherein the multiple second decrypted data packets constitute the second decrypted power data.

14. A security encryption module, characterized in that: The security encryption module includes a processor chip and an encryption chip connected to the processor chip, and the security encryption module is detachably connected to the terminal device, including: A first receiving unit, configured to receive a first random number acquisition request sent by the terminal device; a generating unit, configured to generate a first random number in response to the first random number acquisition request and forward the first random number to a power grid master station through the terminal device, so that the power grid master station encrypts the first random number to obtain first encrypted data and sends the first encrypted data to the terminal device, wherein wireless communication is performed between the terminal device and the power grid master station; A receiving and authentication unit is used to receive the first encrypted data sent by the terminal device and authenticate the first encrypted data. If the authentication is successful, it indicates that the terminal device can upload the power data to the power grid master station.

15. An encryption system, characterized in that: include: A plug-and-play security encryption module, executing the plug-and-play security encryption method according to any one of claims 1 to 7; Power grid master station; The terminal device performs wireless communication with the power grid master station, the plug-and-play security encryption module has a plug, and the terminal device has a socket adapted to the plug.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method of any one of claims 1 to 7 or any one of claims 8 to 13.

17. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of claims 1 to 7, or any one of 8 to 13.