Power Internet of Things terminal authentication method, device, gateway and storage medium

By performing protocol authentication and session key negotiation in the power Internet of Things terminal, and using elliptic curve algorithm and hash function to ensure key security, the problem of the power Internet of Things terminal being attacked during the information transmission process is solved, and the terminal security is achieved. Secure access control and grid stability protection.

CN115580398BActive Publication Date: 2024-09-17GLOBAL ENERGY INTERCONNECTION RES INST CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211169896.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-12-31
Filing Date
2022-09-23
Publication Date
2024-09-17
Estimated Expiration
2042-09-23

AI Technical Summary

Technical Problem

Power Internet of Things terminals are prone to illegal monitoring and attacks during information transmission. Existing secure lightweight interaction protocols cannot effectively defend against man-in-the-middle attacks and affect the stability of the power grid.

Method used

By initializing the gateway information and terminal information in the power Internet of Things, obtain the terminal serial number and identity certification information, perform protocol authentication and session key negotiation, realize secure access control of the terminal, and use elliptic curve algorithm and hash function to ensure the key security.

Benefits of technology

Effectively resist man-in-the-middle attacks, protect the security of terminals and main station systems, improve the security management and control level of power Internet of Things terminals, and prevent keys from being cracked and terminals from being illegally accessed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115580398B_ABST
    Figure CN115580398B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention relates to a method, device, gateway and storage medium for terminal authentication of electric power Internet of Things, including: initializing the gateway information and the information of the terminal to be accessed in the electric power Internet of Things, and obtaining the terminal serial number and terminal identity information corresponding to the terminal to be accessed; performing protocol authentication on the terminal based on the terminal serial number and the terminal identity information to obtain the protocol authentication result; performing session key negotiation on the gateway and the terminal based on the terminal serial number and the terminal identity information to obtain the session key negotiation result; performing session access control on the terminal based on the protocol authentication result and the session key negotiation result. In this way, terminal security authentication can be achieved to resist man-in-the-middle attacks. If an attacker obtains the key of a communication party, the protocol can judge it and prevent the terminal from accessing, thereby protecting the security of the main station system and improving the terminal security management and control level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of electric power Internet of Things, and in particular to an electric power Internet of Things terminal authentication method, device, gateway and storage medium. Background Art

[0002] The power Internet of Things is a new generation of information and communication system that fully carries all businesses such as power operations, enterprise operations, customer services, and new business formats. The power Internet of Things mainly includes a four-layer structure of perception layer, network layer, platform layer, and application layer. Focusing on all aspects of the power system, it fully applies modern information technologies such as mobile Internet and artificial intelligence, and advanced communication technologies to achieve the interconnection of all things in all aspects of the power system and human-computer interaction. It has the characteristics of comprehensive state perception, efficient information processing, and convenient and flexible application.

[0003] The terminals in the perception layer of the power Internet of Things are responsible for monitoring the environment and collecting data. They are mainly hardware devices such as sensors and actuators. The collected data are converted into digital information and transmitted to the main station. The main station issues control instructions and the terminals execute them.

[0004] When the power Internet of Things collects data at the perception layer, its information transmission method is basically wireless network transmission. If there are no effective protection measures for such signals exposed to the public network, they can be easily illegally monitored, stolen, and interfered with. Moreover, in the application of the power Internet of Things, a large number of sensors are used to collect signals, which are remotely controlled by people or computers to complete some complex, dangerous or high-precision operations. In this case, it will be easier for attackers to access these devices, thereby destroying these devices or the sensors they carry, and even illegally manipulating them by deciphering the sensor communication protocol.

[0005] Many current studies focus on designing secure and lightweight interaction protocols for terminals. These protocols can also solve the problem of secure data interaction at power terminals, but they cannot defend against man-in-the-middle attacks in certain specific situations. Once the middleman obtains the key, he can crack the encrypted data and then attack the power Internet of Things, affecting the stability of the power grid. Summary of the invention

[0006] In view of this, in order to solve the above-mentioned technical problems or part of the technical problems, the embodiments of the present invention provide a power Internet of Things terminal authentication method, device, gateway and storage medium.

[0007] In a first aspect, an embodiment of the present invention provides a method for authenticating a power Internet of Things terminal, comprising:

[0008] Initialize the gateway information and the terminal information to be connected in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be connected;

[0009] Performing protocol authentication on the terminal based on the terminal serial number and terminal identity information to obtain a protocol authentication result;

[0010] Performing session key negotiation between the gateway and the terminal based on the terminal serial number and the terminal identity information to obtain a session key negotiation result;

[0011] The terminal is subjected to session access control based on the protocol authentication result and the session key negotiation result.

[0012] In a possible implementation, the method further includes:

[0013] Send the terminal identity information to the server for storage, and obtain the gateway private key and the terminal validity period corresponding to the terminal;

[0014] Generate a first terminal session key based on the gateway private key, the terminal serial number and the terminal validity period;

[0015] Calculate multiple preset parameter information based on the first terminal session key;

[0016] The first preset parameter information is sent to the server and the terminal respectively, and the second preset parameter information is sent to the terminal.

[0017] In a possible implementation, the method further includes:

[0018] Obtaining a verification calculation result of the terminal on its own startup program;

[0019] Sending the terminal serial number to the server, so that the server queries and feeds back the terminal identity information corresponding to the terminal serial number based on the terminal serial number;

[0020] Obtaining terminal identity information corresponding to the terminal serial number fed back by the server;

[0021] Comparing the verification calculation result with the terminal identity certification information to see whether they are the same;

[0022] If they are the same, continue to perform protocol authentication on the terminal;

[0023] If they are different, the terminal is denied access.

[0024] In a possible implementation, the method further includes:

[0025] Obtaining first random number mapping information and second random number mapping information calculated by the terminal using an elliptic curve algorithm based on the terminal random number and second preset parameter information;

[0026] Generate a second terminal session key based on the first preset parameter information, the second preset parameter information, the terminal serial number, the terminal validity period and the gateway private key;

[0027] Determine second random number mapping comparison information based on the second terminal session key;

[0028] comparing the second random number mapping information and the second random number mapping comparison information to see whether they are the same;

[0029] If they are the same, then the protocol authentication result is determined to be passed;

[0030] If they are different, the terminal is denied access.

[0031] In a possible implementation, the method further includes:

[0032] The third random number mapping information and the fourth random number mapping information obtained by calculating the gateway random number using an elliptic curve algorithm;

[0033] The third random number mapping information and the fourth random number mapping information are sent to a terminal, so that the terminal performs protocol authentication based on the third random number mapping information and the fourth random number mapping information.

[0034] In a possible implementation, the method further includes:

[0035] Acquire session key negotiation parameter information and a second terminal session key sent by the terminal;

[0036] Determine session key negotiation comparison parameter information based on the session key negotiation parameter information, the first random number mapping information, the gateway random number, and the fourth random number mapping information;

[0037] Comparing the session key negotiation parameter information with the session key negotiation comparison parameter information to determine whether they are the same;

[0038] If they are the same, determining that the session key negotiation result is passed;

[0039] If they are different, the terminal is denied access.

[0040] In a possible implementation, the method further includes:

[0041] When the protocol authentication result is passed and the session key negotiation result is passed, the terminal is controlled to perform session access.

[0042] In a second aspect, an embodiment of the present invention provides a power Internet of Things terminal authentication device, including:

[0043] The acquisition module is used to initialize the gateway information and the terminal information to be connected in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be connected;

[0044] An authentication module, used to perform protocol authentication on the terminal based on the terminal serial number and terminal identity information, and obtain a protocol authentication result;

[0045] A negotiation module, configured to perform session key negotiation between the gateway and the terminal based on the terminal serial number and the terminal identity information, and obtain a session key negotiation result;

[0046] A control module is used to perform session access control on the terminal based on the protocol authentication result and the session key negotiation result.

[0047] In a possible implementation, the acquisition module is also used to send the terminal identity information to the server for storage, and to obtain a gateway private key and a terminal validity period corresponding to the terminal; generate a first terminal session key based on the gateway private key, the terminal serial number and the terminal validity period; calculate multiple preset parameter information based on the first terminal session key; send the first preset parameter information to the server and the terminal respectively, and send the second preset parameter information to the terminal.

[0048] In a possible implementation, the authentication module is further used to obtain a verification calculation result of the terminal on its own startup program; send the terminal serial number to the server, so that the server queries and feeds back the terminal identity information corresponding to the terminal serial number based on the terminal serial number; obtain the terminal identity information corresponding to the terminal serial number fed back by the server; compare whether the verification calculation result is the same as the terminal identity information; if they are the same, continue to perform protocol authentication on the terminal; if they are different, deny access to the terminal.

[0049] In one possible implementation, the authentication module is also used to obtain first random number mapping information and second random number mapping information calculated by the terminal based on the terminal random number and second preset parameter information using an elliptic curve algorithm; generate a second terminal session key based on the first preset parameter information, the second preset parameter information, the terminal serial number, the terminal validity period and the gateway private key; determine second random number mapping comparison information based on the second terminal session key; compare whether the second random number mapping information and the second random number mapping comparison information are the same; if they are the same, determine that the protocol authentication result is passed; if they are different, deny the terminal access.

[0050] In one possible implementation, the authentication module is also used to obtain third random number mapping information and fourth random number mapping information based on the gateway random number calculated using an elliptic curve algorithm; and send the third random number mapping information and the fourth random number mapping information to the terminal so that the terminal performs protocol authentication based on the third random number mapping information and the fourth random number mapping information.

[0051] In a possible implementation, the negotiation module is also used to obtain session key negotiation parameter information and a second terminal session key sent by the terminal; determine session key negotiation comparison parameter information based on the session key negotiation parameter information, the first random number mapping information, the gateway random number and the fourth random number mapping information; compare the session key negotiation parameter information and the session key negotiation comparison parameter information to see if they are the same; if they are the same, determine that the session key negotiation result is passed; if they are different, deny access to the terminal.

[0052] In a possible implementation manner, the control module is further configured to control the terminal to perform session access when the protocol authentication result is passed and the session key negotiation result is passed.

[0053] In a third aspect, an embodiment of the present invention provides a gateway, comprising: a processor and a memory, wherein the processor is used to execute a power Internet of Things terminal authentication program stored in the memory to implement the power Internet of Things terminal authentication method described in the first aspect above.

[0054] In a fourth aspect, an embodiment of the present invention provides a storage medium, including: the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the power Internet of Things terminal authentication method described in the first aspect above.

[0055] The power Internet of Things terminal authentication scheme provided in the embodiment of the present invention is used to initialize the gateway information and the terminal information to be accessed in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be accessed; based on the terminal serial number and the terminal identity information, the terminal is subjected to protocol authentication to obtain a protocol authentication result; based on the terminal serial number and the terminal identity information, the gateway and the terminal are subjected to session key negotiation to obtain a session key negotiation result; based on the protocol authentication result and the session key negotiation result, the terminal is subjected to session access control. Compared with the terminal-oriented secure lightweight interactive protocol in the prior art, it cannot defend against man-in-the-middle attacks in certain specific circumstances. Once the man-in-the-middle obtains the key, the encrypted data can be cracked, and then the power Internet of Things can be attacked, affecting the stability of the power grid. According to this scheme, terminal security authentication can be achieved and man-in-the-middle attacks can be resisted. If the attacker obtains the key of a communication party, the protocol can judge it and prevent the terminal from accessing, thereby protecting the security of the main station system and improving the terminal security management and control level. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a power Internet of Things terminal access gateway provided by an embodiment of the present invention;

[0057] Figure 2 A schematic diagram of a flow chart of a power Internet of Things terminal authentication method provided by an embodiment of the present invention;

[0058] Figure 3 A schematic diagram of a protocol authentication method provided by an embodiment of the present invention;

[0059] Figure 4 A flowchart of a session key negotiation method provided by an embodiment of the present invention;

[0060] Figure 5 A schematic diagram of the structure of a power Internet of Things terminal authentication device provided by an embodiment of the present invention;

[0061] Figure 6 A schematic diagram of the structure of a gateway provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.

[0064] Figure 1 A schematic diagram of a power Internet of Things terminal access gateway provided by an embodiment of the present invention, such as Figure 1 As shown:

[0065] The embodiment of the present invention proposes a state inspection encryption authentication protocol suitable for power Internet of Things terminals. By using this encryption protocol, terminal security authentication can be achieved to resist man-in-the-middle attacks. If an attacker obtains the key of a communication party, the protocol can determine it and prevent the terminal from accessing. The specific access scheme is as follows: Figure 1 shown.

[0066] In an embodiment of the present invention, before the terminal and the gateway carry out key negotiation, a status check of the terminal is first performed, a self-check is performed on the boot program of the terminal, and the self-check value is sent to the gateway. The gateway compares the self-check value when the terminal is registered. If the self-check value is equal to the self-check value retained at the gateway during registration, it means that the terminal is safe and the boot program of the terminal has not been tampered with by an attack, allowing the next step of authentication between the terminal and the gateway.

[0067] The gateway stores its own key data on the server to prevent the gateway from being attacked and causing key data to be stolen. The gateway will only obtain key data from the server when needed, and will delete it immediately after use without retaining it.

[0068] The server is not exposed to the external network environment, and a man-in-the-middle cannot attack the server.

[0069] Figure 2 A schematic diagram of a flow chart of a power Internet of Things terminal authentication method provided by an embodiment of the present invention, such as Figure 2 As shown, the method specifically includes:

[0070] S21. Initialize the gateway information and the terminal to be accessed in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be accessed.

[0071] In the embodiment of the present invention, the protocol is initialized first. Specifically, gateway A selects a private key K, determines a one-way hash function H(X), an elliptic curve E and a base point G on E, and then gateway A publishes (H(X), E, ​​G) as system parameters and saves the private key K. Among them, (H(X), E, ​​G) are some fixed parameters of the elliptic curve encryption algorithm.

[0072] Initialize the terminal, generate the terminal serial number IDi, the terminal calculates its own binary startup program, verifies the startup program step by step, and the calculation result is Ti=H(X1,X2,X3,...,Xn), where X1,X2,X3,...,Xn is the internal startup program calculation process of the terminal, and Ti is a unique result obtained based on the terminal information as the terminal identity information, which is used for the next interaction to compare the result generated based on the terminal information. Further, the terminal saves its corresponding Ti and IDi on server B through gateway A.

[0073] S22: Perform protocol authentication on the terminal based on the terminal serial number and terminal identity information to obtain a protocol authentication result.

[0074] In the embodiment of the present invention, the protocol authentication includes the following steps:

[0075] Step 1: The terminal performs verification calculation on its own startup program. The calculation method is to perform verification calculation on the startup program of the terminal, and the calculation result is recorded as Ti'=H(X1,X2,X3,...,Xn).

[0076] Step 2: The terminal sends the calculation result Ti' and terminal IDi to gateway A, gateway A sends terminal IDi to server B, server B sends the saved Ti corresponding to terminal IDi to gateway A, and gateway A compares whether Ti' is equal to Ti. If Ti' is equal to Ti, then continue with the subsequent authentication. If Ti' is not equal to Ti, then deny the terminal access and add the terminal IDi to the blacklist, marking it as a terminal that may be attacked, and deny the next access.

[0077] Step 3: After terminal IDi passes the inspection of gateway A, terminal IDi generates a random number N1 and calculates the values ​​of P1 and P2.

[0078] P1=N1×G

[0079] P2=H(P1||N1×CK')

[0080] Among them, P1 and P2 are the mapping of random numbers on the group according to the elliptic curve algorithm. Terminal IDi sends P1 and P2 to gateway A, and gateway A obtains Ji corresponding to IDi from server B.

[0081] Gateway A can then use IDi, Ji, EXP_Time and K to recalculate CK, and calculate P2' through CK.

[0082]

[0083] P2'=H(P1||CK×P1)

[0084] If P2' is equal to the received P2, the authentication request is passed, otherwise the authentication is rejected.

[0085] Step 4: Gateway A selects random number N2 and calculates P3 and P4.

[0086] P3=N2×G

[0087] P4=H(P2'||N2×Ai')

[0088] Among them, P3 and P4 are two parameters obtained by using the elliptic curve algorithm and the hash algorithm. Gateway A sends P3 and P4 to terminal IDi. After receiving it, terminal IDi calculates

[0089] Ai=h(Ji||CK')

[0090] P4'=H(P2||Ai×P3)

[0091] Terminal IDi determines whether P4' is equal to P4. If they are equal, the authentication succeeds; if they are different, the authentication fails.

[0092] S23: performing session key negotiation between the gateway and the terminal based on the terminal serial number and the terminal identity information to obtain a session key negotiation result.

[0093] S24: Perform session access control on the terminal based on the protocol authentication result and the session key negotiation result.

[0094] In the embodiment of the present invention, the session key negotiation process is as follows:

[0095] The terminal IDi calculates the session key negotiation parameter information Vi and the session key SK.

[0096] Vi=H(P4'||N1×P3)

[0097] SK=H(P3||N1×P3)

[0098] Terminal IDi sends Vi to gateway A, which calculates

[0099] Vi'=H(P4||N2×P1)

[0100] Gateway A compares Vi' and Vi. If they are equal, gateway A accepts the login request of terminal IDi. After the session key negotiation is successfully completed, terminal IDi and gateway A can communicate through the session key. If Vi' and Vi are not equal, the terminal access is denied.

[0101] Optionally, if the protocol authentication or session key negotiation fails, the gateway recalculates the session key SK=H(P3||N2×P1) and performs a comparison again.

[0102] The power Internet of Things terminal authentication method provided in the embodiment of the present invention is used to initialize the gateway information and the terminal information to be accessed in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be accessed; based on the terminal serial number and the terminal identity information, the terminal is subjected to protocol authentication to obtain a protocol authentication result; based on the terminal serial number and the terminal identity information, the gateway and the terminal are subjected to session key negotiation to obtain a session key negotiation result; based on the protocol authentication result and the session key negotiation result, the terminal is subjected to session access control. Compared with the terminal-oriented secure lightweight interactive protocol in the prior art, it cannot defend against man-in-the-middle attacks in certain specific circumstances. Once the man-in-the-middle obtains the key, the encrypted data can be cracked, and then the power Internet of Things can be attacked, affecting the problem of power grid stability. By this method, terminal security authentication can be achieved and man-in-the-middle attacks can be resisted. If the attacker obtains the key of a communication party, the protocol can determine it and prevent the terminal from accessing, thereby protecting the security of the master station system and improving the terminal security management and control level.

[0103] Figure 3 A flow chart of a protocol authentication method provided by an embodiment of the present invention is as follows: Figure 3 As shown, the method specifically includes:

[0104] S31. Send the terminal identity information to the server for storage, and obtain a gateway private key and a terminal validity period corresponding to the terminal.

[0105] In the embodiment of the present invention, the protocol is initialized first. Specifically, gateway A selects a private key K, determines a one-way hash function H(X), an elliptic curve E and a base point G on E, and then gateway A publishes (H(X), E, ​​G) as system parameters and saves the private key K. Among them, (H(X), E, ​​G) are some fixed parameters of the elliptic curve encryption algorithm.

[0106] Initialize the terminal, generate the terminal serial number IDi, the terminal calculates its own binary startup program, verifies the startup program step by step, and the calculation result is Ti=H(X1,X2,X3,...,Xn), where X1,X2,X3,...,Xn is the internal startup program calculation process of the terminal, and Ti is a unique result obtained based on the terminal information as the terminal identity information, which is used for the next interaction to compare the result generated based on the terminal information. Further, the terminal saves its corresponding Ti and IDi on server B through gateway A.

[0107] Specifically, the terminal saves its corresponding Ti and IDi on the server B through the gateway A. First, the terminal sends its own serial number IDi to the gateway A through a secure channel.

[0108] S32: Generate a first terminal session key based on the gateway private key, the terminal serial number and the terminal validity period.

[0109] After receiving the terminal serial number IDi, gateway A calculates the following values:

[0110] CK=h(Ri||K||EXP_Time||IDi)

[0111] Among them, CK is the first terminal session key generated according to the gateway private key K and the serial number transmitted by the terminal, Ri is a set of random strings generated by gateway A, K is the gateway private key, EXP_Time is the terminal validity period, and h(X) is a hash function.

[0112] S33: Calculate multiple preset parameter information based on the first terminal session key.

[0113] Based on the first terminal session key, the following multiple preset parameter information is calculated:

[0114] CK'=CK×G

[0115]

[0116]

[0117] Ai'=Ai×G

[0118] Among them, the multiple preset parameter information CK', Ji, Ai, Ai' are parameters obtained by continuously using random numbers and hash operations, which increases the complexity of the cryptographic algorithm and improves security.

[0119] S34: Send the first preset parameter information to the server and the terminal respectively, and send the second preset parameter information to the terminal.

[0120] Gateway A stores {Ai', IDi, EXP_Time}, sends the first preset parameter information (Ji) to server B for storage, and sends the second preset parameter information (CK') and the first preset parameter information (Ji) to the terminal through a secure channel. Terminal IDi saves CK' and Ji for authentication and session key negotiation.

[0121] S35: Obtain the verification calculation result of the terminal on its own startup program.

[0122] S36: Send the terminal serial number to the server, so that the server queries and feeds back terminal identity information corresponding to the terminal serial number based on the terminal serial number.

[0123] S37: Obtain terminal identity information corresponding to the terminal serial number fed back by the server.

[0124] S38: Compare the verification calculation result with the terminal identity certification information to see whether they are the same.

[0125] S39: If they are the same, continue to perform protocol authentication on the terminal.

[0126] The following is a unified description of S35 to S39:

[0127] In the embodiment of the present invention, the protocol authentication includes the following steps:

[0128] Step 1: The terminal performs verification calculation on its own startup program. The calculation method is to perform verification calculation on the startup program of the terminal, and the calculation result is recorded as Ti'=H(X1,X2,X3,...,Xn).

[0129] Step 2: The terminal sends the calculation result Ti' and terminal IDi to gateway A, gateway A sends terminal IDi to server B, server B sends the saved Ti corresponding to terminal IDi to gateway A, and gateway A compares whether Ti' is equal to Ti. If Ti' is equal to Ti, then continue with the subsequent authentication. If Ti' is not equal to Ti, then deny the terminal access and add the terminal IDi to the blacklist, marking it as a terminal that may be attacked, and deny the next access.

[0130] S310: Obtain first random number mapping information and second random number mapping information calculated by the terminal using an elliptic curve algorithm based on the terminal random number and second preset parameter information.

[0131] S311. Generate a second terminal session key based on the first preset parameter information, the second preset parameter information, the terminal serial number, the terminal validity period, and the gateway private key.

[0132] S312: Determine second random number mapping comparison information based on the second terminal session key.

[0133] S313: Compare the second random number mapping information and the second random number mapping comparison information to see whether they are the same.

[0134] S314: If they are the same, determine that the protocol authentication result is passed.

[0135] The following is a unified description of S310 to S314:

[0136] Step 3: After the terminal IDi passes the verification of the gateway A, the terminal IDi generates a terminal random number N1 and calculates the values ​​of the first random number mapping information P1 and the second random number mapping information P2.

[0137] P1=N1×G

[0138] P2=H(P1||N1×CK')

[0139] Among them, P1 and P2 are the mapping of random numbers on the group according to the elliptic curve algorithm. Terminal IDi sends P1 and P2 to gateway A, and gateway A obtains Ji corresponding to IDi from server B.

[0140] Gateway A can then use IDi, Ji, EXP_Time and K to recalculate the second terminal session key CK, and calculate the second random number mapping comparison information P2' through CK.

[0141]

[0142] P2'=H(P1||CK×P1)

[0143] If P2' is equal to the received P2, the authentication request is passed, otherwise the authentication is rejected.

[0144] Figure 4 A flow chart of a session key negotiation method provided by an embodiment of the present invention is shown as follows: Figure 4 As shown, the method specifically includes:

[0145] S41. The third random number mapping information and the fourth random number mapping information are obtained by using an elliptic curve algorithm based on the gateway random number calculation.

[0146] S42: Send the third random number mapping information and the fourth random number mapping information to the terminal, so that the terminal performs protocol authentication based on the third random number mapping information and the fourth random number mapping information.

[0147] In the embodiment of the present invention, the above steps are followed to further complete the fourth step: gateway A selects a gateway random number N2, and calculates the third random number mapping information P3 and the fourth random number mapping information P4.

[0148] P3=N2×G

[0149] P4=H(P2'||N2×Ai')

[0150] Among them, P3 and P4 are two parameters obtained by using the elliptic curve algorithm and the hash algorithm. Gateway A sends P3 and P4 to terminal IDi. After receiving it, terminal IDi calculates

[0151] Ai=h(Ji||CK')

[0152] P4'=H(P2||Ai×P3)

[0153] Terminal IDi determines whether P4' is equal to P4. If they are equal, the authentication is successful. If they are not equal, the authentication fails and the terminal is denied access.

[0154] S43: Acquire the session key negotiation parameter information and the second terminal session key sent by the terminal.

[0155] S44. Determine session key negotiation comparison parameter information based on the session key negotiation parameter information, the first random number mapping information, the gateway random number, and the fourth random number mapping information.

[0156] S45: Compare the session key negotiation parameter information and the session key negotiation comparison parameter information to see whether they are the same.

[0157] S46: If they are the same, determine that the session key negotiation result is passed.

[0158] S47: When the protocol authentication result is passed and the session key negotiation result is passed, control the terminal to perform session access.

[0159] The following is a unified description of S43 to S47:

[0160] In the embodiment of the present invention, the session key negotiation process is as follows:

[0161] Terminal IDi calculates session key negotiation parameter information Vi and second terminal session key SK:

[0162] Vi=H(P4'||N1×P3)

[0163] SK=H(P3||N1×P3)

[0164] Terminal IDi sends Vi to gateway A, and gateway A calculates session key negotiation comparison parameter information Vi' based on session key negotiation parameter information, first random number mapping information, gateway random number and fourth random number mapping information:

[0165] Vi'=H(P4||N2×P1)

[0166] Gateway A compares Vi' and Vi. If they are equal, gateway A accepts the login request of the terminal. After the session key negotiation is successfully completed, the terminal IDi and gateway A can communicate through the session key. If Vi' and Vi are not equal, the terminal access is denied.

[0167] Optionally, if the protocol authentication or session key negotiation fails, the gateway recalculates the session key SK=H(P3||N2×P1) and performs a comparison again.

[0168] The power Internet of Things terminal authentication method provided in the embodiment of the present invention is used to initialize the gateway information and the terminal information to be accessed in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be accessed; based on the terminal serial number and the terminal identity information, the terminal is subjected to protocol authentication to obtain a protocol authentication result; based on the terminal serial number and the terminal identity information, the gateway and the terminal are subjected to session key negotiation to obtain a session key negotiation result; based on the protocol authentication result and the session key negotiation result, the terminal is subjected to session access control. By this method, terminal security authentication can be achieved and man-in-the-middle attacks can be resisted. If an attacker obtains the key of a communication party, the protocol can be judged and the terminal access can be prevented, thereby protecting the security of the main station system and improving the terminal security management and control level.

[0169] Figure 5 A schematic diagram of the structure of a power Internet of Things terminal authentication device provided by an embodiment of the present invention specifically includes:

[0170] The acquisition module 501 is used to initialize the gateway information and the terminal information to be accessed in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be accessed. For detailed description, please refer to the relevant description corresponding to the above method embodiment, which will not be repeated here.

[0171] The authentication module 502 is used to perform protocol authentication on the terminal based on the terminal serial number and the terminal identity information to obtain a protocol authentication result. For detailed description, please refer to the relevant description corresponding to the above method embodiment, which will not be repeated here.

[0172] The negotiation module 503 is used to perform session key negotiation between the gateway and the terminal based on the terminal serial number and the terminal identity information to obtain a session key negotiation result. For detailed description, please refer to the relevant description corresponding to the above method embodiment, which will not be repeated here.

[0173] The control module 504 is used to perform session access control on the terminal based on the protocol authentication result and the session key negotiation result. For detailed description, please refer to the relevant description corresponding to the above method embodiment, which will not be repeated here.

[0174] The power Internet of Things terminal authentication device provided in this embodiment can be as follows Figure 5 The power Internet of Things terminal authentication device shown in can be executed as follows Figure 2-4 All steps of the China Power Internet of Things terminal authentication method, thereby achieving Figure 2-4 For details, please refer to the technical effect of the power Internet of Things terminal authentication method shown in Figure 2-4 For the sake of brevity, the relevant description is not repeated here.

[0175] Figure 6A schematic diagram of the structure of a gateway provided by an embodiment of the present invention, Figure 6 The gateway 600 shown includes: at least one processor 601, a memory 602, at least one network interface 604 and other user interfaces 603. The various components in the gateway 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 605 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 605 is not shown in FIG. Figure 6 Various buses are labeled as bus system 605 .

[0176] The user interface 603 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0177] It can be understood that the memory 602 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0178] In some implementations, the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 6021 and an application program 6022 .

[0179] The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 6022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 6022.

[0180] In the embodiment of the present invention, by calling the program or instruction stored in the memory 602, specifically, the program or instruction stored in the application 6022, the processor 601 is used to execute the method steps provided by each method embodiment, for example, including:

[0181] Initialize the gateway information and the terminal information to be accessed in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be accessed; perform protocol authentication on the terminal based on the terminal serial number and the terminal identity information to obtain a protocol authentication result; perform session key negotiation between the gateway and the terminal based on the terminal serial number and the terminal identity information to obtain a session key negotiation result; perform session access control on the terminal based on the protocol authentication result and the session key negotiation result.

[0182] In one possible implementation, the terminal identity information is sent to a server for storage, and a gateway private key and a terminal validity period corresponding to the terminal are obtained; a first terminal session key is generated based on the gateway private key, the terminal serial number and the terminal validity period; multiple preset parameter information is calculated based on the first terminal session key; the first preset parameter information is sent to the server and the terminal respectively, and the second preset parameter information is sent to the terminal.

[0183] In one possible implementation, a verification calculation result of the terminal on its own startup program is obtained; the terminal serial number is sent to the server, so that the server queries and feeds back terminal identity information corresponding to the terminal serial number based on the terminal serial number; the terminal identity information corresponding to the terminal serial number fed back by the server is obtained; and the verification calculation result is compared with the terminal identity information to see whether they are the same; if they are the same, continuing to perform protocol authentication on the terminal; if they are different, denying access to the terminal.

[0184] In one possible implementation, the terminal obtains first random number mapping information and second random number mapping information calculated by an elliptic curve algorithm based on the terminal random number and the second preset parameter information; generates a second terminal session key based on the first preset parameter information, the second preset parameter information, the terminal serial number, the terminal validity period and the gateway private key; determines the second random number mapping comparison information based on the second terminal session key; compares whether the second random number mapping information and the second random number mapping comparison information are the same; if they are the same, determines that the protocol authentication result is passed; if they are different, denies the terminal access.

[0185] In one possible implementation, the third random number mapping information and the fourth random number mapping information are obtained by calculating the gateway random number using an elliptic curve algorithm; the third random number mapping information and the fourth random number mapping information are sent to the terminal, so that the terminal performs protocol authentication based on the third random number mapping information and the fourth random number mapping information.

[0186] In one possible implementation, the session key negotiation parameter information and the second terminal session key sent by the terminal are obtained; the session key negotiation comparison parameter information is determined based on the session key negotiation parameter information, the first random number mapping information, the gateway random number and the fourth random number mapping information; the session key negotiation parameter information and the session key negotiation comparison parameter information are compared to see whether they are the same; if they are the same, the session key negotiation result is determined to be passed; if they are different, the terminal access is denied.

[0187] In a possible implementation, when the protocol authentication result is passed and the session key negotiation result is passed, the terminal is controlled to perform session access.

[0188] The method disclosed in the above embodiment of the present invention can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 601 or the instruction in the form of software. The above processor 601 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.

[0189] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0190] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0191] The gateway provided in this embodiment can be as follows Figure 6 The gateway shown in , can be executed as Figure 2-4 All steps of the China Power Internet of Things terminal authentication method, thereby achieving Figure 2-4 For details, please refer to the technical effect of the power Internet of Things terminal authentication method shown in Figure 2-4 For the sake of brevity, the relevant description is not repeated here.

[0192] The embodiment of the present invention also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0193] When one or more programs in the storage medium can be executed by one or more processors, the above-mentioned power Internet of Things terminal authentication method executed on the gateway side can be implemented.

[0194] The processor is used to execute the power Internet of Things terminal authentication program stored in the memory to implement the following steps of the power Internet of Things terminal authentication method executed on the gateway side:

[0195] Initialize the gateway information and the terminal information to be accessed in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be accessed; perform protocol authentication on the terminal based on the terminal serial number and the terminal identity information to obtain a protocol authentication result; perform session key negotiation between the gateway and the terminal based on the terminal serial number and the terminal identity information to obtain a session key negotiation result; perform session access control on the terminal based on the protocol authentication result and the session key negotiation result.

[0196] In one possible implementation, the terminal identity information is sent to a server for storage, and a gateway private key and a terminal validity period corresponding to the terminal are obtained; a first terminal session key is generated based on the gateway private key, the terminal serial number and the terminal validity period; multiple preset parameter information is calculated based on the first terminal session key; the first preset parameter information is sent to the server and the terminal respectively, and the second preset parameter information is sent to the terminal.

[0197] In one possible implementation, a verification calculation result of the terminal on its own startup program is obtained; the terminal serial number is sent to the server, so that the server queries and feeds back terminal identity information corresponding to the terminal serial number based on the terminal serial number; the terminal identity information corresponding to the terminal serial number fed back by the server is obtained; and the verification calculation result is compared with the terminal identity information to see whether they are the same; if they are the same, continuing to perform protocol authentication on the terminal; if they are different, denying access to the terminal.

[0198] In one possible implementation, the terminal obtains first random number mapping information and second random number mapping information calculated by an elliptic curve algorithm based on the terminal random number and the second preset parameter information; generates a second terminal session key based on the first preset parameter information, the second preset parameter information, the terminal serial number, the terminal validity period and the gateway private key; determines the second random number mapping comparison information based on the second terminal session key; compares whether the second random number mapping information and the second random number mapping comparison information are the same; if they are the same, determines that the protocol authentication result is passed; if they are different, denies the terminal access.

[0199] In one possible implementation, the third random number mapping information and the fourth random number mapping information are obtained by calculating the gateway random number using an elliptic curve algorithm; the third random number mapping information and the fourth random number mapping information are sent to the terminal, so that the terminal performs protocol authentication based on the third random number mapping information and the fourth random number mapping information.

[0200] In one possible implementation, the session key negotiation parameter information and the second terminal session key sent by the terminal are obtained; the session key negotiation comparison parameter information is determined based on the session key negotiation parameter information, the first random number mapping information, the gateway random number and the fourth random number mapping information; the session key negotiation parameter information and the session key negotiation comparison parameter information are compared to see whether they are the same; if they are the same, the session key negotiation result is determined to be passed; if they are different, the terminal access is denied.

[0201] In a possible implementation, when the protocol authentication result is passed and the session key negotiation result is passed, the terminal is controlled to perform session access.

[0202] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0203] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0204] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for authenticating a power Internet of Things terminal, characterized in that: include: Initialize the gateway information and the terminal information to be accessed in the power Internet of Things, and obtain the terminal serial number and terminal identity information corresponding to the terminal to be accessed; the initialization includes: gateway A selects a private key K, determines a one-way hash function H(X), an elliptic curve E and a base point G on E, and then gateway A publishes (H(X), E, ​​G) as system parameters and saves the private key K, where (H(X), E, ​​G) are some fixed parameters of the elliptic curve encryption algorithm; Initialize the terminal information, generate the terminal serial number IDi, the terminal calculates its own binary startup program, verifies the startup program step by step, and the calculation result is Ti=H(X1,X2,X3,...,Xn), where X1,X2,X3,...,Xn is the internal startup program calculation process of the terminal, and Ti is a unique result obtained based on the terminal information as the terminal identity information; Sending the terminal identity information and the terminal serial number to the server through the gateway for storage, and obtaining the gateway private key and the terminal validity period corresponding to the terminal; After receiving the terminal serial number IDi, gateway A calculates the following values: CK=h(Ri||K||EXP_Time||IDi), where CK is the first terminal session key generated according to the gateway private key K and the serial number transmitted by the terminal, Ri is a set of random strings generated by gateway A, K is the gateway private key, EXP_Time is the terminal validity period, and h(X) is a hash function; Calculate the following multiple preset parameter information based on the first terminal session key; CK'=CK×G, Ai'=Ai×G; Among them, the multiple preset parameter information CK', Ji, Ai, Ai' are parameters obtained by continuously using random numbers and hash operations; Sending first preset parameter information to the server and the terminal respectively, and sending second preset parameter information to the terminal, the first preset parameter information is Ji, and the second preset parameter information is CK'; The gateway performs protocol authentication on the terminal based on the terminal serial number and the terminal identity information to obtain a protocol authentication result; The gateway and the terminal perform session key negotiation to obtain a session key negotiation result; Performing session access control on the terminal based on the protocol authentication result and the session key negotiation result; The gateway performs protocol authentication on the terminal based on the terminal serial number and the terminal identity information, and obtains a protocol authentication result, including: Obtaining a verification calculation result of the terminal on its own startup program; Sending the terminal serial number to the server, so that the server queries and feeds back the terminal identity information corresponding to the terminal serial number based on the terminal serial number; Obtaining terminal identity information corresponding to the terminal serial number fed back by the server; Comparing the verification calculation result with the terminal identity certification information to see whether they are the same; If they are the same, continue to perform protocol authentication on the terminal; If they are different, denying access to the terminal; If they are the same, then continue to perform protocol authentication on the terminal, including: After the terminal IDi passes the inspection of the gateway A, the terminal IDi generates the terminal random number N1, and calculates the values ​​of the first random number mapping information P1 and the second random number mapping information P2; P1 = N1 × G; P2 = H (P1||N1 × CK'); wherein P1 and P2 are the mappings of random numbers on the group according to the elliptic curve algorithm, the terminal IDi sends P1 and P2 to the gateway A, and the gateway A obtains the Ji corresponding to IDi from the server B; the gateway A can then use IDi, Ji, EXP_Time and K to recalculate the second terminal session key CK, and calculate the second random number mapping comparison information P2' through CK; P2'=H(P1||CK×P1); if P2' is equal to the received P2, the authentication request is passed, otherwise the authentication is rejected; After the authentication request is passed, gateway A selects the gateway random number N2, and calculates the third random number mapping information P3 and the fourth random number mapping information P4, P3 = N2 × G, P4 = H (P2'||N2 × Ai'), where P3 and P4 are two parameters obtained using the elliptic curve algorithm and the hash algorithm. Gateway A sends P3 and P4 to terminal IDi. After receiving terminal IDi, it calculates Ai = h (Ji||CK'), P4' = H (P2||Ai × P3). Terminal IDi determines whether P4' is equal to P4. If they are equal, the authentication is successful. If they are not equal, the authentication fails and the terminal is denied access.

2. The method according to claim 1, characterized in that The gateway and the terminal perform session key negotiation to obtain a session key negotiation result, including: Terminal IDi calculates session key negotiation parameter information Vi and second terminal session key SK: Vi=H(P4'||N1×P3), SK=H(P3||N1×P3), terminal IDi sends Vi to gateway A, gateway A calculates session key negotiation comparison parameter information Vi' based on session key negotiation parameter information, first random number mapping information, gateway random number and fourth random number mapping information: Vi'=H(P4||N2×P1), Gateway A compares Vi' and Vi. If they are equal, gateway A accepts the terminal's login request. After the session key negotiation is successfully completed, terminal IDi and gateway A can communicate through the session key. If Vi' and Vi are not equal, terminal access is denied.

3. A gateway, characterized in that: include: A processor and a memory, wherein the processor is used to execute a power Internet of Things terminal authentication program stored in the memory to implement the power Internet of Things terminal authentication method described in any one of claims 1 to 2.

4. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the power Internet of Things terminal authentication method described in any one of claims 1 to 2.