Power equipment communication method and device, computer equipment and readable storage medium

By building an IPSEC tunnel between the power terminal equipment and the concentrator equipment in the smart grid and generating a shared key, the problem of low communication security is solved, and high security and attack resistance of data transmission are achieved.

CN119298942APending Publication Date: 2025-01-10ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411349322.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The prior art In the data transmission between the power terminal equipment and the concentrator terminal equipment in the smart power grid, communication security is not high, and there is a risk of data leakage and tampering.

Method used

By building an IPSEC tunnel between the power terminal device and the concentrator device, verifying the device address legality, and generating a shared key for encrypted transmission, ensuring the security of the data during the transmission process.

Benefits of technology

It improves the security of power equipment communication, prevents data leakage and tampering, and enhances the communication system's anti-attack capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119298942A_ABST
    Figure CN119298942A_ABST
Patent Text Reader

Abstract

The invention relates to a power equipment communication method and device, computer equipment and a readable storage medium. The method comprises the steps that in response to a message transmission request for transmitting an IP message to message receiving equipment, an IPSEC tunnel between power equipment is constructed under the condition that both message sending equipment and the message receiving equipment pass equipment address legality verification, the message sending equipment is one of power terminal equipment and concentrator equipment, and the message receiving equipment is one of the power terminal equipment and the concentrator equipment; the message receiving equipment is the other one of the power terminal equipment and the concentrator equipment except the message sending equipment, performs key negotiation with the message receiving equipment, generates a shared key between the message sending equipment and the message receiving equipment, encrypts an IP message by using the shared key to obtain an IP ciphertext, and sends the IP ciphertext to the concentrator equipment; and sending the IP ciphertext to a message receiving device through the IPSEC tunnel, the message receiving device being used for decrypting the IP ciphertext through the shared key to obtain an IP message. By adopting the method, the communication security can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method and apparatus for communication of electric power equipment, a computer device, a computer-readable storage medium, and a computer program product. Background Art

[0002] In the smart grid, power terminal equipment and concentrator terminal equipment, as important components of the power system, undertake the tasks of real-time data collection, transmission and processing. The collected relevant data flows from the power terminal equipment to the concentrator terminal equipment, and the concentrator terminal equipment reports the subsequent data. Therefore, it is very important to ensure the security and effectiveness of data in the process of data flowing from the power terminal equipment to the concentrator terminal equipment. The existing technology uses a shared key to encrypt and transmit data to protect the security and privacy of communication data.

[0003] However, the current method of using a shared key to encrypt and transmit data has the problem of low communication security. Summary of the invention

[0004] Based on this, it is necessary to provide a power equipment communication method, device, computer equipment, computer-readable storage medium and computer program product that can improve communication security in response to the above technical problems.

[0005] In a first aspect, the present application provides a power equipment communication method, which is applied to a message sending device, comprising:

[0006] In response to a message transmission request for transmitting an IP message to a message receiving device, an IPSEC tunnel is constructed between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0007] Perform key negotiation with the message receiving device to generate a shared key between the message sending device and the message receiving device;

[0008] The IP message is encrypted using the shared key to obtain IP ciphertext, and the IP ciphertext is sent to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain the IP message.

[0009] In one embodiment, performing key negotiation with a message receiving device to generate a shared key between the message sending device and the message receiving device includes:

[0010] Acquire the message sending device address information of the message sending device, and generate the message sending device public information according to the message sending device address information;

[0011] sending public information of a message sending device to a message receiving device through an IPSEC tunnel, and receiving public information of a message receiving device from the message receiving device; the public information of the message sending device is used to instruct the message receiving device to generate a shared key, and the public information of the message receiving device is obtained by the message receiving device based on the message receiving device address information of the message receiving device;

[0012] Based on the public information of the message receiving device and the address information of the message sending device, a shared key between the message sending device and the message receiving device is generated.

[0013] In one of the embodiments, the message sending device address information includes a sending public parameter and a sending private parameter, the message receiving device address information includes a receiving public parameter and a receiving private parameter, the sending public parameter and the receiving public parameter have the same parameter value, and the sending private parameter and the receiving private parameter have different parameter values; the sending public parameter includes a first sending public parameter and a second sending public parameter; the receiving public parameter includes a first receiving public parameter and a second receiving public parameter;

[0014] Generate public information of the message sending device according to the message sending device address information, including:

[0015] The first sending public parameter is modulo the sending private parameter power of the second sending public parameter to obtain the message sending device public information; the message sending device public information is used to instruct the message receiving device to modulo the first receiving public parameter using the receiving private parameter power of the message sending device public information to obtain a shared key;

[0016] Based on the public information of the message receiving device and the address information of the message sending device, a shared key between the message sending device and the message receiving device is generated, including:

[0017] The first sending public parameter is modulo the sending private parameter power of the message receiving device public information to obtain a shared key; the message receiving device public information is obtained by the message receiving device modulo the first receiving public parameter using the receiving private parameter power of the second receiving public parameter.

[0018] In one embodiment, the method further includes: obtaining the number of encryption times and survival time of the shared key;

[0019] When the number of encryption times is greater than or equal to the preset encryption times threshold, or the number of encryption times is less than the preset encryption times threshold and the survival time is greater than the preset survival time threshold, update the message sending device address information, and generate updated message sending device public information according to the updated message sending device address information;

[0020] Sending updated public information of the message sending device to the message receiving device through the IPSEC tunnel, and receiving updated public information of the message receiving device from the message receiving device; the updated public information of the message sending device is used to instruct the message receiving device to generate an updated shared key, and the updated public information of the message receiving device is obtained by the message receiving device based on the updated address information of the message receiving device;

[0021] An updated shared key is generated based on the updated public information of the message receiving device and the updated address information of the message sending device.

[0022] In one embodiment, updating the message sending device address information includes:

[0023] Add 1 to the sending public parameter to obtain the updated sending public parameter;

[0024] The message sending device address information of the message sending device is updated using the updated sending public parameters.

[0025] In an exemplary embodiment, the IP message is encrypted using a shared key to obtain an IP ciphertext, including:

[0026] Get the current time recorded by the message sending device, and generate the corresponding date string based on the current time;

[0027] According to the date string and the shared key, a secondary encryption sequence is obtained;

[0028] The IP message is XORed using the secondary encryption sequence to obtain the IP ciphertext.

[0029] In one embodiment, the method further includes: obtaining a message sending device address of the message sending device, and sending the message sending device address to the message receiving device;

[0030] The message receiving device address of the message receiving device is received from the message receiving device, and the legitimacy verification result of the sending device address returned by the message receiving device; the legitimacy verification result of the sending device address is obtained by the message receiving device after performing device address legitimacy verification based on the message sending device address and a pre-stored message sending legal device address table;

[0031] Based on the message receiving device address and the pre-stored message receiving legal device address table, obtaining the receiving device address legality verification result;

[0032] When the sending device address legitimacy verification result indicates that the message sending device address matches any device address in the message sending legal device address table, and the receiving device address legitimacy verification result indicates that the message receiving device address matches any device address in the message receiving legal device address table, it is determined that both the message sending device and the message receiving device have passed the device address legitimacy verification.

[0033] In a second aspect, the present application also provides a power equipment communication method, which is applied to a message receiving device, comprising:

[0034] When it is detected that an IPSEC tunnel is constructed between the message receiving device and the message sending device, key negotiation is performed with the message sending device to generate a shared key between the message sending device and the message receiving device; the IPSEC tunnel is constructed by the message sending device in response to a message transmission request for transmitting an IP message to the message receiving device, and when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0035] The IP ciphertext sent by the message sending device is received through the IPSEC tunnel, and the IP ciphertext is decrypted using the shared key to obtain the IP message; the IP ciphertext is obtained by the message sending device encrypting the IP message using the shared key.

[0036] In one embodiment, performing key negotiation with a message sending device to generate a shared key between the message sending device and the message receiving device includes:

[0037] Acquire message receiving device address information of the message receiving device, and generate message receiving device public information according to the message receiving device address information;

[0038] Sending the public information of the message receiving device to the message sending device through the IPSEC tunnel, and receiving the public information of the message sending device from the message sending device; the public information of the message receiving device is used to instruct the message sending device to generate a shared key, and the public information of the message sending device is obtained by the message sending device based on the message sending device address information of the message sending device;

[0039] Based on the public information of the message sending device and the address information of the message receiving device, a shared key between the message sending device and the message receiving device is generated.

[0040] In one of the embodiments, the message receiving device address information includes a receiving public parameter and a receiving private parameter, the message sending device address information includes a sending public parameter and a sending private parameter, the receiving public parameter and the sending public parameter have the same parameter value, and the receiving private parameter and the sending private parameter have different parameter values; the receiving public parameter includes a first receiving public parameter and a second receiving public parameter; the sending public parameter includes a first sending public parameter and a second sending public parameter;

[0041] Generate public information of the message receiving device according to the address information of the message receiving device, including:

[0042] The first receiving public parameter is modulo the receiving private parameter power of the second receiving public parameter to obtain the message receiving device public information; the message sending device public information is used to instruct the message sending device to modulo the first sending public parameter using the sending private parameter power of the message receiving device public information to obtain a shared key;

[0043] Based on the public information of the message sending device and the address information of the message receiving device, a shared key between the message sending device and the message receiving device is generated, including:

[0044] The first receiving public parameter is modulo the power of the receiving private parameter of the public information of the message sending device to obtain a shared key; the public information of the message sending device is obtained by the message sending device modulo the first sending public parameter using the sending private parameter power of the second sending public parameter.

[0045] In an exemplary embodiment, the method further comprises:

[0046] Get the number of decryption times and lifetime of the shared key;

[0047] When the number of decryption times is greater than or equal to a preset decryption times threshold, or when the number of decryption times is less than a preset decryption times threshold and the survival time is greater than a preset survival time threshold, the message receiving device address information is updated, and updated message receiving device public information is generated according to the updated message receiving device address information;

[0048] Sending updated public information of the message receiving device to the message sending device through the IPSEC tunnel, and receiving updated public information of the message sending device from the message sending device; the updated public information of the message receiving device is used to instruct the message sending device to generate an updated shared key, and the updated public information of the message sending device is obtained by the message sending device based on the updated message sending device address information of the message sending device;

[0049] An updated shared key is generated based on the updated public information of the message sending device and the updated address information of the message receiving device.

[0050] In one embodiment, updating the message receiving device address information includes:

[0051] Add 1 to the received public parameter to obtain the updated received public parameter;

[0052] The message receiving device address information of the message receiving device is updated using the updated reception public parameters.

[0053] In one embodiment, the method includes:

[0054] Receive a message sending device address from the message sending device, and obtain a message receiving device address of the message receiving device;

[0055] Based on the message sending device address and the pre-stored message sending legal device address table, obtain the sending device address legality verification result;

[0056] The message sending device sends the legitimacy verification result of the sending device address and the message receiving device address to the message sending device; the message sending device is used to determine whether to build an IPSEC tunnel based on the legitimacy verification result of the sending device address, the message receiving device address and a pre-stored message receiving legal device address table.

[0057] In a third aspect, the present application further provides a power equipment communication device, which is applied to a message sending device, including:

[0058] A tunnel construction module, for responding to a message transmission request for transmitting an IP message to a message receiving device, and constructing an IPSEC tunnel between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0059] A key negotiation module, used to negotiate a key with a message receiving device to generate a shared key between the message sending device and the message receiving device;

[0060] The ciphertext sending module is used to encrypt the IP message with the shared key to obtain the IP ciphertext, and send the IP ciphertext to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext with the shared key to obtain the IP message.

[0061] In a fourth aspect, the present application further provides a power equipment communication device, applied to a message receiving device, comprising:

[0062] A key negotiation module is used to negotiate a key with the message sending device to generate a shared key between the message sending device and the message receiving device when it is detected that an IPSEC tunnel is constructed between the message receiving device and the message sending device; the IPSEC tunnel is constructed by the message sending device in response to a message transmission request for transmitting an IP message to the message receiving device, and when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0063] The ciphertext receiving module is used to receive the IP ciphertext sent by the message sending device through the IPSEC tunnel, and decrypt the IP ciphertext using the shared key to obtain the IP message; the IP ciphertext is obtained by the message sending device encrypting the IP message using the shared key.

[0064] In a fifth aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0065] In response to a message transmission request for transmitting an IP message to a message receiving device, an IPSEC tunnel is constructed between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0066] Perform key negotiation with the message receiving device to generate a shared key between the message sending device and the message receiving device;

[0067] The IP message is encrypted using the shared key to obtain IP ciphertext, and the IP ciphertext is sent to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain the IP message.

[0068] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0069] In response to a message transmission request for transmitting an IP message to a message receiving device, an IPSEC tunnel is constructed between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0070] Perform key negotiation with the message receiving device to generate a shared key between the message sending device and the message receiving device;

[0071] The IP message is encrypted using the shared key to obtain IP ciphertext, and the IP ciphertext is sent to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain the IP message.

[0072] In a seventh aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0073] In response to a message transmission request for transmitting an IP message to a message receiving device, an IPSEC tunnel is constructed between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0074] Perform key negotiation with the message receiving device to generate a shared key between the message sending device and the message receiving device;

[0075] The IP message is encrypted using the shared key to obtain IP ciphertext, and the IP ciphertext is sent to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain the IP message.

[0076] The above-mentioned power equipment communication method, device, computer equipment, computer-readable storage medium and computer program product, in response to a message transmission request for transmitting an IP message to a message receiving device, build an IPSEC tunnel between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification, the message sending device is one of the power terminal device and the concentrator device, the message receiving device is the other of the power terminal device and the concentrator device except the message sending device, negotiate keys with the message receiving device, generate a shared key between the message sending device and the message receiving device, encrypt the IP message using the shared key to obtain an IP ciphertext, and send the IP ciphertext to the message receiving device through the IPSEC tunnel, the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain an IP message. By authenticating the legitimacy of the device addresses of both parties in communication, an IPSEC tunnel for communication is established, and corresponding key negotiation is performed to build a shared key of both parties, and the IP message is decrypted using the shared key, thereby greatly improving the communication security. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0078] Figure 1 A diagram of an application environment of a power equipment communication method in an embodiment;

[0079] Figure 2 A schematic diagram of a flow chart of a method for communication of electric power equipment in one embodiment;

[0080] Figure 3 A schematic diagram of a flow chart of a power equipment communication method in another embodiment;

[0081] Figure 4 A schematic diagram of a process of using an IPSCEC tunnel for data transmission in one embodiment;

[0082] Figure 5 A schematic diagram of a flow chart of a device address authentication detection method in another embodiment;

[0083] Figure 6 A schematic diagram of a key negotiation method in an embodiment;

[0084] Figure 7 It is a schematic diagram of interaction between IP message decryption and encryption in another embodiment;

[0085] Figure 8 A schematic diagram of a process for updating a shared key in an embodiment;

[0086] Fig. 9 A structural block diagram of a power equipment communication device in one embodiment;

[0087] Fig.10 is a structural block diagram of a power equipment communication device in another embodiment;

[0088] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0089] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0090] The power equipment communication method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the message sending device 102 can communicate with the message receiving device 104 through the network, and the unencrypted IP message is transmitted. The message sending device 102 can also perform device address verification with the message receiving device 104, and if the verification is passed, an IP security tunnel (IPSEC, Internet Protocol Security Channel) is established between the message receiving device 104, and the two parties negotiate keys to generate a shared key. The IP ciphertext encrypted with the shared key is transmitted in the IPSEC tunnel. Among them, the message sending device 102 is one of the power terminal device and the concentrator device, and the message receiving device 104 is the other of the power terminal device and the concentrator device except the message sending device 102. In response to a message transmission request to transmit an IP message to a message receiving device, when both the message sending device and the message receiving device pass the device address legitimacy verification, an IPSEC tunnel is constructed between the message sending device and the message receiving device, a key negotiation is performed with the message receiving device, a shared key is generated between the message sending device and the message receiving device, the IP message is encrypted using the shared key to obtain an IP ciphertext, and the IP ciphertext is sent to the message receiving device through the IP tunnel, and the message receiving device decrypts the IP ciphertext using the shared key to obtain an IP message. Among them, the message sending device 102 can be a transformer, a switchboard, a relay, a smart meter, an automation device, a circuit breaker, etc., or a data concentrator, a communication concentrator, an Internet of Things concentrator, etc.; the message receiving device 104 can be a transformer, a switchboard, a relay, a smart meter, an automation device, a circuit breaker, etc., or a data concentrator, a communication concentrator, an Internet of Things concentrator, etc.

[0091] In an exemplary embodiment, Figure 2 As shown, a method for communication of electric power equipment is provided, and the method is applied to Figure 1 Taking the message sending device 102 in the example as an example, the method includes the following steps S201 to S203. Among them:

[0092] Step S201, in response to a message transmission request to transmit an IP message to a message receiving device, when both the message sending device and the message receiving device pass the device address legitimacy verification, an IPSEC tunnel is constructed between the message sending device and the message receiving device; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device.

[0093] Among them, IPSEC tunnel can be understood as a network security mechanism for establishing a secure, encrypted data transmission channel on an insecure network (such as the Internet). It achieves data confidentiality and integrity by creating a virtual tunnel between two network nodes. Power terminal equipment can be understood as a general term for various devices and instruments directly related to power generation, transmission, distribution or use in the power system. They play a vital role at the end or access point of the power network, and are mainly used to achieve power measurement, monitoring, control and protection. Concentrator equipment can be understood as a device responsible for concentrating and processing data from multiple terminal devices or sensors in a data collection, monitoring or control system.

[0094] Optionally, the message sending device 102 is one of the power terminal device and the concentrator device, and the message receiving device 104 is the other of the power terminal device and the concentrator device except the message sending device. Here, the power terminal device is used as the message sending device 102, and the concentrator device is used as the message receiving device 104 as an example. In response to a message transmission request for transmitting an IP message to the message receiving device 104, when both the message sending device 102 and the message receiving device 104 pass the device address legitimacy verification, an IPSEC tunnel is constructed between the message sending device 102 and the message receiving device 104. The IPSEC tunnel between the devices is constructed only when the device addresses of both parties pass the device address legitimacy verification, thereby avoiding the invalid construction cost caused by direct construction and the inability of the two parties to communicate. At the same time, the constructed IPSEC tunnel provides a highly secure transmission channel for subsequent communications.

[0095] Step S202: Perform key negotiation with the message receiving device to generate a shared key between the message sending device and the message receiving device.

[0096] Among them, key negotiation can be understood as a process in which a group of participants (usually the two communicating parties) jointly generate and exchange encryption keys through a certain protocol or algorithm in an insecure environment. It can be known that the shared keys generated by both parties are the same.

[0097] For example, the message sending device 102 and the message receiving device 104 perform key negotiation, calculate the shared key by a certain agreed calculation method, and generate a shared key between the message sending device 102 and the message receiving device 104. The generated shared key lays a data foundation for the subsequent encrypted transmission of IP messages, thereby improving the transmission security of IP messages.

[0098] Step S203, encrypt the IP message using the shared key to obtain IP ciphertext, and send the IP ciphertext to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain the IP message.

[0099] Optionally, the power terminal device 102 encrypts the IP message using a shared key to obtain an IP ciphertext, and sends the IP ciphertext to the concentrator device through the constructed IPSEC tunnel. The concentrator device 104 decrypts the IP ciphertext using the shared key to obtain an IP message. The IP message is encrypted using a shared key, and the encrypted IP message is sent to the concentrator device 104 through the IPSEC tunnel. The IP message is encrypted using a shared key, and the ciphertext is transmitted through the IPSEC tunnel, thereby enhancing the security of message transmission.

[0100] In the above-mentioned power equipment communication method, in response to a message transmission request for transmitting an IP message to a message receiving device, when both the message sending device and the message receiving device pass the device address legitimacy verification, an IPSEC tunnel is constructed between the message sending device and the message receiving device, the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device other than the message sending device, and a key negotiation is performed with the message receiving device to generate a shared key between the message sending device and the message receiving device, and the IP message is encrypted using the shared key to obtain an IP ciphertext, and the IP ciphertext is sent to the message receiving device through the IPSEC tunnel, and the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain an IP message. By authenticating the legitimacy of the device addresses of both parties in communication, an IPSEC tunnel for communication is established, and corresponding key negotiation is performed to construct a shared key of both parties, and the IP message is decrypted using the shared key, which greatly improves the communication security.

[0101] In one embodiment, performing key negotiation with a message receiving device to generate a shared key between the message sending device and the message receiving device includes:

[0102] Acquire the message sending device address information of the message sending device, and generate the message sending device public information according to the message sending device address information; send the message sending device public information to the message receiving device through the IPSEC tunnel, and receive the message receiving device public information from the message receiving device; the message sending device public information is used to instruct the message receiving device to generate a shared key, and the message receiving device public information is obtained by the message receiving device based on the message receiving device address information of the message receiving device; generate a shared key between the message sending device and the message receiving device based on the message receiving device public information and the message sending device address information.

[0103] Among them, the message sending device address information can be understood as the message sending device address information recorded in the database for calculating the shared key, which may be the same as or different from the actual device address of the message sending device; similarly, the message receiving device address information can also be understood as the message receiving device address information recorded in the database for calculating the shared key, which may be the same as or different from the actual device address of the message receiving device.

[0104] For example, the message sending device 102 obtains the message sending device address information of the message sending device, generates the message sending device public information according to the message sending device address information, sends the message sending device public information to the message receiving device 104 through the IPSEC tunnel, and receives the message receiving device public information from the message receiving device 104, the message sending device public information is used to instruct the message receiving device to generate a shared key, the message receiving device public information is obtained by the message receiving device 104 based on the message receiving device address information of the message receiving device 104, and the message sending device 102 generates a shared key between the message sending device 102 and the message receiving device 104 based on the message receiving device public information and the message sending device address information. The device address information of the two communicating parties is used to calculate the shared key, so that the shared key finally obtained by the two parties is consistent, thereby ensuring the smooth encryption and decryption of the shared key between the two communicating parties.

[0105] In one of the embodiments, the message sending device address information includes a sending public parameter and a sending private parameter, the message receiving device address information includes a receiving public parameter and a receiving private parameter, the sending public parameter and the receiving public parameter have the same parameter value, and the sending private parameter and the receiving private parameter have different parameter values; the sending public parameter includes a first sending public parameter and a second sending public parameter; the receiving public parameter includes a first receiving public parameter and a second receiving public parameter;

[0106] Generate public information of the message sending device according to the message sending device address information, including:

[0107] The first sending public parameter is modulo the sending private parameter power of the second sending public parameter to obtain the message sending device public information; the message sending device public information is used to instruct the message receiving device to modulo the first receiving public parameter using the receiving private parameter power of the message sending device public information to obtain a shared key;

[0108] Based on the public information of the message receiving device and the address information of the message sending device, a shared key between the message sending device and the message receiving device is generated, including:

[0109] The first sending public parameter is modulo the sending private parameter power of the message receiving device public information to obtain a shared key; the message receiving device public information is obtained by the message receiving device modulo the first receiving public parameter using the receiving private parameter power of the second receiving public parameter.

[0110] Among them, the sending public parameters can be understood as the first four digits of the address information of the message sending device, and the sending private parameters can be understood as the last two digits of the address information of the message sending device. Similarly, the receiving public parameters can be understood as the first four digits of the address information of the message receiving device, and the receiving private parameters can be understood as the last two digits of the address information of the message receiving device; and the four digits used as the sending public parameters are the same as the four digits used as the receiving public parameters, and the two digits used as the sending private parameters are different from the two digits used as the receiving private parameters.

[0111] Among them, the first public parameter sent can be understood as the first two digits of the four-digit number used as the public parameter sent, and the second public parameter sent can be understood as the first two digits of the four-digit number used as the public parameter sent; similarly, the first public parameter received can be understood as the first two digits of the four-digit number used as the public parameter received, and the second public parameter received can be understood as the first two digits of the four-digit number used as the public parameter received, and the values ​​of the first public parameter sent and the second public parameter received are the same, and the values ​​of the second public parameter sent and the second public parameter received are the same.

[0112] Optionally, the message sending device 102 uses the power of the second sending public parameter to perform modulo on the first sending public parameter to obtain the message sending device public information, and the message sending device public information is used to instruct the message receiving device 104 to perform modulo on the first receiving public parameter using the power of the receiving private parameter of the message sending device public information to obtain a shared key. Further, the message sending device uses the power of the sending private parameter of the message receiving device public information previously received to perform modulo on the first sending public parameter to obtain a shared key, and the message receiving device public information is obtained by the message receiving device 104 using the power of the receiving private parameter of the second receiving public parameter to perform modulo on the first receiving public parameter. Due to the commutative law of exponential operation, the shared key calculated by the message sending device 102 and the message receiving device 104 is the same. The above calculation method is well associated with the device address information, and the calculation process and logic are relatively simple, and will not consume more computing resources, nor will it cause delays, and it will maximize the difficulty of decryption and reduce the risk of data leakage.

[0113] In an exemplary embodiment, the method also includes: obtaining the number of encryptions and the survival time of the shared key; when the number of encryptions is greater than or equal to a preset encryption number threshold, or the number of encryptions is less than the preset encryption number threshold and the survival time is greater than the preset survival time threshold, updating the message sending device address information, and generating updated message sending device public information based on the updated message sending device address information; sending the updated message sending device public information to the message receiving device through the IPSEC tunnel, and receiving the updated message receiving device public information from the message receiving device; the updated message sending device public information is used to instruct the message receiving device to generate an updated shared key, and the updated message receiving device public information is obtained by the message receiving device based on the updated message receiving device address information of the message receiving device; based on the updated message receiving device public information and the updated message sending device address information, generating an updated shared key.

[0114] The number of encryptions can be understood as the number of times the shared key is used as a locked "lock", and the survival time can be understood as the length of time the same shared key is used in the system.

[0115] For example, the message sending device 102 obtains the number of encryptions and the survival time of the shared key, and when the number of encryptions is greater than or equal to the preset encryption number threshold, or the number of encryptions is less than the preset encryption number threshold and the survival time is greater than the preset survival time threshold, updates the message sending device address information, generates updated message sending device public information according to the updated message sending device address information, sends the updated message sending device public information to the message receiving device 104 through the IPSEC tunnel, and receives the updated message receiving device public information from the message receiving device 104, the updated message sending device public information is used to instruct the message receiving device 104 to generate an updated shared key, the updated message receiving device public information is obtained by the message receiving device 104 based on the updated message receiving device address information of the message receiving device 104, and finally generates an updated shared key based on the updated message receiving device public information and the updated message sending device address information. By setting the update conditions of the shared key, the shared key that may cause data leakage is updated in time, and the security of communication transmission is further guaranteed.

[0116] In one of the embodiments, updating the message sending device address information includes: adding 1 to a sending public parameter to obtain an updated sending public parameter; and updating the message sending device address information of the message sending device using the updated sending public parameter.

[0117] For example, the message sending device 102 adds 1 to the first sending public parameter and the second sending public parameter to obtain an updated sending public parameter, and uses the updated sending public parameter to update the message sending device address information of the message sending device 102. By using a strategy of generating a new shared key with partial parameters of the old shared key, the security and confidentiality of the shared key in the communication can be guaranteed, and the anti-attack capability of the communication system can also be improved.

[0118] In one embodiment, an IP message is encrypted using a shared key to obtain an IP ciphertext, including: obtaining the current time recorded by the message sending device, and generating a corresponding date string based on the current time; obtaining a secondary encryption sequence based on the date string and the shared key; and performing an XOR operation on the IP message using the secondary encryption sequence to obtain the IP ciphertext.

[0119] Optionally, the message sending device 102 obtains the current time recorded by the message sending device, and generates a corresponding date string based on the current time, and converts the date string into a binary sequence. The two columns of binary strings are connected through the binary with the @ symbol in the order of the initial key in front and the date string in the back, and finally this combined sequence is used as the secondary encryption sequence, and this sequence will be used as our Logistic Map (numeric sequence). Then the generated Logistic Map is specially processed, and the IP message is XORed with the Logistic Map, and the result of the XOR operation is the IP ciphertext. Relying on the time series to increase the key level of the shared key, further reduce the risk of the shared key being hijacked and tampered with.

[0120] In one embodiment, the method further comprises:

[0121] Obtain a message sending device address of a message sending device, and send the message sending device address to a message receiving device;

[0122] The message receiving device address of the message receiving device is received from the message receiving device, and the legitimacy verification result of the sending device address returned by the message receiving device; the legitimacy verification result of the sending device address is obtained by the message receiving device after performing device address legitimacy verification based on the message sending device address and a pre-stored message sending legal device address table;

[0123] Based on the message receiving device address and the pre-stored message receiving legal device address table, obtaining the receiving device address legality verification result;

[0124] When the sending device address legitimacy verification result indicates that the message sending device address matches any device address in the message sending legal device address table, and the receiving device address legitimacy verification result indicates that the message receiving device address matches any device address in the message receiving legal device address table, it is determined that both the message sending device and the message receiving device have passed the device address legitimacy verification.

[0125] Among them, the message sending legal device address table can be understood as recording the message sending devices that the current message receiving device 104 allows to send IP messages. Similarly, the message receiving legal device address table can be understood as recording the message receiving devices that the current message sending device 102 allows to receive IP messages.

[0126] Optionally, the message sending device 102 obtains the message sending device address of the message sending device 102, sends the message sending device address to the message receiving device 104, and receives the message receiving device address of the message receiving device from the message receiving device 104, as well as the legitimacy verification result of the sending device address returned by the message receiving device 104. The legitimacy verification result of the sending device address is obtained by the message receiving device after performing device address legitimacy verification based on the message sending device address and a pre-stored message sending legal device address table, and then obtains the legitimacy verification result of the receiving device address based on the message receiving device address and a pre-stored message receiving legal device address table.

[0127] Optionally, finally, when the result of the sending device address legitimacy verification indicates that the message sending device address matches any device address in the message sending legal device address table, and the result of the receiving device address legitimacy verification indicates that the message receiving device address matches any device address in the message receiving legal device address table, it is determined that both the message sending device 102 and the message receiving device have passed the device address legitimacy verification. By performing the authentication test before establishing the IPSEC tunnel between the communicating parties, the inability to communicate after the channel is established, the large amount of resources consumed, and the data confusion caused after the connection are avoided, and the two-way verification further improves the reliability and effectiveness of the communication.

[0128] In an exemplary embodiment, Figure 3 As shown, a method for communication of electric power equipment is provided, and the method is applied to Figure 1 The message receiving device 104 in the example is used as an example to illustrate, including step S301 and step S302. Among them:

[0129] Step S301, when it is detected that an IPSEC tunnel is constructed between the message receiving device and the message sending device, key negotiation is performed with the message sending device to generate a shared key between the message sending device and the message receiving device; the IPSEC tunnel is constructed by the message sending device in response to a message transmission request to transmit an IP message to the message receiving device, and when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device.

[0130] For example, when the message receiving device 104 detects that an IPSEC tunnel is constructed between the message receiving device 104 and the message sending device 102, key negotiation is performed with the message sending device 102 to generate a shared key between the message sending device 102 and the message receiving device 104. The IPSEC tunnel is constructed by the message sending device 102 in response to a message transmission request to transmit an IP message to the message receiving device 104, and when both the message sending device 102 and the message receiving device 104 pass the device address legitimacy verification. The message sending device 102 is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device. The shared key common to both communicating parties at both ends of the IPSEC tunnel is generated through key negotiation, which lays a data foundation for the subsequent decryption of the IP ciphertext, and the use of the shared key also greatly improves the data security of the IP message.

[0131] Step S302, receiving the IP ciphertext sent by the message sending device through the IPSEC tunnel, and decrypting the IP ciphertext using the shared key to obtain the IP message; the IP ciphertext is obtained by the message sending device encrypting the IP message using the shared key.

[0132] Optionally, the message receiving device 104 receives the IP ciphertext sent by the message sending device 102 through the IPSEC tunnel, and decrypts the IP ciphertext using the shared key to obtain an IP message, which is obtained by encrypting the IP message using the shared key by the message sending device 102. The message receiving device 104 receives the IP ciphertext, which needs to be decrypted using the shared key to obtain the actual IP message, that is, even if data leakage occurs during transportation, other clients cannot easily read the IP message, which greatly improves data security.

[0133] In one embodiment, performing key negotiation with a message sending device to generate a shared key between the message sending device and the message receiving device includes:

[0134] Acquire the message receiving device address information of the message receiving device, and generate the message receiving device public information according to the message receiving device address information; send the message receiving device public information to the message sending device through the IPSEC tunnel, and receive the message sending device public information from the message sending device; the message receiving device public information is used to instruct the message sending device to generate a shared key, and the message sending device public information is obtained by the message sending device based on the message sending device address information of the message sending device; based on the message sending device public information and the message receiving device address information, generate a shared key between the message sending device and the message receiving device.

[0135] For example, the message receiving device 104 obtains the message receiving device address information of the message receiving device 104, generates the message receiving device public information according to the message receiving device address information, sends the message receiving device public information to the message sending device 102 through the IPSEC tunnel, and receives the message sending device public information from the message sending device 102; the message receiving device public information instructs the message sending device 102 to generate a shared key, the message sending device public information is obtained by the message sending device 102 based on the message sending device address information of the message sending device 102, and finally, based on the message sending device public information and the message receiving device address information, a shared key is generated between the message sending device 102 and the message receiving device 104. The device address information of the two communicating parties is used to calculate the shared key, so that the shared key finally obtained by the two parties is consistent, thereby ensuring the smooth encryption and decryption of the shared key between the two communicating parties.

[0136] In one of the embodiments, the message receiving device address information includes a receiving public parameter and a receiving private parameter, the message sending device address information includes a sending public parameter and a sending private parameter, the receiving public parameter and the sending public parameter have the same parameter value, and the receiving private parameter and the sending private parameter have different parameter values; the receiving public parameter includes a first receiving public parameter and a second receiving public parameter; the sending public parameter includes a first sending public parameter and a second sending public parameter;

[0137] Generate public information of the message receiving device according to the address information of the message receiving device, including:

[0138] The first receiving public parameter is modulo the receiving private parameter power of the second receiving public parameter to obtain the message receiving device public information; the message sending device public information is used to instruct the message sending device to modulo the first sending public parameter using the sending private parameter power of the message receiving device public information to obtain a shared key;

[0139] Based on the public information of the message sending device and the address information of the message receiving device, a shared key between the message sending device and the message receiving device is generated, including:

[0140] The first receiving public parameter is modulo the power of the receiving private parameter of the public information of the message sending device to obtain a shared key; the public information of the message sending device is obtained by the message sending device modulo the first sending public parameter using the sending private parameter power of the second sending public parameter.

[0141] Optionally, the message receiving device 104 uses the power of the receiving private parameter of the second receiving public parameter to modulo the first receiving public parameter to obtain the public information of the message receiving device, and the public information of the message sending device instructs the message sending device 102 to use the power of the sending private parameter of the public information of the message receiving device to modulo the first sending public parameter to obtain a shared key, and then uses the power of the receiving private parameter of the public information of the message sending device obtained in advance to modulo the first receiving public parameter to obtain a shared key, and the public information of the message sending device is obtained by the message sending device using the power of the sending private parameter of the first sending public parameter to modulo the first sending public parameter. Due to the commutative law of exponential operation, the shared key calculated by the message sending device 102 and the message receiving device 104 is the same. The above calculation method is well associated with the device address information, and the calculation process and logic are relatively simple, will not consume more computing resources, will not cause delays, and maximize the difficulty of decryption, effectively reducing the risk of data leakage.

[0142] In an exemplary embodiment, the method also includes: obtaining the number of decryption times and the survival time of the shared key; when the number of decryption times is greater than or equal to a preset decryption times threshold, or the number of decryption times is less than the preset decryption times threshold and the survival time is greater than the preset survival time threshold, updating the message receiving device address information, and generating updated message receiving device public information based on the updated message receiving device address information; sending the updated message receiving device public information to the message sending device through the IPSEC tunnel, and receiving the updated message sending device public information from the message sending device; the updated message receiving device public information is used to instruct the message sending device to generate an updated shared key, and the updated message sending device public information is obtained by the message sending device based on the updated message sending device address information of the message sending device; based on the updated message sending device public information and the updated message receiving device address information, generating an updated shared key.

[0143] The number of decryption times can be understood as the number of times the shared key is used as a "key" to unlock the door. The number of decryption times may be consistent with the aforementioned number of encryption times, or may not be consistent.

[0144] For example, the message receiving device 104 obtains the number of decryption times and the survival time of the shared key, and updates the message receiving device address information when the number of decryption times is greater than or equal to the preset decryption times threshold, or the number of decryption times is less than the preset decryption times threshold and the survival time is greater than the preset survival time threshold, and generates updated message receiving device address information according to the updated message receiving device address information, sends updated message receiving device public information to the message sending device 102 through the IPSEC tunnel, and receives updated message sending device public information from the message sending device 102, the updated message receiving device public information instructs the message sending device 102 to generate an updated shared key, the updated message sending device public information is obtained by the message sending device 102 based on the updated message sending device address information of the message sending device 102, and finally generates an updated shared key based on the updated message sending device public information and the updated message receiving device address information. By setting the update conditions of the shared key, the shared key that may cause data leakage is updated in time, and the security of communication transmission is further guaranteed.

[0145] In one embodiment, updating the message receiving device address information includes: adding 1 to the receiving public parameter to obtain an updated receiving public parameter; and updating the message receiving device address information of the message receiving device using the updated receiving public parameter.

[0146] Optionally, the message receiving device 104 adds 1 to the first receiving public parameter and the second receiving public parameter to obtain an updated receiving public parameter, and uses the updated receiving public parameter to update the message receiving device address information of the message receiving device 104. By using a strategy of generating a new shared key with partial parameters of the old shared key, the security and confidentiality of the shared key in the communication can be guaranteed, and the anti-attack capability of the communication system can also be improved.

[0147] In an exemplary embodiment, the method includes: receiving a message sending device address from a message sending device, and obtaining a message receiving device address of a message receiving device; obtaining a sending device address legitimacy verification result based on the message sending device address and a pre-stored message sending legal device address table; sending the sending device address legitimacy verification result and the message receiving device address to the message sending device; the message sending device is used to determine whether to build an IPSEC tunnel based on the sending device address legitimacy verification result, the message receiving device address and a pre-stored message receiving legal device address table.

[0148] For example, the message receiving device 104 receives the message sending device address from the message sending device 102, and obtains the message receiving device address of the message receiving device 104, obtains the sending device address legitimacy verification result based on the message sending device address and the pre-stored message sending legal device address table, sends the sending device address legitimacy verification result and the message receiving device address to the message sending device 102, and the message sending device is used to determine whether to build an IPSEC tunnel according to the sending device address legitimacy verification result, the message receiving device address and the pre-stored message receiving legal device address table. The specific judgment process is as follows:

[0149] When the result of the sending device address legitimacy verification indicates that the message sending device address of the message sending device 102 matches any device address in the message sending legal device address table, and the message receiving device address of the message receiving device 104 matches any device address in the message receiving legal device address table, the message sending device 102 builds an IPSEC tunnel with the message receiving device 104. When any of the above two conditions is not met, the message sending device 102 refuses to build an IPSEC tunnel with the message receiving device 104. By obtaining the device address of the relevant device, and performing legitimacy verification of the message sending device according to the pre-stored legal device address table, and returning the relevant verification result and device address to the message sending device, the message sending device determines whether to build an IPSEC tunnel, which lays a data foundation for the construction of the IPSEC tunnel, avoids the situation where the two ends of the channel cannot communicate due to the arbitrary establishment of the channel, and the two-way verification further improves the reliability and effectiveness of the communication.

[0150] In an exemplary embodiment, Figure 4 As shown, a specific implementation of a power equipment communication method is provided, wherein a message sending device and a message receiving device have successfully established an IPSEC tunnel and communicate after key negotiation.

[0151] But in fact, authentication detection should be performed between the message sending device and the message receiving device first. Authentication based on the terminal hardware address identifies and verifies the unique hardware address of the device (such as MAC address) to confirm its legitimacy to ensure communication security. The terminal device sends its address information and verifies whether the address is legitimate. If it passes, the connection is allowed, otherwise it is rejected. Figure 5 shown.

[0152] After the authentication is passed, an IPSEC tunnel is established between the message sending device and the message receiving device, and key negotiation is performed: Before the communication begins, the message sending device and the message receiving device establish an IPSEC tunnel through IPSEC and perform key negotiation. Using the DH key exchange protocol, both parties generate their own private keys and exchange public keys. Finally, both parties calculate the shared session key. Figure 6 shown.

[0153] Here is an example:

[0154] MAC address 1: 05:08:56:C0:00:02

[0155] MAC address 2: 05:08:56:C0:00:09

[0156] Public values: 05(p), 08(g)

[0157] Privacy value: 02 (privacy1), 09 (privacy2)

[0158] Calculate the public value

[0159] Public value 1: value1 = (g^privacy1) mod p = 4

[0160] Public value 2: value2 = (g^privacy2) mod p = 3

[0161] Calculate the shared secret

[0162] value2^privacy1 mod p=4

[0163] value1^privacy2 mod p=4

[0164] Shared Secret: 4

[0165] It can be understood that the numerical values ​​used above and below are just examples and can be modified according to actual conditions.

[0166] During the communication process, the message sending device and the message receiving device use a shared key to encrypt each message transmitted. The message receiving device uses the shared key to decrypt the encrypted data to restore the original, understandable message content. This process requires an efficient decryption algorithm and strict key management to ensure that only the legitimate recipient can obtain the decrypted data and that the data will not be stolen or tampered with during transmission. Figure 7 shown.

[0167] Take encrypted IP packets as an example:

[0168] Shared Secret: 4

[0169] Binary sequence of shared secret key: 0100

[0170] The current time generates a date string in ISO 8601 format: 20240530

[0171] Binary sequence of date string: 0001001101001101100010010010

[0172] Encrypted sequence string: 0100@0001001101001101100010010010

[0173] Logistic Map: 0100010000000001001101001101100010010010

[0174] Plain text sequence: 1010101010101010101010101010101010101010

[0175] Ciphertext sequence: 1110111010101011100111100111001000111000

[0176] In order to prevent key leakage and replay attacks, the two parties agree to update the shared key after a period of time or number of communications. The update process adopts a forward-secure method, that is, the new key is derived from the old key. Figure 8 shown.

[0177] Example:

[0178] MAC address 1: 05:08:56:C0:00:02

[0179] MAC address 2: 05:08:56:C0:00:09

[0180] Public values: 05(p), 08(g)

[0181] Privacy value: 02 (privacy1), 09 (privacy2)

[0182] Update algorithm after update:

[0183] p=p+1

[0184] g=g+1

[0185] MAC address 1: 05:08:56:C0:00:02

[0186] MAC address 2: 05:08:56:C0:00:09

[0187] New public values: 06(p), 09(g)

[0188] New privacy values: 02 (privacy1), 09 (privacy2)

[0189] For details about the new shared key, refer to the shared key generation process.

[0190] Based on the above process, the complete process of the power equipment communication method is as follows:

[0191] 1. Authentication detection: When two terminal devices are ready to establish an encrypted channel, the identity authentication process is started first. Terminal device A obtains its own hardware address (a characteristic MAC address), and sends its own hardware address information to terminal device B to indicate its identity. After terminal device B receives the hardware address information sent by device A, device B checks whether the received hardware address matches a known legitimate device through a known security policy or a pre-agreed rule (based on its own stored MAC address table). If device B verifies the received hardware address information, it considers device A to be legitimate and can continue to establish an encrypted channel. If device B fails the verification, the connection request of device A is rejected.

[0192] 2. Key generation algorithm: First, initialize the parameters. The two communicating parties agree on some public parameters in advance, including the first two digits p of the first colon of the terminal device MAC address and the last two digits g of the first colon of the MAC address. These parameters are usually public and can be shared between the two communicating parties. Secondly, select the private parameters. Each communicating party selects the last two digits of the last colon of its own MAC address as the private parameters. Then calculate the public value. Each communicating party uses the agreed public parameters and the private parameters selected by itself to calculate a public value. The formula for calculating the public value is to take the modulus of (p) to the power of the private parameter of (g). After calculating the public value, the two communicating parties send the public value to each other. Finally, calculate the shared key. After each communicating party receives the public value sent by the other party, it uses the other party's public value and the private parameter selected by itself to calculate a shared key. The formula for calculating the shared key is to take the modulus of (p) to the power of its own private parameter of the other party's public value. Due to the commutative law of exponential operation, the shared keys calculated by the two communicating parties are the same.

[0193] 3. Message encryption and decryption algorithm: First, we initialize the shared key as an initial key, which will be used as the initial value of the encryption system. Secondly, we generate a secondary encryption sequence. We use the initial key in the encryption system to convert it into a binary sequence. At the same time, we obtain the current time to generate a date string in ISO 8601 format, and convert the date string into a binary sequence. In the order of the initial key first and the date string last, we connect the two binary strings through the binary with the @ symbol, and finally use this combined sequence as the secondary encryption sequence. At the same time, this sequence will be used as our Logistic Map (numeric sequence). Then, we specialize the generated Logistic Map, perform an XOR operation on the plaintext data sequence and the Logistic Map, and the result of the XOR operation is the ciphertext sequence. At the same time, we send the ciphertext to the concentrator device. Finally, we perform the decryption process. The concentrator obtains the Logistic Map in the same way, and then performs an XOR operation on the ciphertext sequence and the Logistic Map. The result of the XOR operation is the original data sequence after decryption.

[0194] 4. Key update algorithm: First, determine the conditions that trigger the key update, which can be time-based (update the key every 30 minutes) or communication-based (update the key after every 1,800 communications). Secondly, based on the public parameters p and g in the key negotiation management, take the p and g values ​​of the old key and convert the p and g values ​​to decimal and add 1 to them respectively. If it exceeds FF, recalculate from 01. The rest of the private parameters are not modified, and the generation of the new shared key is consistent with the key generation algorithm. Finally, the new key adopts the key derivation strategy, that is, the forward security method is used in the update process.

[0195] Compared with the prior art, this application has the following advantages:

[0196] 1. Based on IPSEC, it provides a new customizable encryption and decryption, secure and reliable communication mechanism to protect the security and privacy of communication data between power terminal equipment and concentrator equipment.

[0197] 2. Provides a pre-connection authentication detection method, which can check the network equipment before the communication starts, avoiding the consumption of a large amount of resources during connection detection or the harm after the connection.

[0198] 3. The new key generation algorithm obtained based on the innovative algorithm is different from the existing general key generation algorithm, which can increase the difficulty of decryption to a greater extent; at the same time, the algorithm calculation process and logic are relatively simple, do not consume more computing resources, will not cause delays, rely on time series to increase the key level, and further reduce the risk of key hijacking and tampering. Therefore, through the establishment of this encrypted channel, it can effectively prevent the communication data from being stolen, tampered with or forged.

[0199] 4. Adopt innovative key management and update mechanism, and use the strategy of generating new keys with partial parameters of old keys, which can not only ensure the security and confidentiality of communication keys, but also improve the anti-attack capability of communication systems.

[0200] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0201] Based on the same inventive concept, the embodiment of the present application also provides a power equipment communication device for implementing the power equipment communication method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more power equipment communication device embodiments provided below can refer to the limitations of the power equipment communication method above, and will not be repeated here.

[0202] In an exemplary embodiment, Fig. 9 As shown, a power equipment communication device is provided, which is applied to a message sending device, including: a tunnel construction module 901, a key negotiation module 902 and a ciphertext sending module 903, wherein:

[0203] The tunnel construction module 901 is used to respond to a message transmission request for transmitting an IP message to a message receiving device, and to construct an IPSEC tunnel between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0204] A key negotiation module 902, configured to perform key negotiation with a message receiving device to generate a shared key between the message sending device and the message receiving device;

[0205] The ciphertext sending module 903 is used to encrypt the IP message using the shared key to obtain the IP ciphertext, and send the IP ciphertext to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain the IP message.

[0206] In one embodiment, the key negotiation module 902 further includes:

[0207] The acquisition submodule is used to acquire the message sending device address information of the message sending device and generate the message sending device public information according to the message sending device address information.

[0208] The receiving submodule is used to send the public information of the message sending device to the message receiving device through the IPSEC tunnel, and receive the public information of the message receiving device from the message receiving device; the public information of the message sending device is used to instruct the message receiving device to generate a shared key, and the public information of the message receiving device is obtained by the message receiving device based on the message receiving device address information of the message receiving device.

[0209] The generation submodule is used to generate a shared key between the message sending device and the message receiving device based on the public information of the message receiving device and the address information of the message sending device.

[0210] In one of the embodiments, the address information of the message sending device includes a sending public parameter and a sending private parameter, the address information of the message receiving device includes a receiving public parameter and a receiving private parameter, the parameter values ​​of the sending public parameter and the receiving public parameter are the same, and the parameter values ​​of the sending private parameter and the receiving private parameter are different; the sending public parameter includes a first sending public parameter and a second sending public parameter; the receiving public parameter includes a first receiving public parameter and a second receiving public parameter; the acquisition submodule is also used to take the first sending public parameter modulo the sending private parameter power of the second sending public parameter to obtain the message sending device public information; the message sending device public information is used to instruct the message receiving device to take the first receiving public parameter modulo the receiving private parameter power of the message sending device public information to obtain a shared key; the generation submodule is also used to take the first sending public parameter modulo the sending private parameter power of the message receiving device public information to obtain a shared key; the message receiving device public information is obtained by the message receiving device taking the first receiving public parameter modulo the receiving private parameter power of the second receiving public parameter.

[0211] In an exemplary embodiment, the key negotiation module 902 is further used to obtain the number of encryptions and the survival time of the shared key; when the number of encryptions is greater than or equal to a preset encryption number threshold, or the number of encryptions is less than the preset encryption number threshold and the survival time is greater than the preset survival time threshold, the message sending device address information is updated, and updated message sending device public information is generated based on the updated message sending device address information; the updated message sending device public information is sent to the message receiving device through the IPSEC tunnel, and the updated message receiving device public information is received from the message receiving device; the updated message sending device public information is used to instruct the message receiving device to generate an updated shared key, and the updated message receiving device public information is obtained by the message receiving device based on the updated message receiving device address information of the message receiving device; based on the updated message receiving device public information and the updated message sending device address information, an updated shared key is generated.

[0212] In one embodiment, the key negotiation module 902 is further configured to add 1 to the sending public parameter to obtain an updated sending public parameter; and update the message sending device address information of the message sending device using the updated sending public parameter.

[0213] In one embodiment, the ciphertext sending module 903 is also used to obtain the current time recorded by the message sending device, and generate a corresponding date string based on the current time; obtain a secondary encryption sequence based on the date string and the shared key; and use the secondary encryption sequence to perform an XOR operation on the IP message to obtain the IP ciphertext.

[0214] In an exemplary embodiment, the power equipment communication device further includes:

[0215] An authentication detection unit is used to obtain a message sending device address of a message sending device, and send the message sending device address to a message receiving device; receive the message receiving device address of the message receiving device from the message receiving device, and a legitimacy verification result of the sending device address returned by the message receiving device; the legitimacy verification result of the sending device address is obtained by the message receiving device after performing device address legitimacy verification based on the message sending device address and a pre-stored message sending legal device address table; obtain the legitimacy verification result of the receiving device address based on the message receiving device address and a pre-stored message receiving legal device address table; when the legitimacy verification result of the sending device address indicates that the message sending device address matches any device address in the message sending legal device address table, and the legitimacy verification result of the receiving device address indicates that the message receiving device address matches any device address in the message receiving legal device address table, it is determined that both the message sending device and the message receiving device have passed the device address legitimacy verification.

[0216] In an exemplary embodiment, Fig.10 As shown, a power equipment communication device is provided, which is applied to a message receiving device, including: a key negotiation module 1001 and a ciphertext receiving module 1002, wherein:

[0217] The key negotiation module 1001 is used to perform key negotiation with the message sending device to generate a shared key between the message sending device and the message receiving device when it is detected that an IPSEC tunnel is constructed between the message receiving device and the message sending device; the IPSEC tunnel is constructed by the message sending device in response to a message transmission request for transmitting an IP message to the message receiving device, and when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device;

[0218] The ciphertext receiving module 1002 is used to receive the IP ciphertext sent by the message sending device through the IPSEC tunnel, and decrypt the IP ciphertext using the shared key to obtain the IP message; the IP ciphertext is obtained by the message sending device encrypting the IP message using the shared key.

[0219] In one embodiment, the key agreement module 1001 further includes:

[0220] The acquisition submodule is used to acquire the message receiving device address information of the message receiving device and generate the message receiving device public information according to the message receiving device address information.

[0221] The receiving submodule is used to send the public information of the message receiving device to the message sending device through the IPSEC tunnel, and receive the public information of the message sending device from the message sending device; the public information of the message receiving device is used to instruct the message sending device to generate a shared key, and the public information of the message sending device is obtained by the message sending device based on the message sending device address information of the message sending device.

[0222] The generation submodule is used to generate a shared key between the message sending device and the message receiving device based on the public information of the message sending device and the address information of the message receiving device.

[0223] In one of the embodiments, the address information of the message receiving device includes a receiving public parameter and a receiving private parameter, the address information of the message sending device includes a sending public parameter and a sending private parameter, the parameter values ​​of the receiving public parameter and the sending public parameter are the same, and the parameter values ​​of the receiving private parameter and the sending private parameter are different; the receiving public parameter includes a first receiving public parameter and a second receiving public parameter; the sending public parameter includes a first sending public parameter and a second sending public parameter; the acquisition submodule is also used to take the first receiving public parameter modulo the receiving private parameter power of the second receiving public parameter to obtain the public information of the message receiving device; the public information of the message sending device is used to instruct the message sending device to take the first sending public parameter modulo the sending private parameter power of the message receiving device public information to obtain a shared key; the generation submodule is also used to take the first receiving public parameter modulo the receiving private parameter power of the message sending device public information to obtain a shared key; the public information of the message sending device is obtained by the message sending device taking the first sending public parameter modulo the sending private parameter power of the second sending public parameter.

[0224] In an exemplary embodiment, the key negotiation module 1001 is further used to obtain the number of decryption times and the survival time of the shared key; when the number of decryption times is greater than or equal to a preset decryption times threshold, or the number of decryption times is less than the preset decryption times threshold and the survival time is greater than the preset survival time threshold, the message receiving device address information is updated, and updated message receiving device public information is generated based on the updated message receiving device address information; the updated message receiving device public information is sent to the message sending device through the IPSEC tunnel, and the updated message sending device public information is received from the message sending device; the updated message receiving device public information is used to instruct the message sending device to generate an updated shared key, and the updated message sending device public information is obtained by the message sending device based on the updated message sending device address information of the message sending device; based on the updated message sending device public information and the updated message receiving device address information, an updated shared key is generated.

[0225] In one embodiment, the key negotiation module 1001 is further used to add 1 to the received public parameter to obtain an updated received public parameter; and use the updated received public parameter to update the message receiving device address information of the message receiving device.

[0226] In one embodiment, the power equipment communication device further includes:

[0227] The authentication detection unit is used to receive the message sending device address from the message sending device and obtain the message receiving device address of the message receiving device; based on the message sending device address and a pre-stored message sending legal device address table, obtain the sending device address legitimacy verification result; send the sending device address legitimacy verification result and the message receiving device address to the message sending device; the message sending device is used to determine whether to build an IPSEC tunnel based on the sending device address legitimacy verification result, the message receiving device address and a pre-stored message receiving legal device address table.

[0228] Each module in the above-mentioned power equipment communication device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.

[0229] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.11 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for communicating with an electric power device is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0230] Those skilled in the art will understand that Fig.11The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0231] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the power device communication method of the above embodiment is implemented.

[0232] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the power equipment communication method of the above embodiment is implemented.

[0233] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the power device communication method of the above embodiment is implemented.

[0234] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0235] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0236] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0237] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A power equipment communication method, characterized in that: Applied to a message sending device, the method comprises: In response to a message transmission request for transmitting an IP message to a message receiving device, an IPSEC tunnel is constructed between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device; Performing key negotiation with the message receiving device to generate a shared key between the message sending device and the message receiving device; The IP message is encrypted using the shared key to obtain IP ciphertext, and the IP ciphertext is sent to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain the IP message.

2. The method according to claim 1, characterized in that The performing key negotiation with the message receiving device to generate a shared key between the message sending device and the message receiving device includes: Acquire the message sending device address information of the message sending device, and generate the message sending device public information according to the message sending device address information; Sending the message sending device public information to the message receiving device through the IPSEC tunnel, and receiving the message receiving device public information from the message receiving device; the message sending device public information is used to instruct the message receiving device to generate the shared key, and the message receiving device public information is obtained by the message receiving device based on the message receiving device address information of the message receiving device; Based on the public information of the message receiving device and the address information of the message sending device, a shared key between the message sending device and the message receiving device is generated.

3. The method according to claim 2, characterized in that The message sending device address information includes a sending public parameter and a sending private parameter, the message receiving device address information includes a receiving public parameter and a receiving private parameter, the sending public parameter and the receiving public parameter have the same parameter value, and the sending private parameter and the receiving private parameter have different parameter values; the sending public parameter includes a first sending public parameter and a second sending public parameter; The receiving public parameter includes a first receiving public parameter and a second receiving public parameter; The generating the message sending device public information according to the message sending device address information includes: The first sending public parameter is modulo the sending private parameter power of the second sending public parameter to obtain the message sending device public information; the message sending device public information is used to instruct the message receiving device to modulo the first receiving public parameter using the receiving private parameter power of the message sending device public information to obtain the shared key; The generating a shared key between the message sending device and the message receiving device based on the public information of the message receiving device and the address information of the message sending device includes: The shared key is obtained by taking a modulus of the first sending public parameter using a power of a sending private parameter of the public information of the message receiving device; the public information of the message receiving device is obtained by the message receiving device taking a modulus of the first receiving public parameter using a receiving private parameter power of the second receiving public parameter.

4. The method according to claim 2, characterized in that: The method further comprises: Obtain the number of encryptions and lifetime of the shared key; When the number of encryption times is greater than or equal to a preset encryption times threshold, or when the number of encryption times is less than the preset encryption times threshold and the survival time is greater than the preset survival time threshold, updating the message sending device address information, and generating updated message sending device public information according to the updated message sending device address information; Sending the updated public information of the message sending device to the message receiving device through the IPSEC tunnel, and receiving the updated public information of the message receiving device from the message receiving device; the updated public information of the message sending device is used to instruct the message receiving device to generate an updated shared key, and the updated public information of the message receiving device is obtained by the message receiving device based on the updated address information of the message receiving device; The updated shared key is generated based on the updated public information of the message receiving device and the updated address information of the message sending device.

5. The method according to claim 3, characterized in that: The updating of the message sending device address information includes: Add 1 to the sending public parameter to obtain an updated sending public parameter; The message sending device address information of the message sending device is updated using the updated sending public parameter.

6. The method according to claim 1, characterized in that The step of encrypting the IP message by using the shared key to obtain IP ciphertext includes: Obtaining the current time recorded by the message sending device, and generating a corresponding date string based on the current time; Obtaining a secondary encryption sequence according to the date character string and the shared key; The IP message is subjected to an XOR operation using the secondary encryption sequence to obtain the IP ciphertext.

7. The method according to claim 1, characterized in that The method further comprises: Acquire a message sending device address of the message sending device, and send the message sending device address to the message receiving device; Receiving from the message receiving device the message receiving device address of the message receiving device and the legitimacy verification result of the sending device address returned by the message receiving device; the legitimacy verification result of the sending device address is obtained by the message receiving device after performing device address legitimacy verification based on the message sending device address and a pre-stored message sending legal device address table; Based on the message receiving device address and a pre-stored message receiving legal device address table, obtaining a receiving device address legality verification result; When the sending device address legitimacy verification result indicates that the message sending device address matches any device address in the message sending legal device address table, and the receiving device address legitimacy verification result indicates that the message receiving device address matches any device address in the message receiving legal device address table, it is determined that both the message sending device and the message receiving device have passed the device address legitimacy verification.

8. A power equipment communication method, characterized in that: Applied to a message receiving device, the method comprises: When it is detected that an IPSEC tunnel is constructed between a message receiving device and a message sending device, key negotiation is performed with the message sending device to generate a shared key between the message sending device and the message receiving device; the IPSEC tunnel is constructed by the message sending device in response to a message transmission request for transmitting an IP message to the message receiving device, and when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device; The IP ciphertext sent by the message sending device is received through the IPSEC tunnel, and the IP ciphertext is decrypted using the shared key to obtain the IP message; the IP ciphertext is obtained by the message sending device encrypting the IP message using the shared key.

9. The method according to claim 8, characterized in that The performing key negotiation with the message sending device to generate a shared key between the message sending device and the message receiving device includes: Acquire the message receiving device address information of the message receiving device, and generate the message receiving device public information according to the message receiving device address information; Sending the message receiving device public information to the message sending device through the IPSEC tunnel, and receiving the message sending device public information from the message sending device; the message receiving device public information is used to instruct the message sending device to generate the shared key, and the message sending device public information is obtained by the message sending device based on the message sending device address information of the message sending device; Based on the public information of the message sending device and the address information of the message receiving device, a shared key between the message sending device and the message receiving device is generated.

10. The method according to claim 9, characterized in that The message receiving device address information includes a receiving public parameter and a receiving private parameter, the message sending device address information includes a sending public parameter and a sending private parameter, the receiving public parameter and the sending public parameter have the same parameter value, and the receiving private parameter and the sending private parameter have different parameter values; the receiving public parameter includes a first receiving public parameter and a second receiving public parameter; The sending public parameter includes a first sending public parameter and a second sending public parameter; The generating the message receiving device public information according to the message receiving device address information includes: The first receiving public parameter is modulo the receiving private parameter power of the second receiving public parameter to obtain the message receiving device public information; the message sending device public information is used to instruct the message sending device to modulo the first sending public parameter using the sending private parameter power of the message receiving device public information to obtain the shared key; The generating a shared key between the message sending device and the message receiving device based on the public information of the message sending device and the address information of the message receiving device includes: The first receiving public parameter is modulo the power of the receiving private parameter of the public information of the message sending device to obtain the shared key; the public information of the message sending device is obtained by the message sending device modulo the first sending public parameter using the sending private parameter power of the second sending public parameter.

11. The method according to claim 9, characterized in that The method further comprises: Obtain the number of decryption times and lifetime of the shared key; When the number of decryption times is greater than or equal to a preset decryption times threshold, or when the number of decryption times is less than the preset decryption times threshold and the survival time is greater than the preset survival time threshold, the message receiving device address information is updated, and updated message receiving device public information is generated according to the updated message receiving device address information; Sending the updated public information of the message receiving device to the message sending device through the IPSEC tunnel, and receiving the updated public information of the message sending device from the message sending device; the updated public information of the message receiving device is used to instruct the message sending device to generate an updated shared key, and the updated public information of the message sending device is obtained by the message sending device based on the updated message sending device address information of the message sending device; The updated shared key is generated based on the updated public information of the message sending device and the updated address information of the message receiving device.

12. The method according to claim 10, characterized in that The updating of the message receiving device address information includes: Add 1 to the received public parameter to obtain an updated received public parameter; The message receiving device address information of the message receiving device is updated using the updated receiving public parameter.

13. The method according to claim 8, characterized in that The method comprises: Receiving a message sending device address from the message sending device, and acquiring a message receiving device address of the message receiving device; Based on the message sending device address and a pre-stored message sending legal device address table, obtaining a sending device address legality verification result; The message sending device sends the legitimacy verification result of the sending device address and the message receiving device address to the message sending device; the message sending device is used to determine whether to build the IPSEC tunnel based on the legitimacy verification result of the sending device address, the message receiving device address and a pre-stored message receiving legal device address table.

14. A communication device for electric power equipment, characterized in that: Applied to a message sending device, the device comprises: A tunnel construction module, configured to respond to a message transmission request for transmitting an IP message to a message receiving device, and to construct an IPSEC tunnel between the message sending device and the message receiving device when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device; A key negotiation module, used to perform key negotiation with the message receiving device to generate a shared key between the message sending device and the message receiving device; The ciphertext sending module is used to encrypt the IP message using the shared key to obtain the IP ciphertext, and send the IP ciphertext to the message receiving device through the IPSEC tunnel; the message receiving device is used to decrypt the IP ciphertext using the shared key to obtain the IP message.

15. A communication device for electric power equipment, characterized in that: Applied to a message receiving device, the device comprises: A key negotiation module, configured to, when detecting that an IPSEC tunnel is constructed between a message receiving device and a message sending device, perform key negotiation with the message sending device to generate a shared key between the message sending device and the message receiving device; the IPSEC tunnel is constructed by the message sending device in response to a message transmission request for transmitting an IP message to the message receiving device, and when both the message sending device and the message receiving device pass the device address legitimacy verification; the message sending device is one of the power terminal device and the concentrator device, and the message receiving device is the other of the power terminal device and the concentrator device except the message sending device; The ciphertext receiving module is used to receive the IP ciphertext sent by the message sending device through the IPSEC tunnel, and use the shared key to decrypt the IP ciphertext to obtain the IP message; the IP ciphertext is obtained by the message sending device encrypting the IP message using the shared key.

16. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.

17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.

18. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.