Disclosure of Invention
In view of the above, it is necessary to provide a power data transmission method and system with high communication safety.
A power data transmission method is applied to a gateway of a power monitoring platform and comprises the following steps:
acquiring a first protection message sent by an encryption module; the encryption module acquires first request data sent by the application module, and encrypts and integrity-protects the first request data based on a cryptographic algorithm to generate the first protection message; the encryption module and the application module are arranged in the power terminal;
carrying out integrity verification and decryption on the first protection message based on a state cryptographic algorithm to obtain second request data and sending the second request data to a monitoring server;
receiving feedback data sent by the monitoring server, encrypting and integrity protecting the feedback data based on a state cipher algorithm to obtain a second protection message and sending the second protection message to the encryption module; and the second protection message is used for obtaining response data and sending the response data to the application module after the encryption module carries out integrity verification and decryption based on a state cryptographic algorithm.
In one embodiment, the cryptographic algorithm is a cryptographic SM1 algorithm, a cryptographic SM2 algorithm, or a cryptographic SM4 algorithm.
In one embodiment, before the obtaining the first protection packet sent by the encryption module, the method further includes:
and carrying out key agreement with the encryption module based on the network key exchange protocol to obtain a session key pair.
In one embodiment, the network key exchange protocol is a national security IPSec VPN protocol, and performing key agreement with the encryption module based on the network key exchange protocol to obtain a session key pair includes:
based on the national secret IPSec VPN protocol, working key negotiation is carried out with an encryption module to determine a working key;
receiving a virtual IP request message sent by the encryption module, and feeding back a virtual IP response message to the encryption module according to the virtual IP request message;
and under the protection of the working key, performing session key negotiation with the encryption module based on the national secret IPSec VPN protocol to obtain a session key pair.
In one embodiment, the virtual IP request packet and the virtual IP response packet each include a generic attribute payload and a configuration attribute payload.
In one embodiment, the generic attribute payload includes a generic payload header, a generic type, and a generic extension.
In one embodiment, the configuration attribute payload includes a configuration type, a configuration length, and a configuration content.
A power data transmission method is applied to an encryption module of a power terminal and comprises the following steps:
acquiring first request data sent by an application module; the application module is arranged in the power terminal;
after the first request data are encrypted and subjected to integrity protection processing based on a state cryptographic algorithm, generating a first protection message and sending the first protection message to a gateway of the power monitoring platform;
receiving a second protection message fed back by the gateway, and after integrity verification and decryption are carried out on the second protection message based on a state cryptographic algorithm, obtaining response data and sending the response data to the application module;
the second protection message is generated by the gateway after receiving the feedback data sent by the monitoring server and encrypting and integrity protecting the feedback data based on a cryptographic algorithm; the feedback data is obtained by the monitoring server according to second request data sent by the gateway; and the second request data is obtained by the gateway after integrity check and decryption are carried out on the second protection message based on a cryptographic algorithm.
A power data transmission system comprises a power terminal with an application module and an encryption module built in, and a power monitoring platform comprising a gateway and a monitoring server; the encryption module is connected with the application module and the gateway, and the gateway is connected with the monitoring server;
the encryption module acquires first request data sent by an application module, encrypts the first request data based on a cryptographic algorithm and performs integrity protection processing on the first request data, generates a first protection message and sends the first protection message to the gateway; after the gateway carries out integrity verification and decryption on the first protection message, second request data are obtained and sent to the monitoring server; the monitoring server outputs feedback data according to the second data request; the gateway receives the feedback data, encrypts and integrally protects the feedback data based on a state cipher algorithm to obtain a second protection message and sends the second protection message to the encryption module; and the encryption module obtains response data and sends the response data to the application module after integrity verification and decryption are carried out on the second protection message based on a state cryptographic algorithm.
In one embodiment, the encryption module is a secure chip or a thin film card.
According to the electric power data transmission method, the encryption module of the electric power terminal obtains first request data sent by the application module, encrypts and integrally protects the first request data based on a state cryptographic algorithm, generates a first protection message and sends the first protection message to a gateway of the electric power monitoring platform; the gateway performs integrity check and decryption on the first protection message to obtain second request data, sends the second request data to the monitoring server, receives feedback data sent by the monitoring server, performs encryption and integrity protection processing on the feedback data based on a state cryptographic algorithm to obtain a second protection message, and sends the second protection message to the encryption module; and finally, the encryption module performs integrity verification and decryption on the second protection message based on a state cryptographic algorithm to obtain response data and sends the response data to the application module, so that remote encryption transmission of the electric power data is realized, and the communication safety of the electric power data transmission system is improved.
Detailed Description
To facilitate an understanding of the present application, the present application will now be described more fully with reference to the accompanying drawings. Embodiments of the present application are set forth in the accompanying drawings. This application may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
It will be understood that when an element is referred to as being "connected" to another element, it can be directly connected to the other element or be connected to the other element through intervening elements. Further, "connection" in the following embodiments is understood to mean "electrical connection", "communication connection", or the like, if there is a transfer of electrical signals or data between the connected objects.
As used herein, the singular forms "a", "an" and "the" may include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises/comprising," "includes" or "including," etc., specify the presence of stated features, integers, steps, operations, components, parts, or combinations thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, components, parts, or combinations thereof.
To enhance the Security of the power data transmission process, the communication between the power terminal and the power monitoring platform may be performed based on SSL (Secure Sockets Layer) and TLS (Transport Layer Security). However, in the communication process based on the SSL protocol, on one hand, a plaintext key exchange manner is adopted, so that certain security holes exist, and the effect of improving the security of the communication process is limited; on the other hand, after the key exchange is completed, the SSL protocol adopts decryption before integrity verification, and the working efficiency is low. Based on the above, the application provides a power data transmission method and system, which apply the national secret IPSec VPN protocol to the scene of power terminal access, solve the problem of safe communication between the power terminal and the monitoring platform, and simultaneously, the decryption and integrity verification of the national secret IPSec VPN protocol are synchronously performed, which is beneficial to improving the working efficiency.
In a first aspect of the present application, a power data transmission method is provided, which is applied to a gateway of a power monitoring platform. As shown in fig. 1, the power data transmission method includes steps S220 to S260.
Step S220: and acquiring a first protection message sent by the encryption module.
The power terminal can be a concentrator, a collector or an electric energy meter and the like, and is internally provided with an encryption module and an application module. The power monitoring platform comprises a gateway and a monitoring server. The encryption module can be a security chip or a film card with a national encryption algorithm and is used for encrypting and decrypting data to ensure the integrity and the security of the data.
Further, in one embodiment, the encryption module and the gateway communicate via a national Security IPSec (Internet Protocol Security) channel. National security IPSec is a protocol package that protects the network transport protocol family of IP protocols by encrypting and authenticating packets of the IP protocols. The IPsec mainly includes an Authentication Header (AH), an Encapsulated Security Payload (ESP), a Security Association (SA) protocol, and an encryption key protocol (IKE). Wherein, the authentication header provides connectionless data integrity, message authentication and replay attack protection for the IP datagram; the encapsulation security payload provides confidentiality, data source authentication, connectionless integrity, replay protection and limited transport stream confidentiality, the security association provides algorithms and data packets, provides parameters required for AH and ESP operations; the key agreement provides for the survival and exchange of symmetric keys. The IPsec channel is adopted for communication, mainly because the IPsec protocol provides a security protection protocol standard for guaranteeing confidentiality, integrity and authentication of IP services in a network layer, the IPsec provides service for communication security of the network layer by introducing a security mechanism in cryptography.
Specifically, the encryption module acquires first request data sent by the application module, encrypts and integrity-protects the first request data based on a cryptographic algorithm to generate a first protection message, and then sends the first protection message to a gateway of the power monitoring platform. The type of cryptographic algorithm is not exclusive and may be, for example, the cryptographic SM1 algorithm, the cryptographic SM2 algorithm, or the cryptographic SM4 algorithm.
Further, the purpose of the integrity protection process is to protect the integrity of data and the integrity of data-related attributes that may be compromised in different ways by preventing threats or detecting threats. Specifically, an integrity constraint may be set to perform integrity protection processing on the first request data. For example, an integrity sequence number may be appended to the data item prior to encryption protection; an encryption chain may also be generated during encryption using a chain that extends over a sequence of data items. In addition, the gateway may obtain the first protection packet actively or passively.
Step S240: and after integrity verification and decryption are carried out on the first protection message based on the state cryptographic algorithm, second request data are obtained and sent to the monitoring server.
The type of the monitoring server is not exclusive, and may be, for example, a tower server, a rack server, a blade server, a high-density server, a single-path server, a two-path server, or a multi-path server. Integrity checking refers to checking whether data is complete according to integrity constraints. Specifically, the gateway performs integrity check and decryption on the first protection message based on the cryptographic algorithm, and after determining that the data is complete, obtains second request data and sends the second request data to the monitoring server. It should be noted that the first request data and the second request data are both plaintext request data. If the integrity check is not passed, the situation that an attacker tampers and viruses attack exists is indicated, at the moment, the gateway feeds back abnormal information to the power terminal, and the power data transmission is stopped.
Step S260: and receiving feedback data sent by the monitoring server, encrypting and integrity protecting the feedback data based on a state cipher algorithm, obtaining a second protection message and sending the second protection message to the encryption module.
Specifically, the monitoring server receives the second request data, extracts corresponding feedback data according to the second request data, and sends the feedback data to the gateway. After receiving the feedback data, the gateway encrypts and integrity-protects the feedback data based on a state-secret algorithm to obtain a second protection message and sends the second protection message to the encryption module. And finally, the encryption module performs integrity verification and decryption on the second protection message based on the national encryption algorithm to obtain response data and sends the response data to the application module. Similarly, if the integrity check fails, it indicates that there are situations of attacker tampering and virus attack, and at this time, the encryption module feeds back abnormal information to the application module, and terminates this power data transmission.
According to the electric power data transmission method, the encryption module of the electric power terminal obtains first request data sent by the application module, encrypts and integrally protects the first request data based on a state cryptographic algorithm, generates a first protection message and sends the first protection message to a gateway of the electric power monitoring platform; the gateway performs integrity check and decryption on the first protection message to obtain second request data, sends the second request data to the monitoring server, receives feedback data sent by the monitoring server, performs encryption and integrity protection processing on the feedback data based on a state cryptographic algorithm to obtain a second protection message, and sends the second protection message to the encryption module; and finally, the encryption module performs integrity verification and decryption on the second protection message based on a state cryptographic algorithm to obtain response data and sends the response data to the application module, so that remote encryption transmission of the electric power data is realized, and the communication safety of the electric power data transmission system is improved. Furthermore, the national encryption algorithm has the advantages of high password complexity, high processing speed and low machine performance consumption, and encryption and decryption processing can be performed by using the national encryption algorithm, so that decryption and integrity verification can be performed synchronously, and the work efficiency is improved.
In one embodiment, as shown in fig. 2, before the step S220, a step S210 is further included: and carrying out key agreement with the encryption module based on the network key exchange protocol to obtain a session key pair.
The session key pair refers to a key obtained by negotiating and jointly establishing two or more entities, and the session key pair is obtained by calculating parameters respectively generated by each protocol participant. The negotiation object with the session key pair is established, and the transmission data is encrypted and decrypted according to the session key pair, so that the safety of the data transmission process can be ensured. The type of the key exchange protocol is not exclusive, and may be, for example, national security IPSec VPN (Virtual Private Network) protocol or Oakley protocol.
Specifically, before normal communication is performed between a gateway of the power monitoring platform and an encryption module in the power terminal, key agreement is performed through message interaction based on a network key exchange protocol to obtain a session key pair. The number of session key pairs is determined by the number of encryption/decryption times during communication. Specifically, in this embodiment, the number of the session key pairs is two, and the total number of the session key pairs is four, including the request direction encryption key and the integrity check key, and the response direction encryption key and the integrity check key.
In the above embodiment, before normal communication is performed, the session key pair is obtained based on the network key exchange protocol, which is beneficial to further ensuring the security of the data transmission process.
In one embodiment, as shown in fig. 3, the network key exchange protocol is the national security IPSec VPN protocol, and step S210 includes steps S212 to S216.
Step S212: based on the national secret IPSec VPN protocol, working secret key negotiation is carried out with the encryption module to determine a working secret key.
The function of the VPN is to establish a private network over a public network and perform encrypted communication. The national secret IPSec VPN protocol is a VPN tunnel protocol based on the national secret IPSec and is a third layer tunnel protocol. Specifically, the gateway performs work key negotiation with the encryption module based on the national secret IPSec VPN protocol, determines a work key, and establishes a channel which passes identity authentication and security protection.
Referring to fig. 4, the message interaction process in the work key negotiation process specifically includes: the method comprises the following steps that firstly, a first message containing suggestions such as a first-stage algorithm, a negotiation version, a life cycle and the like is sent to a responder by an initiator, the responder receives the first message, and replies first feedback information containing the first-stage algorithm, a protocol version, a signature, an encryption certificate and the like according to the first message; then the initiator verifies the encrypted certificate, exchanges the temporary key, the signature certificate and the signature, and the responder verifies the signature of the initiator and generates a first-stage key parameter and a working key; and finally, the initiator and the responder respectively identify the keys generated in the negotiation process to determine the working keys. The initiator is an encryption module, and the responder is a gateway.
Step S214: and receiving a virtual IP request message sent by the encryption module, and feeding back a virtual IP response message to the encryption module according to the virtual IP request message.
The virtual IP request message and the virtual IP response message are used for allocating a virtual IP address of the terminal so as to support the terminal access scene. Specifically, please refer to fig. 4, the encryption module sends a virtual IP request packet to the gateway, and the gateway feeds back a virtual IP response packet to the encryption module according to the virtual IP request packet to perform virtual IP address allocation.
In one embodiment, as shown in fig. 5, the virtual IP request message and the virtual IP response message each include a generic attribute payload and a configuration attribute payload.
The generic attribute load is the original load contained in the national secret IPSec VPN protocol. The configuration attribute load is the newly added load in the virtual IP request message and the virtual IP response message.
In one embodiment, continuing with reference to FIG. 5, the generic attribute payload includes a generic payload header, a generic type, and a generic extension. The universal load head is used for defining the boundary of the load, and the length of the universal load head is 4 bytes; the general type is used for indicating a configuration request and has the length of 1 byte; the universal extension is a reserved part in the universal payload and is 1 byte in length.
In one embodiment, continuing with FIG. 5, the configuration attribute payload includes a configuration type, a configuration length, and a configuration content. Wherein the configuration type is the requested virtual IP type, such as IPV4 or IPV 6; the configuration length defines the byte length of the whole configuration attribute load, and the configuration type and the configuration length occupy 3 bytes. The content is configured for placing the corresponding IP address of the feedback, such as the IPV4 address or the IPV6 address. It can be understood that in the virtual IP request message, the configuration content is empty and there is no data stuffing.
Step S216: under the protection of the working key, session key negotiation is carried out with the encryption module based on the national secret IPSec VPN protocol to obtain a session key pair.
Specifically, after the working key is determined, a relatively secure communication channel is established, and at this time, the gateway and the encryption module perform session key agreement based on the national secret IPSec VPN protocol. After the key negotiation is successful, a session key pair is obtained, and then encrypted communication between the encryption module and the gateway can be carried out.
Referring to fig. 4, the message interaction process in the session key negotiation process specifically includes: the initiator sends a second message containing a second-stage algorithm, a life cycle and key intermediate parameters to the responder, and the responder receives the second message and replies second feedback information containing the second-stage algorithm, the life cycle and the key intermediate parameters according to the second message; and the initiator checks the message verification process and generates a session key pair after the verification is passed.
In the above embodiment, on the one hand, the negotiation of two stages is performed based on the national secret IPSec VPN protocol, that is, the negotiation of the working secret key of the first stage is performed first, so as to protect the negotiation process of the session secret key of the second stage, which is beneficial to further improving the communication security; on the other hand, based on the national secret IPSec VPN protocol, the user-defined protocol is expanded to distribute the virtual IP address of the terminal, the terminal access scene is supported, and the problem that the traditional national secret IPSec protocol is only used for the inter-network secure communication and can not support the terminal access can be solved.
In a second aspect of the present application, a power data transmission method is provided, which is applied to an encryption module of a power terminal. As shown in fig. 6, the power data transmission method includes steps S120 to S160.
Step S120: the method comprises the steps of obtaining first request data sent by an application module.
The application module is arranged in the power terminal, and the power terminal can be a concentrator, a collector or an electric energy meter and the like. The encryption module can be a security chip or a film card with a national encryption algorithm and is used for encrypting and decrypting data to ensure the integrity and the security of the data. Specifically, the first request data is plaintext request data, and the encryption module may actively obtain or passively receive the first request data sent by the application module.
Step S140: and after the first request data is encrypted and subjected to integrity protection processing based on a state cryptographic algorithm, generating a first protection message and sending the first protection message to a gateway of the power monitoring platform.
The power monitoring platform comprises a gateway and a monitoring server. The type of monitoring server is not exclusive and may be, for example, a tower server, a rack server, a blade server, a high-density server, a single-pass server, a two-pass server, a multi-pass server, or the like. The type of cryptographic algorithm is also not unique and may be, for example, the cryptographic SM1 algorithm, the cryptographic SM2 algorithm, or the cryptographic SM4 algorithm. Further, the purpose of the integrity protection process is to protect the integrity of data and the integrity of data-related attributes that may be compromised in different ways by preventing threats or detecting threats. Specifically, an integrity constraint may be set to perform integrity protection processing on the first request data. For example, an integrity sequence number may be appended to the data item prior to encryption protection; an encryption chain may also be generated during encryption using a chain that extends over a sequence of data items.
Further, in one embodiment, the encryption module and the gateway communicate via a national Security IPSec (Internet Protocol Security) channel. For the specific definition of national secret IPSec, see above, further description is omitted here.
Step S120: and receiving a second protection message fed back by the gateway, carrying out integrity verification and decryption on the second protection message based on a state cryptographic algorithm, obtaining response data and sending the response data to the application module.
The second protection message is generated after the gateway receives feedback data sent by the monitoring server and encrypts and integrally protects the feedback data based on a state cryptographic algorithm; the feedback data is obtained by the monitoring server according to the second request data sent by the gateway; and the second request data is obtained by the gateway after integrity verification and decryption are carried out on the second protection message based on the cryptographic algorithm. Integrity checking refers to checking whether data is complete according to integrity constraints.
Specifically, the second request data is plaintext request data. And the gateway carries out integrity check and decryption on the first protection message based on a state cryptographic algorithm, and after the data is determined to be complete, second request data is obtained and sent to the monitoring server. And the monitoring server receives the second request data, extracts corresponding feedback data according to the second request data and sends the feedback data to the gateway. After receiving the feedback data, the gateway encrypts and integrity-protects the feedback data based on a state-secret algorithm to obtain a second protection message and sends the second protection message to the encryption module. And finally, the encryption module performs integrity verification and decryption on the second protection message based on the national encryption algorithm to obtain response data and sends the response data to the application module. It should be noted that, in the data transmission process, if the integrity check fails, it indicates that there are situations of attacker tampering and virus attack, and at this time, the gateway or the encryption module feeds back the abnormal information and terminates the current power data transmission.
In one embodiment, before step S120, the method further includes: and carrying out key agreement with the gateway based on the network key exchange protocol to obtain a session key pair.
In one embodiment, the network key exchange protocol is a national security IPSec VPN protocol, and performs key agreement with the gateway based on the network key exchange protocol to obtain a session key pair, including: based on the national secret IPSec VPN protocol, working key negotiation is carried out with the gateway to determine a working key; sending a virtual IP request message to the gateway, and receiving a virtual IP response message fed back by the gateway; under the protection of the working key, session key negotiation is carried out with the gateway based on the national secret IPSec VPN protocol to obtain a session key pair.
For the limitation of the specific communication process between the encryption module and the gateway, refer to the method embodiment of the first aspect, which is not described herein again.
According to the electric power data transmission method, the encryption module of the electric power terminal obtains first request data sent by the application module, encrypts and integrally protects the first request data based on a state cryptographic algorithm, generates a first protection message and sends the first protection message to a gateway of the electric power monitoring platform; the gateway performs integrity check and decryption on the first protection message to obtain second request data, sends the second request data to the monitoring server, receives feedback data sent by the monitoring server, performs encryption and integrity protection processing on the feedback data based on a state cryptographic algorithm to obtain a second protection message, and sends the second protection message to the encryption module; and finally, the encryption module performs integrity verification and decryption on the second protection message based on a state cryptographic algorithm to obtain response data and sends the response data to the application module, so that remote encryption transmission of the electric power data is realized, and the communication safety of the electric power data transmission system is improved. Furthermore, the national encryption algorithm has the advantages of high password complexity, high processing speed and low machine performance consumption, and encryption and decryption processing can be performed by using the national encryption algorithm, so that decryption and integrity verification can be performed synchronously, and the work efficiency is improved.
In a third aspect of the present application, as shown in fig. 7, there is provided an electric power data transmission system, including an electric power terminal 100 with a built-in application module 101 and an encryption module 102, and an electric power monitoring platform 200 including a gateway 201 and a monitoring server 202; the encryption module 102 is connected with the application module 101 and the gateway 201, and the gateway 201 is connected with the monitoring server 202. The encryption module 102 and the gateway 201 are used to execute the above-described power data transmission method.
For the definition of each module, see above, it is not repeated here. It is understood that the above modules may be implemented in whole or in part by software, hardware, and combinations thereof.
Specifically, as shown in fig. 8, the encryption module 102 obtains first request data sent by the application module 101, encrypts the first request data based on a cryptographic algorithm and performs integrity protection processing on the first request data, generates a first protection packet, and sends the first protection packet to the gateway 201; after the gateway 201 performs integrity check and decryption on the first protection message, second request data is obtained and sent to the monitoring server 202; the monitoring server 202 outputs feedback data according to the second data request; the gateway 201 receives the feedback data, encrypts and integrity-protects the feedback data based on a national cryptographic algorithm, obtains a second protection message, and sends the second protection message to the encryption module 102; the encryption module 102 performs integrity check and decryption on the second protection message based on the cryptographic algorithm, obtains response data, and sends the response data to the application module 101. Further, in one embodiment, the encryption module and the gateway communicate via a national security IPSec tunnel.
In one embodiment, the encryption module 102 is a secure chip or thin film card. As shown in fig. 7, the encryption module 102 includes a hardware cryptographic module and a software IPSec client, and implements key storage and key operation by the hardware cryptographic module, and establishes a national key IPSec channel in cooperation with the software IPSec client and the gateway, so that the security of the key at the terminal side can be effectively ensured, and the security of the communication process can be further improved.
In the electric power data transmission system, the encryption module of the electric power terminal acquires first request data sent by the application module, encrypts the first request data based on a state cryptographic algorithm, performs integrity protection processing on the first request data, generates a first protection message and sends the first protection message to a gateway of the electric power monitoring platform; the gateway performs integrity check and decryption on the first protection message to obtain second request data, sends the second request data to the monitoring server, receives feedback data sent by the monitoring server, performs encryption and integrity protection processing on the feedback data based on a state cryptographic algorithm to obtain a second protection message, and sends the second protection message to the encryption module; and finally, the encryption module performs integrity verification and decryption on the second protection message based on a state cryptographic algorithm to obtain response data and sends the response data to the application module, so that remote encryption transmission of the electric power data is realized, and the communication safety of the electric power data transmission system is improved. Furthermore, the national encryption algorithm has the advantages of high password complexity, high processing speed and low machine performance consumption, and encryption and decryption processing can be performed by using the national encryption algorithm, so that decryption and integrity verification can be performed synchronously, and the work efficiency is improved.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.