Vehicle charging method and device, computer device and storage medium

By employing asymmetric and symmetric encryption mechanisms in the plug-and-charge technology to generate digital signatures and message authentication codes, the security risks of vehicle identification code transmission are resolved, ensuring the security and integrity of data transmission and improving the user experience.

CN122372209APending Publication Date: 2026-07-10CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-24
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

The transmission of vehicle identification codes in plug-and-charge technology poses a security risk, as they can be easily tampered with by attackers, leading to user account theft and trust risks.

Method used

Asymmetric and symmetric encryption mechanisms are used between the vehicle and the cloud, and digital signatures and message authentication codes are generated using private keys to ensure the security and integrity of data transmission.

Benefits of technology

This improves the security of vehicle identification code transmission, prevents tampering, and enhances the security of the charging authentication process and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122372209A_ABST
    Figure CN122372209A_ABST
Patent Text Reader

Abstract

This application discloses a vehicle charging method, apparatus, computer equipment, and storage medium, relating to the field of vehicle technology, to address the security risks associated with the transmission of vehicle identification codes in plug-and-charge technology. The method is applicable to the target vehicle and includes: in response to receiving an authentication request from a charging pile, obtaining the original data required for authentication; if a public key certificate is stored locally, signing the original data using a private key to obtain a digital signature; generating first authentication data based on the public key certificate, digital signature, and original data; and transmitting the first authentication data transparently to the cloud via the charging pile, so that the cloud sends a charging start command to the charging pile after successful authentication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, and in particular to a vehicle charging method, apparatus, computer equipment, and storage medium. Background Technology

[0002] In the field of new energy vehicle technology, to improve charging convenience, the industry has seen the emergence of "plug-and-charge" functionality. Users can automatically charge their vehicles after binding with a charging operator, eliminating the need for additional steps such as scanning codes or swiping cards. However, the practical application of this function still faces significant challenges.

[0003] The implementation of "plug-and-charge" functionality typically involves physically locking the charging station immediately after the user plugs it in. The charging station then obtains the vehicle's Vehicle Identification Number (VIN) and uploads it to the cloud for account authentication. However, the VIN is usually transmitted in plaintext or with weak encryption, making it easy for attackers to intercept and tamper with. The cloud cannot verify whether the VIN has been altered upon receipt, leading to security issues such as account theft and misuse, resulting in financial losses and trust risks for both users and operators. Summary of the Invention

[0004] Based on this, a vehicle charging method, device, computer equipment, and storage medium are provided to solve the security risks associated with the transmission of vehicle identification codes in plug-and-charge technology.

[0005] Firstly, this application provides a vehicle charging method applicable to a target vehicle, the method comprising: In response to receiving an authentication request from a charging pile, the system obtains the raw data required for authentication; wherein the raw data includes the vehicle identification code and a random number of the target vehicle. If a public key certificate is stored locally, the original data is signed using the private key to obtain a digital signature; First authentication data is generated based on the public key certificate, the digital signature, and the original data; The first authentication data is transmitted to the cloud through the charging pile, so that the cloud sends a start charging command to the charging pile after authentication is successful, wherein the start charging command instructs the charging pile to perform lock-on charging.

[0006] Optionally, the method further includes: if no public key certificate is available locally, generating a public key based on the private key; generating a certificate signing request based on the public key and the vehicle information of the target vehicle; calculating the original data and the certificate signing request using a symmetric key to obtain a first authentication code corresponding to the original data and a second authentication code corresponding to the certificate signing request; generating second authentication data based on the first authentication code, the original data, the second authentication code, and the certificate signing request; transmitting the second authentication data to the cloud via the charging pile, so that the cloud sends the start charging command to the charging pile and transmits the received public key certificate to the target vehicle via the charging pile after authentication is successful; and saving the public key certificate to local storage in response to receiving the public key certificate.

[0007] Optionally, the step of using a symmetric key to calculate the original data and the certificate signing request to obtain a first authentication code corresponding to the original data and a second authentication code corresponding to the certificate signing request includes: performing hash operations on the original data and the certificate signing request to obtain a first hash value corresponding to the original data and a second hash value corresponding to the certificate signing request; and using the symmetric key to calculate the first hash value and the second hash value based on a message authentication code algorithm to obtain the first authentication code corresponding to the first hash value and the second authentication code corresponding to the second hash value.

[0008] Secondly, this application provides a vehicle charging method, applicable to the cloud, the method comprising: In response to receiving the first authentication data sent by the charging pile, the system obtains the public key certificate, the original data, and the digital signature from the first authentication data; wherein, the first authentication data includes the public key certificate. After confirming that the public key certificate is a valid certificate, the digital signature is verified using the public key corresponding to the public key certificate to obtain verification data; If the verification data and the original data meet the matching requirements, then the original data is subjected to compliance verification. If the original data passes the compliance verification, a charging start command is sent to the charging pile; wherein the charging start command instructs the charging pile to perform gun locking charging.

[0009] Optionally, the verification data includes a first hash value, and the step of performing compliance verification on the original data if the verification data and the original data meet the matching requirements includes: performing a hash operation on the original data to obtain a second hash value; and performing compliance verification on the original data if the first hash value is equal to the second hash value.

[0010] Optionally, the method further includes: in response to receiving second authentication data sent by the charging pile, obtaining the original data, certificate signing request, first authentication code corresponding to the original data, and second authentication code corresponding to the certificate signing request from the second authentication data, and extracting the vehicle identification code from the original data; initiating an authentication code verification request to the key management system based on the original data, the certificate signing request, and the vehicle identification code to obtain a third authentication code and a fourth authentication code; wherein the third authentication code is generated based on the symmetric key corresponding to the vehicle identification code and the original data, and the fourth authentication code is generated based on the symmetric key and the certificate signing request; if the first authentication code is equal to the third authentication code, the second authentication code is equal to the fourth authentication code, and the original data passes the compliance verification, sending the certificate signing request to the public key infrastructure system to obtain a public key certificate; and in response to receiving the public key certificate, sending the public key certificate and the start charging command to the charging pile.

[0011] Thirdly, this application provides a vehicle charging device, installed in a target vehicle, the device comprising: The acquisition module is used to acquire the raw data required for authentication in response to receiving an authentication request sent by the charging pile; wherein, the raw data includes the vehicle identification code and random number of the target vehicle; The signature module is used to sign the original data using a private key if a public key certificate is stored locally, thereby obtaining a digital signature; The generation module is used to generate first authentication data based on the public key certificate, the digital signature, and the original data; The sending module is used to transmit the first authentication data to the cloud through the charging pile, so that the cloud sends a start charging command to the charging pile after authentication is passed, wherein the start charging command instructs the charging pile to perform lock-on charging.

[0012] Optionally, the device is further configured to: generate a public key based on the private key if no public key certificate is available locally; generate a certificate signing request based on the public key and the vehicle information of the target vehicle; calculate the original data and the certificate signing request using a symmetric key to obtain a first authentication code corresponding to the original data and a second authentication code corresponding to the certificate signing request; generate second authentication data based on the first authentication code, the original data, the second authentication code, and the certificate signing request; transmit the second authentication data to the cloud through the charging pile, so that the cloud sends the start charging command to the charging pile and transmits the received public key certificate to the target vehicle through the charging pile after authentication is successful; and save the public key certificate to local storage in response to receiving the public key certificate.

[0013] Optionally, the apparatus is further configured to perform hash operations on the original data and the certificate signing request respectively to obtain a first hash value corresponding to the original data and a second hash value corresponding to the certificate signing request; and to calculate the first hash value and the second hash value using the symmetric key based on the message authentication code algorithm to obtain a first authentication code corresponding to the first hash value and a second authentication code corresponding to the second hash value.

[0014] Fourthly, this application provides a vehicle charging device located in the cloud, the device comprising: The acquisition module is used to, in response to receiving the first authentication data sent by the charging pile, acquire the public key certificate, the original data, and the digital signature from the first authentication data; wherein, the first authentication data includes the public key certificate; The verification module is used to verify the digital signature using the public key corresponding to the public key certificate after determining that the public key certificate is a valid certificate, and to obtain verification data; wherein, the public key and the local key of the target vehicle are a public-private key pair; The verification module is used to perform compliance verification on the original data if the verification data and the original data meet the matching requirements. The sending module is used to send a start charging command to the charging pile when the original data passes the compliance verification; wherein the start charging command instructs the charging pile to perform gun locking charging.

[0015] Optionally, the verification data includes a first hash value, and the verification module is further configured to perform a hash operation on the original data to obtain a second hash value; if the first hash value is equal to the second hash value, then the original data is subjected to compliance verification.

[0016] Optionally, the device is further configured to, in response to receiving second authentication data sent by the charging pile, obtain the original data, certificate signing request, first authentication code corresponding to the original data, and second authentication code corresponding to the certificate signing request from the second authentication data, and extract the vehicle identification code from the original data; initiate an authentication code verification request to the key management system according to the original data, the certificate signing request, and the vehicle identification code to obtain a third authentication code and a fourth authentication code; wherein the third authentication code is generated according to the symmetric key corresponding to the vehicle identification code and the original data, and the fourth authentication code is generated according to the symmetric key and the certificate signing request; if the first authentication code is equal to the third authentication code, the second authentication code is equal to the fourth authentication code, and the original data passes the compliance verification, send the certificate signing request to the public key infrastructure system to obtain a public key certificate; and in response to receiving the public key certificate, send the public key certificate and the start charging command to the charging pile.

[0017] Fifthly, this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vehicle charging method of the first or second aspect described above.

[0018] Sixthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the vehicle charging methods of the first and second aspects described above.

[0019] The aforementioned vehicle charging method, device, computer equipment, and storage medium, when a local public key certificate is available, perform asymmetric encryption on the original data containing the vehicle identification code and a random number, i.e., generate a digital signature using a private key. Then, the original data, public key certificate, and digital signature are used together to construct authentication data (i.e., transmission data). This method ensures that the receiving end can effectively identify whether the transmission data has been attacked by adding a random number to the transmission data, and ensures the credibility of the source and integrity of the data received by the receiving end by adding a digital signature to the original data, thus improving the security of vehicle identification code transmission in the charging authentication process. Attached Figure Description

[0020] Figure 1 One of the steps performed by the target vehicle in the vehicle charging method provided in this application embodiment; Figure 2 The second flowchart of the steps performed by the target vehicle in the vehicle charging method provided in the embodiments of this application; Figure 3The third step in the vehicle charging method provided in this application embodiment is the flowchart of the steps performed by the target vehicle. Figure 4 This is one of the flowcharts showing the steps executed in the cloud in the vehicle charging method provided in the embodiments of this application; Figure 5 The second flowchart of the steps executed in the cloud in the vehicle charging method provided in the embodiments of this application; Figure 6 The third step in the cloud-executed process of the vehicle charging method provided in this application embodiment; Figure 7 A structural block diagram of a vehicle charging device installed in a target vehicle, provided in an embodiment of this application; Figure 8 A structural block diagram of a vehicle charging device installed in the cloud, provided in an embodiment of this application; Figure 9 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The specific operational methods in the method embodiments can also be applied to the device embodiments or system embodiments. It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing together, or B existing alone. A connected to B can represent: A and B directly connected, or A and B connected through C. Furthermore, in the description of this application, terms such as "first" and "second" are used only for distinguishing the purpose of description and should not be construed as indicating or implying relative importance or order.

[0022] To facilitate understanding by those skilled in the art, the technical terms used in this application will first be explained.

[0023] A public key certificate is the foundation of a Public Key Infrastructure (PKI) system. It is a digitally signed file containing information about the public key (key) owner and the public key itself. The public key certificate includes information about the certificate applicant and the issuing certificate authority.

[0024] In this application, the acquisition, transmission, storage, and use of data all comply with the requirements of relevant national laws and regulations.

[0025] Before introducing the vehicle charging method provided in this application, the technical background of this application will be described in detail below for ease of understanding.

[0026] In the electric vehicle sector, to improve charging convenience, the "plug-and-charge" function has emerged, allowing users to automatically charge after plugging in their charging station once they are linked to a charging operator. However, the practical application of this function still faces significant problems: First, related implementations typically physically lock the charging station immediately after the user plugs it in, and then the charging station obtains the vehicle's VIN code and uploads it to the cloud for account authentication. If authentication fails (e.g., insufficient balance, vehicle not linked), the user will be stuck in a "cannot charge, cannot unplug" predicament, forced to wait on the spot or manually scan the code, resulting in a redundant process and poor user experience. Second, the transmission of the vehicle's VIN code in related implementations lacks sufficient security. Vehicle VIN codes are often communicated in plaintext or weak encryption, allowing attackers to easily intercept and tamper with VIN information, leading to security issues such as user account theft and misuse, causing economic losses and trust risks for both users and operators. Therefore, the related plug-and-charge technology suffers from process redundancy and security risks, urgently requiring a safer solution with a smoother user experience.

[0027] In view of this, this application provides a vehicle charging method, apparatus, computer equipment, and storage medium to solve the above problems.

[0028] The technical solution provided in this application will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] Figure 1 This is one of the flowcharts illustrating the steps performed by the target vehicle in the vehicle charging method provided in this application embodiment. This process can be executed by a vehicle charging device installed in the target vehicle. This device can be implemented in software, hardware, or a combination of both. Figure 1 As shown, the process includes the following steps: S101, in response to receiving an authentication request sent by the charging pile, obtain the raw data required for authentication.

[0030] When a user inserts the charging gun of a charging station into the charging port of a target vehicle, and the target vehicle establishes a charging connection with the charging station, the charging station initiates an authentication request to the target vehicle. After receiving the authentication request, the target vehicle obtains the raw data required for authentication.

[0031] In some embodiments, the raw data includes, but is not limited to, the target vehicle's Vehicle Identification Number (VIN), Time Stamp (TS), State of Charge (SOC), and Random Data (RD). The raw data is a string concatenated from the VIN, TS, SOC, and RD. Adding a random number to the raw data facilitates subsequent cloud authentication by verifying the random number to identify whether the authentication data has been altered or attacked, thus improving security.

[0032] S102, if a public key certificate is stored locally, the original data is signed using the private key to obtain a digital signature.

[0033] In some embodiments, when the target vehicle leaves the factory, its security chip has an initial key pre-installed with the vehicle's unique identification code (VIN), such as the 2701 key. This initial key can be used as a private key, or a private key-public key pair can be generated based on the initial key.

[0034] If the target vehicle has a public key certificate stored locally, the original data is processed using asymmetric encryption. The asymmetric encryption method involves signing the original data with the private key to obtain a digital signature. In one implementation, the original data is hashed to obtain a hash value, and then the hash value is signed with the private key to obtain a digital signature of the hash value.

[0035] By processing the original data using a hash algorithm, a unique and dynamic hash value can be generated, thereby ensuring the real-time nature and integrity of the original data. During subsequent transmission, any slight alteration to the original data will cause a significant change in the hash value, making data tampering quickly detectable and effectively guaranteeing the security of the original data during transmission.

[0036] By generating a digital signature using a private key based on the hash value, a double layer of security is achieved. The recipient (in this application, the car manufacturer's cloud platform) can decrypt the digital signature using the public key corresponding to the private key to verify the sender's true identity. Furthermore, the decrypted hash value is completely identical to the hash value recalculated by the cloud platform based on the original data, proving that the original data was not modified during transmission. This combination ensures the trustworthiness of the data source and the integrity of the content, achieving the security goals of identity authentication and integrity protection.

[0037] S103, generate the first authentication data based on the public key certificate, digital signature, and original data.

[0038] After generating the digital signature, the public key certificate, digital signature, and original data are concatenated to obtain the first authentication data.

[0039] In some embodiments, after generating the digital signature, the charging pile identifier, such as the charging pile company number, can also be obtained. The public key certificate, digital signature, original data, and charging pile identifier are then concatenated to obtain the first authentication data.

[0040] S104 transmits the first authentication data to the cloud through the charging pile, so that the cloud sends a charging start command to the charging pile after authentication is successful.

[0041] In this embodiment, after receiving the first authentication data sent by the target vehicle, the charging pile does not process the first authentication data in any way, but transmits the first authentication data to the cloud using a transparent transmission method. Upon receiving the first authentication data, the cloud performs authentication, and after successful authentication, sends a start charging command to the charging pile. The start charging command instructs the charging pile to begin charging with the charging gun locked.

[0042] By adopting a transparent transmission method, charging piles do not require integrated security chips or complex encryption / decryption modules, significantly reducing hardware costs. Furthermore, the charging pile does not access the plaintext or key information of authentication data, reducing the risk of key leakage due to attacks on the charging pile itself. Simultaneously, all authentication logic is implemented uniformly in the cloud, which not only enhances the security of key management but also enables the system to flexibly support future new vehicle-to-cloud authentication protocols, strengthening the system's scalability and long-term applicability.

[0043] Figure 2 The second flowchart illustrates the steps performed by the target vehicle in the vehicle charging method provided in this application embodiment. This process can be executed by a vehicle charging device installed in the target vehicle. This device can be implemented in software, hardware, or a combination of both. Figure 2 As shown, the process includes the following steps: S201, in response to receiving an authentication request from the charging pile, obtain the raw data required for authentication.

[0044] The execution process of step S201 is the same as that of step S101 above, and will not be repeated here.

[0045] S202 If there is no public key certificate locally, the symmetric key is used to calculate the original data to obtain the message authentication code.

[0046] In some embodiments, the target vehicle's security chip has an initial key pre-installed at the factory, which is bound to the Vehicle Identification Number (VIN). A symmetric key can be generated based on this initial key. The target vehicle sends the symmetric key to the automaker's cloud via a secure channel beforehand. In the absence of a local public key certificate, symmetric encryption can be used to encrypt the original data.

[0047] Symmetric encryption works by using a symmetric key to calculate a message authentication code from the original data. In one implementation, the original data is first hashed to obtain a hash value. Then, based on a message authentication code algorithm, the hash value of the original data is calculated using the symmetric key to obtain the message authentication code. Message authentication code algorithms include, but are not limited to, the CMAC (Cipher-based Message Authentication Code) algorithm.

[0048] S203, generate third authentication data based on the message authentication code and the original data.

[0049] In some embodiments, the message authentication code and the original data are concatenated to obtain third authentication data.

[0050] S204 transmits the third authentication data to the cloud through the charging pile, so that the cloud can send a charging start command to the charging pile after the authentication is successful.

[0051] In the absence of a public key certificate on the target vehicle, a symmetric-key-based encryption mechanism is used to protect the original authentication data. This encryption mechanism is simple, fast, and achieves the required security protection with low computational burden, effectively balancing the security and real-time requirements of the authentication process.

[0052] Figure 3 The third step in the flowchart of the vehicle charging method provided in this application embodiment involves the steps performed by the target vehicle. This process can be executed by a vehicle charging device installed in the target vehicle. This device can be implemented in software, hardware, or a combination of both. Figure 3 As shown, the process includes the following steps: S301, in response to receiving an authentication request from the charging pile, obtains the raw data required for authentication.

[0053] The execution process of step S301 is the same as that of step S101 above, and will not be repeated here.

[0054] S302 If there is no public key certificate locally, a public key will be generated based on the private key.

[0055] When there is no local public key certificate and the target vehicle performs charging authentication for the first time, the target vehicle's security chip uses its internal cryptographic engine to generate a public key based on the private key. The private key is securely stored and never exported.

[0056] S303, Generate a certificate signing request based on the public key and the vehicle information of the target vehicle.

[0057] In some embodiments, a Certificate Signing Request (CSR) is generated based on the public key and the vehicle information of the target vehicle. The CSR is a standard document containing information such as the vehicle's public key and VIN, used to request a certificate from a certificate authority, such as a PKI system. In some embodiments, the vehicle information of the target vehicle includes, but is not limited to, the Vehicle Identification Number (VIN), vehicle registration number, vehicle type, and owner identity.

[0058] S304. Using a symmetric key, calculate the original data and the certificate signing request respectively to obtain the first authentication code corresponding to the original data and the second authentication code corresponding to the certificate signing request.

[0059] Since there is no public key certificate locally, meaning the public key is not publicly available, symmetric key encryption is used during the initial charging authentication. In some embodiments, based on a message authentication code algorithm, the symmetric key is used to calculate the first authentication code from the original data; the symmetric key is then used to calculate the second authentication code from the certificate signing request. Message authentication code algorithms include, but are not limited to, the CMAC algorithm.

[0060] In one implementation, the original data is first hashed to obtain a first hash value; then, a message authentication code algorithm is used to calculate the first hash value and the symmetric key to obtain a first authentication code. The certificate signing request is then hashed to obtain a second hash value; finally, a message authentication code algorithm is used to calculate the second hash value and the symmetric key to obtain a second authentication code.

[0061] S305 generates second authentication data based on the first authentication code, the original data, the second authentication code, and the certificate signing request.

[0062] In some embodiments, the first authentication code, the original data, the second authentication code, and the certificate signing request are concatenated to obtain the second authentication data.

[0063] S306 transmits the second authentication data to the cloud via the charging pile, so that the cloud can send a start charging command to the charging pile after authentication is successful, and transmit the received public key certificate to the target vehicle via the charging pile.

[0064] In some embodiments, the second authentication data is uploaded to the cloud for authentication via the charging station. After successful authentication, the cloud sends a certificate signing request to the PKI to apply for a public key certificate. The PKI returns the issued public key certificate to the cloud. Upon receiving the public key certificate, the cloud sends the public key certificate and the charging start command to the charging station. The charging station then transmits the received public key certificate to the target vehicle.

[0065] S307, in response to receiving the public key certificate, saves the public key certificate to the local storage area.

[0066] After receiving the public key certificate, the target vehicle saves the public key certificate to the local secure storage area, and encrypts the original data using the above asymmetric encryption method during the next charging authentication.

[0067] When the target vehicle performs charging authentication for the first time, a Certificate Signature Request (CSR) is embedded in the generated second authentication data, thus combining the identity authentication and certificate application processes into one. After completing identity verification, the cloud can directly apply for a certificate from the PKI, and immediately issue the public key certificate to the target vehicle. Thus, the target vehicle completes identity authentication and certificate acquisition in a single interaction. In subsequent charging authentication, the target vehicle can directly use the private key corresponding to this certificate to perform digital signatures, and the verifier (cloud) uses the issued public key certificate to verify the signature. This method not only achieves seamless establishment of secure trust between the target vehicle and the cloud, and between the target vehicle and the certification authority (PKI), but also significantly improves the security, efficiency, and convenience of subsequent authentication processes due to the use of asymmetric cryptography.

[0068] Figure 4 This is one of the flowcharts illustrating the steps executed in the cloud within the vehicle charging method provided in this application embodiment. This process can be executed by a vehicle charging device located in the cloud. This device can be implemented via software, hardware, or a combination of both. Figure 4 As shown, the process includes the following steps: S401, in response to receiving the first authentication data sent by the charging pile, obtains the public key certificate, original data and digital signature from the first authentication data.

[0069] In some embodiments, the charging pile transmits the first authentication data sent by the target vehicle to the vehicle manufacturer's cloud. The first authentication data includes, but is not limited to, the target vehicle's public key certificate, the original data, and the digital signature corresponding to the original data. The original data includes, but is not limited to, the target vehicle's Vehicle Identification Number (VIN), Timestamp (TS), Battery State of Charge (SOC), and Random Number (RD). The original data is a string concatenated from the VIN, TS, SOC, and RD. The digital signature is calculated based on the target vehicle's private key and the hash value of the original data.

[0070] After receiving the first authentication data, the cloud extracts the public key certificate, the original data, and the VIN.

[0071] S402, after confirming that the public key certificate is a valid certificate, the digital signature is verified using the public key corresponding to the public key certificate to obtain verification data.

[0072] The automaker verifies the public key certificate in the cloud, including but not limited to checking the certificate's validity and trust chain. After confirming the public key certificate is valid, the corresponding public key is obtained; this public key and the target vehicle's private key form a public-private key pair. The digital signature is verified using the public key to obtain verification data. It is then determined whether the verification data matches the original data. If the verification data matches the original data, step S403 is executed.

[0073] In one implementation, the digital signature is decrypted using a public key to obtain a first hash value. The original data is then re-hashd to obtain a second hash value. The first and second hash values ​​are compared. If the first hash value equals the second hash value, it proves that the data has not been modified during transmission, and the verification data meets the matching requirements with the original data. Step S403 is then executed.

[0074] S403 If the verification data and the original data meet the matching requirements, then the original data shall be subject to compliance verification.

[0075] In some embodiments, compliance verification of the raw data includes, but is not limited to: Verify that the timestamp TS is valid. For example, verify whether the time difference between the timestamp in the original data and the current timestamp in the cloud is within a preset range, such as determining whether the time difference is within 5 minutes.

[0076] Verify whether the battery's state of charge (SOC) is reasonable. For example, determine whether the SOC is between 0% and 100%.

[0077] Verify the validity of the Vehicle Identification Number (VIN). For example, determine whether the VIN is stored in the cloud. If the VIN is stored in the cloud, it means that the target vehicle has the plug-and-charge function enabled.

[0078] When all the above verifications pass, the compliance verification is deemed successful, and the following step S404 is executed.

[0079] In some embodiments, when the received first authentication data also includes the charging pile identifier (e.g., charging pile company number 1), the vehicle manufacturer's cloud will initiate an order query request to the Telematics Box (TBOX). The TBOX obtains the current charging information of the target vehicle through the vehicle's internal network and sends the charging information to the vehicle manufacturer's cloud. The charging information includes, but is not limited to, DC charging connection status, charging pile identifier (e.g., charging pile company number 2), and vehicle identification number (VIN2).

[0080] After receiving charging information, the vehicle manufacturer's cloud platform verifies the public key certificate. Once the certificate is confirmed to be valid, it performs compliance checks on the original data and charging information. The compliance check on the original data is the same as described above and will not be repeated here. The compliance check on the charging information includes, but is not limited to: Verify whether the charging pile identifier (e.g., charging pile company number 1) transmitted by the target vehicle to the cloud is consistent with the charging pile identifier (e.g., charging pile company number 2) uploaded to the cloud by the vehicle's internal network.

[0081] Verify whether the Vehicle Identification Code (VIN) transmitted by the target vehicle to the cloud (i.e., VIN1) is consistent with the Vehicle Identification Code (VIN2) uploaded to the cloud from the vehicle's internal network.

[0082] Verify that the DC charging connection is active to ensure that the target vehicle is connected to the charging station.

[0083] By verifying the compliance of charging information, we can ensure that the target vehicle is charging at the charging station and that the order information is correct.

[0084] If both the original data and charging information pass compliance verification, perform the following step S404.

[0085] S404: If the original data passes the compliance verification, a charging start command is sent to the charging pile.

[0086] In some embodiments, the vehicle manufacturer's cloud sends a charging start command to the charging station. The charging start command instructs the charging station to lock the charging gun. In response to receiving the charging start command, the charging station locks the charging gun inserted into the target vehicle's charging port and begins charging the target vehicle.

[0087] By performing asymmetric encryption on the original data at the target vehicle (sender) and corresponding asymmetric decryption on the received data in the cloud (receiver), the security of data transmission is enhanced. Furthermore, the asymmetric encryption, combined with private key signing based on hash processing, provides double protection. The cloud uses the public key corresponding to the private key to decrypt the digital signature, verifying the sender's identity. The fact that the decrypted hash value is identical to the recalculated hash value proves that the data was not modified during transmission. This combination ensures the trustworthiness of the data source and the integrity of the content, achieving the security goals of identity authentication and integrity protection.

[0088] Figure 5 The second flowchart illustrates the steps executed in the cloud within the vehicle charging method provided in this application embodiment. This process can be executed by a vehicle charging device located in the cloud. This device can be implemented through software, hardware, or a combination of both. Figure 5As shown, the process includes the following steps: S501, in response to receiving the third authentication data sent by the charging pile, obtains the original data and message authentication code from the third authentication data, and extracts the vehicle identification code from the original data.

[0089] In some embodiments, the message authentication code is calculated based on the original data and the symmetric key corresponding to the target vehicle. The original data includes, but is not limited to, the vehicle identification number (VIN), timestamp (TS), battery charge state (SOC), and random number (RD) of the target vehicle. The original data is a string concatenated from the VIN, timestamp (TS), battery charge state (SOC), and random number (RD).

[0090] S502 initiates an authentication code request to the key management system based on the raw data and vehicle identification code to obtain the verification authentication code.

[0091] In some embodiments, after obtaining the third authentication data transmitted by the charging pile, the vehicle manufacturer's cloud platform initiates a CMAC verification request to the Key Management Service (KMS) based on the Vehicle Identification Number (VIN) in the third authentication data and the original data. The KMS generates a verification authentication code, which is also a CMAC code, based on the original data and the symmetric key, and returns the verification authentication code to the vehicle manufacturer's cloud platform.

[0092] S503 performs compliance verification on the original data when the message authentication code equals the verification authentication code.

[0093] In some embodiments, the compliance verification of the original data is the same as described above, and will not be repeated here. If it is determined that the original data passes the compliance verification, the following step S504 is performed.

[0094] S504 sends a charging start command to the charging pile after the original data passes compliance verification.

[0095] By performing symmetric encryption on the original data at the target vehicle end (sender) and corresponding symmetric decryption on the received data at the cloud end (receiver), the security of data transmission is improved. Furthermore, this encryption mechanism is simple to implement and fast to operate, achieving the required security protection with a low computational burden, and effectively balancing the security and real-time requirements of the authentication process.

[0096] Figure 6 This is one of the flowcharts illustrating the steps executed in the cloud within the vehicle charging method provided in this application embodiment. This process can be executed by a vehicle charging device located in the cloud. This device can be implemented via software, hardware, or a combination of both. Figure 6 As shown, the process includes the following steps: S601, in response to receiving the second authentication data sent by the charging pile, obtains the original data, the certificate signing request, the first authentication code corresponding to the original data and the second authentication code corresponding to the certificate signing request from the second authentication data, and extracts the vehicle identification code from the original data.

[0097] In some embodiments, the first authentication code is calculated based on the raw data and the target vehicle's private key. The second authentication code is calculated based on the certificate signing request and the target vehicle's private key. The raw data includes, but is not limited to, the target vehicle's Vehicle Identification Number (VIN), Timestamp (TS), Battery State of Charge (SOC), and Random Number (RD). The raw data is a string concatenated from the VIN, TS, SOC, and RD.

[0098] S602 initiates an authentication code verification request to the key management system based on the original data, certificate signing request, and vehicle identification code to obtain the third and fourth authentication codes.

[0099] In some embodiments, the vehicle manufacturer's cloud platform initiates an authentication code verification request to the key management system (KMS) based on the original data, a certificate signing request, and the vehicle identification number (VIN). This authentication code verification request includes a first authentication code verification request and a second authentication code verification request. The first authentication code verification request carries the VIN and the hash value of the original data. The second authentication code verification request carries the VIN and the certificate signing request. Upon receiving the authentication code verification request, the KMS obtains the symmetric key corresponding to the target vehicle based on the VIN. Then, based on the hash value of the original data and the symmetric key, it generates a third authentication code. Based on the certificate signing request and the symmetric key, it generates a fourth authentication code. Finally, it returns the third and fourth authentication codes to the vehicle manufacturer's cloud platform.

[0100] S603, under the condition that the first authentication code equals the third authentication code, the second authentication code equals the fourth authentication code, and the original data passes the compliance verification, sends a certificate signing request to the public key infrastructure system to obtain a public key certificate.

[0101] In some embodiments, in response to receiving a third authentication code, the system verifies whether the first authentication code is equal to the third authentication code. If the first authentication code equals the third authentication code, the system verifies whether the second authentication code equals the fourth authentication code. If the second authentication code equals the fourth authentication code, the system performs a compliance check on the original data. The compliance check process for the original data is the same as described above and will not be repeated here. If the original data passes the compliance check, the vehicle manufacturer's cloud platform sends a certificate signing request to the Public Key Infrastructure (PKI) system, initiating a certificate application. The PKI then returns the issued public key certificate to the vehicle manufacturer's cloud platform.

[0102] S604, in response to receiving the public key certificate sent by the public key infrastructure system, sends the public key certificate and the charging start command to the charging pile.

[0103] In some embodiments, the vehicle manufacturer's cloud sends the public key certificate and the charging start command together to the charging station. Upon receiving the public key certificate and the charging start command, the charging station forwards the public key certificate to the target vehicle, locks the charging gun plugged into the target vehicle's charging port, and begins charging the target vehicle. After receiving the public key certificate, the target vehicle saves it to its local secure storage. Subsequently, the target vehicle locally stores the public key certificate, and during the next charging authentication, it uses asymmetric encryption to encrypt the original data.

[0104] By embedding a certificate signature request into the authentication data and sending it to the cloud during the initial charging authentication of the target vehicle, the vehicle's identity authentication and certificate application processes are integrated into one, allowing the target vehicle to complete identity registration and certificate acquisition in a single interaction. In subsequent charging authentications, the target vehicle can directly use the private key corresponding to the certificate to perform digital signatures, and the verifier (cloud) uses the issued public key certificate to verify the signature. This method not only achieves seamless establishment of secure trust between the target vehicle and the cloud, and between the target vehicle and a Public Key Infrastructure (PKI), but also significantly improves the security, efficiency, and convenience of subsequent authentication processes due to the use of asymmetric cryptography.

[0105] It should be understood that, although Figure 1-6 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-6 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0106] In one embodiment, such as Figure 7 As shown, a vehicle charging device installed in a target vehicle is provided, the device comprising: The acquisition module 701 is used to acquire the raw data required for authentication in response to receiving an authentication request sent by the charging pile; wherein, the raw data includes the vehicle identification code and random number of the target vehicle; The signature module 702 is used to sign the original data using a private key if a public key certificate is stored locally, thereby obtaining a digital signature; The generation module 703 is used to generate first authentication data based on the public key certificate, the digital signature, and the original data; The sending module 704 is used to transmit the first authentication data to the cloud through the charging pile, so that the cloud sends a start charging command to the charging pile after authentication is passed, wherein the start charging command instructs the charging pile to perform lock-on charging.

[0107] In one embodiment, such as Figure 8 As shown, a vehicle charging device installed in the cloud is provided, the device comprising: The acquisition module 801 is used to, in response to receiving the first authentication data sent by the charging pile, acquire the public key certificate, the original data and the digital signature from the first authentication data; wherein, the first authentication data includes the public key certificate; The verification module 802 is used to verify the digital signature using the public key corresponding to the public key certificate after determining that the public key certificate is a valid certificate, and to obtain verification data. The verification module 803 is used to perform compliance verification on the original data if the verification data and the original data meet the matching requirements. The sending module 804 is used to send a start charging command to the charging pile when the original data passes the compliance verification; wherein the start charging command instructs the charging pile to perform gun locking charging.

[0108] Specific limitations regarding the vehicle charging device can be found in the limitations regarding the vehicle charging method described above, and will not be repeated here. Each module in the aforementioned vehicle charging device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0109] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores vehicle charging data. The network interface communicates with external terminals via a network. When the computer program is executed by the processor, it implements a vehicle charging method. The display screen can be an LCD screen or an e-ink display screen. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device casing, or an external keyboard, touchpad, or mouse.

[0110] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0111] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any one of the aforementioned vehicle charging methods.

[0112] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0113] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0114] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A vehicle charging method, characterized in that, Applicable to the target vehicle, the method includes: In response to receiving an authentication request from a charging pile, the system obtains the raw data required for authentication; wherein the raw data includes the vehicle identification code and a random number of the target vehicle. If a public key certificate is stored locally, the original data is signed using the private key to obtain a digital signature; First authentication data is generated based on the public key certificate, the digital signature, and the original data; The first authentication data is transmitted to the cloud through the charging pile, so that the cloud sends a start charging command to the charging pile after authentication is successful, wherein the start charging command instructs the charging pile to perform lock-on charging.

2. The method according to claim 1, characterized in that, The method further includes: If no public key certificate is available locally, a public key will be generated based on the private key. Generate a certificate signing request based on the public key and the vehicle information of the target vehicle; The original data and the certificate signing request are calculated using a symmetric key to obtain a first authentication code corresponding to the original data and a second authentication code corresponding to the certificate signing request. The second authentication data is generated based on the first authentication code, the original data, the second authentication code, and the certificate signing request; The second authentication data is transmitted to the cloud through the charging pile, so that the cloud sends the start charging command to the charging pile after authentication is successful and transmits the received public key certificate to the target vehicle through the charging pile. Upon receiving the public key certificate, the public key certificate is saved to the local storage area.

3. The method according to claim 2, characterized in that, The step of using a symmetric key to calculate the original data and the certificate signing request to obtain a first authentication code corresponding to the original data and a second authentication code corresponding to the certificate signing request includes: The original data and the certificate signing request are hashed respectively to obtain a first hash value corresponding to the original data and a second hash value corresponding to the certificate signing request; Based on the message authentication code algorithm, the symmetric key is used to calculate the first hash value and the second hash value respectively to obtain the first authentication code corresponding to the first hash value and the second authentication code corresponding to the second hash value.

4. A vehicle charging method, characterized in that, Applicable to the cloud, the method includes: In response to receiving the first authentication data sent by the charging pile, the system obtains the public key certificate, the original data, and the digital signature from the first authentication data; wherein, the first authentication data includes the public key certificate. After confirming that the public key certificate is a valid certificate, the digital signature is verified using the public key corresponding to the public key certificate to obtain verification data; If the verification data and the original data meet the matching requirements, then the original data is subjected to compliance verification. If the original data passes the compliance verification, a charging start command is sent to the charging pile; wherein the charging start command instructs the charging pile to perform gun locking charging.

5. The method according to claim 4, characterized in that, The verification data includes a first hash value. If the verification data and the original data meet the matching requirements, then the original data undergoes compliance verification, including: Perform a hash operation on the original data to obtain a second hash value; If the first hash value is equal to the second hash value, then the original data is subjected to compliance verification.

6. The method according to claim 4, characterized in that, The method further includes: In response to receiving the second authentication data sent by the charging pile, the original data, the certificate signing request, the first authentication code corresponding to the original data and the second authentication code corresponding to the certificate signing request are obtained from the second authentication data, and the vehicle identification code is extracted from the original data; The system initiates an authentication code verification request to the key management system based on the original data, the certificate signing request, and the vehicle identification code to obtain a third authentication code and a fourth authentication code; wherein, the third authentication code is generated based on the symmetric key corresponding to the vehicle identification code and the original data, and the fourth authentication code is generated based on the symmetric key and the certificate signing request; If the first authentication code is equal to the third authentication code, the second authentication code is equal to the fourth authentication code, and the original data passes the compliance verification, a certificate signing request is sent to the public key infrastructure system to obtain a public key certificate. Upon receiving the public key certificate, the system sends the public key certificate and the start charging command to the charging pile.

7. A vehicle charging device, characterized in that, The device, installed in the target vehicle, includes: The acquisition module is used to acquire the raw data required for authentication in response to receiving an authentication request sent by the charging pile; wherein, the raw data includes the vehicle identification code and random number of the target vehicle; The signature module is used to sign the original data using the private key if a public key certificate is stored locally, thereby obtaining a digital signature; The generation module is used to generate first authentication data based on the public key certificate, the digital signature, and the original data; The sending module is used to transmit the first authentication data to the cloud through the charging pile, so that the cloud sends a start charging command to the charging pile after authentication is passed, wherein the start charging command instructs the charging pile to perform lock-on charging.

8. A vehicle charging device, characterized in that, Located in the cloud, the device includes: The acquisition module is used to, in response to receiving the first authentication data sent by the charging pile, acquire the public key certificate, the original data, and the digital signature from the first authentication data; wherein, the first authentication data includes the public key certificate; The verification module is used to verify the digital signature using the public key corresponding to the public key certificate after determining that the public key certificate is a valid certificate, and to obtain verification data. The verification module is used to perform compliance verification on the original data if the verification data and the original data meet the matching requirements. The sending module is used to send a start charging command to the charging pile when the original data passes the compliance verification; wherein the start charging command instructs the charging pile to perform gun locking charging.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.