A safe connection method between a vehicle and a charging pile, a charging and discharging method and a system

By registering on the cloud platform and performing three-party verification, the problem of safe connection between public charging piles and vehicles is solved, and absolutely safe connection is achieved, preventing malicious behavior and promoting the popularization of electric vehicles.

CN119172750BActive Publication Date: 2025-02-11HEFEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411571978.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-11
Estimated Expiration
2044-11-06

Smart Images

  • Figure CN119172750B_ABST
    Figure CN119172750B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of vehicle networking, and in particular, relates to a safe connection method, charging and discharging method and system between a vehicle and a charging pile. A safe connection method between a vehicle and a charging pile comprises the following steps: S1, each vehicle and the charging pile are registered at a cloud platform; S2, when the charging gun of the charging pile is inserted into the vehicle, the vehicle initiates a three-party verification between the cloud platform and the charging pile. If the three-party verification is successful, the charging pile establishes a connection with the vehicle through the charging gun. If the three-party verification fails, the vehicle exits the charging gun. The present invention can ensure a safe connection between the vehicle and the charging pile.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vehicle networking, and in particular relates to a method for safely connecting a vehicle to a charging pile, and a charging and discharging method and system. Background Art

[0002] With the rapid development of electric vehicles and smart grids, electric vehicles can be used not only as new energy transportation tools, but also as power storage devices. Electric vehicle V2G (vehicle-to-grid) technology is a key technology that enables electric vehicles to be connected to the grid as both loads and distributed power storage devices. It can achieve two-way energy transmission between electric vehicles and the grid, that is, when the grid load is low, electric vehicles absorb electricity from the grid as energy storage units, and when the grid load is high, electric vehicles can release the stored electricity back to the grid, thereby helping to balance the grid load and improve the utilization rate of grid energy.

[0003] The premise for the implementation of V2G technology is that electric vehicles (hereinafter referred to as vehicles) are connected to charging piles, which creates opportunities for hackers to steal vehicle data or interfere with the power grid by invading charging piles.

[0004] Because private charging piles are often equipped with a locked charging protection box, private vehicles can only be connected to the corresponding private charging piles, which can well ensure the safety of private vehicles and the power grid. However, if private vehicles can only go to the corresponding private charging piles for charging, the vehicle drivers will not dare to drive the vehicle away from the private charging piles due to the problem of vehicle power, which has become the biggest limiting factor in the popularization of electric vehicles. With the emergence of more and more public charging piles, it is convenient for vehicles to charge nearby at any time, allowing drivers to drive their vehicles boldly and safely, which has greatly promoted the popularization of electric vehicles. However, how to ensure that the connection between public charging piles and vehicles is safe has become a difficult problem that needs to be solved on the road to further development of V2G technology in the field of Internet of Vehicles. Summary of the invention

[0005] The purpose of the present invention is to overcome the deficiencies of the above-mentioned prior art and provide a method for safely connecting a vehicle to a charging pile, which can ensure a safe connection between the vehicle and the charging pile.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for safely connecting a vehicle to a charging pile comprises the following steps:

[0008] S1, each vehicle and charging pile is registered on the cloud platform;

[0009] S2, when the charging gun of the charging pile is inserted into the vehicle, the vehicle initiates a three-party verification between the cloud platform and the charging pile. If the three-party verification is successful, the charging pile establishes a connection with the vehicle through the charging gun. If the three-party verification fails, the vehicle exits the charging gun.

[0010] Preferably, S2 also includes the following sub-steps:

[0011] S21, the charging gun of the charging pile is inserted into the vehicle;

[0012] S22, the vehicle initiates three-party verification phase I: the cloud platform authenticates the vehicle. Once the cloud platform authenticates the vehicle, the three-party verification phase I is verified successfully.

[0013] S23, after the three-party verification phase I is verified, the cloud platform initiates the three-party verification phase II: the vehicle and the charging pile perform two-way identity authentication through the cloud platform. After the two-way identity authentication is successful, the three-party verification is successful, and the charging pile establishes a connection with the vehicle through the charging gun; if the three-party verification fails, the vehicle exits the charging gun.

[0014] Preferably, before S1, the following steps are also included:

[0015] S01, the cloud platform TSP is filled with a hash function H and an authentication key package P, and the authentication key package P contains several pairs of quantum keys and key identifiers bound together;

[0016] S02, when vehicles and charging piles are manufactured, the manufacturer injects the hash function H and the authentication key package P into each vehicle and charging pile.

[0017] Preferably, in S1:

[0018] The vehicle is registered at the cloud platform via wireless communication, and further includes sub-steps S11a to S13a:

[0019] S11a, vehicle V generates a first registration request A1 and sends it to the cloud platform TSP:

[0020] A1={req(A1),N V ,t1},N V =H(ID V );

[0021] Where req(·) is the information type identifier, ID V represents the identification code of vehicle V, H(·) represents the hash calculation using a hash function, t1 is the first timestamp, and the time when vehicle V generates the first registration request A1 is recorded as the first timestamp t1, N V Indicates the vehicle V code;

[0022] S12a, the cloud platform TSP records the time when the first registration request A1 is received as the second timestamp t2, and extracts the first timestamp t1 and the vehicle V code N from the first registration request A1. V , if t2-t1≤△T1 and the vehicle V code N does not exist in the cloud platform TSP V , △T1 represents the first time threshold, then the cloud platform TSP determines that the vehicle V is an unregistered vehicle, and the cloud platform TSP randomly extracts a quantum key from the authentication key package P stored in itself and records it as the vehicle-side key K of the current vehicle V V After that, a first registration feedback message M1 is generated and sent to the vehicle V:

[0023] FID V =H(N V ||KN V ), MR M1 =FID V ⊕K V ,M1={req(M1),MR M1 ,KN V ,t3};

[0024] Among them, || is a connector, ⊕ is an XOR operator, KN V Indicates the current vehicle-side key K V Binding key identifier, FID V V pseudonym for vehicle, MR M1 is the first verification code, t3 is the third timestamp, and the cloud platform TSP records the time when the first registration feedback message M1 is generated as the third timestamp t3;

[0025] At the same time, the cloud platform TSP will encode the vehicle V V 、Vehicle V pseudonym FID V 、Car-side key K V and K V The key identifier KN of the binding V Bind to vehicle V registration information for storage;

[0026] If t2-t1>△T1 or the vehicle V code N is stored in the cloud platform TSP V , then the cloud platform TSP discards the current first registration request A1;

[0027] S13a, the vehicle V records the time when the first registration feedback message M1 is received as the fourth timestamp t4, and extracts the third timestamp copy t3´ and the first verification code copy MR from the first registration feedback message M1. M1 ´ and the first copy of the vehicle-side key identifier KN V ´, if t4-t3´≤△T2, △T2 represents the second time threshold, then the vehicle V is based on the first copy of the vehicle-side key identifier KNV 'Extract the first copy of the corresponding vehicle-side key K V ', then calculate the first copy of the vehicle pseudonym FID V =MR M1 ´⊕K V 'After that, the first copy of the vehicle key K V ´、The first copy of the vehicle-side key identifier KN V ´ and vehicle pseudonym first copy FID V ´Store;

[0028] The charging pile is registered at the cloud platform TSP through wireless communication, and also includes sub-steps S11b~S13b:

[0029] S11b, the charging pile CS generates a second registration request A2 and sends it to the cloud platform TSP:

[0030] A2={req(A2),N CS ,t5},N CS =H(ID CS );

[0031] Among them, ID CS represents the identification code of the charging pile CS, t5 is the fifth timestamp, and the charging pile CS records the time when the second registration request A2 is generated as the fifth timestamp t5, N CS Indicates the charging pile CS code;

[0032] S12b, the cloud platform TSP records the time of receiving the second registration request A2 as the sixth timestamp t6, and extracts the fifth timestamp t5 and the charging pile CS code N from the second registration request A2. CS , if t6-t5≤△T3 and the charging pile CS code N does not exist in the cloud platform TSP CS , △T3 represents the third time threshold, then the cloud platform TSP determines that the charging pile CS is an unregistered charging pile, and the cloud platform TSP randomly extracts a quantum key from the authentication key package P stored in itself and records it as the charging pile key K of the current charging pile CS After that, a second registration feedback message M2 is generated and sent to the charging pile CS:

[0033] FID CS =H(N CS ||KN CS ), MR M2 =FID CS ⊕K CS ,M2={req(M2),MR M2 ,KN CS ,t7};

[0034] Among them, KNCS Indicates the key K of the current charging pile CS Binding key identifier, FID CS CS pseudonym for charging pile, MR M2 is the second verification code, t7 is the seventh timestamp, and the cloud platform TSP records the time when the second registration feedback message M2 is generated as the seventh timestamp t7;

[0035] At the same time, the cloud platform TSP will encode the charging pile CS N CS 、Charging pile CS pseudonym FID CS 、Charging pile key K CS and K CS The key identifier KN of the binding V Bind together to form charging pile CS registration information for storage;

[0036] If t6-t5>△T3 or the charging pile CS code N is stored in the cloud platform TSP CS , then the cloud platform TSP discards the current second registration request A2;

[0037] S13b, the charging pile CS records the time when the second registration feedback message M2 is received as the eighth timestamp t8, and extracts the seventh timestamp copy t7´ and the second verification code copy MR from the second registration feedback message M2. M2 ´And a copy of the charging pile key identifier KN CS ´, if t8-t7´≤△T4, △T4 represents the fourth time threshold, the charging pile CS is based on the copy of the charging pile key identifier KN CS ´Extract the corresponding charging pile key copy K CS ', and then calculate the charging pile pseudonym copy FID CS =MR M2 ´⊕K CS ´After that, the charging pile key copy K CS ´、Charging pile key identifier copy KN CS ´ and charging pile pseudonym copy FID CS ´For storage.

[0038] Preferably, in S21: when the charging gun of the charging pile CS is inserted into the vehicle V, the charging pile CS sends the charging pile pseudonym copy FID to the vehicle V through the charging gun CS ´;

[0039] In S22, the following sub-steps are also included:

[0040] S221, vehicle V initiates three-party authentication phase I: vehicle V generates the first identity authentication request A3 and sends it to the cloud platform TSP: A3={req(A3),Q1,t9,KN V´,C1},C1=H(Q1||t9||KN V ´),

[0041] Q1=H(K V ´)⊕DFID V ,DFID V =(FID V ´||FID CS ´)⊕SLOT(t9);

[0042] Wherein, t9 represents the ninth timestamp, which is the time when the first identity authentication request A3 is generated, Q1 represents the first verification code, C1 represents the first complete code, DFID V represents the dynamic pseudonym of the vehicle V, SLOT(t9) represents the time slot corresponding to the ninth timestamp t9;

[0043] All moments within a period of time Ta~Tb belong to the time interval [Ta,Tb);

[0044] S222, the cloud platform TSP records the time when the first identity authentication request A3 is received as the tenth timestamp t 10 , get the tenth timestamp t 10 The corresponding time gap SLOT(t 10 ), and extract the ninth timestamp copy t9´ from the first authentication request A3. If t 10 -t9´≤△T5, △T5 represents the fifth time threshold, then the cloud platform TSP extracts the first verification code copy Q1´ and the second copy of the vehicle-side key identifier KN from the first identity authentication request A3 V ´´ and the first complete code copy C1´, calculate the second complete code C2 = H(Q1´||t9´||KN V ´´), if C2=C1´, then the cloud platform TSP successfully verifies the integrity of the first identity authentication request A3, that is, t9=t9´ and Q1=Q1´ and C1=C1´=C2 and KN V ´´=KN V ´;

[0045] After the cloud platform TSP successfully verifies the integrity of the first identity authentication request A3, it extracts the first copy KN of the vehicle-side key identifier from the authentication key package P. V ´The first copy of the bound vehicle key K V ´, calculate the dynamic pseudonym DFID of vehicle V V =H(K V ´)⊕Q1, and then calculate (FID V ´||FID CS ´)´=DFID V⊕SLOT(t 10 ) and then (FID V ´||FID CS ´)´ Extract the second copy of the vehicle pseudonym FID V ´´ and charging pile pseudonym FID CX If the vehicle pseudonym second copy FID exists in the registration information of the cloud platform TSP V ´´ and charging pile pseudonym FID CX , and the second copy of the vehicle pseudonym FID V ´´The corresponding registration information contains the first copy of the vehicle-side key identifier KN V ´, then the cloud platform TSP obtains the second copy of the vehicle pseudonym FID V Extract the first copy N of the vehicle V code from the corresponding registration information V ´And sent directly to the charging pile pseudonym FID in plain text CX In the corresponding charging pile, the corresponding charging pile receives the second copy N of the vehicle V code V ´´After that, a receipt TX is generated and sent to the cloud platform TSP. The cloud platform TSP receives a copy of the receipt TX´. At this time, the cloud platform TSP passes the identity authentication of the vehicle V, that is, the three-party authentication phase I verification is passed;

[0046] If 10 -t9´>△T5, or the cloud platform TSP fails to verify the integrity of the first identity authentication request A3, or the second copy of the vehicle pseudonym FID does not exist in the registration information in the cloud platform TSP V ´´ and / or charging station pseudonym FID CX , or a second copy of the vehicle's pseudonym FID V ´´The first copy of the vehicle-side key identifier KN does not exist in the corresponding registration information V ´, or the cloud platform TSP fails to authenticate the vehicle V, it is recorded as the failure of the three-party authentication phase I. At this time, the cloud platform TSP discards the current first-level authentication request A3.

[0047] Preferably, in S23, the following sub-steps are also included:

[0048] S231, after the three-party verification phase I is verified, the cloud platform TSP initiates the three-party verification phase II: the cloud platform TSP randomly extracts a quantum key from the authentication key package P as the preset key K H , generate a second authentication request A4 and send it to the vehicle V:

[0049] A4={req(A4),Q2,t 11 ,KN H ,C3},C3=H(Q2||t11 ||KN H ),

[0050] Q2=K H [DB]⊕DFID V ,DB=H(SLOT(t 10 )||TX´||QRNG1);

[0051] Among them, t 11 Indicates the eleventh timestamp, the eleventh timestamp t 11 The moment when the second authentication request A4 is generated, Q2 represents the second verification code, C3 represents the third complete code, KN H Indicates the authentication key package P and the preset key K H The key identifier of the binding, K H [·] indicates using the preset key K H Symmetric encryption is performed, DB represents the second authentication data, and QRNG1 represents the first random number generated by the quantum random number generator in the cloud platform TSP;

[0052] S232, the vehicle V records the time when the second identity authentication request A4 is received as the twelfth timestamp t 12 , and extract the eleventh timestamp copy t from the second authentication request A4 11 ´, if t 12 -t 11 ´≤△T6, △T6 represents the sixth time threshold, then the vehicle V extracts the second verification code copy Q2´ and the key identifier copy KN from the second identity authentication request A4 H ´ and the third complete code copy C3´, calculate the fourth complete code C4 = H(Q2´||t 11 ´||KN H ´), if C4=C3´, then the integrity check of the second identity authentication request A4 by vehicle V is successful, that is, t 11 =t 11 ´ and Q2=Q2´ and C3=C3´=C4 and KN H =KN H ;

[0053] After the vehicle V successfully verifies the integrity of the second identity authentication request A4, it first calculates K H [DB]=Q2⊕DFID V , and then extract the key identifier KN from the authentication key package P H Bound preset key K H To symmetric decrypt K HAfter obtaining the second authentication data DB, the vehicle V generates a feedback message M3 based on the second authentication data DB and sends it to the cloud platform TSP: M3={W,C5}, W=N V ⊕DB, C5=H(W||DB);

[0054] Wherein, W represents the verification body, and C5 represents the fifth complete code;

[0055] If 12 -t 11 ´>△T6, or the vehicle V fails to verify the integrity of the second identity authentication request A4, which is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the vehicle V discards the current second identity authentication request A4;

[0056] S233, after the cloud platform TSP obtains the first copy W' of the verification body and the fifth complete code copy C5' from the feedback message M3, it calculates the sixth complete code C6=H(W'||DB). If C6=C5', the cloud platform TSP successfully verifies the integrity of the feedback message M3, that is, W=W' and C5=C5'=C6;

[0057] After the cloud platform TSP successfully verifies the integrity of the feedback message M3, it randomly extracts a quantum key from the authentication key package P as the verification key K G , generate charging pile verification message M4 and send it to the charging pile pseudonym FID CX In the corresponding charging pile CX:

[0058] M4={req(M4),Q3,Q4,W,t 13 ,KN G}, Q3=H(K CX )⊕DFID CX ,

[0059] Q4=K G [DB]⊕DFID CX ,DFID CX =FID CX ⊕QRNG1;

[0060] Among them, t 13 Indicates the thirteenth timestamp, the thirteenth timestamp t 13 The moment when the charging pile verification message M4 is generated, Q3 represents the third verification code, Q4 represents the fourth verification code, DFID CX Indicates the dynamic pseudonym of the charging pile CX, K CX For cloud platform TSP, use the pseudonym FID of charging pile CX The charging pile key extracted from the corresponding registration information, KN G Indicates the authentication key package P and the verification key KG The key identifier of the binding, K G [·] indicates the use of the verification key K G Perform symmetric encryption;

[0061] If the cloud platform TSP fails to verify the integrity of the feedback message M3, it is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the cloud platform TSP discards the current feedback message M3;

[0062] S234, after the charging pile CX is registered at the cloud platform TSP, it stores a copy of the charging pile key K CX ´、Charging pile key identifier copy KN CX ´ and charging pile pseudonym copy FID CX ´; The charging pile CX records the time when the charging pile verification message M4 is received as the fourteenth timestamp t 14 , get the fourteenth timestamp t 14 The corresponding time gap SLOT(t 14 ), and extract the thirteenth timestamp copy t from the charging pile verification message M4 13 ´, if t 14 -t 13 ´≤△T7, △T7 represents the seventh time threshold, then the charging pile CX extracts the third verification code copy Q3´, the fourth verification code copy Q4´, the second copy of the verification body W´´, and the key identifier copy KN from the charging pile verification message M4 G 'After that, calculate the first copy DFID of the dynamic pseudonym of the charging pile CX CX =H(K CX ´)⊕Q3´, the charging pile CX then uses the key identifier copy KN G ´Get the charging pile pseudonym copy FID CX ´, and obtain the verification key copy K from the authentication key package P G 'After that, calculate the ciphertext copy

[0063] K G [DB]´=Q4´⊕DFID CX ´ and the first random number copy QRNG1´ = FID CX ´⊕DFID CX ´, then use the verification key copy K G ´Symmetrically decrypt the ciphertext copy K G [DB]' and then obtain the second authentication data copy DB'. If the charging pile CX calculation exists DB'=H(SLOT(t 14 )||TX||QRNG1´), then the time-effectiveness integrity verification of the second-level authentication data copy DB´ passes, that is, DB´=DB. If DB´≠H(SLOT(t 14)||TX||QRNG1´), the time integrity verification of the second authentication data copy DB´ fails;

[0064] After the time integrity verification of the second authentication data copy DB' is passed, if the charging pile CX calculation has N V =W ''⊕ DB, then the charging pile CX successfully verifies the charging pile verification message M4, that is, N V ´´=N V ´, if N V ´´≠W´´⊕DB, then the charging pile CX fails to verify the charging pile verification message M4;

[0065] If 14 -t 13 ´>△T7, or the time integrity verification of the second authentication data copy DB´ fails, or the charging pile CX fails to verify the charging pile verification message M4, which is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the charging pile CX discards the current charging pile verification message M4.

[0066] Preferably, if the charging pile CX is the charging pile CS, then S234 includes S235-S236:

[0067] S235, after the charging pile CS successfully verifies the charging pile verification message M4, it generates a confirmation message M5 and sends it to the vehicle V through the charging gun: M5={req(M5),SD}, SD=H(DB||N V ´), where SD represents the confirmatory body;

[0068] S236, vehicle V extracts the first copy SD' of the confirmation body from the confirmation message M5, and uses the vehicle V code N V To calculate the second copy of the confirmation body SD´´=H(DB||N V ), if SD´=SD´´, then the two-way identity authentication between vehicle V and charging pile is successful, that is, the three-party authentication phase II is verified. At this time, the three-party authentication is successful, and the charging pile CS establishes a connection with vehicle V through the charging gun;

[0069] If SD´≠SD´´, the three-party verification phase II verification fails. At this time, the three-party verification fails and the vehicle V exits the charging gun of the charging pile CS;

[0070] If the charging pile CX is not the charging pile CS, the confirmation message M5 generated by the charging pile CX cannot be sent to the vehicle V through the charging gun, the three-party verification phase II cannot be verified, the three-party verification cannot be successful, and the vehicle V cannot establish a connection with the charging pile CS.

[0071] Preferably, after S2, S3 is also included: S3, when the vehicle is disconnected from the charging pile, the vehicle exits the charging gun; when the vehicle is about to establish a connection with the charging pile again, return to S2.

[0072] The present invention also provides a charging and discharging method for a vehicle and a charging pile, comprising the following steps:

[0073] Step 1: A connection is established between the vehicle and the charging pile using a safe connection method between the vehicle and the charging pile as described above;

[0074] Step 2: During off-peak hours, the charging pile charges the connected vehicle battery through the charging gun; during peak hours, the vehicle battery discharges and releases the stored electrical energy back to the grid through the connected charging pile.

[0075] The present invention also provides a charging and discharging system for a vehicle and a charging pile, comprising: a vehicle, a cloud platform and a charging pile, the cloud platform stores registration information of the vehicle and the charging pile, receives messages sent by the vehicle and the charging pile, or sends messages to the vehicle and the charging pile; the charging pile sends messages to the vehicle via a charging gun; the vehicle establishes a connection with the charging pile via the charging gun to perform charging and discharging; each charging pile, vehicle and cloud platform is programmed or equipped to execute a charging and discharging method for a vehicle and a charging pile as described above.

[0076] The beneficial effects of the present invention are:

[0077] (1) The secure connection method of the present invention prevents a malicious vehicle / malicious charging pile from establishing a connection with a legitimate charging pile / legitimate vehicle directly by inserting the charging pile, thereby ensuring that the connection between the vehicle and the charging pile is absolutely safe.

[0078] (2) In the secure connection method of the present invention, the process of registering the vehicle and the charging pile on the cloud platform:

[0079] ① It is completed through wireless communication, and each registration process can be carried out separately, so the registration process has a high degree of freedom, flexibility and efficiency, especially the vehicle registration process. There is no need for the car buyer to bring the vehicle to the offline registration, which improves the user experience.

[0080] ② After the vehicle is successfully registered, it only needs to store its own registration information, without storing any registration information about the legal charging pile; similarly, after the charging pile is successfully registered, it only needs to store its own registration information, without storing any registration information about the legal vehicle. Therefore, no matter how many legal vehicles and legal charging piles are added later, the previous legal vehicles and legal charging piles do not need to occupy their own storage resources for update and storage. That is, the safe connection method of the present invention takes up very little memory for vehicles and charging piles, and has high versatility.

[0081] (3) In the secure connection method of the present invention, during the process of establishing a connection between the charging pile and the vehicle, many messages transmitted via wireless communication are generated. These messages not only have extremely high confidentiality, but also have strong resistance to hacker attacks, further improving the security of the connection between the vehicle and the charging pile:

[0082] ① In the secure connection method of the present invention, basically all message recipients first verify the timestamp of the message. By first verifying the timestamp, which is a verification method with very little computational overhead, messages that are not time-sensitive can be efficiently screened out, and only messages that pass the timeliness verification will be subjected to more complex calculations to verify their integrity (i.e., to verify whether the message has been tampered with during wireless communication).

[0083] ② The present invention controls the timeliness of messages from different aspects through timestamps and time gaps, and has strong resistance to replay attacks.

[0084] ③ The time gaps contained in all messages of the present invention are hashed, so there is no risk of being cracked. In addition, the present invention creatively integrates the time gap corresponding to the timestamp into the integrity verification of the message, which not only eliminates the need to verify the time gap separately, but also improves the verification efficiency of the message and the security level of the message.

[0085] ④ The components of the message of the present invention can be divided into two categories: plaintext and ciphertext. Even if the plaintext is intercepted by hackers, the hackers cannot obtain the key to decrypt other ciphertexts, and the plaintext can reduce the computing overhead; the ciphertext is further divided into key encryption and hash calculation. If the hacker intercepts the ciphertext obtained by hash calculation, it will not be decrypted due to the one-way mapping characteristic of the hash function; the key used in the present invention is the quantum key randomly extracted from the authentication key package at that time, and each encryption is basically one-time and one-key. The key has extremely high randomness. Only the information of the key identifier exists in each message, and there is no information about the key itself currently used. Therefore, the messages transmitted in wireless communication by the present invention have extremely high confidentiality and are difficult to crack, which greatly improves the security of the wireless communication process.

[0086] (4) In the secure connection method of the present invention, compared with the verification method of the prior art, the setting of each step of the three-party verification is simple, efficient and irreplaceable, reducing the total communication overhead in the entire verification process, and can ensure that the charging pile, cloud platform and vehicle to which the charging gun inserted into the vehicle belongs are all legal, comprehensively ensuring that the connection established between the vehicle and the charging pile is absolutely safe; furthermore, in the three-party verification of the present invention, a large number of encryption and decryption calculations occur in a cloud platform with powerful computing power and rich storage resources, further reducing the computing overhead of the vehicle and the charging pile.

[0087] (5) The charging and discharging method of a vehicle and a charging pile of the present invention, for the vehicle: avoids the risk of vehicle data being stolen during the charging and discharging process, protects the privacy of the owner and the safety of the vehicle; electric vehicles no longer need to be restricted by the location of a specific charging pile and cannot travel far, which greatly promotes the popularization of electric vehicles. For the power grid: prevents malicious vehicles from interfering with the power grid by invading the charging pile during the charging and discharging process; and allows the vehicle to charge and discharge safely with the charging pile. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] Figure 1 A flow chart of a method for safely connecting a vehicle to a charging pile according to the present invention;

[0089] Figure 2 This is a diagram of the charging and discharging system architecture of a vehicle and a charging pile according to the present invention. DETAILED DESCRIPTION

[0090] In order to make the technical solution of the present invention clearer and more specific, the present invention is clearly and completely described below in conjunction with the accompanying drawings. Any equivalent replacement of the technical features of the technical solution of the present invention and any solution derived by conventional reasoning by ordinary technicians in the field without making any creative work shall fall within the protection scope of the present invention.

[0091] Because the vehicle and charging pile identity authentication method of the present invention is applicable not only to public charging piles but also to private charging piles, for the convenience of description, the following will no longer emphasize public charging piles or private charging piles, and they will be uniformly referred to as charging piles.

[0092] Example 1

[0093] like Figure 1 As shown in the figure, a method for safely connecting a vehicle to a charging pile according to the present invention is shown, and the specific steps are as follows:

[0094] S1, each vehicle and charging pile is registered on the cloud platform;

[0095] S2, when the charging gun of the charging pile is inserted into the vehicle, the vehicle initiates a three-party verification between the cloud platform and the charging pile. If the three-party verification is successful, the charging pile establishes a connection with the vehicle through the charging gun. If the three-party verification fails, the vehicle exits the charging gun.

[0096] Optionally, S3 is also included after S2:

[0097] S3, when the vehicle is disconnected from the charging pile, the vehicle exits the charging gun; when the vehicle is about to establish a connection with the charging pile again, it returns to S2.

[0098] The following sub-steps are also included before S1:

[0099] S01, the cloud platform TSP stores a hash function H and an authentication key package P, the authentication key package P contains several pairs of quantum keys and key identifiers bound together, and the quantum keys and key identifiers are generated by the quantum random number generator built into the cloud platform TSP; the hash function H is injected into the cloud platform TSP;

[0100] S02, when vehicles and charging piles are manufactured, the manufacturer injects the hash function H and the authentication key package P into the storage medium of each vehicle and charging pile.

[0101] The hash function H and the authentication key package P first exist and are stored in the cloud platform TSP. After the vehicle and charging pile manufacturers obtain the hash function H and the authentication key package P from the cloud platform TSP, no matter when and how many vehicles and charging piles are produced subsequently, the hash function H and the authentication key package P will be injected into the storage medium in the vehicles and charging piles when the vehicles and charging piles are produced.

[0102] In S1, the vehicle registers at the cloud platform TSP through wireless communication. The specific process is as follows:

[0103] S11a, vehicle V generates a first registration request A1 and sends it to the cloud platform TSP:

[0104] A1={req(A1),N V ,t1},N V =H(ID V ),

[0105] Wherein, req(·) is the information type identifier, req(A1) represents the information type identifier of the first registration request A1, ID V represents the identification code of vehicle V, H(·) represents the hash calculation using a hash function, t1 is the first timestamp, and the time when vehicle V generates the first registration request A1 is recorded as the first timestamp t1, N V Indicates the vehicle V code.

[0106] In this embodiment, the hash function H is a SHA-256 hash function.

[0107] S12a, the cloud platform TSP records the time when the first registration request A1 is received as the second timestamp t2, and extracts the first timestamp t1 and the vehicle V code N from the first registration request A1. V , if t2-t1≤△T1 and the vehicle V code N does not exist in the cloud platform TSP V , △T1 represents the first time threshold, then the cloud platform TSP determines that the vehicle V is an unregistered vehicle, and the cloud platform TSP randomly extracts a quantum key from the authentication key package P stored in itself and records it as the vehicle-side key K of the current vehicle V VAfter that, a first registration feedback message M1 is generated and sent to the vehicle V:

[0108] FID V =H(N V ||KN V ), MR M1 =FID V ⊕K V ,

[0109] M1={req(M1),MR M1 ,KN V ,t3},

[0110] Among them, || is a connector, ⊕ is an XOR operator, KN V Indicates the current vehicle-side key K V Binding key identifier, FID V V pseudonym for vehicle, MR M1 is the first verification code, req(M1) represents the information type identifier of the first registration feedback message M1, t3 is the third timestamp, and the cloud platform TSP records the time when the first registration feedback message M1 is generated as the third timestamp t3.

[0111] At the same time, the cloud platform TSP will encode the vehicle V V 、Vehicle V pseudonym FID V 、Car-side key K V and K V The key identifier KN of the binding V Bind to vehicle V registration information for storage;

[0112] If t2-t1>△T1 or the vehicle V code N is stored in the cloud platform TSP V , the cloud platform TSP discards the current first registration request A1.

[0113] After the vehicle V sends the first registration request A1, if the vehicle V does not receive the first registration feedback message M1 sent by the cloud platform for more than Δα1 time interval, the process returns to S11a.

[0114] In wireless communication, a separate communication channel will be established between each message receiving end and each message sending end. Even if the message sending end is not clear about the identity of a certain message receiving end, the message sending end will not mistakenly send the message that should be sent to the first message receiving end to the first message receiving end. For example, if vehicles V1 and V2 are registered at the cloud platform TSP at the same time, the cloud platform TSP will not mistakenly send the first registration feedback message sent to vehicle V1 to vehicle V2. Of course, during wireless communication, there is a risk that the communication channel will be cracked by hackers, resulting in the interception of messages in a specific transmission direction. For example, if hackers crack the transmission direction of the cloud platform TSP to vehicle V1 in the communication channel, they can intercept the information sent by the cloud platform TSP to vehicle V1. In wireless communication, there is also the risk of hackers pretending to be a good third party to steal messages. For example, hackers can pretend to be a vehicle that needs to be registered, forge a first registration request and send it to the cloud platform TSP to receive and attempt to decrypt the first registration feedback message fed back by the cloud platform TSP.

[0115] S13a, the vehicle V records the time when the first registration feedback message M1 is received as the fourth timestamp t4, and extracts the third timestamp copy t3´ and the first verification code copy MR from the first registration feedback message M1. M1 ´ and the first copy of the vehicle-side key identifier KN V ´, if t4-t3´≤△T2, △T2 represents the second time threshold, then the vehicle V is based on the first copy of the vehicle-side key identifier KN V Extract the first copy of the corresponding vehicle-side key K from its own storage medium V ', then calculate the first copy of the vehicle pseudonym FID V =MR M1 ´⊕K V 'After that, the first copy of the vehicle key K V ´、The first copy of the vehicle-side key identifier KN V ´ and vehicle pseudonym first copy FID V ´Stored in its own storage medium. At this point, vehicle V is successfully registered at the cloud platform TSP.

[0116] In S1, the charging pile is registered at the cloud platform TSP through wireless communication. The specific process is as follows:

[0117] S11b, the charging pile CS generates a second registration request A2 and sends it to the cloud platform TSP:

[0118] A2={req(A2),N CS ,t5},N CS =H(ID CS ),

[0119] Wherein, req(A2) represents the information type identifier of the second registration request A2, ID CS represents the identification code of the charging pile CS, t5 is the fifth timestamp, and the charging pile CS records the time when the second registration request A2 is generated as the fifth timestamp t5, N CS Indicates the charging pile CS code.

[0120] S12b, the cloud platform TSP records the time of receiving the second registration request A2 as the sixth timestamp t6, and extracts the fifth timestamp t5 and the charging pile CS code N from the second registration request A2. CS , if t6-t5≤△T3 and the charging pile CS code N does not exist in the cloud platform TSP CS , △T3 represents the third time threshold, then the cloud platform TSP determines that the charging pile CS is an unregistered charging pile, and the cloud platform TSP randomly extracts a quantum key from the authentication key package P stored in itself and records it as the charging pile key K of the current charging pile CS After that, a second registration feedback message M2 is generated and sent to the charging pile CS:

[0121] FID CS =H(N CS ||KN CS ), MR M2 =FID CS ⊕K CS ,

[0122] M2={req(M2),MR M2 ,KN CS ,t7},

[0123] Among them, KN CS Indicates the key K of the current charging pile CS Binding key identifier, FID CS CS pseudonym for charging pile, MR M2 is the second verification code, req(M2) represents the information type identifier of the second registration feedback message M2, t7 is the seventh timestamp, and the cloud platform TSP records the time when the second registration feedback message M2 is generated as the seventh timestamp t7,

[0124] At the same time, the cloud platform TSP will encode the charging pile CS N CS 、Charging pile CS pseudonym FID CS 、Charging pile key K CS and K CS The key identifier KN of the binding V Bind together to form charging pile CS registration information for storage;

[0125] If t6-t5>△T3 or the charging pile CS code N is stored in the cloud platform TSPCS , the cloud platform TSP discards the current second registration request A2.

[0126] After the cloud platform TSP sends the second registration request A2, if it does not receive the second registration feedback message M2 sent by the cloud platform for more than Δα2 time interval, it returns to S11b.

[0127] S13b, the charging pile CS records the time when the second registration feedback message M2 is received as the eighth timestamp t8, and extracts the seventh timestamp copy t7' and the second verification code copy MR from the second registration feedback message M2. M2 ´And a copy of the charging pile key identifier KN CS ´, if t8-t7´≤△T4, △T4 represents the fourth time threshold, the charging pile CS is based on the copy of the charging pile key identifier KN CS ´Extract the corresponding charging pile key copy K from its own storage medium CS ', and then calculate the charging pile pseudonym copy FID CS =MR M2 ´⊕K CS ´After that, the charging pile key copy K CS ´、Charging pile key identifier copy KN CS ´ and charging pile pseudonym copy FID CS ´Stored in its own storage medium. At this point, the charging pile CS is successfully registered at the cloud platform TSP.

[0128] S2 also includes the following sub-steps:

[0129] S21, when the charging gun of the charging pile CS is inserted into the vehicle V, the charging pile CS sends the charging pile pseudonym copy FID to the vehicle V through the charging gun CS ´;

[0130] S22, vehicle V initiates three-party authentication phase I: the cloud platform TSP authenticates the identity of vehicle V. The cloud platform TSP passes the three-party authentication phase I by authenticating the identity of vehicle V.

[0131] S23, after the three-party verification phase I is verified, the cloud platform TSP initiates the three-party verification phase II: the vehicle V and the charging pile perform two-way identity authentication through the cloud platform TSP. If the two-way identity authentication is successful, the three-party verification phase II is verified. At this time, the three-party verification is successful, and the charging pile establishes a connection with the vehicle through the charging gun; if the three-party verification fails, the vehicle V exits the charging gun.

[0132] S22 also includes the following sub-steps:

[0133] S221, vehicle V initiates three-party authentication phase I: vehicle V generates a first identity authentication request A3 and sends it to the cloud platform TSP:

[0134] A3={req(A3),Q1,t9,KN V ´,C1},

[0135] C1=H(Q1||t9||KN V ´), Q1=H(K V ´)⊕DFID V ,

[0136] DFID V =(FID V ´||FID CS ´)⊕SLOT(t9),

[0137] Wherein, req(A3) represents the information type identifier of the first re-identity authentication request A3, t9 represents the ninth timestamp, and the ninth timestamp t9 is the time when the first re-identity authentication request A3 is generated, Q1 represents the first verification code, C1 represents the first complete code, DFID V represents the dynamic pseudonym of the vehicle V, and SLOT(t9) represents the time slot corresponding to the ninth timestamp t9.

[0138] All moments within a period of time Ta~Tb (including Ta moment, but excluding Tb moment) belong to the time slot [Ta, Tb). There is no overlapping moment between adjacent time slots and they are continuous in the time dimension. Ta and Tb are accurate to milliseconds. For example, if there is a time slot [15:00:00.000,15:10:16.032), then the moment 15:06:10.032 belongs to the time slot

[0139] [15:00:00.000,15:10:16.032). Divide the 24 hours of a day into a number of consecutive time slots.

[0140] The specific division result of 24 hours a day into several continuous time slots, like the authentication key package P in S01~S02, has been pre-filled into the storage media of the cloud platform TSP, the vehicle and the charging pile when they are produced.

[0141] S222, the cloud platform TSP records the time when the first identity authentication request A3 is received as the tenth timestamp t 10 , find the tenth timestamp t in its own storage medium 10 The corresponding time gap SLOT(t 10 ), and extract the ninth timestamp copy t9´ from the first authentication request A3. If t10 -t9´≤△T5, △T5 represents the fifth time threshold, then the cloud platform TSP extracts the first verification code copy Q1´ and the second copy of the vehicle-side key identifier KN from the first identity authentication request A3 V ´´ and the first complete code copy C1´, calculate the second complete code C2 = H(Q1´||t9´||KN V ´´), if C2=C1´, then the cloud platform TSP successfully verifies the integrity of the first identity authentication request A3, that is, t9=t9´ and Q1=Q1´ and C1=C1´=C2 and KN V ´´=KN V ´;

[0142] After the cloud platform TSP successfully verifies the integrity of the first identity authentication request A3, it extracts the first copy KN of the vehicle-side key identifier from the authentication key package P stored in itself. V ´The first copy of the bound vehicle key K V ´, calculate the dynamic pseudonym DFID of vehicle V V =H(K V ´)⊕Q1, and then calculate (FID V ´||FID CS ´)´=DFID V ⊕SLOT(t 10 ) and then (FID V ´||FID CS ´)´ Extract the second copy of the vehicle pseudonym FID V ´´ and charging pile pseudonym FID CX ,

[0143] If the second copy of the vehicle pseudonym FID is stored in the registration information in the cloud platform TSP's own storage medium V ´´ and charging pile pseudonym FID CX , and the second copy of the vehicle pseudonym FID V ´´The corresponding registration information contains the first copy of the vehicle-side key identifier KN V ´, then the cloud platform TSP obtains the second copy of the vehicle pseudonym FID V Extract the first copy N of the vehicle V code from the corresponding registration information V ´And sent directly to the charging pile pseudonym FID in plain text CX In the corresponding charging pile, the corresponding charging pile receives the second copy N of the vehicle V code V ´´After that, a receipt TX is generated and sent to the cloud platform TSP. The cloud platform TSP receives a copy of the receipt TX´. At this time, the cloud platform TSP passes the identity authentication of the vehicle V, that is, the three-party authentication phase I verification is passed;

[0144] If 10 -t9´>△T5, or the cloud platform TSP fails to verify the integrity of the first identity authentication request A3, or the cloud platform TSP does not have the second copy of the vehicle pseudonym FID in its own storage medium V ´´ and / or charging station pseudonym FID CX , or a second copy of the vehicle's pseudonym FID V ´´The first copy of the vehicle-side key identifier KN does not exist in the corresponding registration information V ´, or the cloud platform TSP fails to authenticate the vehicle V, it is recorded as the failure of the three-party authentication phase I. At this time, the cloud platform TSP discards the current first-level authentication request A3.

[0145] Optionally, the receipt TX is in plain text. Each receipt TX generated by the charging pile is unique.

[0146] The cloud platform TSP directly encodes the first copy N of the vehicle V in plain text V ´Send to charging station pseudonym FID CX In the corresponding charging pile, the use of plain text transmission is not only extremely fast, but also greatly reduces the computing overhead and resource usage of the message sender (i.e., the cloud platform TSP) and the message receiver (i.e., the charging pile). And because the first copy N of the vehicle V code V ´ is the vehicle identification code obtained by hash calculation, which is irreversible, so even if a hacker intercepts the first copy of the vehicle V code N V ´, the vehicle identification code cannot be obtained, and the subsequent steps are based only on the first copy N of the vehicle V code V ´No other valid information can be obtained; if the hacker intercepts and tampers with the first copy of the vehicle V code N V ´, it will result in the second copy N of the vehicle V code received by the corresponding charging pile V ´´With vehicle V code first copy N V ' is different, but this will only make it impossible to establish a connection between the vehicle V and the charging pile CS due to a hacker attack, which just meets the purpose of the invention, that is, to ensure that the connection established between the vehicle and the charging pile is safe.

[0147] The specific analysis of the charging pile sending a receipt directly to the cloud platform TSP in plain text is the same as above and will not be repeated here.

[0148] If the cloud platform TSP successfully verifies the integrity of the first identity authentication request A3, it means that the first identity authentication request A3 has not been tampered with during the wireless communication process from the vehicle V to the cloud platform TSP. That is to say, in S222, the cloud platform TSP extracts the ninth timestamp copy t9´ from the first identity authentication request A3, which is the ninth timestamp t9, the first verification code copy Q1´ is the first verification code Q1, the first complete code copy C1´ is the first complete code C1, and the second copy KN of the vehicle-side key identifier is V ´´ is the first copy of the vehicle-side key identifier KN V ´, so C2=C1´.

[0149] Only when the tenth timestamp t 10 SLOT(t 10 )=SLOT(t9), further, FID V ´´=FID V And FID CX =FID CS ´; and only if all steps in the registration phase are undisturbed and safe, there will be FID V =FID V And FID CS =FID CS That is to say, only if S222 and all previous steps are safe, there will be FID. V ´´=FID V =FID V And FID CX =FID CS =FID CS To ensure that the vehicle pseudonym second copy FID exists in the cloud platform TSP V ´´ and charging pile pseudonym FID CX , and the charging pile pseudonym FID CX The corresponding charging pile CX is the charging pile CS (that is, the charging pile to which the charging gun inserted into the vehicle V actually belongs), and the charging pile pseudonym FID CX The corresponding registration information is the registration information of the charging pile CS, which can also ensure that the cloud platform TSP is the first copy of the vehicle V code N V ´Sent to the charging pile CS, similarly it can ensure that the receipt TX is generated by the charging pile CS.

[0150] If only FID V ´´=FID V And FID CX =FID CS ´, but no FID V =FIDV And FID CS =FID CS , the cloud platform TSP generally does not store the second copy of the current vehicle pseudonym FID V ´´ and charging pile pseudonym FID CX In extreme cases, even if the cloud platform TSP stores the second copy of the current vehicle pseudonym FID V ´´ and charging pile pseudonym FID CX , and also because of the pseudonym FID of the charging pile in the cloud platform TSP CX The corresponding charging pile CX is not the charging pile CS, so the cloud platform TSP will not encode the first copy of the vehicle V V ´ is sent to the charging pile CS, so the receipt received by the cloud platform TSP is not sent by the charging pile CS, so that subsequent steps such as S3 and its sub-steps cannot be carried out smoothly, and no connection will be established between the vehicle V and the charging pile CS.

[0151] Optionally, △T5<Ta-Tb.

[0152] For ease of description, the following will define vehicles and charging piles that have not been successfully registered at the cloud platform TSP as malicious vehicles and malicious charging piles respectively; the identities of vehicles and charging piles that have successfully registered at the cloud platform TSP are legal, and are recorded as legal charging piles and legal vehicles. Whether the vehicle is charged through the charging pile, or the vehicle releases the stored electric energy back to the power grid through the charging pile, it is the vehicle that is the initiator, and it can only be achieved after the connection is established between the vehicle and the charging pile. In the prior art, after the charging gun of the legal charging pile is inserted into the malicious vehicle, the malicious vehicle directly establishes a connection with the legal charging pile through the charging gun, and the malicious vehicle can interfere with the power grid through the legal charging pile, affecting the safety of the power grid; and after the charging gun of the malicious charging pile is inserted into the legal vehicle, the malicious charging pile directly establishes a connection with the legal vehicle through the charging gun, and the malicious charging pile can steal the vehicle data of the legal vehicle, leak the privacy of the owner and threaten the safety of the vehicle.

[0153] In the secure connection method of the present invention, even if the charging gun of a legitimate charging pile is inserted into a malicious vehicle, the malicious vehicle can only obtain a copy of the charging pile pseudonym sent by the legitimate charging pile through the charging gun. If the malicious vehicle does not initiate the three-party verification phase I, it is naturally impossible to establish a connection with the legitimate charging pile. Even if the malicious vehicle initiates the three-party verification phase I, the three-party verification phase I will fail, so the malicious vehicle cannot establish a connection with the legitimate charging pile.

[0154] S23 also includes the following sub-steps:

[0155] S231, after the three-party verification phase I is verified, the cloud platform TSP initiates the three-party verification phase II: the cloud platform TSP randomly extracts a quantum key from the authentication key package P as the preset key K H , generate a second authentication request A4 and send it to the vehicle V:

[0156] A4={req(A4),Q2,t 11 ,KN H ,C3},

[0157] C3=H(Q2||t 11 ||KN H ), Q2=K H [DB]⊕DFID V ,

[0158] DB=H(SLOT(t 10 )||TX´||QRNG1),

[0159] Where req(A4) represents the information type identifier of the second authentication request A4, 11 Indicates the eleventh timestamp, the eleventh timestamp t 11 The moment when the second authentication request A4 is generated, Q2 represents the second verification code, C3 represents the third complete code, KN H Indicates the authentication key package P and the preset key K H The key identifier of the binding, K H [·] indicates using the preset key K H Symmetric encryption is performed, DB represents the second authentication data, and QRNG1 represents the first random number generated by the quantum random number generator in the cloud platform TSP.

[0160] If the vehicle V registered with the cloud platform does not receive the second identity authentication request A4 from the cloud platform within a time interval greater than Δα3 after sending the first identity authentication request A3, the process returns to S221.

[0161] S232, the vehicle V records the time when the second identity authentication request A4 is received as the twelfth timestamp t 12 , and extract the eleventh timestamp copy t from the second authentication request A4 11 ´, if t 12 -t 11 ´≤△T6, △T6 represents the sixth time threshold, then the vehicle V extracts the second verification code copy Q2´ and the key identifier copy KN from the second identity authentication request A4 H ´ and the third complete code copy C3´, calculate the fourth complete code C4 = H(Q2´||t 11 ´||KNH ´), if C4=C3´, then the integrity check of the second identity authentication request A4 by vehicle V is successful, that is, t 11 =t 11 ´ and Q2=Q2´ and C3=C3´=C4 and KN H =KN H ;

[0162] After the vehicle V successfully verifies the integrity of the second identity authentication request A4, it first calculates K H [DB]=Q2⊕DFID V , and then extract the key identifier KN from the authentication key package P stored in itself H Bound preset key K H To symmetric decrypt K H After obtaining the second authentication data DB, the vehicle V generates a feedback message M3 based on the second authentication data DB and sends it to the cloud platform TSP:

[0163] M3={W,C5},W=N V ⊕DB, C5=H(W||DB),

[0164] Wherein, W represents the verification body, and C5 represents the fifth complete code.

[0165] If t 12 -t 11 ´>△T6, or the vehicle V fails to verify the integrity of the second identity authentication request A4, which is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the vehicle V discards the current second identity authentication request A4.

[0166] S233, after the cloud platform TSP obtains the first copy W' of the verification body and the fifth complete code copy C5' from the feedback message M3, it calculates the sixth complete code C6=H(W'||DB). If C6=C5', the cloud platform TSP successfully verifies the integrity of the feedback message M3, that is, W=W' and C5=C5'=C6;

[0167] After the cloud platform TSP successfully verifies the integrity of the feedback message M3, it randomly extracts a quantum key from its own stored authentication key package P as the verification key K G , generate charging pile verification message M4 and send it to the charging pile pseudonym FID CX In the corresponding charging pile CX:

[0168] M4={req(M4),Q3,Q4,W,t 13 ,KN G},

[0169] Q3=H(K CX)⊕DFID CX , Q4=K G [DB]⊕DFID CX ,

[0170] DFID CX =FID CX ⊕QRNG1,

[0171] Wherein, req(M4) represents the information type identifier of the charging pile verification message M4, t 13 Indicates the thirteenth timestamp, the thirteenth timestamp t 13 The moment when the charging pile verification message M4 is generated, Q3 represents the third verification code, Q4 represents the fourth verification code, DFID CX Indicates the dynamic pseudonym of the charging pile CX, K CX For cloud platform TSP, use the pseudonym FID of charging pile CX The charging pile key extracted from the corresponding registration information, KN G Indicates the authentication key package P and the verification key K G The key identifier of the binding, K G [·] indicates the use of the verification key K G Perform symmetric encryption.

[0172] If the cloud platform TSP fails to verify the integrity of the feedback message M3, it is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the cloud platform TSP discards the current feedback message M3.

[0173] S234, after the charging pile CX is registered at the cloud platform TSP, a copy of the charging pile key K is stored in its own storage medium CX ´、Charging pile key identifier copy KN CX ´ and charging pile pseudonym copy FID CX ´,

[0174] The charging pile CX records the time when the charging pile verification message M4 is received as the fourteenth timestamp t 14 , find the fourteenth timestamp t in its own storage medium 14 The corresponding time gap SLOT(t 14 ), and extract the thirteenth timestamp copy t from the charging pile verification message M4 13 ´, if t 14 -t 13 ´≤△T7, △T7 represents the seventh time threshold, then the charging pile CX extracts the third verification code copy Q3´, the fourth verification code copy Q4´, the second copy of the verification body W´´, and the key identifier copy KN from the charging pile verification message M4 G 'After that, obtain the charging pile CX key copy K from its own storage medium CX'After that, calculate the first copy DFID of the dynamic pseudonym of the charging pile CX CX =H(K CX ´)⊕Q3´, the charging pile CX then uses the key identifier copy KN G ´Get the charging pile pseudonym copy FID from its own storage medium CX ´、Get the verification key copy K from the authentication key package P G 'After that, calculate the ciphertext copy K G [DB]´=Q4´⊕DFID CX ´、First random number copy QRNG1´=FID CX ´⊕DFID CX ´, then use the verification key copy K G ´Symmetrically decrypt the ciphertext copy K G [DB]' and then get the second authentication data copy DB'. If the charging pile CX is calculated as DB'=H(SLOT(t 14 )||TX||QRNG1´), then the time-effectiveness integrity verification of the second-level authentication data copy DB´ passes, that is, DB´=DB. If DB´≠H(SLOT(t 14 )||TX||QRNG1´), the time integrity verification of the second authentication data copy DB´ fails. After the time integrity verification of the second authentication data copy DB´ passes, if the charging pile CX calculation has N V =W ''⊕ DB, then the charging pile CX successfully verifies the charging pile verification message M4, that is, N V ´´=N V ´, if N V ´´≠W´´⊕DB, then the charging pile CX fails to verify the charging pile verification message M4.

[0175] If t 14 -t 13 ´>△T7, or the time integrity verification of the second authentication data copy DB´ fails, or the charging pile CX fails to verify the charging pile verification message M4, which is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the charging pile CX discards the current charging pile verification message M4.

[0176] Only when the fourteenth timestamp t 14 With the tenth timestamp t 10 Only when they belong to the same time slot, there is SLOT(t 14 )=SLOT(t 10), and only if the charging pile verification message M4 and the receipt TX issued by the charging pile are not intercepted and tampered by hackers during the wireless communication process, will TX=TX´, QRNG1´=QRNG1, and further, DB´=DB, and the timeliness integrity verification of the second-level authentication data copy DB´ will be passed.

[0177] After the charging pile CX successfully verifies the charging pile verification message M4, it can send a message to the vehicle V in a unidirectional manner through the charging gun connected to the vehicle V in a wired communication manner.

[0178] If the charging pile CX is the same as the charging pile CS, then S234 includes S235~S236:

[0179] S235, after the charging pile CS successfully verifies the charging pile verification message M4, it generates a confirmation message M5 and sends it to the vehicle V through the charging gun:

[0180] M5={req(M5),SD},SD=H(DB||N V ´),

[0181] Wherein, req(M5) represents the information type identifier of the confirmation message M5, and SD represents the confirmation body.

[0182] S236, the vehicle V extracts the first copy of the confirmation body SD' from the confirmation message M5, and extracts the vehicle V code N from its own storage medium V To calculate the second copy of the confirmation body SD´´=H(DB||N V ), if SD´=SD´´, then the two-way identity authentication between vehicle V and charging pile is successful, that is, the three-party authentication phase II is verified. At this time, the three-party authentication is successful, and the charging pile CS establishes a connection with vehicle V through the charging gun;

[0183] If SD´≠SD´´, the three-party verification phase II verification fails. At this time, the three-party verification fails and the vehicle V exits the charging gun of the charging pile CS.

[0184] If the vehicle V registered at the cloud platform does not receive the confirmation message M5 sent by the charging pile CS through the charging gun for more than Δα4 time interval after sending the feedback message M3, the vehicle returns to S221.

[0185] Optionally, if the vehicle V returns to S221 for β consecutive times, the vehicle V will feedback to the owner that the current charging pile is suspected to be a malicious charging pile, and send a suspicious charging pile alarm to the cloud platform, and the alarm content includes the current location information of the vehicle V. The current location of the vehicle V is the location of the suspicious charging pile.

[0186] In this embodiment, β=10.

[0187] Optionally, if the charging pile CX is the charging pile CS, then S234 also includes S235'~S236':

[0188] S235´, after the charging pile CS successfully verifies the charging pile verification message M4, it generates a confirmation message M5 and sends it to the vehicle V through the charging gun: M5={req(M5),SD,t 15},SD=H(DB||N V ´||t 15 ),

[0189] Where req(M5) represents the information type identifier of the confirmation message M5, t 15 Indicates the fifteenth timestamp, the fifteenth timestamp t 15 This is the time when the confirmation message M5 is generated, and SD represents the confirmation body.

[0190] S236 ´, the vehicle V records the time of receiving the confirmation message M5 as the sixteenth time stamp t 16 , and extract the fifteenth timestamp copy t from the confirmation message M5 15 ´ and confirm the first copy SD´, if t 16 -t 15 ´≤△T8, △T8 represents the eighth time threshold, then the vehicle V extracts the vehicle V code N from its own storage medium V To calculate the second copy of the confirmation body SD´´=H(DB||N V ||t 15 ´), if SD´=SD´´, then the two-way identity authentication between vehicle V and charging pile is successful, that is, the three-party authentication phase II is verified. At this time, the three-party authentication is successful, and the charging pile CS establishes a connection with vehicle V through the charging gun;

[0191] If SD´≠SD´´, the three-party verification phase II verification fails. At this time, the three-party verification fails and the vehicle V exits the charging gun of the charging pile CS.

[0192] In this embodiment, △T1=10s, △T2=6s, △T3=△T4=△T5=△T6=8s, △T7=△T8=5s.

[0193] When a hacker disguises himself as a cloud platform, even if the verification of phases I and II is successful with a very low probability, the vehicle will not receive the confirmation message M5 and cannot complete the three-party verification because it is unclear which charging pile the charging gun inserted into the vehicle actually belongs to. Naturally, the connection between the vehicle and the charging pile will not be established. Therefore, the final setting of S235~S236 or S235´~S236´ can not only let the vehicle V know that the charging pile CS is a legal charging pile, and the vehicle V and the charging pile CS can establish a connection; but also prevent hackers from disguising themselves as cloud platforms and attempting to send malicious commands to the vehicle and the charging pile after the vehicle and the charging pile are connected to interfere with the charging and discharging of the vehicle and the charging pile after the connection.

[0194] If the charging pile CX is not the charging pile CS, the confirmation message M5 generated by the charging pile CX cannot be sent to the vehicle V through the charging gun, the three-party verification phase II cannot be verified, the three-party verification cannot be successful, and the vehicle V cannot establish a connection with the charging pile CS.

[0195] Several extreme situations that cause the charging pile CX to be not the charging pile CS:

[0196] ① The message during the registration process of charging pile CS at the cloud platform TSP is tampered by hackers, making the copy of the charging pile pseudonym stored in the charging pile CS different from the charging pile CS pseudonym stored in the cloud platform TSP. However, there is an extremely low probability that the copy of the charging pile pseudonym stored in the charging pile CS also exists in the cloud platform TSP, but the copy of the charging pile pseudonym belongs to the registration information of the charging pile CX.

[0197] ② The first-level identity verification request A3 sent by the charging pile CS to the cloud platform TSP in the three-party verification phase I was tampered with by hackers, but the first-level identity verification request A3 passed the integrity check of the cloud platform TSP with an extremely low probability, and the charging pile pseudonym calculated by the cloud platform TSP based on the first-level identity verification request A3 also exists in the registration information stored by the cloud platform TSP, but the charging pile pseudonym belongs to the registration information of the charging pile CX.

[0198] ③ A malicious vehicle first obtains a copy of the charging pile pseudonym of the legitimate charging pile CX through a charging gun, and then gives the copy to the malicious charging pile CS. The malicious charging pile CS attempts to use this copy to pass the three-party verification with the legitimate vehicle V. However, the cloud platform TSP will only exchange information with the legitimate charging pile CX during the entire three-party verification process.

[0199] If the charging pile CX is not the charging pile CS, and the charging gun of the charging pile CX is not inserted into any vehicle at this time, the confirmation message M5 generated by the charging pile CX naturally cannot be sent to the vehicle V through the charging gun, and the three-party verification phase II cannot proceed. The three-party verification will naturally not succeed, and the vehicle V will naturally not establish a connection with the charging pile CS.

[0200] If the charging pile CX is not the charging pile CS, but the charging gun of the charging pile CX is inserted into the vehicle Y at this time, the confirmation message M5 generated by the charging pile CX is sent to the vehicle Y through the charging gun. However, because SD´≠SD´´ calculated in the vehicle Y, the three-party verification phase II verification fails, that is, the three-party verification fails. The vehicle Y will exit the charging gun of the charging pile CX, and the vehicle V will not establish a connection with the charging pile CS.

[0201] If a malicious charging pile sends a forged copy of the charging pile pseudonym to a legitimate vehicle through a charging gun, but the forged copy of the charging pile pseudonym does not exist in the registration information stored by the cloud platform TSP, then the three-party verification phase I will fail. Therefore, in this case, the malicious charging pile cannot establish a connection with the legitimate vehicle.

[0202] From the above analysis, it can be seen that in the safe connection method of the present invention, even if the charging gun of a malicious charging pile is inserted into a legitimate vehicle, the three-party verification will fail in either case, so the malicious charging pile cannot establish a connection with the legitimate vehicle.

[0203] In summary, the secure connection method of the present invention prevents a malicious vehicle / malicious charging pile from establishing a connection with a legitimate charging pile / legitimate vehicle directly by inserting the charging pile, thereby ensuring that the connection between the vehicle and the charging pile is absolutely safe.

[0204] In the secure connection method of the present invention, the process of registering the vehicle and the charging pile on the cloud platform is as follows:

[0205] (1) It is completed through wireless communication, and each registration process can be carried out separately, so the registration process has a high degree of freedom, flexibility and efficiency. Especially for the vehicle registration process, there is no need for the car buyer to bring the vehicle to the offline registration, which improves the user experience.

[0206] (2) After a vehicle is successfully registered, it only needs to store its own registration information, without storing any registration information about legal charging piles; similarly, after a charging pile is successfully registered, it only needs to store its own registration information, without storing any registration information about legal vehicles. Therefore, no matter how many legal vehicles and legal charging piles are added later, there is no need for the previous legal vehicles and legal charging piles to occupy their own storage resources for update and storage. That is, the secure connection method of the present invention takes up very little memory of vehicles and charging piles and has high versatility.

[0207] The secure connection method of the present invention generates a lot of messages transmitted through wireless communication during the process of establishing a connection between the charging pile and the vehicle. These messages not only have extremely high confidentiality, but also have strong resistance to hacker attacks, further improving the security of the connection between the vehicle and the charging pile:

[0208] (1) Under the premise that wireless communication is not interfered by hackers, the messages received by the message recipient are basically time-sensitive, while messages that are not time-sensitive are likely to be intercepted and tampered by hackers and then resent to the message recipient, or hackers may intercept the message and replay the message to the message recipient. In the secure connection method of the present invention, basically all message recipients first verify the timestamp of the message. By first verifying the timestamp, which is a verification method with very little computational overhead, messages that are not time-sensitive can be efficiently screened out, and only messages that pass the timeliness verification will be subjected to more complex calculations to verify their integrity (i.e., verify whether the message has been tampered with during the wireless communication process).

[0209] (2) In the present invention, only the ninth timestamp t9 and the tenth timestamp t 10 and the fourteenth timestamp t 14 They all belong to the same time slot, that is, from the time when vehicle V initiates the three-party verification phase I until the charging pile CX receives the charging pile verification message M4 in the three-party verification phase II, they must be in the same time slot, then the three-party verification phase II can be successful. The introduction of the timestamp corresponding to the time slot further restricts the timeliness of the message, and avoids the situation that some messages used in replay attacks can forge timestamps to pass the timestamp verification. That is, the present invention controls the timeliness of the message from different aspects through timestamps and time slots, and has strong resistance to replay attacks.

[0210] (3) The time gaps contained in all messages of the present invention are hashed, so there is no risk of being cracked. In addition, the present invention creatively integrates the time gap corresponding to the timestamp into the integrity verification of the message, which not only eliminates the need to verify the time gap separately, but also improves the verification efficiency of the message and the security level of the message.

[0211] (4) The components of the message of the present invention can be divided into two categories: plain text and cipher text. Even if the plain text is intercepted by hackers, the hackers cannot obtain the key to decrypt other cipher texts, and the plain text can reduce the computing overhead. The cipher text is further divided into two categories: key encryption and hash calculation. If the hacker intercepts the cipher text obtained by hash calculation, it will not be able to decrypt it because the hash function has the characteristic of one-way mapping. The key used in the present invention is the quantum key randomly extracted from the authentication key package P at that time, and each encryption is basically one-time one-key. The key has extremely high randomness. Only the key identifier information exists in each message, and there is no information about the key itself currently used. Therefore, the message transmitted in the wireless communication of the present invention has extremely high confidentiality and is difficult to crack, which greatly improves the security of the wireless communication process.

[0212] In the present invention, successful three-party authentication can ensure that the charging pile, cloud platform and vehicle to which the charging gun inserted into the vehicle belongs are all legitimate, thus safeguarding the security of the subsequent connection between the charging pile and the vehicle. In the prior art, identity authentication between the three parties often requires mutual identity authentication between the two parties. The three-party verification of the present invention is divided into Phase I and Phase II, wherein Phase I is mainly initiated by the vehicle, and the cloud platform authenticates the vehicle. Only after the cloud platform successfully authenticates the vehicle's identity, will the cloud platform interact with the charging pile to obtain a receipt from the charging pile. If Phase I fails, it proves that the identity of the vehicle is in doubt, and naturally there is no need to proceed to Phase II. If Phase I verification succeeds, it proves that the identity of the vehicle is legal, and then Phase II proceeds. Because the legality of the vehicle's identity is verified by the cloud platform, Phase II is initiated by the cloud platform, and the two-way identity authentication between the vehicle and the charging pile is carried out with the help of the cloud platform. The information flow of Phase II is cloud platform → vehicle → cloud platform → charging pile → vehicle. Phase II can not only verify whether the identity of the charging pile is legal, but also indirectly verify whether the identity of the cloud platform is legal, and can also verify whether the charging pile participating in Phase II is the same as the charging pile to which the charging gun inserted into the vehicle actually belongs, thereby comprehensively ensuring that the connection established between the vehicle and the charging pile is absolutely safe. That is, compared with the verification method of the prior art, the three-party verification of the present invention is simple, efficient and irreplaceable in the setting of each step, which reduces the total communication overhead in the entire verification process, and can ensure that the charging pile, cloud platform and vehicle to which the charging gun inserted into the vehicle belongs are all legal, and comprehensively guarantee that the connection established between the vehicle and the charging pile is absolutely safe; furthermore, in the three-party verification of the present invention, a large number of encryption and decryption calculations occur in a cloud platform with powerful computing power and rich storage resources, further reducing the computing overhead of vehicles and charging piles.

[0213] Example 2

[0214] The present invention also provides a charging and discharging method for a vehicle and a charging pile, comprising the following steps:

[0215] Step 1: A vehicle and a charging pile are connected by using a safe connection method between a vehicle and a charging pile as described in Example 1;

[0216] Step 2: During off-peak hours, the charging pile charges the connected vehicle battery through the charging gun; during peak hours, the vehicle battery discharges and releases the stored electrical energy back to the grid through the connected charging pile.

[0217] The charging and discharging method of a vehicle and a charging pile of the present invention can avoid the risk of vehicle data being stolen during the charging and discharging process, protect the privacy of the owner and the safety of the vehicle, and greatly promote the popularization of electric vehicles. For the power grid, it can avoid malicious vehicles from interfering with the power grid by invading the charging pile during the charging and discharging process, so that the vehicle can be safely charged and discharged with the charging pile.

[0218] Example 3

[0219] The present invention also provides a charging and discharging system for a vehicle and a charging pile, such as Figure 2 As shown, the dotted line represents wireless communication, and the solid line represents wired communication, including: vehicles, cloud platforms and charging piles,

[0220] The cloud platform stores the registration information of the vehicle and the charging pile, receives messages sent by the vehicle and the charging pile, or sends messages to the vehicle and the charging pile; the charging pile sends messages to the vehicle through the charging gun; the vehicle establishes a connection with the charging pile through the charging gun to charge and discharge; each charging pile, vehicle, and cloud platform are programmed or equipped to execute a charging and discharging method for a vehicle and a charging pile as described in Example 2.

[0221] The technology, shape, and structure parts not described in detail in the present invention are all well-known technologies. It should also be pointed out that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. The components or steps in the embodiments of the present invention can be decomposed and / or recombined, and these decompositions and / or recombinations should be regarded as equivalent solutions of the present application and should fall within the protection scope of the present invention.

Claims

1. A method for safely connecting a vehicle to a charging pile, characterized in that: The following steps are involved: Three-party verification phase II: The cloud platform TSP generates a second authentication request A4 and sends it to the vehicle V. A4 contains the second authentication data DB: DB=H(SLOT(t 10 )||TX´||QRNG1); QRNG1 represents the first random number generated by the quantum random number generator in the cloud platform TSP, H(·) represents the hash calculation using the hash function, || is a connector, and the cloud platform TSP records the time when the first re-authentication request A3 is received as the tenth timestamp t 10 , SLOT(t 10 ) indicates that 10 The corresponding time gap, all the moments within a period of time Ta~Tb belong to the time gap [Ta, Tb); In the three-party verification phase I, the vehicle V generates the first identity authentication request A3 and sends it to the cloud platform TSP. After the cloud platform TSP successfully verifies the integrity of A3, the corresponding charging pile generates a receipt TX, and the cloud platform TSP records the received receipt copy as TX´; After the vehicle V successfully verifies the integrity of A4, the vehicle V generates a feedback message M3 based on DB and sends it to the cloud platform TSP. After the cloud platform TSP successfully verifies the integrity of M3, it randomly extracts a quantum key from the authentication key package P as the verification key K. G , generate charging pile verification message M4 and send it to the charging pile pseudonym FID CX In the corresponding charging pile CX: M4={Q3,Q4,W,t 13 ,KN G }, Q3=H(K CX )⊕DFID CX , Q4=K G [DB]⊕DFID CX ,DFID CX =FID CX ⊕QRNG1; where t 13 represents the thirteenth timestamp, ⊕ is the XOR operator, t 13 is the time when M4 is generated, Q3 represents the third check code, Q4 represents the fourth check code, DFID CX Indicates the dynamic pseudonym of the charging pile CX, K CX For cloud platform TSP, use the pseudonym FID of charging pile CX The charging pile key extracted from the corresponding registration information, KN G Indicates the authentication key package P and the verification key K G The key identifier of the binding, K G [·] indicates the use of the verification key K G Symmetric encryption is performed; after the charging pile CX is registered at the cloud platform TSP, it stores a copy of the charging pile key K CX ´、Charging pile key identifier copy KN CX ´ and charging pile pseudonym copy FID CX ´; The charging pile CX records the time of receiving M4 as the fourteenth timestamp t 14 , get the value with t 14 The corresponding time gap SLOT(t 14 ), and then extract the third check code copy Q3', the fourth check code copy Q4', and the key identifier copy KN from M4 G 'After that, calculate the first copy DFID of the dynamic pseudonym of the charging pile CX CX =H(K CX ´)⊕Q3´, the charging pile CX is then calculated based on KN G ´Get the charging pile pseudonym copy FID CX ´, and obtain the verification key copy K from the authentication key package P G 'After that, calculate the ciphertext copy K G [DB]´=Q4´⊕DFID CX ´ and the first random number copy QRNG1´ = FID CX ´⊕DFID CX ´, charging pile CX then uses K G Symmetric decryption K G [DB]' and then obtain the second authentication data copy DB'. If the charging pile CX calculation exists DB'=H(SLOT(t 14 )||TX||QRNG1´), then the time integrity verification of DB´ passes, that is, DB´=DB.

2. A method for safely connecting a vehicle to a charging pile according to claim 1, characterized in that: S1, each vehicle and charging pile is registered on the cloud platform; S2: When the charging gun of the charging pile is inserted into the vehicle, the vehicle initiates a three-party verification between the cloud platform and the charging pile. If the three-party verification is successful, the charging pile establishes a connection with the vehicle through the charging gun. If the three-party verification fails, the vehicle exits the charging gun. S2 also includes the following sub-steps: S21, the charging gun of the charging pile is inserted into the vehicle; S22, the vehicle initiates three-party authentication phase I: the cloud platform authenticates the vehicle; S23, after the three-party verification phase I is verified, the cloud platform initiates the three-party verification phase II: the vehicle and the charging pile perform two-way identity authentication through the cloud platform. After the two-way identity authentication is successful, the three-party verification is successful, and the charging pile establishes a connection with the vehicle through the charging gun; if the three-party verification fails, the vehicle exits the charging gun.

3. A method for safely connecting a vehicle to a charging pile according to claim 2, characterized in that: In S1: before S1, the following steps are also included: S01, the cloud platform TSP is filled with a hash function H and an authentication key package P, and the authentication key package P contains several pairs of quantum keys and key identifiers bound together; S02, when vehicles and charging piles are manufactured, the manufacturer injects the hash function H and the authentication key package P into each vehicle and charging pile.

4. A method for safely connecting a vehicle to a charging pile according to claim 3, characterized in that: In S1: The vehicle is registered at the cloud platform via wireless communication, and further includes sub-steps S11a to S13a: S11a, vehicle V generates a first registration request A1 and sends it to the cloud platform TSP: A1={req(A1),N V ,t1},N V =H(ID V ); Where req(·) is the information type identifier, ID V represents the identification code of vehicle V, H(·) represents the hash calculation using a hash function, t1 is the first timestamp, and the time when vehicle V generates the first registration request A1 is recorded as the first timestamp t1, N V Indicates the vehicle V code; S12a, the cloud platform TSP records the time when the first registration request A1 is received as the second timestamp t2, and extracts the first timestamp t1 and the vehicle V code N from the first registration request A1. V , if t2-t1≤△T1 and the vehicle V code N does not exist in the cloud platform TSP V , △T1 represents the first time threshold, then the cloud platform TSP determines that the vehicle V is an unregistered vehicle, and the cloud platform TSP randomly extracts a quantum key from the authentication key package P stored in itself and records it as the vehicle-side key K of the current vehicle V V After that, a first registration feedback message M1 is generated and sent to the vehicle V: FID V =H(N V ||KN V ),MR M1 =FID V ⊕K V ,M1={req(M1),MR M1 ,KN V ,t3}; Among them, || is a connector, ⊕ is an XOR operator, KN V Indicates the current vehicle-side key K V Binding key identifier, FID V V pseudonym for vehicle, MR M1 is the first verification code, t3 is the third timestamp, and the cloud platform TSP records the time when the first registration feedback message M1 is generated as the third timestamp t3; At the same time, the cloud platform TSP will encode the vehicle V V 、Vehicle V pseudonym FID V 、Car-side key K V and K V The key identifier KN of the binding V Bind to vehicle V registration information for storage; If t2-t1>△T1 or the vehicle V code N is stored in the cloud platform TSP V , then the cloud platform TSP discards the current first registration request A1; S13a, the vehicle V records the time when the first registration feedback message M1 is received as the fourth timestamp t4, and extracts the third timestamp copy t3´ and the first verification code copy MR from the first registration feedback message M1. M1 ´ and the first copy of the vehicle-side key identifier KN V ´, if t4-t3´≤△T2, △T2 represents the second time threshold, then the vehicle V is based on the first copy of the vehicle-side key identifier KN V ´Extract the first copy of the corresponding vehicle-side key K V ', then calculate the first copy of the vehicle pseudonym FID V =MR M1 ´⊕K V 'After that, the first copy of the vehicle key K V ´、The first copy of the vehicle-side key identifier KN V ´ and vehicle pseudonym first copy FID V ´Store; The charging pile is registered at the cloud platform TSP through wireless communication, and also includes sub-steps S11b~S13b: S11b, the charging pile CS generates a second registration request A2 and sends it to the cloud platform TSP: A2={req(A2),N CS ,t5},N CS =H(ID CS ); Among them, ID CS represents the identification code of the charging pile CS, t5 is the fifth timestamp, and the charging pile CS records the time when the second registration request A2 is generated as the fifth timestamp t5, N CS Indicates the charging pile CS code; S12b, the cloud platform TSP records the time of receiving the second registration request A2 as the sixth timestamp t6, and extracts the fifth timestamp t5 and the charging pile CS code N from the second registration request A2. CS , if t6-t5≤△T3 and the charging pile CS code N does not exist in the cloud platform TSP CS , △T3 represents the third time threshold, then the cloud platform TSP determines that the charging pile CS is an unregistered charging pile, and the cloud platform TSP randomly extracts a quantum key from the authentication key package P stored in itself and records it as the charging pile key K of the current charging pile CS After that, a second registration feedback message M2 is generated and sent to the charging pile CS: FID CS =H(N CS ||KN CS ),MR M2 =FID CS ⊕K CS ,M2={req(M2),MR M2 ,KN CS ,t7}; Among them, KN CS Indicates the key K of the current charging pile CS Binding key identifier, FID CS CS pseudonym for charging pile, MR M2 is the second verification code, t7 is the seventh timestamp, and the cloud platform TSP records the time when the second registration feedback message M2 is generated as the seventh timestamp t7; At the same time, the cloud platform TSP will encode the charging pile CS N CS 、Charging pile CS pseudonym FID CS 、Charging pile key K CS and K CS The key identifier KN of the binding V Bind together to form the charging pile CS registration information for storage; If t6-t5>△T3 or the charging pile CS code N is stored in the cloud platform TSP CS , then the cloud platform TSP discards the current second registration request A2; S13b, the charging pile CS records the time when the second registration feedback message M2 is received as the eighth timestamp t8, and extracts the seventh timestamp copy t7´ and the second verification code copy MR from the second registration feedback message M2. M2 ´And a copy of the charging pile key identifier KN CS ´, if t8-t7´≤△T4, △T4 represents the fourth time threshold, the charging pile CS is based on the copy of the charging pile key identifier KN CS ´Extract the corresponding charging pile key copy K CS ', and then calculate the charging pile pseudonym copy FID CS =MR M2 ´⊕K CS ´After that, the charging pile key copy K CS ´、Charging pile key identifier copy KN CS ´ and charging pile pseudonym copy FID CS ´For storage.

5. A method for safely connecting a vehicle to a charging pile according to claim 4, characterized in that: In S21: When the charging gun of the charging pile CS is inserted into the vehicle V, the charging pile CS sends the charging pile pseudonym copy FID to the vehicle V through the charging gun. CS ´; In S22, the following sub-steps are also included: S221, vehicle V initiates three-party authentication phase I: vehicle V generates the first identity authentication request A3 and sends it to the cloud platform TSP: A3={req(A3),Q1,t9,KN V ´,C1},C1=H(Q1||t9||KN V ´), <h2 style=";text-align:left;direction:ltr">Q1=H(K<h2 style=";text-align:left;direction:ltr"> V <h2 style=";text-align:left;direction:ltr"> ´)⊕DFID<h2 style=";text-align:left;direction:ltr"> V <h2 style=";text-align:left;direction:ltr"> DFID<h2 style=";text-align:left;direction:ltr"> V <h2 style=";text-align:left;direction:ltr"> =(FID<h2 style=";text-align:left;direction:ltr"> V <h2 style=";text-align:left;direction:ltr"> FID<h2 style=";text-align:left;direction:ltr"> CS <h2 style=";text-align:left;direction:ltr"> ´)⊕SLOT(t9); Wherein, t9 represents the ninth timestamp, which is the time when the first identity authentication request A3 is generated, Q1 represents the first verification code, C1 represents the first complete code, DFID V represents the dynamic pseudonym of the vehicle V, SLOT(t9) represents the time slot corresponding to the ninth timestamp t9; S222, the cloud platform TSP records the time when the first identity authentication request A3 is received as the tenth timestamp t 10 , get the tenth timestamp t 10 The corresponding time gap SLOT(t 10 ), and extract the ninth timestamp copy t9´ from the first authentication request A3. If t 10 -t9´≤△T5, △T5 represents the fifth time threshold, then the cloud platform TSP extracts the first verification code copy Q1´ and the second copy of the vehicle-side key identifier KN from the first identity authentication request A3 V ´´ and the first complete code copy C1´, calculate the second complete code C2 = H(Q1´||t9´||KN V ´´), if C2=C1´, then the cloud platform TSP successfully verifies the integrity of the first identity authentication request A3, that is, t9=t9´ and Q1=Q1´ and C1=C1´=C2 and KN V ´´=KN V ´; After the cloud platform TSP successfully verifies the integrity of the first identity authentication request A3, it extracts the first copy KN of the vehicle-side key identifier from the authentication key package P. V ´The first copy of the bound vehicle key K V ´, calculate the dynamic pseudonym DFID of vehicle V V =H(K V ´)⊕Q1, and then calculate (FID V ´||FID CS ´)´=DFID V ⊕SLOT(t 10 ) and then (FID V ´||FID CS ´)´ Extract the second copy of the vehicle pseudonym FID V ´´ and charging pile pseudonym FID CX If the vehicle pseudonym second copy FID exists in the registration information of the cloud platform TSP V ´´ and charging pile pseudonym FID CX , and the second copy of the vehicle pseudonym FID V ´´The corresponding registration information contains the first copy of the vehicle-side key identifier KN V ´, then the cloud platform TSP obtains the second copy of the vehicle pseudonym FID V Extract the first copy N of the vehicle V code from the corresponding registration information V ´And sent directly to the charging pile pseudonym FID in plain text CX In the corresponding charging pile, the corresponding charging pile receives the second copy N of the vehicle V code V ´´After that, a receipt TX is generated and sent to the cloud platform TSP. The cloud platform TSP receives a copy of the receipt TX´. At this time, the cloud platform TSP passes the identity authentication of the vehicle V, that is, the three-party authentication phase I verification is passed; If 10 -t9´>△T5, or the cloud platform TSP fails to verify the integrity of the first identity authentication request A3, or the second copy of the vehicle pseudonym FID does not exist in the registration information in the cloud platform TSP V ´´ and / or charging station pseudonym FID CX , or a second copy of the vehicle's pseudonym FID V ´´The first copy of the vehicle-side key identifier KN does not exist in the corresponding registration information V ´, or the cloud platform TSP fails to authenticate the vehicle V, it is recorded as the failure of the three-party authentication phase I. At this time, the cloud platform TSP discards the current first-level authentication request A3.

6. A method for safely connecting a vehicle to a charging pile according to claim 5, characterized in that: In S23, the following sub-steps are also included: S231, after the three-party verification phase I is verified, the cloud platform TSP initiates the three-party verification phase II: the cloud platform TSP randomly extracts a quantum key from the authentication key package P as the preset key K H , generate a second authentication request A4 and send it to the vehicle V: A4={req(A4),Q2,t 11 ,KN H ,C3},C3=H(Q2||t 11 ||KN H ),Q2=K H [DB]⊕DFID V ; Among them, t 11 Indicates the eleventh timestamp, the eleventh timestamp t 11 The moment when the second authentication request A4 is generated, Q2 represents the second verification code, C3 represents the third complete code, KN H Indicates the authentication key package P and the preset key K H The key identifier of the binding, K H [·] indicates using the preset key K H Perform symmetric encryption; S232, the vehicle V records the time when the second identity authentication request A4 is received as the twelfth timestamp t 12 , and extract the eleventh timestamp copy t from the second authentication request A4 11 ´, if t 12 -t 11 ´≤△T6, △T6 represents the sixth time threshold, then the vehicle V extracts the second verification code copy Q2´ and the key identifier copy KN from the second identity authentication request A4 H ´ and the third complete code copy C3´, calculate the fourth complete code C4 = H(Q2´||t 11 ´||KN H ´), if C4=C3´, then the integrity check of the second identity authentication request A4 by vehicle V is successful, that is, t 11 =t 11 ´ and Q2=Q2´ and C3=C3´=C4 and KN H =KN H ; After the vehicle V successfully verifies the integrity of the second identity authentication request A4, it first calculates K H [DB]=Q2⊕DFID V , and then extract the key identifier KN from the authentication key package P H Bound preset key K H To symmetric decrypt K H After obtaining the second authentication data DB, the vehicle V generates a feedback message M3 based on the second authentication data DB and sends it to the cloud platform TSP: M3={W,C5},W=N V ⊕DB,C5=H(W||DB); Wherein, W represents the verification body, and C5 represents the fifth complete code; If 12 -t 11 ´>△T6, or the vehicle V fails to verify the integrity of the second identity authentication request A4, which is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the vehicle V discards the current second identity authentication request A4; S233, after the cloud platform TSP obtains the first copy W' of the verification body and the fifth complete code copy C5' from the feedback message M3, it calculates the sixth complete code C6=H(W'||DB). If C6=C5', the cloud platform TSP successfully verifies the integrity of the feedback message M3, that is, W=W' and C5=C5'=C6; After the cloud platform TSP successfully verifies the integrity of the feedback message M3, it randomly extracts a quantum key from the authentication key package P as the verification key K G , generate charging pile verification message M4 and send it to the charging pile pseudonym FID CX In the corresponding charging pile CX, if the cloud platform TSP fails to verify the integrity of the feedback message M3, it is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the cloud platform TSP discards the current feedback message M3; S234, the charging pile CX extracts the thirteenth timestamp copy t from the charging pile verification message M4 13 ´, if t 14 -t 13 ´≤△T7, △T7 represents the seventh time threshold, then the charging pile CX extracts the second copy of the verification body W´´ from the charging pile verification message M4, and then performs time integrity verification on the second authentication data copy DB´ in the charging pile verification message M4. If the time integrity verification of the second authentication data copy DB´ passes, DB´=DB, if DB´≠H(SLOT(t 14 )||TX||QRNG1´), the time integrity verification of the second authentication data copy DB´ fails; After the time integrity verification of the second authentication data copy DB' is passed, if the charging pile CX calculation has N V =W ''⊕ DB, then the charging pile CX successfully verifies the charging pile verification message M4, that is, N V ´´=N V ´, if N V ´´≠W´´⊕DB, then the charging pile CX fails to verify the charging pile verification message M4; If 14 -t 13 ´>△T7, or the time integrity verification of the second authentication data copy DB´ fails, or the charging pile CX fails to verify the charging pile verification message M4, which is recorded as a failure of the two-way identity authentication between the vehicle V and the charging pile. At this time, the charging pile CX discards the current charging pile verification message M4.

7. A method for safely connecting a vehicle to a charging pile according to claim 6, characterized in that: If the charging pile CX is the same as the charging pile CS, then S234 includes S235~S236: S235, after the charging pile CS successfully verifies the charging pile verification message M4, it generates a confirmation message M5 and sends it to the vehicle V through the charging gun: M5={req(M5),SD}, SD=H(DB||N V ´), where SD represents the confirmatory body; S236, vehicle V extracts the first copy SD' of the confirmation body from the confirmation message M5, and uses the vehicle V code N V To calculate the second copy of the confirmation body SD´´=H(DB||N V ), if SD´=SD´´, then the two-way identity authentication between vehicle V and charging pile is successful, that is, the three-party authentication phase II is verified. At this time, the three-party authentication is successful, and the charging pile CS establishes a connection with vehicle V through the charging gun; If SD´≠SD´´, the three-party verification phase II verification fails. At this time, the three-party verification fails and the vehicle V exits the charging gun of the charging pile CS; If the charging pile CX is not the charging pile CS, the confirmation message M5 generated by the charging pile CX cannot be sent to the vehicle V through the charging gun, the three-party verification phase II cannot be verified, the three-party verification cannot be successful, and the vehicle V cannot establish a connection with the charging pile CS.

8. A method for safely connecting a vehicle to a charging pile according to claim 2, characterized in that: S2 also includes S3: In S3, when the vehicle is disconnected from the charging pile, the vehicle exits the charging gun; when the vehicle is about to establish a connection with the charging pile again, it returns to S2.

9. A method for charging and discharging a vehicle and a charging pile, characterized in that: The following steps are involved: Step 1: A connection is established between the vehicle and the charging pile using a safe connection method between a vehicle and a charging pile as described in any one of claims 1 to 8; Step 2: During the off-peak period, the charging pile charges the connected vehicle battery through the charging gun; During peak electricity consumption periods, the vehicle battery is discharged and the stored energy is released back to the grid through the connected charging station.

10. A charging and discharging system for a vehicle and a charging pile, characterized in that: include: Vehicle, cloud platform and charging pile, the cloud platform stores the registration information of the vehicle and the charging pile, receives messages sent by the vehicle and the charging pile, or sends messages to the vehicle and the charging pile; the charging pile sends messages to the vehicle through the charging gun; the vehicle establishes a connection with the charging pile through the charging gun to charge and discharge; each charging pile, vehicle, and cloud platform is programmed or equipped to execute a charging and discharging method for a vehicle and a charging pile as described in claim 9.

Citation Information

Patent Citations

  • Lightweight anonymous authentication system and method for vehicles in V2G network based on multiple servers

    CN110519726A

  • Vehicle charging method, device and equipment and storage medium

    CN116766968A