Sensor device for power system, processing device and power system

By adding random token values ​​to data packets between power system sensor devices and processing devices and using signal strength to generate symmetric keys, the replay attack problem in wireless communications is solved, achieving a highly secure and low-cost defense effect.

CN120692547APending Publication Date: 2025-09-23ABB (SCHWEIZ) AG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410329981.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

The existing technology for replay attacks on wireless communications in power systems has low security and high costs, making it difficult to effectively defend against them.

Method used

A randomly generated token value is added to the data packet transmitted between the sensor device and the processing device. Only when the received data packet includes the same token value will the data packet be recognized and processed, and a symmetric key is generated according to the signal strength value to encrypt the data packet.

Benefits of technology

It effectively combats replay attacks, improves security, reduces requirements on chip performance, and saves costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120692547A_ABST
    Figure CN120692547A_ABST
Patent Text Reader

Abstract

The invention relates to a sensor device for a power system, a processing device and a power system. In the invention, the sensor equipment and the processing equipment used for the power system add the randomly generated token value into the sent data packet, and the corresponding sensor equipment and the processing equipment can accept and process the received data packet only under the condition that the subsequently received data packet comprises the same token value; therefore, the replay attack can be effectively resisted. Compared with a serial number technology, the replay attack resisting mode has higher security, and compared with a timestamp technology and a security authentication and encryption technology based on a public and private key system, the chip performance requirement is lower on the premise of ensuring that the security is not reduced, and the cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power systems and electronic technologies, and in particular to a sensor device, a processing device and a power system for a power system. Background Art

[0002] Power systems, such as intelligent substations, employ a large number of sensor devices to monitor the status of objects such as switchgear. A significant portion of these sensors transmit monitoring data wirelessly to processing equipment, which collects and processes the data. Because wireless communications present greater security risks, the security of wireless data transmission warrants particular attention.

[0003] Replay attacks are a common type of attack faced during wireless communications. After intercepting wireless data packets, an attacker retransmits data packets that have already been received by the target device, thereby deceiving the system. Replay attacks can cause a variety of problems, such as authentication bypass, data tampering, and denial of service.

[0004] The IEC TS 62351 standard for data and communications security for power system management and information exchange specifies the following methods to mitigate replay attacks: 1. Use of serial number technology; 2. Use of timestamp technology; 3. Use of authentication and encryption technologies based on public-private key systems. However, each of these methods has its limitations. Serial number technology offers lower security, while timestamp technology and authentication and encryption technologies based on public-private key systems require higher chip performance in sensor and processing equipment, increasing equipment costs.

[0005] Therefore, a highly secure and low-cost method is needed to combat replay attacks. Summary of the Invention

[0006] The present invention is based on the principle of providing a sensor device, a processing device and a power system for a power system, so as to solve the above-mentioned problems existing in the prior art.

[0007] An embodiment of the present invention provides a sensor device for an electric power system, wherein the sensor device is used to interact with data of a processing device of the electric power system. The sensor device uses a transmission key to encrypt and decrypt a data packet including at least one token transmitted between the sensor device and the processing device. The sensor device recognizes and processes the data packet only if the received data packet includes a token value randomly generated by the sensor device in the last sent data packet.

[0008] Optionally, the sensor device is specifically used to:

[0009] After startup, randomly generate and store a token value; and

[0010] In a case where the sensor device has not been issued a transmission key, a monitoring data packet including a first token assigned to the token value and monitoring data is sent to the processing device; or, in a case where the sensor device has already stored the transmission key, a monitoring data packet including a first token assigned to the token value and monitoring data encrypted using the transmission key is sent to the processing device.

[0011] Optionally, upon receiving a key data packet including the first token, the second token, and the transmission key from the processing device, the sensor device is specifically configured to:

[0012] Obtaining a level value corresponding to the signal strength value of the key data packet, and generating a symmetric key according to the identity identification code of the sensor device and the level value,

[0013] decrypting the key data packet using the symmetric key,

[0014] If the decryption is successful, if the value of the first token in the key data packet is the same as the stored token value or the same as the value corresponding to the location of the first token in the monitoring data packet, the transmission key in the key data packet is stored as a new transmission key, and the value of the second token in the key data packet is stored as a new token value, and

[0015] When sending the next monitoring data packet, the value of the first token in the next monitoring data packet is assigned to the new token value and the next monitoring data packet is encrypted using the new transmission key.

[0016] Optionally, upon receiving a response data packet including the first token, the second token, and the response data from the processing device, the sensor device is specifically configured to:

[0017] decrypting the response data packet using the transmission key,

[0018] If the decryption is successful, if the value of the first token in the response data packet is the same as the stored token value, storing the value of the second token in the response data packet as a new token value, and

[0019] When sending the next monitoring data packet, the value of the first token in the next monitoring data packet is assigned to the new token value and the next monitoring data packet is encrypted using the transmission key.

[0020] Optionally, if decryption of the key data packet or the response data packet fails, the key data packet or the response data packet is not recognized, a new token value is randomly generated and stored, and a monitoring data packet including a first token assigned to the new token value and monitoring data is sent to the processing device.

[0021] Optionally, if the verification of the value of the first token in the key data packet or the response data packet fails, the key data packet or the response data packet is not recognized, a new token value is randomly generated and stored, and a monitoring data packet including the first token assigned to the new token value and monitoring data encrypted using the transmission key is sent to the processing device.

[0022] Optionally, after sending the monitoring data packet, if no key data packet or response data packet is received from the processing device within a preset time period, a number of monitoring data packets with the same token value as the previous monitoring data packet, which is less than a set number threshold, is repeatedly sent; if still no data packet is received from the processing device, a new token value is randomly generated and stored, and a monitoring data packet including a first token assigned to the new token value and monitoring data encrypted using the transmission key is sent to the processing device.

[0023] According to another aspect of the present invention, a processing device for an electric power system is provided, wherein the processing device is used to interact with data of a sensor device of the electric power system, and the processing device uses a transmission key to encrypt and decrypt a data packet including at least one token transmitted between the sensor device and the processing device, wherein the processing device recognizes and processes a data packet only if the received data packet includes a token value randomly generated by the processing device in a previously sent data packet.

[0024] Optionally, upon receiving a monitoring data packet including a first token and monitoring data from the sensor device, the processing device is specifically configured to:

[0025] Identify whether the monitoring data packet is encrypted. If the monitoring data packet is not encrypted, issue a transmission key to the sensor device. If the monitoring data packet is encrypted, issue a transmission key to the sensor device if the processing device does not store the transmission key corresponding to the identity identification code of the sensor device. If the processing device stores the transmission key and token value corresponding to the identity identification code of the sensor device, decrypt the monitoring data packet using the transmission key. If the decryption is successful, if the value of the first token in the monitoring data packet is the same as the stored token value, accept the monitoring data in the monitoring data packet and send response data to the sensor device or actively update the transmission key. If the decryption fails, issue a new transmission key to the sensor device.

[0026] Optionally, when the monitoring data packet is not encrypted, issuing a transmission key to the sensor device includes:

[0027] Randomly generate and store a transmission key and a token value corresponding to the identification code of the sensor device,

[0028] Obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the identity identification code of the sensor device and the level value, and

[0029] A key data packet encrypted with the symmetric key and including a first token, a second token, and the transmission key is sent to the sensor device, wherein the first token in the key data packet is assigned the value of the first token in the monitoring data packet, and the second token in the key data packet is assigned the token value.

[0030] Optionally, when the processing device does not store a transmission key corresponding to the identity identification code of the sensor device, issuing the transmission key to the sensor device includes:

[0031] Randomly generate and store a transmission key and a token value corresponding to the identification code of the sensor device,

[0032] Obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the identity identification code of the sensor device and the level value, and

[0033] A key data packet encrypted with the symmetric key and including a first token, a second token, and the transmission key is sent to the sensor device, wherein the first token in the key data packet is assigned a value corresponding to the position of the first token in the monitoring data packet, and the second token in the key data packet is assigned the token value.

[0034] Optionally, sending response data to the sensor device includes:

[0035] Randomly generate and store a new token value, and send a response data packet including a first token, a second token and response data to the sensor device, wherein the first token in the response data packet is assigned the value of the first token in the monitoring data packet, and the second token in the response data packet is assigned the new token value.

[0036] Optionally, actively updating the transmission key includes:

[0037] Randomly generate and store a new transfer key and a new token value,

[0038] Obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the identity identification code of the sensor device and the level value, and

[0039] A key data packet encrypted with the symmetric key and including a first token, a second token and the new transmission key is sent to the sensor device, wherein the first token in the key data packet is assigned the value of the first token in the monitoring data packet, and the second token in the key data packet is assigned the new token value.

[0040] Optionally, in the event of a decryption failure, issuing a new transmission key to the sensor device includes:

[0041] Randomly generate and store a new transmission key and a new token value corresponding to the identification code of the sensor device,

[0042] Obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the identity identification code of the sensor device and the level value, and

[0043] A key data packet encrypted with the symmetric key and including a first token, a second token and the new transmission key is sent to the sensor device, wherein the first token in the key data packet is assigned a value corresponding to the position of the first token in the monitoring data packet, and the second token in the key data packet is assigned the new token value.

[0044] Optionally, if the verification of the value of the first token in the monitoring data packet fails, the monitoring data packet is not recognized, a new token value is randomly generated and stored, and a response data packet encrypted with the transmission key is sent to the sensor device, including the first token, the second token and response data, wherein the first token in the response data packet is assigned the value of the first token in the monitoring data packet, and the second token in the response data packet is assigned the new token value.

[0045] According to yet another aspect of the present invention, a power system is provided. The power system includes the sensor device for a power system and the processing device for a power system provided by the present invention.

[0046] The sensor device, processing device, and power system for a power system of the present invention have at least the following advantages:

[0047] In the present invention, sensor devices and processing devices used in power systems add randomly generated token values ​​to transmitted data packets. Only if a subsequently received data packet contains the same token value will the corresponding sensor device and processing device recognize and process the received data packet, effectively countering replay attacks. This method of countering replay attacks offers higher security than serial number technology and, while maintaining security, lower chip performance requirements than timestamp technology and public-private key-based security authentication and encryption technologies, thus saving costs.

[0048] In the present invention, in the process of issuing a transmission key through symmetric encryption, the sensor device and the processing device use the signal strength value of the received data packet as one of the influencing factors in the process of generating the symmetric key, thereby enhancing the randomness of the symmetric key and ensuring that the symmetric key is not easily cracked. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Other details and advantages of the present invention will become apparent from the detailed description provided below. It should be understood that the following drawings are merely schematic and not drawn to scale, and therefore should not be considered as limiting the present invention. The following detailed description will be given with reference to the accompanying drawings, in which:

[0050] Figure 1 A power system including a sensor device and a processing device according to a first embodiment of the present invention is schematically shown.

[0051] Figure 2A and 2B The data processing and interaction process of the sensor device and the processing device in the power system according to the second specific embodiment of the present invention is schematically shown.

[0052] Figure 3A A specific form of a monitoring data packet is schematically shown.

[0053] Figure 3B A specific form of the key data packet is schematically shown.

[0054] Figure 3C A specific form of a response data packet is schematically shown. DETAILED DESCRIPTION

[0055] Embodiments of the present invention are described below with reference to the accompanying drawings. In the following description, many specific details are set forth to enable those skilled in the art to more fully understand and implement the present invention. However, it will be apparent to those skilled in the art that the present invention may be implemented without some of these specific details. Furthermore, it should be understood that the present invention is not limited to the specific embodiments described. Rather, it is contemplated that the present invention may be implemented with any combination of the features and elements described below, regardless of whether they relate to different embodiments. Therefore, the following aspects, features, embodiments, and advantages are provided for illustrative purposes only and should not be considered as elements or limitations of the claims unless expressly set forth in the claims.

[0056] The core inventive concept of the present invention is that, during the data interaction process, the sensor devices and processing devices of the power system will add a randomly generated token value to the transmitted data packet. Only when the subsequently received data packet includes the same token value, the corresponding sensor device and processing device will recognize and process the received data packet, thereby effectively resisting replay attacks. Compared with the serial number technology, the technical solution of the present invention is more secure against replay attacks. Under the premise of ensuring that security is not reduced, the chip performance requirements of the sensor device and processing device are lower than those of the timestamp technology and the security authentication and encryption technology based on the public-private key system, which is conducive to cost savings.

[0057] Now refer to Figure 1, shows an electric power system of a specific embodiment of the present invention. The electric power system includes a sensor device and a processing device. The sensor device monitors the status of the monitored object (for example, a switch device) and uploads the monitoring data to the processing device. The processing device collects and processes the monitoring data from the sensor device. The processing device can be any suitable device with data receiving and processing functions, such as a host or a data concentrator, and these variations do not exceed the scope of protection of the present invention. The sensor device and the processing device exchange data through wired or wireless communication (preferably through wireless communication). Those skilled in the art will understand that the sensor device and the processing device can exchange data through any suitable wireless communication method, for example, WSN (Wireless Sensor Networks), and these variations do not exceed the scope of protection of the present invention.

[0058] In the present invention, during data processing and interaction, the sensor device uses a transmission key to encrypt and decrypt data packets, including at least one token, transmitted between the sensor device and the processing device. The sensor device only recognizes and processes a received data packet if it contains the token value randomly generated by the sensor device in the previously sent data packet. This effectively counters replay attacks with high security and low cost.

[0059] The sensor device of the present invention can be specifically configured to: after startup, randomly generate and store a token value. If the sensor device has not been issued a transmission key, send a monitoring data packet including a first token assigned to the token value and monitoring data to a processing device; or, if the sensor device has stored the transmission key, send a monitoring data packet including the first token assigned to the token value and monitoring data encrypted using the transmission key to the processing device.

[0060] After sending the monitoring data packet, the sensor device may receive two different data packets from the processing device, namely, a key data packet containing the transmission key and a response data packet containing the response data.

[0061] In the case of receiving a key data packet including a first token, a second token and a transmission key from a processing device, the sensor device can be specifically used to: obtain a level value corresponding to the signal strength value of the key data packet, and generate a symmetric key based on the identity identification code of the sensor device and the level value. Decrypt the key data packet using the symmetric key. If the decryption is successful, then when the value of the first token in the key data packet is the same as the stored token value or the same as the value corresponding to the location of the first token in the monitoring data packet, the transmission key in the key data packet is stored as a new transmission key, and the value of the second token in the key data packet is stored as a new token value. When sending the next monitoring data packet, the value of the first token in the next monitoring data packet is assigned to the new token value and the next monitoring data packet is encrypted using the new transmission key.

[0062] Upon receiving a response packet from the processing device including a first token, a second token, and response data, the sensor device may be configured to: decrypt the response packet using the transmission key; if the decryption is successful, and if the value of the first token in the response packet is the same as the stored token value, store the value of the second token in the response packet as the new token value; and when transmitting the next monitoring packet, assign the value of the first token in the next monitoring packet to the new token value and encrypt the next monitoring packet using the transmission key.

[0063] In addition, if the decryption of the key data packet or the response data packet fails, the sensor device may not recognize the key data packet or the response data packet, randomly generate and store a new token value, and send a monitoring data packet including a first token assigned to the new token value and monitoring data to the processing device.

[0064] In addition, if the verification of the value of the first token in the key data packet or the response data packet fails, the sensor device may not recognize the key data packet or the response data packet, randomly generate and store a new token value, and send a monitoring data packet encrypted using the transmission key to the processing device, including the first token assigned to the new token value and the monitoring data.

[0065] In addition, after sending the monitoring data packet, if no key data packet or response data packet is received from the processing device within a preset time period, the sensor device can repeatedly send monitoring data packets with the same token value as the previous monitoring data packet but less than the set number threshold. If no data packet is still received from the processing device, the sensor device can randomly generate and store a new token value, and send a monitoring data packet to the processing device that includes a first token assigned to the new token value and monitoring data encrypted using the transmission key. The specific value of the number threshold can be set according to the actual working conditions, for example, it can be 2 or 3. These variations do not exceed the scope of protection of the present invention.

[0066] In the present invention, during data processing and interaction, the processing device uses a transmission key to encrypt and decrypt data packets, including at least one token, transmitted between the sensor device and the processing device. The processing device only recognizes and processes a received data packet if it contains the token value randomly generated by the processing device in the previously sent data packet. This effectively counters replay attacks with high security and low cost.

[0067] In the case of receiving a monitoring data packet including a first token and monitoring data from a sensor device, the processing device can be specifically used to: identify whether the monitoring data packet is encrypted. If the monitoring data packet is not encrypted, a transmission key is issued to the sensor device. If the monitoring data packet is encrypted, in the case that the processing device does not store a transmission key corresponding to the identity identification code of the sensor device, a transmission key is issued to the sensor device. In the case that the processing device stores a transmission key and a token value corresponding to the identity identification code of the sensor device, the processing device decrypts the monitoring data packet using the transmission key. If the decryption is successful, in the case that the value of the first token in the monitoring data packet is the same as the stored token value, the processing device accepts the monitoring data in the monitoring data packet, and sends response data to the sensor device or actively updates the transmission key. If the decryption fails, the processing device issues a new transmission key to the sensor device.

[0068] If the received monitoring data packet is unencrypted, the processing device may issue a transmission key to the sensor device in the following manner: randomly generating and storing a transmission key and a token value corresponding to the sensor device's identification code; obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the sensor device's identification code and the level value; and sending a key data packet encrypted with the symmetric key, including a first token, a second token, and the transmission key, to the sensor device. The first token in the key data packet is assigned the value of the first token in the monitoring data packet, and the second token in the key data packet is assigned the token value.

[0069] If the processing device does not store a transmission key corresponding to the sensor device's identification code, the processing device may issue a transmission key to the sensor device in the following manner: randomly generating and storing a transmission key and a token value corresponding to the sensor device's identification code; obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the sensor device's identification code and the level value; and sending a key data packet encrypted with a symmetric key, including a first token, a second token, and the transmission key, to the sensor device. The first token in the key data packet is assigned a value corresponding to the location of the first token in the monitoring data packet, and the second token in the key data packet is assigned the token value.

[0070] The processing device can specifically send response data to the sensor device in the following manner: randomly generate and store a new token value, and send a response data packet including a first token, a second token and response data to the sensor device, wherein the first token in the response data packet is assigned the value of the first token in the monitoring data packet, and the second token in the response data packet is assigned the new token value.

[0071] Specifically, the processing device can proactively update the transmission key by randomly generating and storing a new transmission key and a new token value. Obtaining a level value corresponding to the signal strength value of the monitoring data packet and generating a symmetric key based on the sensor device's identification code and the level value. Sending a key data packet encrypted with the symmetric key, including a first token, a second token, and the new transmission key, to the sensor device. The first token in the key data packet is assigned the value of the first token in the monitoring data packet, and the second token in the key data packet is assigned the new token value.

[0072] If decryption fails, the processing device can issue a new transmission key to the sensor device in the following manner: randomly generating and storing a new transmission key and a new token value corresponding to the sensor device's identification code; obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the sensor device's identification code and the level value; and sending a key data packet encrypted with the symmetric key, including the first token, the second token, and the new transmission key, to the sensor device. The first token in the key data packet is assigned a value corresponding to the location of the first token in the monitoring data packet, and the second token in the key data packet is assigned the new token value.

[0073] In addition, if the verification of the value of the first token in the monitoring data packet fails, the processing device may not recognize the monitoring data packet, randomly generate and store a new token value, and send a response data packet including the first token, the second token and the response data encrypted with the transmission key to the sensor device, wherein the first token in the response data packet is assigned to the value of the first token in the monitoring data packet, and the second token in the response data packet is assigned to the new token value.

[0074] based on Figure 1 The working principle of the sensor device and the processing device in the power system according to the first specific embodiment of the present invention, Figure 2A and 2B The data processing and interaction process of the sensor device and the processing device in the power system according to the second specific embodiment of the present invention is schematically shown.

[0075] like Figure 2A and 2B As shown, after deciding to pair a sensor in the power system with a host (ie, a processing device), first, the ID (ie, an identification code) of the sensor is added to the host (eg, stored in a storage device of the host).

[0076] After the sensor is powered on, it randomly generates a value as the value of Token A, and then sends a monitoring data packet, such as an RTMP (Real Time Messaging Protocol) data packet, to the host. Figure 3A A specific form of monitoring data packets is schematically shown. Those skilled in the art will appreciate that although Figure 3A A specific form of the monitoring data packet is shown in the figure, however, any suitable form of data packet can be used as the monitoring data packet, and these variations do not exceed the scope of protection of the present invention. The RTMP data packet includes Token A, which is assigned a randomly generated value, and monitoring data. For a brand new sensor that has not been paired (in this case, the sensor has not been issued a transmission key), the sensor will send an unencrypted RTMP_1 data packet. For a sensor that has been paired with other hosts (in this case, the sensor has stored the transmission key SKA* issued by the previous host), the sensor will send an RTMP_2 data packet encrypted with the transmission key SKA*.

[0077] After receiving the RTMP data packet, the host will identify whether the RTMP data packet is encrypted. The host can use any known method to identify whether the RTMP data packet is encrypted, and these variations do not exceed the scope of protection of the present invention.

[0078] If the host receives the RTMP_1 data packet, it will recognize that the RTMP_1 data packet is not encrypted. The host obtains the value of Token A and the signal strength value of the RTMP data packet, and obtains the level value Q1 corresponding to the signal strength value according to the set corresponding rules.

[0079] If the host receives the RTMP_2 data packet, it will recognize that the RTMP_2 data packet is encrypted. Since the host does not store the transmission key corresponding to the sensor ID, the host will obtain the value of the original frame of the undecrypted Token A (that is, the value corresponding to the location of Token A) and the signal strength value of the RTMP data packet, and obtain the level value Q1 corresponding to the signal strength value according to the set corresponding rules.

[0080] Afterwards, the host generates a symmetric key SK1 based on the level value Q1 and the sensor ID (and possibly other information), randomly generates a transmission key SKA and a random value, and generates a key data packet PK. Figure 3B The schematic diagram shows a specific form of the key data packet. The key data packet PK includes Token A (assigned to the value of Token A obtained from RTMP_1 or the value of the original frame of the undecrypted Token A obtained from RTMP_2), Token B (assigned to a generated random value) and SKA. It can be understood by those skilled in the art that although Figure 3B A specific form of the key data packet is shown in FIG. , however, any suitable form of data packet can be used as the key data packet, and these variations do not exceed the scope of protection of the present invention.

[0081] Afterwards, the host encrypts the key package PK using SK1 to generate an encrypted package PK_1, and sends the encrypted package PK_1 to the sensor.

[0082] After receiving the encrypted packet PK_1, the sensor can determine from the function code in the packet that it is a key packet carrying the transmission key. The sensor then obtains the signal strength value of the encrypted packet PK_1 and, based on a predefined matching rule, determines the corresponding level value Q2. The sensor then generates the symmetric key SK1 based on the level value Q2 and the sensor ID (and possibly other information).

[0083] Since the sensor and host are installed in essentially the same environment and their installation positions and orientations are fixed, when both send data packets with approximately the same signal strength, the signal strengths of the data packets received by both are also essentially the same. Furthermore, to avoid the impact of slight errors in the signal strengths received by both, the present invention further associates signal strength values ​​with corresponding level values. Signal strength values ​​within a signal strength range can correspond to the same level value, thereby ensuring that when the sensor and host send data packets with approximately the same signal strength values, the level values ​​corresponding to the signal strength values ​​of the data packets received by both (i.e., Q1 and Q2) are the same. In this way, on the one hand, the introduction of the signal strength value increases the randomness of the symmetric key SK1, ensuring that the symmetric key is not easily cracked. On the other hand, the consistency of the symmetric key SK1 generated by the sensor and the host is guaranteed.

[0084] The sensor then decrypts the encrypted packet PK_1 using SK1. If decryption is successful, if the value of Token A in the key packet PK is the same as the value of Token A in the unencrypted RTMP_1 packet sent by the sensor, or the value corresponding to the location of Token A in the encrypted RTMP_2 packet, the sensor stores the transport key SKA in the key packet PK and stores the value of Token B in the key packet PK as the new token value.

[0085] Afterwards, when the sensor needs to send an RTMP data packet again, the value of Token A in the RTMP data packet is assigned to the new token value (i.e., the value of Token B in the key package PK), the RTMP data packet is encrypted using the transmission key SKA to generate an RTMP_3 data packet, and the RTMP_3 data packet is sent to the host.

[0086] After receiving the RTMP_3 packet, the host uses SKA to decrypt it. After successful decryption, the host determines whether the value of Token A in the RTMP_3 packet is the same as the stored random value (i.e., the value of Token B in the key package PK previously sent by the host). If the two are the same, the host accepts the monitoring data in the RTMP_3 packet and generates a new random value. The host then generates a response packet (ACK). Figure 3C The schematic diagram shows a specific form of the response data packet. The response data packet ACK includes Token A (assigned to the value of Token A obtained from RTMP_3), Token B (assigned to a new random value generated) and response data. It can be understood by those skilled in the art that although Figure 3CA specific form of a response data packet is shown in FIG. However, any suitable form of data packet may be used as the response data packet, and such variations are within the scope of the present invention. The host then encrypts the response data packet ACK using SKA to generate an encrypted packet ACK_3, and sends the encrypted packet ACK_3 to the sensor.

[0087] After receiving the encrypted packet ACK_3, the sensor can determine, based on the function code in the packet, that it is a response packet carrying response data. The sensor decrypts the encrypted packet ACK_3 using the transmission key SKA. After successful decryption, the sensor determines whether the value of Token A in the response packet ACK is the same as the stored value (i.e., the value of Token A in the RTMP_3 previously sent by the sensor). If the two are the same, the sensor accepts the ACK packet and stores the value of Token B in the ACK packet as the new token value. When the sensor sends the next RTMP packet, it assigns the value of Token A in the next RTMP packet to the new token value.

[0088] In addition, as has been described in detail in the content of the invention and the first specific embodiment of the present invention, in the event that decryption of a key data packet or a response data packet from the host fails, the sensor may not recognize the key data packet or the response data packet, randomly generate and store a new token value, and send an RTMP data packet including Token A assigned the new token value and monitoring data to the processing device.

[0089] In addition, as has been described in detail in the content of the invention and the first specific embodiment of the present invention, in the event that the verification of the value of Token A in the key data packet or response data packet from the host fails, the sensor may not recognize the key data packet or response data packet, randomly generate and store a new token value, and send an RTMP data packet encrypted using SKA to the processing device, including Token A assigned the new token value and monitoring data.

[0090] In addition, as described in detail in the Summary of the Invention and the first specific embodiment of the present invention, after sending an encrypted RTMP data packet, if no key data packet or response data packet is received from the host within a preset time period, the sensor may repeatedly send less than a set number threshold (e.g., two or three) of RTMP data packets with the same token value as Token A in the previous RTMP data packet. If no data packet is still received from the host, the sensor may randomly generate and store a new token value, and send a monitoring data packet to the host that includes Token A assigned the new token value and monitoring data encrypted using SKA.

[0091] In addition, when the RTMP data packets from the sensor are not encrypted, the host can issue a transmission key to the sensor. This process has been described in detail in the summary of the invention and the first specific embodiment of the present invention, and will not be described here in detail.

[0092] In addition, if the host does not store the transmission key corresponding to the sensor's identification code, the host can issue the transmission key to the sensor. This process has been described in detail in the Summary of the Invention and the first embodiment of the present invention and will not be described in detail here.

[0093] Additionally, if decryption is successful and the token value is successfully verified, the host can send response data to the sensor device, or the host can proactively update the transmission key under specific trigger conditions (e.g., if a preset time threshold has passed since the last issuance of the transmission key). This process has been described in detail in the Summary of the Invention and the first specific embodiment of the present invention and will not be further described here.

[0094] In addition, if decryption fails, the host can issue a new transmission key to the sensor device. This process has been described in detail in the summary of the invention and the first embodiment of the present invention, and will not be described in detail here.

[0095] In addition, as has been described in detail in the content of the invention and the first specific embodiment of the present invention, in the event that the verification of the value of Token A in the RTMP data packet fails, the host may not recognize the RTMP data packet, randomly generate and store a new token value, and send a response data packet encrypted using SKA including Token A, Token B and response data to the sensor device, wherein Token A in the response data packet is assigned the value of Token A in the RTMP data packet, and Token B in the response data packet is assigned the new token value.

[0096] Compared with the prior art, the sensor device, processing device, and power system of the power system according to the specific embodiment of the present invention have at least the following advantages:

[0097] In the present invention, sensor devices and processing devices used in power systems add randomly generated token values ​​to transmitted data packets. Only if a subsequently received data packet contains the same token value will the corresponding sensor device and processing device recognize and process the received data packet, effectively countering replay attacks. This method of countering replay attacks offers higher security than serial number technology and, while maintaining security, lower chip performance requirements than timestamp technology and public-private key-based security authentication and encryption technologies, thus saving costs.

[0098] In the present invention, in the process of issuing a transmission key through symmetric encryption, the sensor device and the processing device use the signal strength value of the received data packet as one of the influencing factors in the process of generating the symmetric key, thereby enhancing the randomness of the symmetric key and ensuring that the symmetric key is not easily cracked.

[0099] Although the present invention has been disclosed above with reference to preferred embodiments, the present invention is not limited thereto. Any changes and modifications made by those skilled in the art without departing from the spirit and scope of the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope defined by the claims.

Claims

1. A sensor device for an electric power system, wherein the sensor device is used to exchange data with a processing device of the electric power system, characterized in that: The sensor device uses a transmission key to encrypt and decrypt a data packet including at least one token transmitted between the sensor device and the processing device, wherein the sensor device recognizes and processes the data packet only if the received data packet includes the token value randomly generated by the sensor device in the last sent data packet.

2. The sensor device for an electric power system according to claim 1, wherein: The sensor device is specifically used for: After startup, randomly generate and store a token value; and In a case where the sensor device has not been issued a transmission key, a monitoring data packet including a first token assigned to the token value and monitoring data is sent to the processing device; or, in a case where the sensor device has already stored the transmission key, a monitoring data packet including a first token assigned to the token value and monitoring data encrypted using the transmission key is sent to the processing device.

3. The sensor device for an electric power system according to claim 2, wherein: In case of receiving a key data packet including a first token, a second token and a transmission key from the processing device, the sensor device is specifically configured to: Obtaining a level value corresponding to the signal strength value of the key data packet, and generating a symmetric key according to the identity identification code of the sensor device and the level value, decrypting the key data packet using the symmetric key, If the decryption is successful, if the value of the first token in the key data packet is the same as the stored token value or the same as the value corresponding to the location of the first token in the monitoring data packet, the transmission key in the key data packet is stored as a new transmission key, and the value of the second token in the key data packet is stored as a new token value, and When sending the next monitoring data packet, the value of the first token in the next monitoring data packet is assigned to the new token value and the next monitoring data packet is encrypted using the new transmission key.

4. The sensor device for an electric power system according to claim 2, wherein: In case of receiving a response data packet including the first token, the second token and the response data from the processing device, the sensor device is specifically configured to: decrypting the response data packet using the transmission key, If the decryption is successful, if the value of the first token in the response data packet is the same as the stored token value, storing the value of the second token in the response data packet as a new token value, and When sending the next monitoring data packet, the value of the first token in the next monitoring data packet is assigned to the new token value and the next monitoring data packet is encrypted using the transmission key.

5. The sensor device for a power system according to claim 3 or 4, wherein: If decryption of the key data packet or the response data packet fails, the key data packet or the response data packet is not recognized, a new token value is randomly generated and stored, and a monitoring data packet including a first token assigned to the new token value and monitoring data is sent to the processing device.

6. The sensor device for a power system according to claim 3 or 4, wherein: If the verification of the value of the first token in the key data packet or the response data packet fails, the key data packet or the response data packet is not recognized, a new token value is randomly generated and stored, and a monitoring data packet including the first token assigned to the new token value and monitoring data encrypted using the transmission key is sent to the processing device.

7. The sensor device for an electric power system according to claim 2, wherein: After sending the monitoring data packet, if no key data packet or response data packet is received from the processing device within a preset time period, the monitoring data packet with the same token value as the previous monitoring data packet is repeatedly sent, and the number of monitoring data packets less than the set number threshold is less than the set number threshold. If the data packet from the processing device is still not received, a new token value is randomly generated and stored, and a monitoring data packet including a first token assigned to the new token value and monitoring data encrypted using the transmission key is sent to the processing device.

8. A processing device for an electric power system, the processing device being used for data interaction with a sensor device of the electric power system, characterized in that: The processing device uses a transmission key to encrypt and decrypt a data packet including at least one token transmitted between the sensor device and the processing device, wherein the processing device recognizes and processes the data packet only if the received data packet includes the token value randomly generated by the processing device in the last sent data packet.

9. The processing device for a power system according to claim 8, wherein: In a case where a monitoring data packet including a first token and monitoring data is received from the sensor device, the processing device is specifically configured to: identifying whether the monitoring data packet is encrypted, issuing a transmission key to the sensor device if the monitoring data packet is not encrypted, issuing a transmission key to the sensor device if the monitoring data packet is encrypted if the processing device does not store the transmission key corresponding to the identification code of the sensor device, and decrypting the monitoring data packet using the transmission key if the processing device stores the transmission key and a token value corresponding to the identification code of the sensor device; If the decryption is successful, then when the value of the first token in the monitoring data packet is the same as the stored token value, accept the monitoring data in the monitoring data packet, and send response data to the sensor device or actively update the transmission key; If decryption fails, a new transmission key is issued to the sensor device.

10. The processing device for a power system according to claim 9, wherein: In a case where the monitoring data packet is not encrypted, issuing a transmission key to the sensor device includes: Randomly generate and store a transmission key and a token value corresponding to the identification code of the sensor device, Obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the identity identification code of the sensor device and the level value, and A key data packet encrypted with the symmetric key and including a first token, a second token, and the transmission key is sent to the sensor device, wherein the first token in the key data packet is assigned the value of the first token in the monitoring data packet, and the second token in the key data packet is assigned the token value.

11. The processing device for a power system according to claim 9, wherein: In a case where the processing device does not store a transmission key corresponding to the identity identification code of the sensor device, issuing the transmission key to the sensor device includes: Randomly generate and store a transmission key and a token value corresponding to the identification code of the sensor device, Obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the identity identification code of the sensor device and the level value, and A key data packet encrypted with the symmetric key and including a first token, a second token, and the transmission key is sent to the sensor device, wherein the first token in the key data packet is assigned a value corresponding to the position of the first token in the monitoring data packet, and the second token in the key data packet is assigned the token value.

12. The processing device for a power system according to claim 9, wherein: Sending response data to the sensor device includes: Randomly generate and store a new token value, and send a response data packet including a first token, a second token and response data to the sensor device, wherein the first token in the response data packet is assigned the value of the first token in the monitoring data packet, and the second token in the response data packet is assigned the new token value.

13. The processing device for a power system according to claim 9, wherein: Actively updating the transmission key includes: Randomly generate and store a new transfer key and a new token value, Obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the identity identification code of the sensor device and the level value, and A key data packet encrypted with the symmetric key and including a first token, a second token and the new transmission key is sent to the sensor device, wherein the first token in the key data packet is assigned the value of the first token in the monitoring data packet, and the second token in the key data packet is assigned the new token value.

14. The processing device for a power system according to claim 9, wherein: In the event of a decryption failure, issuing a new transmission key to the sensor device includes: Randomly generate and store a new transmission key and a new token value corresponding to the identification code of the sensor device, Obtaining a level value corresponding to the signal strength value of the monitoring data packet, and generating a symmetric key based on the identity identification code of the sensor device and the level value, and A key data packet encrypted with the symmetric key and including a first token, a second token and the new transmission key is sent to the sensor device, wherein the first token in the key data packet is assigned a value corresponding to the position of the first token in the monitoring data packet, and the second token in the key data packet is assigned the new token value.

15. The processing device for a power system according to claim 9, wherein: If the verification of the value of the first token in the monitoring data packet fails, the monitoring data packet is not recognized, a new token value is randomly generated and stored, and a response data packet encrypted with the transmission key and including the first token, the second token and response data is sent to the sensor device, wherein the first token in the response data packet is assigned the value of the first token in the monitoring data packet, and the second token in the response data packet is assigned the new token value. 16 . An electric power system comprising the sensor device for an electric power system according to claim 1 and the processing device for an electric power system according to claim 8 .