Charging method and device, electronic equipment, storage medium and program product

By using encrypted authentication verification and unstructured factory-defined messages in the charging communication channel, the problems of data inconsistency and voltage discomfort during charging are solved, and the charging safety and accuracy of data transmission are improved, achieving rapid and safe Charge.

CN119233248APending Publication Date: 2024-12-31BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411366514.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing charging technology is difficult to ensure charging safety during the charging process between the power consumption equipment and the power supply equipment, especially during power gear negotiation and data transmission, there are problems of data inconsistency and inappropriate voltage.

Method used

By introducing session seeds and random numbers into the charging communication channel for encryption authentication verification, we ensure the security of charging operations, and use unstructured factory-defined message transmission command parameters, such as session seed parameters, random number parameters, and reverse authentication Parameters, etc., realize two-way authentication and encrypted transmission of device operation information.

Benefits of technology

Improves the safety of the charging process and the accuracy of data transmission, ensuring that only verified power supply equipment can communicate efficiently with the power consumption equipment, protect the battery from unsuitable voltage or current, and achieve fast and safe charging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119233248A_ABST
    Figure CN119233248A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and particularly provides a charging method and device, electronic equipment, a storage medium and a program product. The method comprises the following steps: after a charging communication channel is established, based on a session seed and a random number, sending an authentication verification request message to power supply equipment; when it is determined that an authentication verification response message returned by the power supply equipment is received, obtaining first encrypted data contained in the authentication verification response message; performing encryption based on the session seed and the random number to obtain second encrypted data; performing authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result; and executing a corresponding charging operation according to an authentication verification result. Therefore, the charging safety is improved through communication authentication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to a charging method, device, electronic device, storage medium and program product. Background Art

[0002] In a charging scenario, during the charging process of an electrical device (such as a mobile phone), the electrical device and the power supply device (such as a charger) usually establish a charging communication channel based on a charging protocol and then perform charging operations based on the charging communication channel. Summary of the invention

[0003] The purpose of the embodiments of the present disclosure is to provide a charging method, device, electronic device, storage medium and program product to improve charging safety.

[0004] In one aspect, an embodiment of the present disclosure provides a charging method, including:

[0005] After the charging communication channel is established, an authentication verification request message is sent to the power supply device based on the session seed and the random number; the session seed and the random number are both used for data encryption; the charging communication channel is established based on the first charging protocol;

[0006] When it is determined that an authentication verification response message returned by the power supply device is received, obtaining the first encrypted data contained in the authentication verification response message;

[0007] Encrypt based on the session seed and the random number to obtain second encrypted data;

[0008] Performing authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result;

[0009] According to the authentication result, the corresponding charging operation is performed.

[0010] In one implementation, the authentication verification request message and the authentication verification response message are both unstructured factory-defined messages;

[0011] The unstructured factory-defined message contains the following command parameters: session seed parameter and random number parameter;

[0012] The session seed parameter is used to indicate whether to send the session seed; the random number parameter is used to indicate whether to send the random number.

[0013] In one implementation, performing authentication verification based on the first encrypted data and the second encrypted data to obtain an authentication verification result includes:

[0014] Comparing the first encrypted data with the second encrypted data to obtain a first comparison result;

[0015] If the first comparison result is that the data is consistent, then the authentication verification result is determined to be successful;

[0016] Otherwise, the authentication verification result is determined to be authentication verification failure.

[0017] In one implementation, performing authentication verification based on the first encrypted data and the second encrypted data to obtain an authentication verification result includes:

[0018] Comparing partial data in the first encrypted data with corresponding partial data in the second encrypted data to obtain a second comparison result;

[0019] If the second comparison result indicates that the data is inconsistent, determining the authentication verification result is an authentication verification failure;

[0020] When the second comparison result indicates that the data are consistent, a reverse authentication request instruction including the second encrypted data is sent to the power supply device;

[0021] A reverse authentication response instruction including an authentication verification result is received and returned by the power supply device based on the reverse authentication request instruction.

[0022] In one implementation, the reverse authentication request instruction and the reverse authentication response instruction are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: reverse authentication parameters and verification result parameters;

[0023] The reverse authentication parameter is used to indicate whether reverse authentication is performed; the verification result parameter is used to indicate whether the authentication verification result is sent.

[0024] In one embodiment, the method further comprises:

[0025] Sending a request for equipment operation information to the power supply equipment;

[0026] Receiving a device operation information response instruction containing device operation information returned by the power supply device based on the device operation information request instruction;

[0027] Among them, the device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus and current temperature; the device operation information request instruction is an unstructured factory-defined message, and the unstructured factory-defined message contains at least one of the following command parameters: firmware version parameter, voltage bus voltage parameter and current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

[0028] In one embodiment, the unstructured factory-defined message further includes at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter;

[0029] The connection status parameter is used to indicate the connection status with the power supply device;

[0030] The remove current compensation parameter is used to indicate whether to remove the current compensation of the power supply device;

[0031] The permission status parameter is used to indicate whether the structured factory-defined message is allowed to be sent.

[0032] In one aspect, an embodiment of the present disclosure provides a charging method, including:

[0033] After the charging communication channel is established, if an authentication verification request message sent by the power-consuming device is received, encryption is performed according to the session seed and the random number in the authentication verification request message to obtain the first encrypted data; the charging communication channel is established based on the first charging protocol;

[0034] Returning an authentication verification response message containing the first encrypted data to the electric device; the first encrypted data is used for authentication verification;

[0035] If an authentication result message returned by the electric device is received, the authentication verification result is determined according to the authentication result message;

[0036] According to the authentication result, the corresponding charging operation is performed.

[0037] In one implementation, the authentication verification request message and the authentication verification response message are both unstructured factory-defined messages; the unstructured factory-defined messages include the following command parameters: a session seed parameter and a random number parameter;

[0038] The session seed parameter is used to indicate whether to send the session seed; the random number parameter is used to indicate whether to send the random number.

[0039] In one implementation, if an authentication result message returned by the electric device is received, determining the authentication verification result according to the authentication result message includes:

[0040] If a reverse authentication request instruction including the second encrypted data is received from the electric device, the second encrypted data included in the reverse authentication request instruction is obtained; the authentication result message includes the reverse authentication request instruction;

[0041] An authentication verification result is obtained according to a third comparison result between partial data in the first encrypted data and corresponding partial data in the second encrypted data.

[0042] In one implementation, the reverse authentication request instruction and the reverse authentication response instruction are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: reverse authentication parameters and verification result parameters;

[0043] The reverse authentication parameter is used to indicate whether reverse authentication is performed; the verification result parameter is used to indicate whether the authentication verification result is sent.

[0044] In one embodiment, the method further comprises:

[0045] If a device operation information request instruction sent by the electric device is received, the device operation information is obtained;

[0046] Sending a device operation information response instruction containing device operation information to the power-consuming device;

[0047] The device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus, and current temperature;

[0048] The device operation information request instruction is an unstructured factory-defined message, which contains at least one of the following command parameters: a firmware version parameter, a voltage bus voltage parameter, and a current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

[0049] In one embodiment, the unstructured factory-defined message further includes at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter;

[0050] The connection status parameter is used to indicate the connection status with the power supply device;

[0051] The remove current compensation parameter is used to indicate whether to remove the current compensation of the power supply device;

[0052] The permission status parameter is used to indicate whether the structured factory-defined message is allowed to be sent.

[0053] In one aspect, an embodiment of the present disclosure provides a charging device, comprising:

[0054] A sending unit, configured to send an authentication request message to the power supply device based on a session seed and a random number after establishing a charging communication channel; the session seed and the random number are both used for data encryption; the charging communication channel is established based on a first charging protocol;

[0055] An acquiring unit, configured to acquire the first encrypted data contained in the authentication verification response message when determining that the authentication verification response message returned by the power supply device is received;

[0056] An encryption unit, used for performing encryption based on a session seed and a random number to obtain second encrypted data;

[0057] A verification unit, used to perform authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result;

[0058] The execution unit is used to execute the corresponding charging operation according to the authentication result.

[0059] In one implementation, the authentication verification request message and the authentication verification response message are both unstructured factory-defined messages;

[0060] The unstructured factory-defined message contains the following command parameters: session seed parameter and random number parameter;

[0061] The session seed parameter is used to indicate whether to send the session seed; the random number parameter is used to indicate whether to send the random number.

[0062] In one implementation, the verification unit is used to:

[0063] Comparing the first encrypted data with the second encrypted data to obtain a first comparison result;

[0064] If the first comparison result is that the data is consistent, then the authentication verification result is determined to be successful;

[0065] Otherwise, the authentication verification result is determined to be authentication verification failure.

[0066] In one implementation, the verification unit is used to:

[0067] Comparing partial data in the first encrypted data with corresponding partial data in the second encrypted data to obtain a second comparison result;

[0068] If the second comparison result indicates that the data is inconsistent, determining the authentication verification result is an authentication verification failure;

[0069] When the second comparison result indicates that the data are consistent, a reverse authentication request instruction including the second encrypted data is sent to the power supply device;

[0070] A reverse authentication response instruction including an authentication verification result is received and returned by the power supply device based on the reverse authentication request instruction.

[0071] In one implementation, the reverse authentication request instruction and the reverse authentication response instruction are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: reverse authentication parameters and verification result parameters;

[0072] The reverse authentication parameter is used to indicate whether reverse authentication is performed; the verification result parameter is used to indicate whether the authentication verification result is sent.

[0073] In one implementation, the verification unit is further configured to:

[0074] Sending a request for equipment operation information to the power supply equipment;

[0075] Receiving a device operation information response instruction containing device operation information returned by the power supply device based on the device operation information request instruction;

[0076] Among them, the device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus and current temperature; the device operation information request instruction is an unstructured factory-defined message, and the unstructured factory-defined message contains at least one of the following command parameters: firmware version parameter, voltage bus voltage parameter and current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

[0077] In one embodiment, the unstructured factory-defined message further includes at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter;

[0078] The connection status parameter is used to indicate the connection status with the power supply device;

[0079] The remove current compensation parameter is used to indicate whether to remove the current compensation of the power supply device;

[0080] The permission status parameter is used to indicate whether the structured factory-defined message is allowed to be sent.

[0081] In one aspect, an embodiment of the present disclosure provides a charging device, comprising:

[0082] an encryption unit, configured to encrypt the authentication request message according to the session seed and the random number in the authentication request message to obtain first encrypted data if the authentication request message sent by the power-consuming device is received after the charging communication channel is established; the charging communication channel is established based on the first charging protocol;

[0083] A returning unit, configured to return an authentication verification response message including the first encrypted data to the electric device; the first encrypted data is used for authentication verification;

[0084] A determination unit, configured to determine an authentication verification result according to the authentication result message if an authentication result message returned by the electric device is received;

[0085] The execution unit is used to execute the corresponding charging operation according to the authentication result.

[0086] In one implementation, the authentication verification request message and the authentication verification response message are both unstructured factory-defined messages; the unstructured factory-defined messages include the following command parameters: a session seed parameter and a random number parameter;

[0087] The session seed parameter is used to indicate whether to send the session seed; the random number parameter is used to indicate whether to send the random number.

[0088] In one implementation, the determining unit is used to:

[0089] If a reverse authentication request instruction including the second encrypted data is received from the electric device, the second encrypted data included in the reverse authentication request instruction is obtained; the authentication result message includes the reverse authentication request instruction;

[0090] An authentication verification result is obtained according to a third comparison result between partial data in the first encrypted data and corresponding partial data in the second encrypted data.

[0091] In one implementation, the reverse authentication request instruction and the reverse authentication response instruction are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: reverse authentication parameters and verification result parameters;

[0092] The reverse authentication parameter is used to indicate whether reverse authentication is performed; the verification result parameter is used to indicate whether the authentication verification result is sent.

[0093] In one implementation, the determining unit is further configured to:

[0094] If a device operation information request instruction sent by the electric device is received, the device operation information is obtained;

[0095] Sending a device operation information response instruction containing device operation information to the power-consuming device;

[0096] The device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus, and current temperature;

[0097] The device operation information request instruction is an unstructured factory-defined message, which contains at least one of the following command parameters: a firmware version parameter, a voltage bus voltage parameter, and a current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

[0098] In one embodiment, the unstructured factory-defined message further includes at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter;

[0099] The connection status parameter is used to indicate the connection status with the power supply device;

[0100] The remove current compensation parameter is used to indicate whether to remove the current compensation of the power supply device;

[0101] The permission status parameter is used to indicate whether the structured factory-defined message is allowed to be sent.

[0102] In one aspect, an electronic device is provided in an embodiment of the present disclosure, including:

[0103] Processor; and

[0104] A memory stores computer instructions, wherein the computer instructions are used to cause a processor to execute the steps of the method provided in any of the various optional implementations of charging described above.

[0105] On the one hand, an embodiment of the present disclosure provides a computer-readable storage medium storing computer instructions, which are used to enable a computer to execute the steps of the method provided in any of the various optional implementations of charging as described above.

[0106] On the one hand, a computer program product is provided in an embodiment of the present disclosure, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the steps of the method provided in any of the various optional implementations of charging described above.

[0107] The charging method in the embodiment of the present disclosure includes, after establishing a charging communication channel, sending an authentication verification request message to a power supply device based on a session seed and a random number; the session seed and the random number are both used for data encryption; the charging communication channel is established based on a first charging protocol; when it is determined that an authentication verification response message returned by the power supply device is received, the first encrypted data contained in the authentication verification response message is obtained; encryption is performed based on the session seed and the random number to obtain the second encrypted data; authentication verification is performed based on the first encrypted data and the second encrypted data to obtain an authentication verification result; and the corresponding charging operation is performed based on the authentication verification result. In this way, a charging communication channel is established based on the first charging protocol, and communication authentication is performed through the charging communication channel. The charging safety is improved by adding an authentication link. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] Figure 1 It is a schematic diagram of a device charging scenario in an embodiment of the present disclosure.

[0109] Figure 2 It is a flowchart of a charging negotiation method in an embodiment of the present disclosure.

[0110] Figure 3 It is an interactive flow chart of the charging method in the embodiment of the present disclosure.

[0111] Figure 4 It is an interactive flow chart of a two-way authentication method in an embodiment of the present disclosure.

[0112] Figure 5 It is a structural block diagram of a charging device in an embodiment of the present disclosure.

[0113] Figure 6 It is a structural block diagram of another charging device in an embodiment of the present disclosure.

[0114] Figure 7 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0115] The technical solution of the present disclosure will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described implementation is a part of the implementation of the present disclosure, rather than all the implementations. Based on the implementation in the present disclosure, all other implementations obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure. In addition, the technical features involved in the different implementations of the present disclosure described below can be combined with each other as long as they do not conflict with each other.

[0116] Considering that in the related art, a charging communication channel is usually established based on the PD protocol, and then the power level is negotiated and power is supplied through the charging communication channel, but this is usually difficult to ensure charging safety. In the embodiments of the present disclosure, a charging method, device, electronic device, storage medium and program product are provided to improve charging safety.

[0117] A charging method is provided in an embodiment of the present disclosure, which can be applied to electronic devices. The present disclosure does not limit the type of electronic device, and the method can be any type of device suitable for implementation, such as a terminal device and a server, etc. The present disclosure will not elaborate on this.

[0118] See also Figure 1 As shown, it is a schematic diagram of a charging scenario of a device. Figure 1 The power supply device includes an electric device and a power supply device, and the electric device and the power supply device are connected by a charging cable. The electric device is an electronic device to be charged, such as a mobile phone, and the power supply device is a device used to charge other devices, such as a charger.

[0119] See also Figure 2 As shown, it is a flowchart of a charging negotiation method in an embodiment of the present disclosure. Figure 1 The method is described below. The specific implementation process of the method is as follows:

[0120] Step 201: After the power supply device detects a wired connection with the power-consuming device, it sends a power level broadcast message to the power-consuming device.

[0121] In one implementation, when the power supply device detects that a power-consuming device is connected (Insert), it sends a power level broadcast message including at least one universal power level to the power-consuming device.

[0122] The general power level included in the power level broadcast message may be a fixed power data object (PDO) level.

[0123] Step 202: The power-consuming device sends a power supply configuration request message including a safe power level to the power supply device.

[0124] In one implementation, the power-consuming device selects a safe power level from common power levels included in the power level broadcast message, and sends it to the power supply device.

[0125] For example, the safe power level may be a default PDO level.

[0126] Step 203: The powered device receives a power supply configuration confirmation message returned by the power supply device.

[0127] As an example, the power supply device may return a PS_RDY (power configuration confirmation message) to the powered device, which means that the power supply has reached the required operating conditions.

[0128] Step 204: The power-consuming device and the power supply device exchange roles.

[0129] For example, the mobile phone sends a DR_SWAP role swap command to the charger to actively apply for role swap, where the charger needs to support the role swap function. Previously, the charger led the communication, and after completing the role swap, the communication switched to the mobile phone leading the subsequent charging process, and returned an accept message after the switch was successful.

[0130] In the embodiment of the present application, after the role exchange is successful, a charging communication channel is successfully established, wherein the charging communication channel is established based on a first charging protocol, and the first charging protocol may be a PD protocol.

[0131] Step 205: The power-consuming device performs identity authentication on the power supply device.

[0132] In one embodiment, the power-consuming device obtains the power supply device information of the power supply device for identity authentication, such as, which may include at least one of the following: a vendor identification code (Vender ID, VID), a product identification code (Product ID, PID), and a standard or manufacturer identification code (Standard or Vendor ID, SVID), and authenticates the power supply device through the power supply device information.

[0133] Step 206: After the power-consuming device determines that the identity authentication is passed, it obtains the device operation information of the power supply device through the charging communication channel.

[0134] In one implementation, the power-consuming device sends a device operation information request instruction to the power supply device. If the power supply device receives the device operation information request instruction sent by the power-consuming device, it obtains the device operation information and sends a device operation information response instruction containing the device operation information to the power-consuming device. The power-consuming device receives the device operation information response instruction containing the device operation information returned by the power supply device based on the device operation information request instruction.

[0135] The device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus, and current temperature;

[0136] The device operation information request instruction is an unstructured (Unstructured) vendor define message (VDM) message, which may include at least one of the following command parameters: a firmware version parameter, a voltage bus voltage parameter, and a current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

[0137] The Unstructured VDM message may indicate a message type or a message of this type, and the specific meaning may be understood according to the context.

[0138] Furthermore, the unstructured factory-defined message may also include at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter.

[0139] Among them, the connection status parameter is used to indicate the connection status with the power supply device; the removal current compensation parameter is used to indicate whether to remove the current compensation of the power supply device; and the permission status parameter is used to indicate whether the structured original factory-defined message is allowed to be sent.

[0140] Step 207: The power-consuming device and the power supply device perform communication authentication via the charging communication channel.

[0141] In the embodiment of the present application, only the sequential execution of step 206 and step 207 is used as an example for illustration. In practice, the two can be executed in any order and are not limited here.

[0142] Step 208: If the authentication is successful, the power-consuming device obtains a plurality of private power levels of the power supply device.

[0143] Step 209: The power-consuming device sends a target power level selected from each private power level to the power supply device.

[0144] Step 210: The power supply device supplies power to the power-consuming device according to the target power level.

[0145] In this way, after the authentication is successful, the power supply device can broadcast one or more supported private power gears to the power consumer for the power consumer to choose, and then supply power according to the power consumer's choice. This not only achieves fast charging, but also protects the battery from damage caused by inappropriate voltage or current. These gears are designed according to the specific needs of the device and can provide more precise charging strategies. The implementation of this protocol relies on encrypted communication between the power supply device and the power consumer, ensuring the security of data transmission and the correctness of charging instructions. Only verified power supply devices can communicate efficiently with the device, making the charging process both efficient and safe.

[0146] Unstructured VDM messages are used to carry information defined by equipment manufacturers and are non-standardized. Compared with structured VDM messages, Unstructured VDM messages have no fixed format or parameter requirements, which makes them more flexible and can adapt to various manufacturer-specific needs and uses.

[0147] As an example, in the Unstructured VDM message header, Bit31-Bit16 is the 16-bit VID of the vendor, such as 0x1011. Bit15 is 0, indicating that the message is an Unstructured VDM message. Bit14-Bit0 can be customized by the vendor, and multiple command parameters can be customized.

[0148] The unstructured factory-defined message may include the following command parameters: session seed parameter, random number parameter, and verification result parameter.

[0149] The session seed parameter is used to indicate whether to send session seed related instructions, such as, can be used to indicate whether to send session seeds, the random number parameter is used to indicate whether to send random number related instructions, such as, can be used to indicate whether to send random numbers, the verification result parameter is used to indicate verification result related instructions, such as, can be used to indicate whether to send authentication verification results. Among them, the instruction can be a request instruction or a response instruction, and the response instruction can be a response instruction).

[0150] Furthermore, the unstructured factory-defined message may also include at least one of the following command parameters: a connection status parameter, a firmware version parameter, a voltage bus voltage parameter, a current temperature parameter, a removal current compensation parameter, a reverse authentication parameter, and a permission status parameter;

[0151] The connection status parameter is used to indicate the connection status with the power supply device, such as it can indicate not connected; the firmware version parameter is used to indicate whether to send instructions related to the firmware version information, such as it can be used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to send instructions related to the voltage bus voltage parameter, such as it can be used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to send instructions related to the current temperature, such as it can be used to indicate whether to obtain the current temperature of the power supply device; the removal current compensation parameter is used to indicate whether to send instructions related to the removal of current compensation, such as it can be used to indicate whether to remove the current compensation of the power supply device; the reverse authentication parameter is used to indicate whether to send instructions related to reverse authentication, such as it can indicate whether to pass the reverse authentication of the power supply device; the permission status parameter is used to indicate whether the structured original factory-defined message is allowed to be sent.

[0152] In actual applications, the bits corresponding to each command parameter in the Unstructured VDM message can be adjusted according to actual application scenarios, and can also be expanded on this basis to set other command parameters according to actual application scenarios, which is not limited here.

[0153] For example, Bit 15=0 in the message Header indicates that the message type is Unstructured VDM, Bit 9-Bit 8 in the message Header is 1, indicating that this is a request (Requirement, REQ) message, Bit 4-Bit 0 is 1, indicating that the firmware version information of the power supply device is obtained. Similarly, Bit 4-Bit 0 can also be 2 or 3 to obtain the current voltage or current temperature of the voltage bus.

[0154] In this way, when the above step 207 is executed, the corresponding device operation information can be obtained through at least one of the firmware version parameter, the voltage bus voltage parameter and the current temperature parameter.

[0155] Combine the following Figure 3 , for the above Figure 1 Detailed description of step 208 in FIG. Figure 3 As shown, it is an interactive flow chart of a charging method in an embodiment of the present disclosure, and the specific implementation process of the method is as follows:

[0156] Step 301: After establishing a charging communication channel, the power-consuming device sends an authentication request message to the power supply device based on a session seed and a random number.

[0157] Among them, the session seed and the random number are used for data encryption; the charging communication channel is established based on the first charging protocol. The authentication request message is an unstructured factory-defined message; the unstructured factory-defined message can contain the following command parameters: session seed parameter and random number parameter; the session seed parameter is used to indicate whether to send the session seed; the random number parameter is used to indicate whether to send the random number. The unstructured factory-defined messages are all transmitted through the charging communication channel.

[0158] Optionally, the session seed and the random number may be sent through the same message or may be sent in different messages. If they are sent in different messages, the authentication request message may include a key generation request instruction and an encryption request instruction.

[0159] In one implementation, when executing step 301, the following steps may be used:

[0160] S3011: After establishing the charging communication channel, the power-consuming device sends a key generation request instruction including a session seed to the power supply device.

[0161] The key generation request instruction also includes a session seed parameter to indicate sending the session seed. In this way, the session seed can be sent to the power supply device through the customized session seed parameter in the Header.

[0162] S3012: The power supply device generates a power supply device key according to the session seed in the key generation request instruction.

[0163] In one implementation, if a key generation request instruction is received from a power-consuming device, the power supply device obtains a locally stored initial key, and encrypts a session seed according to the initial key using an encryption algorithm to obtain a power supply device key.

[0164] Optionally, the encryption algorithm may be a 256-bit secure hash algorithm (SHA256) of a hash-based message authentication code (HMAC).

[0165] Optionally, the initial key may be 32 bytes, which may be expressed as M_Secret, and the power supply device key may be 32 bytes, which may be expressed as S_Secret.

[0166] In this way, a PSE key can be generated for encryption.

[0167] S3013: The power supply device returns a key generation confirmation instruction to the power consumption device.

[0168] Among them, the key generation confirmation instruction is Unstructured VDM.

[0169] S3014: The power-consuming device sends an encrypted request instruction containing a random number to the power supply device.

[0170] In one implementation, when the power-consuming device determines that it has received the key generation confirmation instruction returned by the power supply device, it sends an encryption request instruction of the Unstructured VDM type to the power supply device.

[0171] In this way, you can send random numbers through customized random number parameters.

[0172] Step 302: The power supply device performs encryption according to the session seed and the random number to obtain first encrypted data.

[0173] In one implementation, the power supply device encrypts the random number in the encryption request instruction based on the power supply device key to obtain the first encrypted data.

[0174] In one implementation, if an encryption request instruction is received from an electric device, the power supply device obtains a memory identifier (Read-Only Memory Identifier, ROMID), and encrypts the ROMID and a random number in the encryption request instruction based on a power supply device key to obtain first encrypted data.

[0175] The first encrypted data may be a 32-Byte digest.

[0176] Step 303: The power supply device returns an authentication response message including the first encrypted data to the power consumption device.

[0177] The authentication verification response message is an Unstructured VDM message. In the embodiment of the present application, one-way authentication or two-way authentication can be used. If one-way authentication is used, the complete first encrypted data can be returned to the power-consuming device. If two-way authentication is used, only part of the first encrypted data can be returned to the power-consuming device, such as the first 16 bytes of the first encrypted data.

[0178] Step 304: The electric device performs encryption based on the session seed and the random number to obtain second encrypted data.

[0179] In one embodiment, when the power-consuming device determines that it has received an authentication verification response message returned by the power supply device, it obtains the first encrypted data contained in the authentication verification response message, obtains the locally stored initial key, and encrypts the session seed based on the initial key to obtain the power-consuming device key, and encrypts the random number based on the power-consuming device key to obtain the second encrypted data.

[0180] Optionally, the above ROMID stored locally may be obtained, and the ROMID and the random number may be encrypted according to the power-consuming device key to obtain the second encrypted data.

[0181] In this way, the second encrypted data can be generated based on the same principle as that of generating the first encrypted data, so as to perform authentication verification in subsequent steps.

[0182] Step 305: The electric device performs authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result.

[0183] In one implementation, when executing step 305, any of the following methods may be used:

[0184] Method 1: Obtain the authentication result through one-way authentication.

[0185] In one implementation, the first encrypted data is compared with the second encrypted data to obtain a first comparison result; if the first comparison result is that the data is consistent, the authentication verification result is determined to be authentication verification success; otherwise, the authentication verification result is determined to be authentication verification failure.

[0186] Method 2: Obtain the authentication result through two-way authentication.

[0187] Step 306: The power supply device receives the authentication result message returned by the power consumption device.

[0188] Step 307: The power supply device determines the authentication result according to the authentication result message, and performs a corresponding charging operation according to the authentication result.

[0189] Optionally, the authentication result message includes an authentication notification instruction and a reverse authentication request instruction.

[0190] In one implementation, when executing step 307, any of the following methods may be used:

[0191] Method 1: If one-way authentication is adopted, the power-consuming device sends an authentication notification instruction to the power supply device. If the power supply device receives the authentication notification instruction returned by the power-consuming device, it obtains the authentication verification result in the authentication notification instruction.

[0192] The authentication notification instruction is an Unstructured VDM message, and the authentication notification instruction also includes a verification result parameter to indicate sending the authentication verification result through the verification result parameter. Furthermore, the power supply device can also return a notification response message to the power consumption device based on the authentication notification instruction.

[0193] Method 2: If two-way authentication is adopted, the power-consuming device sends a reverse authentication request instruction to the power supply device, and the power supply device performs verification again according to the first encrypted data in the reverse authentication request instruction to obtain an authentication result.

[0194] Step 308: The power-consuming device performs corresponding charging operations according to the authentication result.

[0195] Combine the following Figure 4 For an example of two-way authentication, see Figure 4 FIG. 1 is an interactive flow chart of a two-way authentication method, wherein the flow of the method includes:

[0196] Step 401: The electric device compares part of the data in the first encrypted data with the corresponding part of the data in the second encrypted data to obtain a second comparison result.

[0197] In one implementation, the power supply device may return an authentication response message including the first encrypted data or part of the first encrypted data to the power consumption device. If the complete first encrypted data is received, the power consumption device may select part of the data from the first encrypted data for comparison. For example, the power supply device may return only the first 16 bytes of data in the first encrypted data, and the power consumption device may compare the first 16 bytes of data in the first encrypted data with the first 16 bytes of data in the second encrypted data to obtain a second comparison result.

[0198] Step 402: When the second comparison result indicates that the data is consistent, the power-consuming device sends a reverse authentication request instruction containing the second encrypted data to the power supply device.

[0199] Furthermore, when the second comparison result indicates that the data is inconsistent, the power-consuming device determines that the authentication result is an authentication failure and notifies the power supply device.

[0200] The reverse authentication request instruction is sent when the second comparison result between the partial data in the first encrypted data and the corresponding partial data in the second encrypted data is that the data is consistent. The reverse authentication request instruction may also include only the remaining part of the second encrypted data, such as the last 16 bytes of the second encrypted data. The reverse authentication request instruction is an Unstructured VDM message, and further includes a reverse authentication parameter to indicate reverse authentication through the reverse authentication parameter, and may also include a verification result parameter to indicate sending the second comparison result through the verification result parameter.

[0201] Step 403: The power supply device obtains an authentication result according to a third comparison result between partial data in the first encrypted data and corresponding partial data in the second encrypted data.

[0202] In one embodiment, if a reverse authentication request instruction containing second encrypted data is received from an electric device, the power supply device obtains the second encrypted data contained in the reverse authentication request instruction, and compares part of the data in the first encrypted data (e.g., the remaining 16 bytes of data) with the corresponding part of the data in the second encrypted data to obtain a third comparison result. If the third comparison result indicates that the data is consistent, it is determined that the authentication verification is passed, otherwise, it is determined that the authentication verification fails. The part of the data in the first encrypted data and the part of the data in the first encrypted data used to obtain the second comparison result may be the same or different, and there may be some duplication.

[0203] Step 404: the power-consuming device receives a reverse authentication response message including a verification result parameter and an authentication verification result, which is returned by the power supply device based on the reverse authentication request instruction.

[0204] The reverse authentication response instruction also includes a verification result parameter to indicate that the message includes an authentication verification result.

[0205] In the embodiment of the present application, after the charging communication channel is established based on the PD protocol, the Unstructured VDM message of the customized PD protocol can realize customized communication, and then can transmit charging-related information and realize encryption authentication, etc. After the authentication verification is successful, the power supply device will broadcast one or more supported private power gears to the power-consuming device for the power-consuming device to select, and then supply power according to the selection of the power-consuming device. In this way, relying on encrypted communication between the power supply device and the power-consuming device, the security of data transmission and the correctness of charging instructions are ensured. Only the verified power supply device can communicate efficiently with the device, thereby making the charging process both efficient and safe.

[0206] Based on the same inventive concept, a charging device is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the above-mentioned device and equipment is similar to that of a charging method, the implementation of the above-mentioned device can refer to the implementation of the method, and the repeated parts will not be repeated. The device can be applied to electronic devices. The present disclosure does not limit the type of electronic device. It can be any type of device suitable for implementation, such as terminal devices and servers, etc. The present disclosure will not repeat this. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the electronic device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution.

[0207] See also Figure 5 , which is a structural block diagram of a charging device in an embodiment of the present disclosure. In some embodiments, the charging device in the example of the present disclosure includes:

[0208] The sending unit 501 is used to send an authentication request message to the power supply device based on a session seed and a random number after the charging communication channel is established; the session seed and the random number are both used for data encryption; the charging communication channel is established based on the first charging protocol;

[0209] The acquiring unit 502 is configured to acquire the first encrypted data contained in the authentication verification response message when determining that the authentication verification response message returned by the power supply device is received;

[0210] The encryption unit 503 is used to perform encryption based on the session seed and the random number to obtain second encrypted data;

[0211] The verification unit 504 is used to perform authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result;

[0212] The execution unit 505 is used to execute the corresponding charging operation according to the authentication result.

[0213] In one implementation, the authentication verification request message and the authentication verification response message are both unstructured factory-defined messages;

[0214] The unstructured factory-defined message contains the following command parameters: session seed parameter and random number parameter;

[0215] The session seed parameter is used to indicate whether to send the session seed; the random number parameter is used to indicate whether to send the random number.

[0216] In one implementation, the verification unit 504 is used to:

[0217] Comparing the first encrypted data with the second encrypted data to obtain a first comparison result;

[0218] If the first comparison result is that the data is consistent, then the authentication verification result is determined to be successful;

[0219] Otherwise, the authentication verification result is determined to be authentication verification failure.

[0220] In one implementation, the verification unit 504 is used to:

[0221] Comparing partial data in the first encrypted data with corresponding partial data in the second encrypted data to obtain a second comparison result;

[0222] If the second comparison result indicates that the data is inconsistent, determining the authentication verification result is an authentication verification failure;

[0223] When the second comparison result indicates that the data are consistent, a reverse authentication request instruction including the second encrypted data is sent to the power supply device;

[0224] A reverse authentication response instruction including an authentication verification result is received from the power supply device based on the reverse authentication request instruction; the authentication verification result is obtained by the power supply device based on a third comparison result between partial data in the first encrypted data and corresponding partial data in the second encrypted data.

[0225] In one implementation, the reverse authentication request instruction and the reverse authentication response instruction are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: reverse authentication parameters and verification result parameters;

[0226] The reverse authentication parameter is used to indicate whether reverse authentication is performed; the verification result parameter is used to indicate whether the authentication verification result is sent.

[0227] In one implementation, the verification unit 504 is further configured to:

[0228] Sending a request for equipment operation information to the power supply equipment;

[0229] Receiving a device operation information response instruction containing device operation information returned by the power supply device based on the device operation information request instruction;

[0230] Among them, the device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus and current temperature; the device operation information request instruction is an unstructured factory-defined message, and the unstructured factory-defined message contains at least one of the following command parameters: firmware version parameter, voltage bus voltage parameter and current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

[0231] In one embodiment, the unstructured factory-defined message further includes at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter;

[0232] The connection status parameter is used to indicate the connection status with the power supply device;

[0233] The remove current compensation parameter is used to indicate whether to remove the current compensation of the power supply device;

[0234] The permission status parameter is used to indicate whether the structured factory-defined message is allowed to be sent.

[0235] See also Figure 6 , which is a structural block diagram of another charging device in an embodiment of the present disclosure. In some embodiments, the charging device of the present disclosure example includes:

[0236] The encryption unit 601 is used to encrypt the authentication request message according to the session seed and the random number in the authentication request message to obtain the first encrypted data after the charging communication channel is established, if the authentication request message sent by the power-consuming device is received; the charging communication channel is established based on the first charging protocol;

[0237] The returning unit 602 is used to return an authentication verification response message including the first encrypted data to the electric device; the first encrypted data is used for authentication verification;

[0238] The determination unit 603 is configured to determine the authentication result according to the authentication result message if the authentication result message returned by the electric device is received;

[0239] The execution unit 604 is used to execute a corresponding charging operation according to the authentication result.

[0240] In one implementation, the authentication verification request message and the authentication verification response message are both unstructured factory-defined messages; the unstructured factory-defined messages include the following command parameters: a session seed parameter and a random number parameter;

[0241] The session seed parameter is used to indicate whether to send the session seed; the random number parameter is used to indicate whether to send the random number.

[0242] In one implementation, the determining unit 603 is further configured to:

[0243] If a reverse authentication request instruction including the second encrypted data is received from the electric device, the second encrypted data included in the reverse authentication request instruction is obtained; the authentication result message includes the reverse authentication request instruction;

[0244] An authentication verification result is obtained according to a third comparison result between partial data in the first encrypted data and corresponding partial data in the second encrypted data.

[0245] In one implementation, the reverse authentication request instruction and the reverse authentication response instruction are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: reverse authentication parameters and verification result parameters;

[0246] The reverse authentication parameter is used to indicate whether reverse authentication is performed; the verification result parameter is used to indicate whether the authentication verification result is sent.

[0247] In one implementation, the determining unit 603 is further configured to:

[0248] If a device operation information request instruction sent by the electric device is received, the device operation information is obtained;

[0249] Sending a device operation information response instruction containing device operation information to the power-consuming device;

[0250] The device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus, and current temperature;

[0251] The device operation information request instruction is an unstructured factory-defined message, which contains at least one of the following command parameters: a firmware version parameter, a voltage bus voltage parameter, and a current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

[0252] In one embodiment, the unstructured factory-defined message further includes at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter;

[0253] The connection status parameter is used to indicate the connection status with the power supply device;

[0254] The remove current compensation parameter is used to indicate whether to remove the current compensation of the power supply device;

[0255] The permission status parameter is used to indicate whether the structured factory-defined message is allowed to be sent.

[0256] The charging method in the embodiment of the present disclosure includes, after establishing a charging communication channel, sending an authentication verification request message to a power supply device based on a session seed and a random number; the session seed and the random number are both used for data encryption; the charging communication channel is established based on a first charging protocol; when it is determined that an authentication verification response message returned by the power supply device is received, the first encrypted data contained in the authentication verification response message is obtained; encryption is performed based on the session seed and the random number to obtain the second encrypted data; authentication verification is performed based on the first encrypted data and the second encrypted data to obtain an authentication verification result; and the corresponding charging operation is performed based on the authentication verification result. In this way, a charging communication channel is established based on the first charging protocol, and communication authentication is performed through the charging communication channel. The charging safety is improved by adding an authentication link.

[0257] In an embodiment of the present disclosure, an electronic device is also provided, including:

[0258] Processor; and

[0259] The memory stores computer instructions, where the computer instructions are used to enable the processor to execute the method of any of the above embodiments.

[0260] In an embodiment of the present disclosure, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a computer to execute a method in any of the above embodiments.

[0261] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device implements any of the above-mentioned embodiments of the method.

[0262] Figure 7 FIG. 7 is a schematic diagram showing the structure of an electronic device 7000. Figure 7 As shown, the electronic device 7000 includes: a processor 7010 and a memory 7020 , and optionally, may also include a power supply 7030 , a display unit 7040 , and an input unit 7050 .

[0263] The processor 7010 is the control center of the electronic device 7000. It connects various components using various interfaces and lines, and performs various functions of the electronic device 7000 by running or executing software programs and / or data stored in the memory 7020, thereby monitoring the electronic device 7000 as a whole.

[0264] In the embodiment of the present disclosure, the processor 7010 executes the various steps in the above embodiment when calling the computer program stored in the memory 7020.

[0265] Optionally, the processor 7010 may include one or more processing units; preferably, the processor 7010 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 7010. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips.

[0266] The memory 7020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, various applications, etc.; the data storage area may store data created according to the use of the electronic device 7000, etc. In addition, the memory 7020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices, etc.

[0267] The electronic device 7000 also includes a power source 7030 (such as a battery) for supplying power to various components. The power source can be logically connected to the processor 7010 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0268] The display unit 7040 may be used to display information input by the user or information provided to the user and various menus of the electronic device 7000, and in the embodiment of the present disclosure, is mainly used to display the display interface of each application in the electronic device 7000 and objects such as text and pictures displayed in the display interface. The display unit 7040 may include a display panel 7041. The display panel 7041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0269] The input unit 7050 may be used to receive information such as numbers or characters input by the user. The input unit 7050 may include a touch panel 7051 and other input devices 7052. The touch panel 7051, also known as a touch screen, may collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any other suitable object or accessory on or near the touch panel 7051).

[0270] Specifically, the touch panel 7051 can detect the user's touch operation, detect the signal brought by the touch operation, convert these signals into touch point coordinates, send them to the processor 7010, and receive and execute the command sent by the processor 7010. In addition, the touch panel 7051 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices 7052 can include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0271] Of course, the touch panel 7051 can cover the display panel 7041. When the touch panel 7051 detects a touch operation on or near it, it is transmitted to the processor 7010 to determine the type of touch event. Then the processor 7010 provides corresponding visual output on the display panel 7041 according to the type of touch event. Figure 7 In the embodiment, the touch panel 7051 and the display panel 7041 are used as two independent components to realize the input and output functions of the electronic device 7000, but in some embodiments, the touch panel 7051 and the display panel 7041 can be integrated to realize the input and output functions of the electronic device 7000.

[0272] The electronic device 7000 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs of specific applications, the electronic device 7000 may also include other components such as a camera. Since these components are not the key components used in the embodiments of the present disclosure, Figure 7It is not shown and will not be described in detail.

[0273] Those skilled in the art will understand that Figure 7 The electronic device is merely an example and does not limit the electronic device, and may include more or less components than those shown in the figure, or may combine certain components, or may include different components.

[0274] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing the present disclosure, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

Claims

1. A charging method, characterized in that: The method comprises: After the charging communication channel is established, an authentication verification request message is sent to the power supply device based on a session seed and a random number; the session seed and the random number are both used for data encryption; the charging communication channel is established based on the first charging protocol; When it is determined that an authentication verification response message returned by the power supply device is received, obtaining the first encrypted data contained in the authentication verification response message; Perform encryption based on the session seed and the random number to obtain second encrypted data; Performing authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result; According to the authentication result, a corresponding charging operation is performed.

2. The method according to claim 1, characterized in that The authentication verification request message and the authentication verification response message are both unstructured factory-defined messages; The unstructured factory-defined message includes the following command parameters: a session seed parameter and a random number parameter; The session seed parameter is used to indicate whether to send a session seed; the random number parameter is used to indicate whether to send a random number.

3. The method according to claim 2, characterized in that The performing authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result includes: Comparing the first encrypted data with the second encrypted data to obtain a first comparison result; If the first comparison result is that the data is consistent, then determining the authentication verification result is that the authentication verification is successful; Otherwise, the authentication verification result is determined to be authentication verification failure.

4. The method according to claim 2, characterized in that: The performing authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result includes: Comparing partial data in the first encrypted data with corresponding partial data in the second encrypted data to obtain a second comparison result; When the second comparison result indicates that the data is inconsistent, determining the authentication verification result is an authentication verification failure; When the second comparison result indicates that the data are consistent, sending a reverse authentication request instruction including the second encrypted data to the power supply device; Receive a reverse authentication response instruction containing the authentication verification result, which is returned by the power supply device based on the reverse authentication request instruction.

5. The method according to claim 4, characterized in that The reverse authentication request instruction and the reverse authentication response instruction are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: reverse authentication parameters and verification result parameters; The reverse authentication parameter is used to indicate whether to reversely authenticate; the verification result parameter is used to indicate whether to send the authentication verification result.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Sending a device operation information request instruction to the power supply device; receiving a device operation information response instruction containing device operation information returned by the power supply device based on the device operation information request instruction; Among them, the device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus and current temperature; the device operation information request instruction is an unstructured factory-defined message, and the unstructured factory-defined message contains at least one of the following command parameters: firmware version parameter, voltage bus voltage parameter and current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

7. The method according to any one of claims 2 to 5, characterized in that: The unstructured factory-defined message further includes at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter; The connection status parameter is used to indicate the connection status with the power supply device; The current compensation removal parameter is used to indicate whether to remove the current compensation of the power supply device; The permission status parameter is used to indicate whether the structured factory-defined message is allowed to be sent.

8. A charging method, characterized in that: The method comprises: After the charging communication channel is established, if an authentication verification request message sent by the power-consuming device is received, encryption is performed according to the session seed and the random number in the authentication verification request message to obtain first encrypted data; the charging communication channel is established based on the first charging protocol; Returning an authentication response message including the first encrypted data to the power-consuming device; the first encrypted data is used for authentication verification; If an authentication result message returned by the electric device is received, determining the authentication verification result according to the authentication result message; According to the authentication result, a corresponding charging operation is performed.

9. The method according to claim 8, characterized in that The authentication verification request message and the authentication verification response message are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: a session seed parameter and a random number parameter; The session seed parameter is used to indicate whether to send a session seed; the random number parameter is used to indicate whether to send a random number.

10. The method according to claim 9, characterized in that If an authentication result message returned by the electric device is received, determining the authentication verification result according to the authentication result message includes: If a reverse authentication request instruction including second encrypted data is received from the electric device, the second encrypted data included in the reverse authentication request instruction is obtained; the authentication result message includes the reverse authentication request instruction; The authentication verification result is obtained according to a third comparison result between partial data in the first encrypted data and corresponding partial data in the second encrypted data.

11. The method according to claim 10, characterized in that The reverse authentication request instruction and the reverse authentication response instruction are both unstructured factory-defined messages; the unstructured factory-defined message includes the following command parameters: reverse authentication parameters and verification result parameters; The reverse authentication parameter is used to indicate whether to reversely authenticate; the verification result parameter is used to indicate whether to send the authentication verification result.

12. The method according to any one of claims 8 to 11, characterized in that: The method further comprises: If a device operation information request instruction sent by the electric device is received, the device operation information is obtained; Sending a device operation information response instruction containing the device operation information to the electrical device; The device operation information includes at least one of the following information: firmware version information, current voltage of the voltage bus, and current temperature; The device operation information request instruction is an unstructured factory-defined message, and the unstructured factory-defined message includes at least one of the following command parameters: a firmware version parameter, a voltage bus voltage parameter, and a current temperature parameter; the firmware version parameter is used to indicate whether to obtain the firmware version information of the power supply device; the voltage bus voltage parameter is used to indicate whether to obtain the current voltage of the voltage bus of the power supply device; the current temperature parameter is used to indicate whether to obtain the current temperature of the power supply device.

13. The method according to any one of claims 9 to 11, characterized in that: The unstructured factory-defined message further includes at least one command parameter: a connection status parameter, a removal current compensation parameter, and a permission status parameter; The connection status parameter is used to indicate the connection status with the power supply device; The current compensation removal parameter is used to indicate whether to remove the current compensation of the power supply device; The permission status parameter is used to indicate whether the structured factory-defined message is allowed to be sent.

14. A charging device, characterized in that: The device comprises: A sending unit, configured to send an authentication request message to the power supply device based on a session seed and a random number after establishing a charging communication channel; the session seed and the random number are both used for data encryption; the charging communication channel is established based on a first charging protocol; an acquiring unit, configured to acquire the first encrypted data contained in the authentication verification response message when determining that the authentication verification response message returned by the power supply device is received; an encryption unit, configured to perform encryption based on the session seed and the random number to obtain second encrypted data; A verification unit, configured to perform authentication verification according to the first encrypted data and the second encrypted data to obtain an authentication verification result; The execution unit is used to execute a corresponding charging operation according to the authentication result.

15. A charging device, characterized in that: The device comprises: an encryption unit, configured to, after establishing a charging communication channel, encrypt according to a session seed and a random number in the authentication request message to obtain first encrypted data if an authentication request message sent by the power-consuming device is received; the charging communication channel is established based on the first charging protocol; A returning unit, configured to return an authentication response message including the first encrypted data to the electric device; the first encrypted data is used for authentication verification; A determination unit, configured to determine an authentication verification result according to the authentication result message if an authentication result message returned by the electric device is received; The execution unit is used to execute a corresponding charging operation according to the authentication result.

16. An electronic device, characterized in that: include: processor; as well as A memory storing computer instructions, wherein the computer instructions are used to enable the processor to execute the method according to any one of claims 1 to 7.

17. A computer-readable storage medium, characterized in that: Computer instructions are stored, and the computer instructions are used to make a computer execute the method according to any one of claims 1 to 7.

18. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device performs the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Charging control method and device, electric equipment, charging equipment, system and medium

    CN111864858A

  • Charging pile authentication method, charging system, vehicle-mounted equipment, charging pile, cloud server and computer program product

    CN118590877A