WO2023245356A1 - Charging method and apparatus for electronic device, and electronic device and storage medium - Google Patents

Charging method and apparatus for electronic device, and electronic device and storage medium Download PDF

Info

Publication number
WO2023245356A1
WO2023245356A1 PCT/CN2022/099918 CN2022099918W WO2023245356A1 WO 2023245356 A1 WO2023245356 A1 WO 2023245356A1 CN 2022099918 W CN2022099918 W CN 2022099918W WO 2023245356 A1 WO2023245356 A1 WO 2023245356A1
Authority
WO
WIPO (PCT)
Prior art keywords
battery
authentication
encryption
charging
electronic device
Prior art date
Application number
PCT/CN2022/099918
Other languages
French (fr)
Chinese (zh)
Inventor
田富涛
Original Assignee
北京小米移动软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to PCT/CN2022/099918 priority Critical patent/WO2023245356A1/en
Priority to CN202280004266.6A priority patent/CN117616658A/en
Publication of WO2023245356A1 publication Critical patent/WO2023245356A1/en

Links

Images

Definitions

  • the present disclosure relates to the field of electronic technology, and in particular, to a charging method for electronic equipment, a charging device for electronic equipment, electronic equipment, and a storage medium.
  • the present disclosure provides a charging method for electronic equipment, a charging device for electronic equipment, electronic equipment and a storage medium.
  • a first aspect of an embodiment of the present disclosure provides a charging method for an electronic device.
  • the battery of the electronic device has an encryption unit.
  • the charging method includes:
  • the charging mode of the electronic device is determined, wherein the charging power for charging the battery is different in different charging modes.
  • the first encryption authentication is determined to be encryption authentication of the battery based on a first encryption method
  • sending authentication information to the cloud server includes:
  • the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
  • performing encryption authentication on the battery based on the first encryption method includes:
  • Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
  • the encryption and authentication of the battery based on the second encryption method includes:
  • Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
  • performing encryption authentication on the battery based on the first public key and the first private key includes:
  • the second character code is encrypted based on the first private key to obtain a second ciphertext
  • the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
  • performing encryption authentication on the battery based on the second public key and the second private key includes:
  • the encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
  • determining the charging mode of the electronic device according to the authentication result includes:
  • the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode
  • the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
  • determining to charge the electronic device in the first charging mode includes:
  • the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
  • the predetermined time After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
  • the charging method further includes:
  • the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
  • sending authentication information to the cloud server includes:
  • the authentication information is sent to the cloud server.
  • the charging method includes:
  • the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
  • determining the charging mode of the electronic device includes:
  • the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
  • the charging method further includes:
  • the cloud server determines that the battery is an authorized battery and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
  • a second aspect of the embodiment of the present disclosure provides a charging method for an electronic device, which is applied to a cloud server that is communicatively connected to the electronic device.
  • the charging method includes:
  • verifying whether the battery of the electronic device is an authorized battery through the authentication information, and obtaining the authentication result includes:
  • the authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
  • determining the authentication result based on the matching result of the fourth character code and the first character code includes:
  • the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
  • a third aspect of an embodiment of the present disclosure provides a charging device for an electronic device.
  • the battery of the electronic device has an encryption unit.
  • the charging device includes:
  • a first processing unit configured to perform first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery;
  • a second processing unit configured to send authentication information to the cloud server when the first encryption authentication passes, wherein the authentication information is associated with the battery;
  • a third processing unit configured to receive an authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
  • the fourth processing unit is configured to determine the charging mode of the electronic device according to the authentication result, wherein the charging power for charging the battery is different in different charging modes.
  • the first encryption authentication is determined to be encryption authentication of the battery based on a first encryption method
  • the second processing unit is used to calculate the second processing unit.
  • the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
  • the first processing unit is used to calculate the first processing unit.
  • Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
  • the second processing unit is used to calculate the second processing unit.
  • Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
  • the first processing unit is used to calculate the first processing unit.
  • the second character code is encrypted based on the first private key to obtain a second ciphertext
  • the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
  • the second processing unit is used to calculate the second processing unit.
  • the encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode
  • the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
  • the predetermined time After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
  • the second processing unit is used to calculate the second processing unit.
  • the authentication information is sent to the cloud server.
  • the second processing unit is used to calculate the second processing unit.
  • the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the cloud server determines that the battery is an authorized battery and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
  • a fourth aspect of the embodiment of the present disclosure provides a charging device for electronic equipment, applied to a cloud server that is communicatively connected to the electronic equipment.
  • the charging device includes:
  • a first processing unit configured to receive authentication information transmitted by the electronic device
  • a second processing unit configured to verify whether the battery of the electronic device is an authorized battery through the authentication information, and obtain an authentication result
  • a third processing unit configured to feed back the authentication result to the electronic device.
  • the second processing unit is used to calculate the second processing unit.
  • the authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
  • the second processing unit is used to calculate the second processing unit.
  • the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
  • a fifth aspect of the embodiment of the present disclosure provides an electronic device, including:
  • a processor and memory for storing a computer program capable of running on the processor
  • a battery the battery of the electronic device has an encryption unit; wherein the processor is used to execute the steps of the method described in the first aspect or the second aspect when running the computer program.
  • a sixth aspect of the embodiments of the present disclosure provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to perform the steps of the method described in the first aspect or the second aspect.
  • the battery of the electronic device has an encryption unit.
  • the charging method includes: performing a first encryption authentication on the battery through an encryption unit, where the first encryption authentication is used to authenticate whether the battery is an authorized battery; when the first encryption authentication is passed, sending authentication information to the cloud server, Among them, the authentication information is associated with the battery; the authentication result fed back by the cloud server is received, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery; and the charging mode of the electronic device is determined according to the authentication result, wherein the different The charging power for charging the battery in charging mode is different.
  • the second encryption authentication when the first encryption authentication is passed, the second encryption authentication is performed, which includes sending authentication information to the cloud server, and determining the charging mode of the electronic device through the authentication result of the authentication information by the cloud server. Since the second encryption authentication authenticates the authentication information in the cloud server, the corresponding information used in the authentication process is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
  • Figure 1 is a flowchart 1 of a charging method for an electronic device according to an exemplary embodiment.
  • Figure 2 is a flowchart 2 of a charging method for an electronic device according to an exemplary embodiment.
  • FIG. 3 is a schematic diagram of an application scenario of a charging method for an electronic device according to an exemplary embodiment.
  • Figure 4 is a flow chart 3 of a charging method for an electronic device according to an exemplary embodiment.
  • Figure 5 is a flow chart 4 of a charging method for an electronic device according to an exemplary embodiment.
  • FIG. 6 is a schematic structural diagram of a charging device for electronic equipment according to an exemplary embodiment.
  • FIG. 7 is a schematic structural diagram 2 of a charging device for electronic equipment according to an exemplary embodiment.
  • FIG. 8 is a device block diagram of an electronic device according to an exemplary embodiment.
  • first, second, third, etc. may be used to describe various information in the embodiments of the present disclosure, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other.
  • first information may also be called second information, and similarly, the second information may also be called first information.
  • word “if” as used herein may be interpreted as "when” or "when” or "in response to determining.”
  • FIG. 1 illustrates a charging method for an electronic device provided by an embodiment of the present disclosure.
  • the battery of the electronic device has an encryption unit.
  • Figure 1 is a flowchart 1 of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 1, the charging method includes:
  • Step 10 Perform a first encryption authentication on the battery through the encryption unit, where the first encryption authentication is used to authenticate whether the battery is an authorized battery;
  • Step 11 If the first encryption authentication passes, send authentication information to the cloud server, where the authentication information is associated with the battery;
  • Step 12 Receive the authentication result fed back by the cloud server, wherein the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
  • Step 13 Determine the charging mode of the electronic device according to the authentication result, wherein the charging power for charging the battery is different in different charging modes.
  • the first encryption authentication may be performed in the authentication system of the electronic device.
  • the authentication system can be a device system. Because the device system may be an open source system.
  • performing the second encryption authentication includes sending authentication information associated with the battery to the cloud server and receiving the authentication result fed back by the cloud server.
  • the charging mode of the electronic device is determined.
  • the cloud server can authenticate the authentication information and obtain an authentication result indicating whether the battery is an authorized battery.
  • Electronic devices can include mobile phones, tablets, laptops and other electronic devices. Device systems include mobile operating systems such as Android systems.
  • the battery of the electronic device has an encryption unit.
  • the charging method includes: performing a first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to determine whether the battery is an authorized battery. Perform authentication; when the first encryption authentication passes, send authentication information to the cloud server, where the authentication information is associated with the battery; receive the authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used Indicates whether the battery is an authorized battery; based on the authentication result, the charging mode of the electronic device is determined.
  • the charging power for charging the battery is different in different charging modes.
  • the second encryption authentication when the first encryption authentication is passed, the second encryption authentication is performed, which includes sending authentication information to the cloud server, and determining the charging mode of the electronic device through the authentication result of the authentication information by the cloud server. Since the second encryption authentication authenticates the authentication information in the cloud server, the corresponding information used in the authentication process is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
  • the first encryption authentication is determined to be encryption authentication of the battery based on a first encryption method
  • sending authentication information to the cloud server includes:
  • the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
  • the first encryption method and the second encryption method are different, which may include: the encryption unit or encryption address of the first encryption method is different from the encryption unit or encryption address of the second encryption method, which may also include the first encryption method.
  • the public key and private key used for encryption and decryption in the second encryption method are different from the public key and private key used for encryption and decryption in the second encryption method.
  • performing encryption authentication on the battery based on the first encryption method includes:
  • Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
  • the encryption and authentication of the battery based on the second encryption method includes:
  • Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
  • the first public key and the first private key used in the first encryption method are different from the second public key and the second private key used in the second encryption method. That is, the first public key is different from the second public key, and the first private key is different from the second private key.
  • the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery.
  • the public key is stored in the cloud server, and the second private key is stored in the encryption unit of the battery.
  • performing the second encryption authentication includes performing encryption authentication on the battery based on the second public key and the second private key. Since the second encryption authentication is performed on the cloud server through the second public key, and the second public key is stored in the cloud, and only the administrator has the authority to know it, the second public key used in the authentication process is not easily cracked by the calculator, so It can reduce the probability of battery encryption being cracked.
  • performing encryption authentication on the battery based on the first public key and the first private key includes:
  • the second character code is encrypted based on the first private key to obtain a second ciphertext
  • the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
  • the first character code may be a string containing data and letters, and may be randomly generated by the device system.
  • the first public key and the first private key may correspond based on the first encryption rule.
  • the first public key encryption can be performed on the first character code to obtain the first ciphertext.
  • the encryption unit of the battery can decrypt the first ciphertext through the first private key decryption to obtain the second character code, where the second character code is different from the first character code.
  • the first character code matches the third character code it is determined that the first encryption authentication of the battery has passed. At this time, it means that the battery may be an authorized battery, or it may be because the first encryption authentication has been deciphered. . Therefore, a second encryption authentication is required.
  • the matching of the third character code and the first character code may include: the third character code and the first character code are both character codes that comply with the same predetermined rule, for example, both have the same order of letters and numbers. character code. If the third character code does not match the first character code, then the third character code and the first character code are character codes that do not comply with the same predetermined rule.
  • the predetermined rule is that the character code is 6, which is a string, and the order is the interval setting between letters and numbers.
  • q1w1e3, and a1s2f3 are both 6 is a string, and the order is the interval setting between letters and numbers. At this time, it can be considered that q1w1e3, and a1s2f3 conforms to the character code under the same predetermined rule.
  • performing encryption authentication on the battery based on the second public key and the second private key includes:
  • the encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
  • the encryption unit when the battery is encrypted and authenticated based on the second public key and the second private key, the encryption unit can be used to authenticate the third private key based on the second private key stored in the encryption unit.
  • the two-character code is encrypted to obtain the authentication information.
  • the authentication information is transmitted to the cloud server through the authentication system.
  • determining the charging mode of the electronic device according to the authentication result includes:
  • the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode
  • the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
  • the authentication result when the charging mode of the electronic device is determined through the authentication result, the authentication result may indicate that the battery is an authorized battery or an unauthorized battery. If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode; if the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in the second charging mode.
  • the electronic device is charged.
  • the first charging mode can be understood as a fast charging mode, and its corresponding charging power is the first charging power.
  • the second charging mode can be understood as a normal charging mode, and its corresponding charging power is the second charging power. Determining the charging mode through the certification results can help reduce the situation of rapid charging of disguised batteries (i.e. unauthorized batteries), thereby reducing the risk of battery fires caused by non-compliant charging.
  • determining to charge the electronic device in the first charging mode includes:
  • the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
  • the predetermined time After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
  • the predetermined time is the length of the validity period of the battery being charged in the first charging mode after being authenticated by the cloud server as an authorized battery.
  • the authentication result determines that the battery is an authorized battery
  • the battery can be charged directly with the first charging power within a predetermined time, and there is no need to perform authorization verification on the battery. But after a predetermined time, re-certify whether the battery is an authorized battery.
  • the predetermined time has elapsed, before re-certifying whether the battery is an authorized battery, the second public key and the second private key used for encryption authentication are updated to increase the effectiveness of the re-certification.
  • the charging method further includes:
  • the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
  • the cloud server determines that the battery is an unauthorized battery, it can be determined that the first encryption authentication of the battery has been cracked.
  • the first public key and the first private key need to be updated to increase the effectiveness of the first encryption authentication.
  • sending authentication information to the cloud server includes:
  • the authentication information is sent to the cloud server.
  • the electronic device since the second encryption authentication requires sending authentication information to the cloud server, the electronic device needs to determine whether the electronic device has established communication with the cloud server before performing the second encryption authentication after passing the first encryption authentication. connect. After the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
  • the charging method includes:
  • the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
  • the third charging power is smaller than the first charging power, but the third charging power is larger than the second charging power.
  • the first charging power is a fast charging power of 120 watts
  • the second charging power is a slow charging power of 5 watts
  • the third charging power may be 15 watts.
  • determining the charging mode of the electronic device includes:
  • the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
  • the battery when the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the battery can be marked as a disguised battery.
  • Tag information may include tag number, tag barcode, etc. Mark the disguised battery with a specific marking number or marking barcode for identification by the authentication system, and upload the marking information of the disguised battery to the cloud server for recording.
  • the charging method further includes:
  • the cloud server determines that the battery is an authorized battery and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
  • the predetermined time is determined to be one month, and when the battery determined to be authorized is charged for the second time, as long as the authorization time to the second charging time is within one month, it is determined that the time to pass the verification does not exceed the predetermined time. At this time The validity of said verification pass may be delayed. That is, no authorization verification is required when charging for the second time.
  • FIG. 1 An embodiment of the present disclosure provides a charging method for an electronic device, which is applied to a cloud server that is communicatively connected to the electronic device.
  • Figure 2 is a flowchart 2 of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 2, charging methods include:
  • Step 20 Receive the authentication information transmitted by the electronic device
  • Step 21 Verify whether the battery of the electronic device is an authorized battery through the authentication information, and obtain the authentication result
  • Step 22 Feed back the authentication result to the electronic device.
  • the cloud server can authenticate the received authentication information to verify whether the battery of the electronic device is an authorized battery. For example, if the cloud server can authenticate the received authentication information successfully, then it can be verified that the battery of the electronic device is an authorized battery; or if the cloud server cannot authenticate the received authentication information, it can be verified that the battery of the electronic device is an authorized battery. Unauthorized battery. Feeding back the authentication result to the electronic device means feeding back the result of whether the battery is an authorized battery to the electronic device. In this application, since the authentication work of the authentication information is completed by the cloud server, the corresponding information used in the authentication process stored in the cloud server is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
  • verifying whether the battery of the electronic device is an authorized battery through the authentication information, and obtaining the authentication result includes:
  • the authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
  • the authentication information when the cloud server authenticates the authentication information, the authentication information can be decrypted using the second public key in the cloud server to obtain the fourth character code.
  • determining the authentication result based on the matching result of the fourth character code and the first character code includes:
  • the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
  • the matching of the fourth character code and the first character code may include: the fourth character code and the first character code are both character codes that comply with the same predetermined rule, for example, both are character codes with the same order of letters and numbers. If the fourth character code does not match the first character code, then the fourth character code and the first character code are character codes that do not comply with the same predetermined rule.
  • the predetermined rule is that the character code is 6, which is a string, and the order is the interval setting between letters and numbers.
  • q1w1e3, and a1s2f3 are both 6 is a string, and the order is the interval setting between letters and numbers. At this time, it can be considered that q1w1e3, and a1s2f3 conforms to the character code under the same predetermined rule.
  • FIG. 3 is a schematic diagram of an application scenario of a charging method for an electronic device according to an exemplary embodiment.
  • the battery of the mobile phone contains an encryption IC chip as the encryption unit of the battery.
  • Encryption IC chips can be used to encrypt and decrypt character codes.
  • the encryption IC chip is built with a first private key corresponding to the first public key and a second private key corresponding to the second public key.
  • the first public key is located in the mobile phone authentication system, and the second public key is located in the cloud server.
  • the first encryption authentication and the encryption and decryption in the second encryption authentication based on the first private key and the second private key can be realized between the mobile phone system side and the battery IC; the battery encryption IC can transmit the second ciphertext to the cloud through the mobile phone system side
  • the second ciphertext and the matching result of the second character code and the first character code can be transmitted between the server, the cloud server and the mobile phone system; the cloud server authorizes the mobile phone to adjust the charging power of the battery based on the relevant communication protocol based on the matching result.
  • FIG. 4 is a flow chart 3 of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 4, the process includes:
  • Step 41 Start, obtain electronic equipment
  • Step 42 Initialize the electronic device system
  • Step 43 Before charging the battery, perform encryption verification to verify whether the first encryption authentication is passed. If yes, perform step 44. Otherwise, set the battery charging power to the minimum power;
  • Step 44 Verify whether the electronic device is connected to the network, if so, proceed to step 45, otherwise limit the power to 15 watts;
  • Step 45 Verify whether the second encryption authentication is passed. If yes, proceed to step 46. Otherwise, mark the battery as a disguised battery, upload the cloud verification result, and limit the charging power to the minimum power;
  • Step 46 The fast charging power limit is lifted
  • Step 47 Check whether the cloud's fast charging authorization for the electronic device system has expired. If so, re-execute step 43 for an encryption verification. Otherwise, delay and continue to authorize the fast charging permission for the electronic device system.
  • FIG. 5 is a flow chart 4 of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 5, the process includes:
  • Step 30 The equipment system generates the first character code
  • Step 31 The device system performs first public key encryption on the first character code to obtain the first ciphertext
  • Step 32 The device system transmits the first ciphertext to the encryption unit of the battery;
  • Step 33 The battery encryption unit decrypts the first ciphertext using the first private key to obtain the second character code
  • Step 34 The battery encryption unit sends the second character code to the device system
  • Step 35 The device system verifies whether the first character code and the second character code match, and if not, limits the charging power of the battery;
  • Step 36 If the first character code matches the second character code, the battery encryption unit encrypts the second character code through the second private key to obtain the second ciphertext;
  • Step 37 The encryption unit transmits the second ciphertext to the cloud server through the device system;
  • Step 38 The cloud server decrypts the second ciphertext through the second public key to obtain the third character code
  • Step 39 When the first character code matches the third character code, the cloud server can authorize the device system to charge the battery in the fast charge mode, otherwise the charging power of the battery is limited; where both the cloud server and the device system can perform the first character code. Matching work between code and third character code; battery charging power in fast charging mode is much greater than that in normal charging mode;
  • Step 40 When the number of batteries with limited charging power reaches a predetermined number, the cloud server can remotely update the first public key and the first private key;
  • Step 41 When the authorization time reaches the predetermined time, the cloud server can remotely update the second public key and the second private key;
  • Step 42 The device system can charge the battery according to the matching result of the first character code and the third character code.
  • FIG. 6 is a schematic structural diagram of a charging device for electronic equipment according to an exemplary embodiment. As shown in Figure 6, the charging device includes:
  • the first processing unit 51 is configured to perform first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery;
  • the second processing unit 52 is configured to send authentication information to the cloud server when the first encryption authentication passes, where the authentication information is associated with the battery;
  • the third processing unit 53 is configured to receive an authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
  • the fourth processing unit 54 is configured to determine the charging mode of the electronic device according to the authentication result, wherein the charging power for charging the battery is different in different charging modes.
  • the first encryption authentication may be performed in the authentication system of the electronic device.
  • the authentication system can be a device system. Because the device system may be an open source system.
  • performing the second encryption authentication includes sending authentication information associated with the battery to the cloud server and receiving the authentication result fed back by the cloud server.
  • the charging mode of the electronic device is determined.
  • the cloud server can authenticate the authentication information and obtain an authentication result indicating whether the battery is an authorized battery.
  • Electronic devices can include mobile phones, tablets, laptops and other electronic devices. Device systems include mobile operating systems such as Android systems.
  • the charging device of the electronic device in the embodiment of the present disclosure is used to: perform first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery; in the case where the first encryption authentication is passed Next, send authentication information to the cloud server, where the authentication information is associated with the battery; receive the authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery; according to the authentication result, Determine the charging mode of the electronic device, wherein the charging power for charging the battery is different in different charging modes.
  • the second encryption authentication when the first encryption authentication is passed, the second encryption authentication is performed, which includes sending authentication information to the cloud server, and determining the charging mode of the electronic device through the authentication result of the authentication information by the cloud server. Since the second encryption authentication authenticates the authentication information in the cloud server, the corresponding information used in the authentication process is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
  • the first encryption authentication is determined to be encryption authentication of the battery based on a first encryption method
  • the second processing unit is used to calculate the second processing unit.
  • the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
  • the first encryption method and the second encryption method are different, which may include: the encryption unit or encryption address of the first encryption method is different from the encryption unit or encryption address of the second encryption method, which may also include the first encryption method.
  • the public key and private key used for encryption and decryption in the second encryption method are different from the public key and private key used for encryption and decryption in the second encryption method.
  • the first processing unit is used to calculate the first processing unit.
  • Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
  • the second processing unit is used to calculate the second processing unit.
  • Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
  • the first public key and the first private key used in the first encryption method are different from the second public key and the second private key used in the second encryption method. That is, the first public key is different from the second public key, and the first private key is different from the second private key.
  • the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery.
  • the public key is stored in the cloud server, and the second private key is stored in the encryption unit of the battery.
  • performing the second encryption authentication includes performing encryption authentication on the battery based on the second public key and the second private key. Since the second encryption authentication is performed on the cloud server through the second public key, and the second public key is stored in the cloud, and only the administrator has the authority to know it, the second public key used in the authentication process is not easily cracked by the calculator, so It can reduce the probability of battery encryption being cracked.
  • the first processing unit is used to calculate the first processing unit.
  • the second character code is encrypted based on the first private key to obtain a second ciphertext
  • the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
  • the first character code may be a string containing data and letters, and may be randomly generated by the device system.
  • the first public key and the first private key may correspond based on the first encryption rule.
  • the first public key encryption can be performed on the first character code to obtain the first ciphertext.
  • the encryption unit of the battery can decrypt the first ciphertext through the first private key decryption to obtain the second character code, where the second character code is different from the first character code.
  • the first character code matches the third character code it is determined that the first encryption authentication for the battery has passed. At this time, it means that the battery may be an authorized battery, or it may be because the first encryption authentication has been deciphered. . Therefore, a second encryption authentication is required.
  • the matching of the third character code and the first character code may include: the third character code and the first character code are both character codes that comply with the same predetermined rule, for example, both have the same order of letters and numbers. character code. If the third character code does not match the first character code, then the third character code and the first character code are character codes that do not comply with the same predetermined rule.
  • the predetermined rule is that the character code is 6 as a string, and the order is the interval setting between letters and numbers.
  • q1w1e3, and a1s2f3 are both 6 as a string, and the order is the interval setting between letters and numbers. At this time, it can be considered that q1w1e3, and a1s2f3 conforms to the character code under the same predetermined rule.
  • the second processing unit is used to calculate the second processing unit.
  • the encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
  • the encryption unit when the battery is encrypted and authenticated based on the second public key and the second private key, the encryption unit can be used to authenticate the third private key based on the second private key stored in the encryption unit.
  • the two-character code is encrypted to obtain the authentication information.
  • the authentication information is transmitted to the cloud server through the authentication system.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode
  • the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
  • the authentication result when the charging mode of the electronic device is determined through the authentication result, the authentication result may indicate that the battery is an authorized battery or an unauthorized battery. If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode; if the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in the second charging mode.
  • the electronic device is charged.
  • the first charging mode can be understood as a fast charging mode, and its corresponding charging power is the first charging power.
  • the second charging mode can be understood as a normal charging mode, and its corresponding charging power is the second charging power. Determining the charging mode through the certification results can help reduce the situation of rapid charging of disguised batteries (i.e. unauthorized batteries), thereby reducing the risk of battery fires caused by non-compliant charging.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
  • the predetermined time After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
  • the predetermined time is the length of the validity period of the battery being charged in the first charging mode after being authenticated by the cloud server as an authorized battery.
  • the authentication result determines that the battery is an authorized battery
  • the battery can be charged directly with the first charging power within a predetermined time, and there is no need to perform authorization verification on the battery. But after a predetermined time, re-certify whether the battery is an authorized battery.
  • the predetermined time has elapsed, before re-certifying whether the battery is an authorized battery, the second public key and the second private key used for encryption authentication are updated to increase the effectiveness of the re-certification.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
  • the cloud server determines that the battery is an unauthorized battery, it can be determined that the first encryption authentication of the battery has been cracked.
  • the first public key and the first private key need to be updated to increase the effectiveness of the first encryption authentication.
  • the second processing unit is used to calculate the second processing unit.
  • the authentication information is sent to the cloud server.
  • the electronic device since the second encryption authentication requires sending authentication information to the cloud server, the electronic device needs to determine whether the electronic device has established communication with the cloud server before performing the second encryption authentication after passing the first encryption authentication. connect. After the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
  • the second processing unit is used to calculate the second processing unit.
  • the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
  • the third charging power is smaller than the first charging power, but the third charging power is larger than the second charging power.
  • the first charging power is a fast charging power of 120 watts
  • the second charging power is a slow charging power of 5 watts
  • the third charging power may be 15 watts.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
  • the battery when the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the battery can be marked as a disguised battery.
  • Tag information may include tag number, tag barcode, etc. Mark the disguised battery with a specific marking number or marking barcode for identification by the authentication system, and upload the marking information of the disguised battery to the cloud server for recording.
  • the fourth processing unit is used to calculate the fourth processing unit.
  • the cloud server determines that the battery is an authorized battery, and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
  • the predetermined time is determined to be one month, and when the battery determined to be authorized is charged for the second time, as long as the authorization time to the second charging time is within one month, it is determined that the time to pass the verification does not exceed the predetermined time. At this time The validity of said verification pass may be delayed. That is, no authorization verification is required when charging for the second time.
  • FIG. 7 is a schematic structural diagram of a charging device for electronic equipment according to an exemplary embodiment. As shown in Figure 7, the charging device includes:
  • the first processing unit 61 is configured to receive authentication information transmitted by the electronic device
  • the second processing unit 62 is configured to use the authentication information to verify whether the battery of the electronic device is an authorized battery and obtain an authentication result;
  • the third processing unit 63 is used to feed back the authentication result to the electronic device.
  • the cloud server can authenticate the received authentication information to verify whether the battery of the electronic device is an authorized battery. For example, if the cloud server can authenticate the received authentication information successfully, then it can be verified that the battery of the electronic device is an authorized battery; or if the cloud server cannot authenticate the received authentication information, it can be verified that the battery of the electronic device is an authorized battery. Unauthorized battery. Feeding back the authentication result to the electronic device means feeding back the result of whether the battery is an authorized battery to the electronic device. In this application, since the authentication work of the authentication information is completed by the cloud server, the corresponding information used in the authentication process stored in the cloud server is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
  • the second processing unit is used to calculate the second processing unit.
  • the authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
  • the authentication information when the cloud server authenticates the authentication information, the authentication information can be decrypted using the second public key in the cloud server to obtain the fourth character code.
  • determining the authentication result based on the matching result of the fourth character code and the first character code includes:
  • the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
  • the second processing unit is used to calculate the second processing unit.
  • the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
  • the matching of the fourth character code and the first character code may include: the fourth character code and the first character code are both character codes that comply with the same predetermined rule, for example, both are character codes with the same order of letters and numbers. If the fourth character code does not match the first character code, then the fourth character code and the first character code are character codes that do not comply with the same predetermined rule.
  • the predetermined rule is that the character code is 6, which is a string, and the order is the interval setting between letters and numbers.
  • q1w1e3, and a1s2f3 are both 6 is a string, and the order is the interval setting between letters and numbers. At this time, it can be considered that q1w1e3, and a1s2f3 conforms to the character code under the same predetermined rule.
  • An embodiment of the present disclosure provides an electronic device, including:
  • a processor and memory for storing a computer program capable of running on the processor
  • a battery the battery of the electronic device has an encryption unit; wherein the processor is used to execute the steps of the methods described in the above embodiments when running the computer program.
  • Embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored, and the computer program is used by a processor to execute the steps of the methods described in the above embodiments.
  • FIG. 8 is a device block diagram of an electronic device according to an exemplary embodiment.
  • the electronic device may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
  • the electronic device may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communications component 816.
  • a processing component 802 a memory 804
  • a power component 806 a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communications component 816.
  • I/O input/output
  • Processing component 802 generally controls the overall operation of the electronic device, such as operations associated with touch, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method.
  • processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components.
  • processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operations in the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 804 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Power component 806 provides power to various components of the electronic device.
  • Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic devices.
  • Multimedia component 808 includes a screen that provides an output interface between the electronic device and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. A touch sensor can not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.
  • multimedia component 808 includes a front-facing camera and/or a rear-facing camera.
  • the front camera and/or the rear camera can receive external multimedia data.
  • Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
  • Audio component 810 is configured to output and/or input audio signals.
  • audio component 810 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or sent via communication component 816 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
  • Sensor component 814 includes one or more sensors for providing various aspects of status assessment for the electronic device.
  • the sensor component 814 can detect the open/closed state of the electronic device, the relative positioning of components, such as the display and keypad of the electronic device, the sensor component 814 can also detect the position change of the electronic device or a component of the electronic device, the user The presence or absence of contact with the electronic device, the orientation or acceleration/deceleration of the electronic device and the temperature changes of the electronic device.
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 816 is configured to facilitate wired or wireless communications between electronic devices and other devices. Electronic devices can access wireless networks based on communication standards, such as WiFi, 4G or 5G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communications component 816 includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the electronic device may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable Gate array
  • controller microcontroller, microprocessor or other electronic components are implemented for executing the above method.

Abstract

The present disclosure relates to a charging method and apparatus for an electronic device, and an electronic device and a storage medium. The charging method for an electronic device comprises: performing first encryption authentication on a battery by means of an encryption unit, wherein the first encryption authentication is used for authenticating whether the battery is an authorized battery; when the first encryption authentication is passed, sending authentication information to a cloud server, wherein the authentication information is associated with the battery; receiving an authentication result, which is fed back by the cloud server, wherein the authentication result is determined according to the authentication information, and the authentication result is used for indicating whether the battery is an authorized battery; and determining a charging mode of an electronic device according to the authentication result, wherein the battery is charged with different charging powers in different charging modes. In the present application, since second encryption authentication is performed in a cloud server to authenticate authentication information, corresponding information used during the authentication process is not prone to being cracked by means of a computer, such that the probability of the encryption of a battery being cracked can be reduced.

Description

电子设备的充电方法、充电装置、电子设备及存储介质Charging method, charging device, electronic equipment and storage medium for electronic equipment 技术领域Technical field
本公开涉及电子技术领域,尤其涉及一种电子设备的充电方法、电子设备的充电装置、电子设备及存储介质。The present disclosure relates to the field of electronic technology, and in particular, to a charging method for electronic equipment, a charging device for electronic equipment, electronic equipment, and a storage medium.
背景技术Background technique
随着电子技术发展,很多电子设备安装有属于自己的专用电池。为了防止专用电池被伪装电池替换,会通过加密解密的方式来确认电池是否为真的专用电池。发现伪装电池时,可对其进行充电功率限制。但很多电子设备系统是开源的,第三方可以通过开源的系统代码中找到公钥、明文、被私钥加密的密文及关于私钥的相关信息,从而存在被超级计算器破解的风险。With the development of electronic technology, many electronic devices are equipped with their own special batteries. In order to prevent the special battery from being replaced by a fake battery, encryption and decryption will be used to confirm whether the battery is a real special battery. When a camouflaged battery is discovered, its charging power can be limited. However, many electronic equipment systems are open source. Third parties can find the public key, plaintext, ciphertext encrypted by the private key, and related information about the private key through the open source system code, thus there is a risk of being cracked by supercomputers.
发明内容Contents of the invention
本公开提供一种电子设备的充电方法、电子设备的充电装置、电子设备及存储介质。The present disclosure provides a charging method for electronic equipment, a charging device for electronic equipment, electronic equipment and a storage medium.
本公开实施例的第一方面,提供一种电子设备的充电方法,所述电子设备的电池具有加密单元,所述充电方法,包括:A first aspect of an embodiment of the present disclosure provides a charging method for an electronic device. The battery of the electronic device has an encryption unit. The charging method includes:
通过所述加密单元对所述电池进行第一加密认证,其中,所述第一加密认证用于对所述电池是否为授权电池进行认证;Perform a first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery;
在所述第一加密认证通过的情况下,向云端服务器发送认证信息,其中,所述认证信息与所述电池相关联;If the first encrypted authentication passes, send authentication information to the cloud server, where the authentication information is associated with the battery;
接收所述云端服务器反馈的认证结果,其中,所述认证结果根据所述认证信息确定,所述认证结果用于指示所述电池是否为授权电池;Receive an authentication result fed back by the cloud server, wherein the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
根据所述认证结果,确定所述电子设备的充电模式,其中不同充电模式下对所述电池进行充电的充电功率不同。According to the authentication result, the charging mode of the electronic device is determined, wherein the charging power for charging the battery is different in different charging modes.
在一些实施例中,所述第一加密认证确定为基于第一加密方式对所述电池进行加密认证;In some embodiments, the first encryption authentication is determined to be encryption authentication of the battery based on a first encryption method;
所述在所述第一加密认证通过的情况下,向云端服务器发送认证信息,包括:If the first encryption authentication passes, sending authentication information to the cloud server includes:
在所述第一加密认证通过的情况下,基于第二加密方式对所述电池进行加密认证,生成所述认证信息;所述第二加密方式不同于所述第一加密方式。If the first encryption authentication passes, the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
在一些实施例中,所述基于第一加密方式对所述电池进行加密认证,包括:In some embodiments, performing encryption authentication on the battery based on the first encryption method includes:
基于第一公钥与第一私钥,对所述电池进行加密认证,其中所述第一公钥存储于所述电子设备的认证系统,所述第一私钥存储于所述电池的加密单元;Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
所述基于第二加密方式对所述电池进行加密认证,包括:The encryption and authentication of the battery based on the second encryption method includes:
基于所述第二公钥与第二私钥,对所述电池进行加密认证,其中所述公钥存储于所述云端服务器,所述第二私钥存储于所述电池的加密单元;所述第一公钥不同于所述第二公钥,所述第一私钥不同于所述第二私钥。Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
在一些实施例中,所述基于第一公钥与第一私钥,对所述电池进行加密认证,包括:In some embodiments, performing encryption authentication on the battery based on the first public key and the first private key includes:
获取第一字符码;Get the first character code;
基于所述第一公钥对所述第一字符码进行加密,得到第一密文;Encrypt the first character code based on the first public key to obtain a first ciphertext;
通过所述加密单元,基于所述第一私钥对所述第一密文解密,得到第二字符码;Decrypt the first ciphertext based on the first private key through the encryption unit to obtain a second character code;
通过所述加密单元,基于所述第一私钥对所述第二字符码加密,得到第二密文;Through the encryption unit, the second character code is encrypted based on the first private key to obtain a second ciphertext;
通过所述第一公钥,对所述第二密文进行解密,得到第三字符码;Decrypt the second ciphertext using the first public key to obtain a third character code;
若所述第一字符码与所述第三字符码匹配,则确定对所述电池的所述第一加密认证通过。If the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
在一些实施例中,所述基于所述第二公钥与第二私钥,对所述电池进行加密认证,包括:In some embodiments, performing encryption authentication on the battery based on the second public key and the second private key includes:
通过所述加密单元,基于所述第二私钥对所述第二字符码加密,得到所述认证信息。The encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
在一些实施例中,所述根据所述认证结果,确定所述电子设备的充电模式,包括:In some embodiments, determining the charging mode of the electronic device according to the authentication result includes:
若所述认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电;If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode;
若所述认证结果确定为所述电池为未授权电池,则确定以第二充电模式对所述电子设备进行充电;其中,所述第一充电模式对应于第一充电功率,所述第二充电模式对应于第二充电功率,所述第一充电功率大于所述第二充电功率。If the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
在一些实施例中,所述若所述认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电,包括:In some embodiments, if the authentication result determines that the battery is an authorized battery, determining to charge the electronic device in the first charging mode includes:
若所述认证结果确定为所述电池为授权电池,则预定时间内以第一充电功率对所述电池充电;If the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
所述预定时间后,重新认证所述电池是否为授权电池,包括:更新用于加密认证的第二公钥与第二私钥;其中,所述预定时间为所述电池被云端服务器认证为授权电池后以第一充电模式进行充电的有效期限的时间长度。After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
在一些实施例中,所述充电方法还包括:In some embodiments, the charging method further includes:
若所述第一加密认证通过,且所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则更新所述第一公钥和所述第一私钥。If the first encryption authentication passes and the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
在一些实施例中,所述向云端服务器发送认证信息,包括:In some embodiments, sending authentication information to the cloud server includes:
确定所述电子设备是否与所述云端服务器建立通信连接;Determine whether the electronic device has established a communication connection with the cloud server;
若所述电子设备与所述云端服务器建立通信连接,则向云端服务器发送所述认证信息。If the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
在一些实施例中,所述充电方法,包括:In some embodiments, the charging method includes:
若所述电子设备未与所述云端服务器建立通信连接,则确定以第三充电功率对所述电子设备进行充电。If the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
在一些实施例中,所述确定所述电子设备的充电模式,包括:In some embodiments, determining the charging mode of the electronic device includes:
所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则标记所述电池为伪装电池;If the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
上传所述伪装电池的标记信息至所述云端服务器。Upload the tag information of the disguised battery to the cloud server.
在一些实施例中,所述充电方法还包括:In some embodiments, the charging method further includes:
当所述云端服务器反馈的所述认证结果确定为所述电池为授权电池,对所述电池进行第二次充电时,确定验证通过的时间是否超过预定时间;When the authentication result fed back by the cloud server determines that the battery is an authorized battery and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
若验证通过的时间未超过所述预定时间,则延时所述验证通过的有效性;If the time for passing the verification does not exceed the predetermined time, delay the validity of the passing verification;
若所述验证通过的时间超过所述预定时间,则重新验证所述电池是否为授权电池。If the verification time exceeds the predetermined time, whether the battery is an authorized battery is re-verified.
本公开实施例的第二方面提供一种电子设备的充电方法,应用于与所述电子设备通信连接的云端服务器,所述充电方法,包括:A second aspect of the embodiment of the present disclosure provides a charging method for an electronic device, which is applied to a cloud server that is communicatively connected to the electronic device. The charging method includes:
接收所述电子设备传输的认证信息;Receive authentication information transmitted by the electronic device;
通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果;Verify whether the battery of the electronic device is an authorized battery through the authentication information, and obtain the authentication result;
反馈所述认证结果至所述电子设备。Feed back the authentication result to the electronic device.
在一些实施例中,所述通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果,包括:In some embodiments, verifying whether the battery of the electronic device is an authorized battery through the authentication information, and obtaining the authentication result includes:
通过第二公钥对所述认证信息进行解密,得到第四字符码;Decrypt the authentication information using the second public key to obtain a fourth character code;
基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果;所述第一字符码为所述电子设备对所述电池进行第一加密认证时生成。The authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
在一些实施例中,所述基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果,包括:In some embodiments, determining the authentication result based on the matching result of the fourth character code and the first character code includes:
若所述第四字符码与第一字符码的相匹配,则确定所述电池为授权电池;If the fourth character code matches the first character code, it is determined that the battery is an authorized battery;
若所述第四字符码与第一字符码的不匹配,则确定所述电池为未授权电池。If the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
本公开实施例的第三方面提供一种电子设备的充电装置,所述电子设备的电池具有加密单元,所述充电装置,包括:A third aspect of an embodiment of the present disclosure provides a charging device for an electronic device. The battery of the electronic device has an encryption unit. The charging device includes:
第一处理单元,用于通过所述加密单元对所述电池进行第一加密认证,其中,所述第一加密认证用于对所述电池是否为授权电池进行认证;A first processing unit configured to perform first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery;
第二处理单元,用于在所述第一加密认证通过的情况下,向云端服务器发送认证信息,其中,所述认证信息与所述电池相关联;A second processing unit configured to send authentication information to the cloud server when the first encryption authentication passes, wherein the authentication information is associated with the battery;
第三处理单元,用于接收所述云端服务器反馈的认证结果,其中,所述认证结果根据所述认证信息确定,所述认证结果用于指示所述电池是否为授权电池;A third processing unit configured to receive an authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
第四处理单元,用于根据所述认证结果,确定所述电子设备的充电模式,其中不同充电模式下对所述电池进行充电的充电功率不同。The fourth processing unit is configured to determine the charging mode of the electronic device according to the authentication result, wherein the charging power for charging the battery is different in different charging modes.
在一些实施例中,所述第一加密认证确定为基于第一加密方式对所述电池进行加密认证;In some embodiments, the first encryption authentication is determined to be encryption authentication of the battery based on a first encryption method;
所述第二处理单元,用于The second processing unit is used to
在所述第一加密认证通过的情况下,基于第二加密方式对所述电池进行加密认证,生成所述认证信息;所述第二加密方式不同于所述第一加密方式。If the first encryption authentication passes, the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
在一些实施例中,所述第一处理单元,用于In some embodiments, the first processing unit is used to
基于第一公钥与第一私钥,对所述电池进行加密认证,其中所述第一公钥存储于所述电子设备的认证系统,所述第一私钥存储于所述电池的加密单元;Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
所述第二处理单元,用于The second processing unit is used to
基于所述第二公钥与第二私钥,对所述电池进行加密认证,其中所述公钥存储于所述云端服务器,所述第二私钥存储于所述电池的加密单元;所述第一公钥不同于所述第二公钥,所述第一私钥不同于所述第二私钥。Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
在一些实施例中,所述第一处理单元,用于In some embodiments, the first processing unit is used to
获取第一字符码;Get the first character code;
基于所述第一公钥对所述第一字符码进行加密,得到第一密文;Encrypt the first character code based on the first public key to obtain a first ciphertext;
通过所述加密单元,基于所述第一私钥对所述第一密文解密,得到第二字符码;Decrypt the first ciphertext based on the first private key through the encryption unit to obtain a second character code;
通过所述加密单元,基于所述第一私钥对所述第二字符码加密,得到第二密文;Through the encryption unit, the second character code is encrypted based on the first private key to obtain a second ciphertext;
通过所述第一公钥,对所述第二密文进行解密,得到第三字符码;Decrypt the second ciphertext using the first public key to obtain a third character code;
若所述第一字符码与所述第三字符码匹配,则确定对所述电池的所述第一加密认证通过。If the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
通过所述加密单元,基于所述第二私钥对所述第二字符码加密,得到所述认证信息。The encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
若所述认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电;If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode;
若所述认证结果确定为所述电池为未授权电池,则确定以第二充电模式对所述电子设备进行充电;其中,所述第一充电模式对应于第一充电功率,所述第二充电模式对应于第二充电功率,所述第一充电功率大于所述第二充电功率。If the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
若所述认证结果确定为所述电池为授权电池,则预定时间内以第一充电功率对所述电池充电;If the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
所述预定时间后,重新认证所述电池是否为授权电池,包括:更新用于加密认证的第二公钥与第二私钥;其中,所述预定时间为所述电池被云端服务器认证为授权电池后以第一充电模式进行充电的有效期限的时间长度。After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
若所述第一加密认证通过,且所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则更新所述第一公钥和所述第一私钥。If the first encryption authentication passes and the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
确定所述电子设备是否与所述云端服务器建立通信连接;Determine whether the electronic device has established a communication connection with the cloud server;
若所述电子设备与所述云端服务器建立通信连接,则向云端服务器发送所述认证信息。If the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
若所述电子设备未与所述云端服务器建立通信连接,则确定以第三充电功率对所述电子设备进行充电。If the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则标记所述电池为伪装电池;If the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
上传所述伪装电池的标记信息至所述云端服务器。Upload the tag information of the disguised battery to the cloud server.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
当所述云端服务器反馈的所述认证结果确定为所述电池为授权电池,对所述电池进行第二次充电时,确定验证通过的时间是否超过预定时间;When the authentication result fed back by the cloud server determines that the battery is an authorized battery and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
若验证通过的时间未超过所述预定时间,则延时所述验证通过的有效性;If the time for passing the verification does not exceed the predetermined time, delay the validity of the passing verification;
若所述验证通过的时间超过所述预定时间,则重新验证所述电池是否为授权电池。If the verification time exceeds the predetermined time, whether the battery is an authorized battery is re-verified.
本公开实施例的第四方面提供一种电子设备的充电装置,应用于与所述电子设备通信连接的云端服务器,所述充电装置,包括:A fourth aspect of the embodiment of the present disclosure provides a charging device for electronic equipment, applied to a cloud server that is communicatively connected to the electronic equipment. The charging device includes:
第一处理单元,用于接收所述电子设备传输的认证信息;A first processing unit configured to receive authentication information transmitted by the electronic device;
第二处理单元,用于通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果;A second processing unit, configured to verify whether the battery of the electronic device is an authorized battery through the authentication information, and obtain an authentication result;
第三处理单元,用于反馈所述认证结果至所述电子设备。A third processing unit configured to feed back the authentication result to the electronic device.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
通过第二公钥对所述认证信息进行解密,得到第四字符码;Decrypt the authentication information using the second public key to obtain a fourth character code;
基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果;所述第一字符码为所述电子设备对所述电池进行第一加密认证时生成。The authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
若所述第四字符码与第一字符码的相匹配,则确定所述电池为授权电池;If the fourth character code matches the first character code, it is determined that the battery is an authorized battery;
若所述第四字符码与第一字符码的不匹配,则确定所述电池为未授权电池。If the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
本公开实施例的第五方面提供一种电子设备,包括:A fifth aspect of the embodiment of the present disclosure provides an electronic device, including:
处理器和用于存储能够在处理器上运行的计算机程序的存储器;A processor and memory for storing a computer program capable of running on the processor;
电池,所述电子设备的电池具有加密单元;其中,所述处理器用于运行所述计算机程序时,执行上述第一方面或第二方面所述方法的步骤。A battery, the battery of the electronic device has an encryption unit; wherein the processor is used to execute the steps of the method described in the first aspect or the second aspect when running the computer program.
本公开实施例的第六方面提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行上述第一方面或第二方面所述方法的步骤。A sixth aspect of the embodiments of the present disclosure provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to perform the steps of the method described in the first aspect or the second aspect.
本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
本公开实施例中的电子设备的充电方法,电子设备的电池具有加密单元。充电方法,包括:通过加密单元对电池进行第一加密认证,其中,第一加密认证用于对电池是否为授权电池进行认证; 在第一加密认证通过的情况下,向云端服务器发送认证信息,其中,认证信息与电池相关联;接收云端服务器反馈的认证结果,其中,认证结果根据认证信息确定,认证结果用于指示电池是否为授权电池;根据认证结果,确定电子设备的充电模式,其中不同充电模式下对电池进行充电的充电功率不同。本申请中,在第一加密认证通过的情况下进行第二加密认证,包括向云端服务器发送认证信息,通过云端服务器对认证信息的认证结果来确定电子设备的充电模式。由于第二加密认证是在云端服务器内对认证信息进行认证,认证过程中用到的对应信息不容易被计算器破解,从而可减少电池加密被破解的概率。In the charging method of an electronic device in an embodiment of the present disclosure, the battery of the electronic device has an encryption unit. The charging method includes: performing a first encryption authentication on the battery through an encryption unit, where the first encryption authentication is used to authenticate whether the battery is an authorized battery; when the first encryption authentication is passed, sending authentication information to the cloud server, Among them, the authentication information is associated with the battery; the authentication result fed back by the cloud server is received, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery; and the charging mode of the electronic device is determined according to the authentication result, wherein the different The charging power for charging the battery in charging mode is different. In this application, when the first encryption authentication is passed, the second encryption authentication is performed, which includes sending authentication information to the cloud server, and determining the charging mode of the electronic device through the authentication result of the authentication information by the cloud server. Since the second encryption authentication authenticates the authentication information in the cloud server, the corresponding information used in the authentication process is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开实施例。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the embodiments of the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开实施例,并与说明书一起用于解释本公开实施例的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosed embodiments.
图1是根据一示例性实施例示出的一种电子设备的充电方法流程图一。Figure 1 is a flowchart 1 of a charging method for an electronic device according to an exemplary embodiment.
图2是根据一示例性实施例示出的一种电子设备的充电方法流程图二。Figure 2 is a flowchart 2 of a charging method for an electronic device according to an exemplary embodiment.
图3是根据一示例性实施例示出的一种电子设备的充电方法应用场景示意图。FIG. 3 is a schematic diagram of an application scenario of a charging method for an electronic device according to an exemplary embodiment.
图4是根据一示例性实施例示出的一种电子设备的充电方法流程图三。Figure 4 is a flow chart 3 of a charging method for an electronic device according to an exemplary embodiment.
图5是根据一示例性实施例示出的一种电子设备的充电方法流程图四。Figure 5 is a flow chart 4 of a charging method for an electronic device according to an exemplary embodiment.
图6是根据一示例性实施例示出的一种电子设备的充电装置结构示意图一。FIG. 6 is a schematic structural diagram of a charging device for electronic equipment according to an exemplary embodiment.
图7是根据一示例性实施例示出的一种电子设备的充电装置结构示意图二。FIG. 7 is a schematic structural diagram 2 of a charging device for electronic equipment according to an exemplary embodiment.
图8是根据一示例性实施例示出的一种电子设备的设备框图。FIG. 8 is a device block diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开实施例相一致的所有实施方式。相反,它们仅是本公开实施例的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with embodiments of the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of embodiments of the present disclosure.
在本公开实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开实施例。在本公开所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in the embodiments of the present disclosure is for the purpose of describing specific embodiments only and is not intended to limit the embodiments of the present disclosure. As used in this disclosure, the singular forms "a," "the" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本公开实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信 息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present disclosure, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the embodiments of the present disclosure, the first information may also be called second information, and similarly, the second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to determining."
请参考图1,其示出了本公开实施例提供的一种电子设备的充电方法,所述电子设备的电池具有加密单元。图1是根据一示例性实施例示出的一种电子设备的充电方法流程图一。如图1所示,所述充电方法,包括:Please refer to FIG. 1 , which illustrates a charging method for an electronic device provided by an embodiment of the present disclosure. The battery of the electronic device has an encryption unit. Figure 1 is a flowchart 1 of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 1, the charging method includes:
步骤10、通过所述加密单元对所述电池进行第一加密认证,其中,所述第一加密认证用于对所述电池是否为授权电池进行认证;Step 10: Perform a first encryption authentication on the battery through the encryption unit, where the first encryption authentication is used to authenticate whether the battery is an authorized battery;
步骤11、在所述第一加密认证通过的情况下,向云端服务器发送认证信息,其中,所述认证信息与所述电池相关联; Step 11. If the first encryption authentication passes, send authentication information to the cloud server, where the authentication information is associated with the battery;
步骤12、接收所述云端服务器反馈的认证结果,其中,所述认证结果根据所述认证信息确定,所述认证结果用于指示所述电池是否为授权电池;Step 12: Receive the authentication result fed back by the cloud server, wherein the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
步骤13、根据所述认证结果,确定所述电子设备的充电模式,其中不同充电模式下对所述电池进行充电的充电功率不同。Step 13: Determine the charging mode of the electronic device according to the authentication result, wherein the charging power for charging the battery is different in different charging modes.
本公开实施例中,第一加密认证可以在电子设备的认证系统中进行认证。认证系统可以是设备系统。由于设备系统可能是开源系统。在设备系统中进行第一加密认证时,会存在被破译的风险,因此进行第二加密认证,包括向云端服务器发送与所述电池相关联的认证信息,接收所述云端服务器反馈的认证结果,根据所述认证结果,确定所述电子设备的充电模式。其中云端服务器可对认证信息进行认证,得到指示所述电池是否为授权电池的认证结果。电子设备可以包括手机、平板、笔记本等电子设备。设备系统包括手机操作系统等例如安卓系统等。In the embodiment of the present disclosure, the first encryption authentication may be performed in the authentication system of the electronic device. The authentication system can be a device system. Because the device system may be an open source system. When performing the first encryption authentication in the device system, there is a risk of being deciphered. Therefore, performing the second encryption authentication includes sending authentication information associated with the battery to the cloud server and receiving the authentication result fed back by the cloud server. According to the authentication result, the charging mode of the electronic device is determined. The cloud server can authenticate the authentication information and obtain an authentication result indicating whether the battery is an authorized battery. Electronic devices can include mobile phones, tablets, laptops and other electronic devices. Device systems include mobile operating systems such as Android systems.
本公开实施例中的电子设备的充电方法,电子设备的电池具有加密单元,充电方法,包括:通过加密单元对电池进行第一加密认证,其中,第一加密认证用于对电池是否为授权电池进行认证;在第一加密认证通过的情况下,向云端服务器发送认证信息,其中,认证信息与电池相关联;接收云端服务器反馈的认证结果,其中,认证结果根据认证信息确定,认证结果用于指示电池是否为授权电池;根据认证结果,确定电子设备的充电模式,其中不同充电模式下对电池进行充电的充电功率不同。本申请中,在第一加密认证通过的情况下进行第二加密认证,包括向云端服务器发送认证信息,通过云端服务器对认证信息的认证结果来确定电子设备的充电模式。由于第二加密认证是在云端服务器内对认证信息进行认证,认证过程中用到的对应信息不容易被计算器破解,从而可减少电池加密被破解的概率。In the charging method of the electronic device in the embodiment of the present disclosure, the battery of the electronic device has an encryption unit. The charging method includes: performing a first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to determine whether the battery is an authorized battery. Perform authentication; when the first encryption authentication passes, send authentication information to the cloud server, where the authentication information is associated with the battery; receive the authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used Indicates whether the battery is an authorized battery; based on the authentication result, the charging mode of the electronic device is determined. The charging power for charging the battery is different in different charging modes. In this application, when the first encryption authentication is passed, the second encryption authentication is performed, which includes sending authentication information to the cloud server, and determining the charging mode of the electronic device through the authentication result of the authentication information by the cloud server. Since the second encryption authentication authenticates the authentication information in the cloud server, the corresponding information used in the authentication process is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
在一些实施例中,所述第一加密认证确定为基于第一加密方式对所述电池进行加密认证;In some embodiments, the first encryption authentication is determined to be encryption authentication of the battery based on a first encryption method;
所述在所述第一加密认证通过的情况下,向云端服务器发送认证信息,包括:If the first encryption authentication passes, sending authentication information to the cloud server includes:
在所述第一加密认证通过的情况下,基于第二加密方式对所述电池进行加密认证,生成所述认 证信息;所述第二加密方式不同于所述第一加密方式。If the first encryption authentication passes, the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
本公开实施例中,第一加密方式和第二加密方式不同,可以包括:第一加密方式的加密单元或加密地址与第二加密方式的加密单元或加密地址不同,也可以包括第一加密方式中用于加解密的公钥与私钥不同于第二加密方式中用于加解密的公钥与私钥。在所述第一加密认证通过的情况下,基于第二加密方式对所述电池进行加密认证,进而可减少电池加密被破解的概率。In the embodiment of the present disclosure, the first encryption method and the second encryption method are different, which may include: the encryption unit or encryption address of the first encryption method is different from the encryption unit or encryption address of the second encryption method, which may also include the first encryption method. The public key and private key used for encryption and decryption in the second encryption method are different from the public key and private key used for encryption and decryption in the second encryption method. When the first encryption authentication is passed, the battery is encrypted and authenticated based on the second encryption method, thereby reducing the probability that the battery encryption is cracked.
在一些实施例中,所述基于第一加密方式对所述电池进行加密认证,包括:In some embodiments, performing encryption authentication on the battery based on the first encryption method includes:
基于第一公钥与第一私钥,对所述电池进行加密认证,其中所述第一公钥存储于所述电子设备的认证系统,所述第一私钥存储于所述电池的加密单元;Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
所述基于第二加密方式对所述电池进行加密认证,包括:The encryption and authentication of the battery based on the second encryption method includes:
基于所述第二公钥与第二私钥,对所述电池进行加密认证,其中所述公钥存储于所述云端服务器,所述第二私钥存储于所述电池的加密单元;所述第一公钥不同于所述第二公钥,所述第一私钥不同于所述第二私钥。Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
本公开实施例中,第一加密方式用到的第一公钥与第一私钥,不同于第二加密方式用到的第二公钥与第二私钥。即第一公钥不同于所述第二公钥,所述第一私钥不同于所述第二私钥。In this disclosed embodiment, the first public key and the first private key used in the first encryption method are different from the second public key and the second private key used in the second encryption method. That is, the first public key is different from the second public key, and the first private key is different from the second private key.
本公开实施例中,第一公钥存储于所述电子设备的认证系统,所述第一私钥存储于所述电池的加密单元。公钥存储于所述云端服务器,所述第二私钥存储于所述电池的加密单元。当在第一加密认证通过的情况下进行第二加密认证,包括基于所述第二公钥与第二私钥,对所述电池进行加密认证。由于第二加密认证是在云端服务器通过第二公钥进行认证,第二公钥存储于云端,只有管理员有权限知道,认证过程中用到的第二公钥不容易被计算器破解,从而可减少电池加密被破解的概率。In this disclosed embodiment, the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery. The public key is stored in the cloud server, and the second private key is stored in the encryption unit of the battery. When the first encryption authentication is passed, performing the second encryption authentication includes performing encryption authentication on the battery based on the second public key and the second private key. Since the second encryption authentication is performed on the cloud server through the second public key, and the second public key is stored in the cloud, and only the administrator has the authority to know it, the second public key used in the authentication process is not easily cracked by the calculator, so It can reduce the probability of battery encryption being cracked.
在一些实施例中,所述基于第一公钥与第一私钥,对所述电池进行加密认证,包括:In some embodiments, performing encryption authentication on the battery based on the first public key and the first private key includes:
获取第一字符码;Get the first character code;
基于所述第一公钥对所述第一字符码进行加密,得到第一密文;Encrypt the first character code based on the first public key to obtain a first ciphertext;
通过所述加密单元,基于所述第一私钥对所述第一密文解密,得到第二字符码;Decrypt the first ciphertext based on the first private key through the encryption unit to obtain a second character code;
通过所述加密单元,基于所述第一私钥对所述第二字符码加密,得到第二密文;Through the encryption unit, the second character code is encrypted based on the first private key to obtain a second ciphertext;
通过所述第一公钥,对所述第二密文进行解密,得到第三字符码;Decrypt the second ciphertext using the first public key to obtain a third character code;
若所述第一字符码与所述第三字符码匹配,则确定对所述电池的所述第一加密认证通过。If the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
本公开实施例中,第一字符码可以为包含有数据及字母的字符串,可由设备系统随机生成。第一公钥和第一私钥可基于第一加密规则相对应。在设备系统中可实现对第一字符码进行第一公钥加密,得到第一密文。电池的加密单元可通过第一私钥解密对第一密文解密,得到第二字符码,其中第二字符码不同于第一字符码。当所述第一字符码与所述第三字符码匹配,则确定对所述电池的所述第一加密认证通过,此时说明电池可能为授权电池,也可能是因为第一加密认证被破译。因此需要进行第二加密认证。In the embodiment of the present disclosure, the first character code may be a string containing data and letters, and may be randomly generated by the device system. The first public key and the first private key may correspond based on the first encryption rule. In the device system, the first public key encryption can be performed on the first character code to obtain the first ciphertext. The encryption unit of the battery can decrypt the first ciphertext through the first private key decryption to obtain the second character code, where the second character code is different from the first character code. When the first character code matches the third character code, it is determined that the first encryption authentication of the battery has passed. At this time, it means that the battery may be an authorized battery, or it may be because the first encryption authentication has been deciphered. . Therefore, a second encryption authentication is required.
本公开实施例中,第三字符码与第一字符码的相匹配可以包括:第三字符码与第一字符码均为符合同一预定规则下的字符码,例如均为字母与数字排序相同的字符码。第三字符码与第一字符码的不匹配,则第三字符码与第一字符码为不符合同一预定规则下的字符码。例如预定规则为字符码为6为字符串,且顺序为字母与数字间隔设置,例如:q1w1e3,与a1s2f3均为6为字符串且顺序为字母与数字间隔设置,则此时可认为q1w1e3,与a1s2f3符合同一预定规则下的字符码。In the embodiment of the present disclosure, the matching of the third character code and the first character code may include: the third character code and the first character code are both character codes that comply with the same predetermined rule, for example, both have the same order of letters and numbers. character code. If the third character code does not match the first character code, then the third character code and the first character code are character codes that do not comply with the same predetermined rule. For example, the predetermined rule is that the character code is 6, which is a string, and the order is the interval setting between letters and numbers. For example: q1w1e3, and a1s2f3 are both 6 is a string, and the order is the interval setting between letters and numbers. At this time, it can be considered that q1w1e3, and a1s2f3 conforms to the character code under the same predetermined rule.
在一些实施例中,所述基于所述第二公钥与第二私钥,对所述电池进行加密认证,包括:In some embodiments, performing encryption authentication on the battery based on the second public key and the second private key includes:
通过所述加密单元,基于所述第二私钥对所述第二字符码加密,得到所述认证信息。The encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
本公开实施例中,在通过基于所述第二公钥与第二私钥,对所述电池进行加密认证时,可通过加密单元,基于存储于加密单元内的第二私钥对所述第二字符码加密,得到所述认证信息。认证信息通过认证系统传输给云端服务器。In this disclosed embodiment, when the battery is encrypted and authenticated based on the second public key and the second private key, the encryption unit can be used to authenticate the third private key based on the second private key stored in the encryption unit. The two-character code is encrypted to obtain the authentication information. The authentication information is transmitted to the cloud server through the authentication system.
在一些实施例中,所述根据所述认证结果,确定所述电子设备的充电模式,包括:In some embodiments, determining the charging mode of the electronic device according to the authentication result includes:
若所述认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电;If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode;
若所述认证结果确定为所述电池为未授权电池,则确定以第二充电模式对所述电子设备进行充电;其中,所述第一充电模式对应于第一充电功率,所述第二充电模式对应于第二充电功率,所述第一充电功率大于所述第二充电功率。If the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
本公开实施例中,在通过认证结果来确定电子设备的充电模式时,认证结果可以指示电池为授权电池或未授权电池。其中认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电;若所述认证结果确定为所述电池为未授权电池,则确定以第二充电模式对所述电子设备进行充电。第一充电模式可理解为快速充电模式,其对应的充电功率为第一充电功率,第二充电模式可理解为普通充电模式,其对应的充电功率为第二充电功率。通过认证结果确定充电模式,可有利于减少对伪装电池(即未授权电池)快速充电的情况,进而减少因不合规充电容易造成电池起火的情况。In the embodiment of the present disclosure, when the charging mode of the electronic device is determined through the authentication result, the authentication result may indicate that the battery is an authorized battery or an unauthorized battery. If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode; if the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in the second charging mode. The electronic device is charged. The first charging mode can be understood as a fast charging mode, and its corresponding charging power is the first charging power. The second charging mode can be understood as a normal charging mode, and its corresponding charging power is the second charging power. Determining the charging mode through the certification results can help reduce the situation of rapid charging of disguised batteries (i.e. unauthorized batteries), thereby reducing the risk of battery fires caused by non-compliant charging.
在一些实施例中,所述若所述认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电,包括:In some embodiments, if the authentication result determines that the battery is an authorized battery, determining to charge the electronic device in the first charging mode includes:
若所述认证结果确定为所述电池为授权电池,则预定时间内以第一充电功率对所述电池充电;If the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
所述预定时间后,重新认证所述电池是否为授权电池,包括:更新用于加密认证的第二公钥与第二私钥;其中,所述预定时间为所述电池被云端服务器认证为授权电池后以第一充电模式进行充电的有效期限的时间长度。After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
本公开实施例中,预定时间为所述电池被云端服务器认证为授权电池后以第一充电模式进行充电的有效期限的时间长度。当认证结果确定为所述电池为授权电池时,在预定时间内可直接以第一充电功率对所述电池充电,不需要再对电池进行授权验证。但预定时间后,重新认证所述电池是否 为授权电池。当超过预定时候后,进行重新认证所述电池是否为授权电池前,更新用于加密认证的第二公钥与第二私钥,来增加重新认证的有效性。In the embodiment of the present disclosure, the predetermined time is the length of the validity period of the battery being charged in the first charging mode after being authenticated by the cloud server as an authorized battery. When the authentication result determines that the battery is an authorized battery, the battery can be charged directly with the first charging power within a predetermined time, and there is no need to perform authorization verification on the battery. But after a predetermined time, re-certify whether the battery is an authorized battery. When the predetermined time has elapsed, before re-certifying whether the battery is an authorized battery, the second public key and the second private key used for encryption authentication are updated to increase the effectiveness of the re-certification.
在一些实施例中,所述充电方法还包括:In some embodiments, the charging method further includes:
若所述第一加密认证通过,且所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则更新所述第一公钥和所述第一私钥。If the first encryption authentication passes and the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
本公开实施例中,当所述第一加密认证通过,且所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则可以确定该电池的第一加密认证被破解,此时需要更新所述第一公钥和所述第一私钥,来增加第一加密认证的有效性。In this disclosed embodiment, when the first encryption authentication is passed and the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, it can be determined that the first encryption authentication of the battery has been cracked. The first public key and the first private key need to be updated to increase the effectiveness of the first encryption authentication.
在一些实施例中,所述向云端服务器发送认证信息,包括:In some embodiments, sending authentication information to the cloud server includes:
确定所述电子设备是否与所述云端服务器建立通信连接;Determine whether the electronic device has established a communication connection with the cloud server;
若所述电子设备与所述云端服务器建立通信连接,则向云端服务器发送所述认证信息。If the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
本公开实施例中,由于第二加密认证需要向云端服务器发送认证信息,因此电子设备在第一加密认证通过后进行第二加密认证前,需要确定所述电子设备是否与所述云端服务器建立通信连接。当所述电子设备与所述云端服务器建立通信连接后,则向云端服务器发送所述认证信息。In this disclosed embodiment, since the second encryption authentication requires sending authentication information to the cloud server, the electronic device needs to determine whether the electronic device has established communication with the cloud server before performing the second encryption authentication after passing the first encryption authentication. connect. After the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
在一些实施例中,所述充电方法,包括:In some embodiments, the charging method includes:
若所述电子设备未与所述云端服务器建立通信连接,则确定以第三充电功率对所述电子设备进行充电。If the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
本公开实施例中,第三充电功率小于第一充电功率,但第三充电功率大于第二充电功率。例如,第一充电功率为快充功率120瓦,第二充电功率为慢充电功率5瓦,第三充电功率可以为15瓦。In the embodiment of the present disclosure, the third charging power is smaller than the first charging power, but the third charging power is larger than the second charging power. For example, the first charging power is a fast charging power of 120 watts, the second charging power is a slow charging power of 5 watts, and the third charging power may be 15 watts.
在一些实施例中,所述确定所述电子设备的充电模式,包括:In some embodiments, determining the charging mode of the electronic device includes:
所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则标记所述电池为伪装电池;If the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
上传所述伪装电池的标记信息至所述云端服务器。Upload the tag information of the disguised battery to the cloud server.
本公开实施例中,在云端服务器反馈的所述认证结果确定为该电池为未授权电池时,可标记该电池为伪装电池。标记信息可包括标记编号,标记条形码等。将伪装电池标记上特定标记编号或标记条形码,来供认证系统识别,并上传所述伪装电池的标记信息至所述云端服务器,进行记录。In the embodiment of the present disclosure, when the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the battery can be marked as a disguised battery. Tag information may include tag number, tag barcode, etc. Mark the disguised battery with a specific marking number or marking barcode for identification by the authentication system, and upload the marking information of the disguised battery to the cloud server for recording.
在一些实施例中,所述充电方法还包括:In some embodiments, the charging method further includes:
当所述云端服务器反馈的所述认证结果确定为所述电池为授权电池,对所述电池进行第二次充电时,确定验证通过的时间是否超过预定时间;When the authentication result fed back by the cloud server determines that the battery is an authorized battery and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
若验证通过的时间未超过所述预定时间,则延时所述验证通过的有效性;If the time for passing the verification does not exceed the predetermined time, delay the validity of the passing verification;
若所述验证通过的时间超过所述预定时间,则重新验证所述电池是否为授权电池。If the verification time exceeds the predetermined time, whether the battery is an authorized battery is re-verified.
本公开实施例中,当所述云端服务器反馈的所述认证结果确定为所述电池为授权电池,对所述电池进行第二次充电时,需要确定验证通过的时间是否超过预定时间。当验证通过的时间未超过所述预定时间,则延时所述验证通过的有效性。例如预定时间确定为一个月,则对确定为授权电池进行第二次充电时,只要授权时间至第二次充电时间在一个月以内,则确定验证通过的时间未超过所述预定时间,此时可延时所述验证通过的有效性。即第二次充电时不需要进行授权验证。In this disclosed embodiment, when the authentication result fed back by the cloud server determines that the battery is an authorized battery, and the battery is charged for the second time, it is necessary to determine whether the verification passing time exceeds a predetermined time. When the time for passing the verification does not exceed the predetermined time, the validity of the passed verification is delayed. For example, the predetermined time is determined to be one month, and when the battery determined to be authorized is charged for the second time, as long as the authorization time to the second charging time is within one month, it is determined that the time to pass the verification does not exceed the predetermined time. At this time The validity of said verification pass may be delayed. That is, no authorization verification is required when charging for the second time.
本公开实施例提供一种电子设备的充电方法,应用于与所述电子设备通信连接的云端服务器。图2是根据一示例性实施例示出的一种电子设备的充电方法流程图二。如图2所示,充电方法,包括:An embodiment of the present disclosure provides a charging method for an electronic device, which is applied to a cloud server that is communicatively connected to the electronic device. Figure 2 is a flowchart 2 of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 2, charging methods include:
步骤20、接收所述电子设备传输的认证信息;Step 20: Receive the authentication information transmitted by the electronic device;
步骤21、通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果;Step 21: Verify whether the battery of the electronic device is an authorized battery through the authentication information, and obtain the authentication result;
步骤22、反馈所述认证结果至所述电子设备。Step 22: Feed back the authentication result to the electronic device.
本公开实施例中,云端服务器可对接收的认证信息进行认证,来验证所述电子设备的电池是否为授权电池。例如,云端服务器可对接收的认证信息认证通过,则可验证所述电子设备的电池为授权电池,或,云端服务器可对接收的认证信息认证不通过,则可验证所述电子设备的电池为未授权电池。反馈所述认证结果至所述电子设备即将该电池是否为授权电池的结果反馈给电子设备。本申请中,由于对认证信息的认证工作由云端服务器完成,云端服务器内存储的认证过程中用到的对应信息不容易被计算器破解,从而可减少电池加密被破解的概率。In this disclosed embodiment, the cloud server can authenticate the received authentication information to verify whether the battery of the electronic device is an authorized battery. For example, if the cloud server can authenticate the received authentication information successfully, then it can be verified that the battery of the electronic device is an authorized battery; or if the cloud server cannot authenticate the received authentication information, it can be verified that the battery of the electronic device is an authorized battery. Unauthorized battery. Feeding back the authentication result to the electronic device means feeding back the result of whether the battery is an authorized battery to the electronic device. In this application, since the authentication work of the authentication information is completed by the cloud server, the corresponding information used in the authentication process stored in the cloud server is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
在一些实施例中,所述通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果,包括:In some embodiments, verifying whether the battery of the electronic device is an authorized battery through the authentication information, and obtaining the authentication result includes:
通过第二公钥对所述认证信息进行解密,得到第四字符码;Decrypt the authentication information using the second public key to obtain a fourth character code;
基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果;所述第一字符码为所述电子设备对所述电池进行第一加密认证时生成。The authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
本公开实施例中,云端服务器对认证信息进行认证时,可通过云端服务器内的第二公钥对所述认证信息进行解密,得到第四字符码。In this disclosed embodiment, when the cloud server authenticates the authentication information, the authentication information can be decrypted using the second public key in the cloud server to obtain the fourth character code.
本公开实施例中,所述基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果,包括:In the embodiment of the present disclosure, determining the authentication result based on the matching result of the fourth character code and the first character code includes:
若所述第四字符码与第一字符码的相匹配,则确定所述电池为授权电池;If the fourth character code matches the first character code, it is determined that the battery is an authorized battery;
若所述第四字符码与第一字符码的不匹配,则确定所述电池为未授权电池。If the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
本公开实施例中,当第四字符码与第一字符码的相匹配,则确定所述电池为授权电池。当第四字符码与第一字符码的不匹配,则确定所述电池为未授权电池。此时第四字符码与第一字符码的相匹配可以包括:第四字符码与第一字符码均为符合同一预定规则下的字符码,例如均为字母与数字 排序相同的字符码。第四字符码与第一字符码的不匹配,则第四字符码与第一字符码为不符合同一预定规则下的字符码。例如预定规则为字符码为6为字符串,且顺序为字母与数字间隔设置,例如:q1w1e3,与a1s2f3均为6为字符串且顺序为字母与数字间隔设置,则此时可认为q1w1e3,与a1s2f3符合同一预定规则下的字符码。In the embodiment of the present disclosure, when the fourth character code matches the first character code, it is determined that the battery is an authorized battery. When the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery. At this time, the matching of the fourth character code and the first character code may include: the fourth character code and the first character code are both character codes that comply with the same predetermined rule, for example, both are character codes with the same order of letters and numbers. If the fourth character code does not match the first character code, then the fourth character code and the first character code are character codes that do not comply with the same predetermined rule. For example, the predetermined rule is that the character code is 6, which is a string, and the order is the interval setting between letters and numbers. For example: q1w1e3, and a1s2f3 are both 6 is a string, and the order is the interval setting between letters and numbers. At this time, it can be considered that q1w1e3, and a1s2f3 conforms to the character code under the same predetermined rule.
图3是根据一示例性实施例示出的一种电子设备的充电方法应用场景示意图。如图3所示,上述充电方法的应用场景中手机的电池中包含有加密IC芯片作为电池的加密单元。加密IC芯片可以用来字符码加密解密。加密IC芯片内置于与第一公钥对应的第一私钥,和与第二公钥对应的第二私钥。其中第一公钥位于手机端认证系统内,第二公钥位于云端服务器。手机系统端与电池IC间可以实现基于第一私钥和第二私钥的第一加密认证和第二加密认证中的加解密;电池加密IC可通过手机系统端将第二密文传输给云端服务器,云端服务器与手机系统端之间可传输第二密文,及第二字符码与第一字符码的匹配结果;云端服务器根据匹配结果基于相关通信协议授权调节手机端对电池的充电功率。FIG. 3 is a schematic diagram of an application scenario of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 3, in the application scenario of the above charging method, the battery of the mobile phone contains an encryption IC chip as the encryption unit of the battery. Encryption IC chips can be used to encrypt and decrypt character codes. The encryption IC chip is built with a first private key corresponding to the first public key and a second private key corresponding to the second public key. The first public key is located in the mobile phone authentication system, and the second public key is located in the cloud server. The first encryption authentication and the encryption and decryption in the second encryption authentication based on the first private key and the second private key can be realized between the mobile phone system side and the battery IC; the battery encryption IC can transmit the second ciphertext to the cloud through the mobile phone system side The second ciphertext and the matching result of the second character code and the first character code can be transmitted between the server, the cloud server and the mobile phone system; the cloud server authorizes the mobile phone to adjust the charging power of the battery based on the relevant communication protocol based on the matching result.
图4是根据一示例性实施例示出的一种电子设备的充电方法流程图三。如图4所示,流程包括:Figure 4 is a flow chart 3 of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 4, the process includes:
步骤41、开始,获取电子设备; Step 41. Start, obtain electronic equipment;
步骤42、将电子设备系统初始化;Step 42: Initialize the electronic device system;
步骤43、对电池进行充电前,进行加密验证,验证第一加密认证是否通过,是则执行步骤44,否则将电池充电功率设置为最小功率;Step 43. Before charging the battery, perform encryption verification to verify whether the first encryption authentication is passed. If yes, perform step 44. Otherwise, set the battery charging power to the minimum power;
步骤44、验证电子设备是否连接网络,是则执行步骤45,否则将功率限制为15瓦;Step 44: Verify whether the electronic device is connected to the network, if so, proceed to step 45, otherwise limit the power to 15 watts;
步骤45、验证第二加密认证是否通过,是则执行步骤46,否则标记电池为伪装电池,并上传云端验证结果,限制充电功率为最小功率;Step 45: Verify whether the second encryption authentication is passed. If yes, proceed to step 46. Otherwise, mark the battery as a disguised battery, upload the cloud verification result, and limit the charging power to the minimum power;
步骤46、快充功率限制解除; Step 46. The fast charging power limit is lifted;
步骤47、检验云端对电子设备系统的快充授权是否过期,是则重新执行步骤43进行一次加密验证,否则延时继续授权电子设备系统的快充权限。Step 47: Check whether the cloud's fast charging authorization for the electronic device system has expired. If so, re-execute step 43 for an encryption verification. Otherwise, delay and continue to authorize the fast charging permission for the electronic device system.
图5是根据一示例性实施例示出的一种电子设备的充电方法流程图四。如图5所示,流程包括:Figure 5 is a flow chart 4 of a charging method for an electronic device according to an exemplary embodiment. As shown in Figure 5, the process includes:
步骤30、设备系统生成第一字符码;Step 30: The equipment system generates the first character code;
步骤31、设备系统对第一字符码进行第一公钥加密,得到第一密文;Step 31: The device system performs first public key encryption on the first character code to obtain the first ciphertext;
步骤32、设备系统传输第一密文至电池的加密单元;Step 32: The device system transmits the first ciphertext to the encryption unit of the battery;
步骤33、电池加密单元通过第一私钥对第一密文解密得到第二字符码;Step 33: The battery encryption unit decrypts the first ciphertext using the first private key to obtain the second character code;
步骤34、电池加密单元发送第二字符码至设备系统;Step 34: The battery encryption unit sends the second character code to the device system;
步骤35、设备系统验证第一字符码与第二字符码是否匹配,如果不匹配则限制电池的充电功率;Step 35: The device system verifies whether the first character code and the second character code match, and if not, limits the charging power of the battery;
步骤36、如果第一字符码与第二字符码匹配,电池加密单元则通过第二私钥对第二字符码加密,得到第二密文; Step 36. If the first character code matches the second character code, the battery encryption unit encrypts the second character code through the second private key to obtain the second ciphertext;
步骤37、加密单元通过设备系统将第二密文传输给云端服务器;Step 37: The encryption unit transmits the second ciphertext to the cloud server through the device system;
步骤38、云端服务器通过第二公钥对第二密文进行解密,得到第三字符码;Step 38: The cloud server decrypts the second ciphertext through the second public key to obtain the third character code;
步骤39、当第一字符码与第三字符码匹配时,云端服务器可授权设备系统以快充模式进行电池充电,否则限制电池的充电功率;其中,云端服务器和设备系统均可进行第一字符码与第三字符码的匹配工作;快充模式中的电池充电功率远大于普通充电模式的电池充电功率; Step 39. When the first character code matches the third character code, the cloud server can authorize the device system to charge the battery in the fast charge mode, otherwise the charging power of the battery is limited; where both the cloud server and the device system can perform the first character code. Matching work between code and third character code; battery charging power in fast charging mode is much greater than that in normal charging mode;
步骤40、当被限制充电功率的电池数量达到预定数量时,云端服务器可远程更新第一公钥和第一私钥;Step 40: When the number of batteries with limited charging power reaches a predetermined number, the cloud server can remotely update the first public key and the first private key;
步骤41、当授权时间达到预定时间后,云端服务器可远程更新第二公钥和第二私钥;Step 41: When the authorization time reaches the predetermined time, the cloud server can remotely update the second public key and the second private key;
步骤42、设备系统可根据第一字符码与第三字符码的匹配结果,对电池进行充电。Step 42: The device system can charge the battery according to the matching result of the first character code and the third character code.
本公开实施例提供一种电子设备的充电装置,所述电子设备的电池具有加密单元。图6是根据一示例性实施例示出的一种电子设备的充电装置结构示意图一。如图6所示,所述充电装置,包括:An embodiment of the present disclosure provides a charging device for an electronic device, and a battery of the electronic device has an encryption unit. FIG. 6 is a schematic structural diagram of a charging device for electronic equipment according to an exemplary embodiment. As shown in Figure 6, the charging device includes:
第一处理单元51,用于通过所述加密单元对所述电池进行第一加密认证,其中,所述第一加密认证用于对所述电池是否为授权电池进行认证;The first processing unit 51 is configured to perform first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery;
第二处理单元52,用于在所述第一加密认证通过的情况下,向云端服务器发送认证信息,其中,所述认证信息与所述电池相关联;The second processing unit 52 is configured to send authentication information to the cloud server when the first encryption authentication passes, where the authentication information is associated with the battery;
第三处理单元53,用于接收所述云端服务器反馈的认证结果,其中,所述认证结果根据所述认证信息确定,所述认证结果用于指示所述电池是否为授权电池;The third processing unit 53 is configured to receive an authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
第四处理单元54,用于根据所述认证结果,确定所述电子设备的充电模式,其中不同充电模式下对所述电池进行充电的充电功率不同。The fourth processing unit 54 is configured to determine the charging mode of the electronic device according to the authentication result, wherein the charging power for charging the battery is different in different charging modes.
本公开实施例中,第一加密认证可以在电子设备的认证系统中进行认证。认证系统可以是设备系统。由于设备系统可能是开源系统。在设备系统中进行第一加密认证时,会存在被破译的风险,因此进行第二加密认证,包括向云端服务器发送与所述电池相关联的认证信息,接收所述云端服务器反馈的认证结果,根据所述认证结果,确定所述电子设备的充电模式。其中云端服务器可对认证信息进行认证,得到指示所述电池是否为授权电池的认证结果。电子设备可以包括手机、平板、笔记本等电子设备。设备系统包括手机操作系统等例如安卓系统等。In the embodiment of the present disclosure, the first encryption authentication may be performed in the authentication system of the electronic device. The authentication system can be a device system. Because the device system may be an open source system. When performing the first encryption authentication in the device system, there is a risk of being deciphered. Therefore, performing the second encryption authentication includes sending authentication information associated with the battery to the cloud server and receiving the authentication result fed back by the cloud server. According to the authentication result, the charging mode of the electronic device is determined. The cloud server can authenticate the authentication information and obtain an authentication result indicating whether the battery is an authorized battery. Electronic devices can include mobile phones, tablets, laptops and other electronic devices. Device systems include mobile operating systems such as Android systems.
本公开实施例中的电子设备的充电装置用于:通过加密单元对电池进行第一加密认证,其中,第一加密认证用于对电池是否为授权电池进行认证;在第一加密认证通过的情况下,向云端服务器发送认证信息,其中,认证信息与电池相关联;接收云端服务器反馈的认证结果,其中,认证结果根据认证信息确定,认证结果用于指示电池是否为授权电池;根据认证结果,确定电子设备的充电模式,其中不同充电模式下对电池进行充电的充电功率不同。本申请中,在第一加密认证通过的情况下进行第二加密认证,包括向云端服务器发送认证信息,通过云端服务器对认证信息的认证结果来确定电子设备的充电模式。由于第二加密认证是在云端服务器内对认证信息进行认证,认证过程中用到的对应信息不容易被计算器破解,从而可减少电池加密被破解的概率。The charging device of the electronic device in the embodiment of the present disclosure is used to: perform first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery; in the case where the first encryption authentication is passed Next, send authentication information to the cloud server, where the authentication information is associated with the battery; receive the authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery; according to the authentication result, Determine the charging mode of the electronic device, wherein the charging power for charging the battery is different in different charging modes. In this application, when the first encryption authentication is passed, the second encryption authentication is performed, which includes sending authentication information to the cloud server, and determining the charging mode of the electronic device through the authentication result of the authentication information by the cloud server. Since the second encryption authentication authenticates the authentication information in the cloud server, the corresponding information used in the authentication process is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
在一些实施例中,所述第一加密认证确定为基于第一加密方式对所述电池进行加密认证;In some embodiments, the first encryption authentication is determined to be encryption authentication of the battery based on a first encryption method;
所述第二处理单元,用于The second processing unit is used to
在所述第一加密认证通过的情况下,基于第二加密方式对所述电池进行加密认证,生成所述认证信息;所述第二加密方式不同于所述第一加密方式。If the first encryption authentication passes, the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
本公开实施例中,第一加密方式和第二加密方式不同,可以包括:第一加密方式的加密单元或加密地址与第二加密方式的加密单元或加密地址不同,也可以包括第一加密方式中用于加解密的公钥与私钥不同于第二加密方式中用于加解密的公钥与私钥。在所述第一加密认证通过的情况下,基于第二加密方式对所述电池进行加密认证,进而可减少电池加密被破解的概率。In the embodiment of the present disclosure, the first encryption method and the second encryption method are different, which may include: the encryption unit or encryption address of the first encryption method is different from the encryption unit or encryption address of the second encryption method, which may also include the first encryption method. The public key and private key used for encryption and decryption in the second encryption method are different from the public key and private key used for encryption and decryption in the second encryption method. When the first encryption authentication is passed, the battery is encrypted and authenticated based on the second encryption method, thereby reducing the probability that the battery encryption is cracked.
在一些实施例中,所述第一处理单元,用于In some embodiments, the first processing unit is used to
基于第一公钥与第一私钥,对所述电池进行加密认证,其中所述第一公钥存储于所述电子设备的认证系统,所述第一私钥存储于所述电池的加密单元;Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
所述第二处理单元,用于The second processing unit is used to
基于所述第二公钥与第二私钥,对所述电池进行加密认证,其中所述公钥存储于所述云端服务器,所述第二私钥存储于所述电池的加密单元;所述第一公钥不同于所述第二公钥,所述第一私钥不同于所述第二私钥。Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
本公开实施例中,第一加密方式用到的第一公钥与第一私钥,不同于第二加密方式用到的第二公钥与第二私钥。即第一公钥不同于所述第二公钥,所述第一私钥不同于所述第二私钥。In this disclosed embodiment, the first public key and the first private key used in the first encryption method are different from the second public key and the second private key used in the second encryption method. That is, the first public key is different from the second public key, and the first private key is different from the second private key.
本公开实施例中,第一公钥存储于所述电子设备的认证系统,所述第一私钥存储于所述电池的加密单元。公钥存储于所述云端服务器,所述第二私钥存储于所述电池的加密单元。当在第一加密认证通过的情况下进行第二加密认证,包括基于所述第二公钥与第二私钥,对所述电池进行加密认证。由于第二加密认证是在云端服务器通过第二公钥进行认证,第二公钥存储于云端,只有管理员有权限知道,认证过程中用到的第二公钥不容易被计算器破解,从而可减少电池加密被破解的概率。In this disclosed embodiment, the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery. The public key is stored in the cloud server, and the second private key is stored in the encryption unit of the battery. When the first encryption authentication is passed, performing the second encryption authentication includes performing encryption authentication on the battery based on the second public key and the second private key. Since the second encryption authentication is performed on the cloud server through the second public key, and the second public key is stored in the cloud, and only the administrator has the authority to know it, the second public key used in the authentication process is not easily cracked by the calculator, so It can reduce the probability of battery encryption being cracked.
在一些实施例中,所述第一处理单元,用于In some embodiments, the first processing unit is used to
获取第一字符码;Get the first character code;
基于所述第一公钥对所述第一字符码进行加密,得到第一密文;Encrypt the first character code based on the first public key to obtain a first ciphertext;
通过所述加密单元,基于所述第一私钥对所述第一密文解密,得到第二字符码;Decrypt the first ciphertext based on the first private key through the encryption unit to obtain a second character code;
通过所述加密单元,基于所述第一私钥对所述第二字符码加密,得到第二密文;Through the encryption unit, the second character code is encrypted based on the first private key to obtain a second ciphertext;
通过所述第一公钥,对所述第二密文进行解密,得到第三字符码;Decrypt the second ciphertext using the first public key to obtain a third character code;
若所述第一字符码与所述第三字符码匹配,则确定对所述电池的所述第一加密认证通过。If the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
本公开实施例中,第一字符码可以为包含有数据及字母的字符串,可由设备系统随机生成。第一公钥和第一私钥可基于第一加密规则相对应。在设备系统中可实现对第一字符码进行第一公钥加密,得到第一密文。电池的加密单元可通过第一私钥解密对第一密文解密,得到第二字符码,其中 第二字符码不同于第一字符码。当所述第一字符码与所述第三字符码匹配,则确定对所述电池的所述第一加密认证通过,此时说明电池可能为授权电池,也可能是因为第一加密认证被破译。因此需要进行第二加密认证。In the embodiment of the present disclosure, the first character code may be a string containing data and letters, and may be randomly generated by the device system. The first public key and the first private key may correspond based on the first encryption rule. In the device system, the first public key encryption can be performed on the first character code to obtain the first ciphertext. The encryption unit of the battery can decrypt the first ciphertext through the first private key decryption to obtain the second character code, where the second character code is different from the first character code. When the first character code matches the third character code, it is determined that the first encryption authentication for the battery has passed. At this time, it means that the battery may be an authorized battery, or it may be because the first encryption authentication has been deciphered. . Therefore, a second encryption authentication is required.
本公开实施例中,第三字符码与第一字符码的相匹配可以包括:第三字符码与第一字符码均为符合同一预定规则下的字符码,例如均为字母与数字排序相同的字符码。第三字符码与第一字符码的不匹配,则第三字符码与第一字符码为不符合同一预定规则下的字符码。例如预定规则为字符码为6为字符串,且顺序为字母与数字间隔设置,例如:q1w1e3,与a1s2f3均为6为字符串且顺序为字母与数字间隔设置,则此时可认为q1w1e3,与a1s2f3符合同一预定规则下的字符码。In the embodiment of the present disclosure, the matching of the third character code and the first character code may include: the third character code and the first character code are both character codes that comply with the same predetermined rule, for example, both have the same order of letters and numbers. character code. If the third character code does not match the first character code, then the third character code and the first character code are character codes that do not comply with the same predetermined rule. For example, the predetermined rule is that the character code is 6 as a string, and the order is the interval setting between letters and numbers. For example: q1w1e3, and a1s2f3 are both 6 as a string, and the order is the interval setting between letters and numbers. At this time, it can be considered that q1w1e3, and a1s2f3 conforms to the character code under the same predetermined rule.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
通过所述加密单元,基于所述第二私钥对所述第二字符码加密,得到所述认证信息。The encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
本公开实施例中,在通过基于所述第二公钥与第二私钥,对所述电池进行加密认证时,可通过加密单元,基于存储于加密单元内的第二私钥对所述第二字符码加密,得到所述认证信息。认证信息通过认证系统传输给云端服务器。In this disclosed embodiment, when the battery is encrypted and authenticated based on the second public key and the second private key, the encryption unit can be used to authenticate the third private key based on the second private key stored in the encryption unit. The two-character code is encrypted to obtain the authentication information. The authentication information is transmitted to the cloud server through the authentication system.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
若所述认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电;If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode;
若所述认证结果确定为所述电池为未授权电池,则确定以第二充电模式对所述电子设备进行充电;其中,所述第一充电模式对应于第一充电功率,所述第二充电模式对应于第二充电功率,所述第一充电功率大于所述第二充电功率。If the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
本公开实施例中,在通过认证结果来确定电子设备的充电模式时,认证结果可以指示电池为授权电池或未授权电池。其中认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电;若所述认证结果确定为所述电池为未授权电池,则确定以第二充电模式对所述电子设备进行充电。第一充电模式可理解为快速充电模式,其对应的充电功率为第一充电功率,第二充电模式可理解为普通充电模式,其对应的充电功率为第二充电功率。通过认证结果确定充电模式,可有利于减少对伪装电池(即未授权电池)快速充电的情况,进而减少因不合规充电容易造成电池起火的情况。In the embodiment of the present disclosure, when the charging mode of the electronic device is determined through the authentication result, the authentication result may indicate that the battery is an authorized battery or an unauthorized battery. If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode; if the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in the second charging mode. The electronic device is charged. The first charging mode can be understood as a fast charging mode, and its corresponding charging power is the first charging power. The second charging mode can be understood as a normal charging mode, and its corresponding charging power is the second charging power. Determining the charging mode through the certification results can help reduce the situation of rapid charging of disguised batteries (i.e. unauthorized batteries), thereby reducing the risk of battery fires caused by non-compliant charging.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
若所述认证结果确定为所述电池为授权电池,则预定时间内以第一充电功率对所述电池充电;If the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
所述预定时间后,重新认证所述电池是否为授权电池,包括:更新用于加密认证的第二公钥与第二私钥;其中,所述预定时间为所述电池被云端服务器认证为授权电池后以第一充电模式进行充电的有效期限的时间长度。After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
本公开实施例中,预定时间为所述电池被云端服务器认证为授权电池后以第一充电模式进行充 电的有效期限的时间长度。当认证结果确定为所述电池为授权电池时,在预定时间内可直接以第一充电功率对所述电池充电,不需要再对电池进行授权验证。但预定时间后,重新认证所述电池是否为授权电池。当超过预定时候后,进行重新认证所述电池是否为授权电池前,更新用于加密认证的第二公钥与第二私钥,来增加重新认证的有效性。In the embodiment of the present disclosure, the predetermined time is the length of the validity period of the battery being charged in the first charging mode after being authenticated by the cloud server as an authorized battery. When the authentication result determines that the battery is an authorized battery, the battery can be charged directly with the first charging power within a predetermined time, and there is no need to perform authorization verification on the battery. But after a predetermined time, re-certify whether the battery is an authorized battery. When the predetermined time has elapsed, before re-certifying whether the battery is an authorized battery, the second public key and the second private key used for encryption authentication are updated to increase the effectiveness of the re-certification.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
若所述第一加密认证通过,且所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则更新所述第一公钥和所述第一私钥。If the first encryption authentication passes and the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
本公开实施例中,当所述第一加密认证通过,且所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则可以确定该电池的第一加密认证被破解,此时需要更新所述第一公钥和所述第一私钥,来增加第一加密认证的有效性。In this disclosed embodiment, when the first encryption authentication is passed and the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, it can be determined that the first encryption authentication of the battery has been cracked. The first public key and the first private key need to be updated to increase the effectiveness of the first encryption authentication.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
确定所述电子设备是否与所述云端服务器建立通信连接;Determine whether the electronic device has established a communication connection with the cloud server;
若所述电子设备与所述云端服务器建立通信连接,则向云端服务器发送所述认证信息。If the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
本公开实施例中,由于第二加密认证需要向云端服务器发送认证信息,因此电子设备在第一加密认证通过后进行第二加密认证前,需要确定所述电子设备是否与所述云端服务器建立通信连接。当所述电子设备与所述云端服务器建立通信连接后,则向云端服务器发送所述认证信息。In this disclosed embodiment, since the second encryption authentication requires sending authentication information to the cloud server, the electronic device needs to determine whether the electronic device has established communication with the cloud server before performing the second encryption authentication after passing the first encryption authentication. connect. After the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
若所述电子设备未与所述云端服务器建立通信连接,则确定以第三充电功率对所述电子设备进行充电。If the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
本公开实施例中,第三充电功率小于第一充电功率,但第三充电功率大于第二充电功率。例如,第一充电功率为快充功率120瓦,第二充电功率为慢充电功率5瓦,第三充电功率可以为15瓦。In the embodiment of the present disclosure, the third charging power is smaller than the first charging power, but the third charging power is larger than the second charging power. For example, the first charging power is a fast charging power of 120 watts, the second charging power is a slow charging power of 5 watts, and the third charging power may be 15 watts.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则标记所述电池为伪装电池;If the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
上传所述伪装电池的标记信息至所述云端服务器。Upload the tag information of the disguised battery to the cloud server.
本公开实施例中,在云端服务器反馈的所述认证结果确定为该电池为未授权电池时,可标记该电池为伪装电池。标记信息可包括标记编号,标记条形码等。将伪装电池标记上特定标记编号或标记条形码,来供认证系统识别,并上传所述伪装电池的标记信息至所述云端服务器,进行记录。In the embodiment of the present disclosure, when the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the battery can be marked as a disguised battery. Tag information may include tag number, tag barcode, etc. Mark the disguised battery with a specific marking number or marking barcode for identification by the authentication system, and upload the marking information of the disguised battery to the cloud server for recording.
在一些实施例中,所述第四处理单元,用于In some embodiments, the fourth processing unit is used to
当所述云端服务器反馈的所述认证结果确定为所述电池为授权电池,对所述电池进行第二次充 电时,确定验证通过的时间是否超过预定时间;When the authentication result fed back by the cloud server determines that the battery is an authorized battery, and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
若验证通过的时间未超过所述预定时间,则延时所述验证通过的有效性;If the time for passing the verification does not exceed the predetermined time, delay the validity of the passing verification;
若所述验证通过的时间超过所述预定时间,则重新验证所述电池是否为授权电池。If the verification time exceeds the predetermined time, whether the battery is an authorized battery is re-verified.
本公开实施例中,当所述云端服务器反馈的所述认证结果确定为所述电池为授权电池,对所述电池进行第二次充电时,需要确定验证通过的时间是否超过预定时间。当验证通过的时间未超过所述预定时间,则延时所述验证通过的有效性。例如预定时间确定为一个月,则对确定为授权电池进行第二次充电时,只要授权时间至第二次充电时间在一个月以内,则确定验证通过的时间未超过所述预定时间,此时可延时所述验证通过的有效性。即第二次充电时不需要进行授权验证。In this disclosed embodiment, when the authentication result fed back by the cloud server determines that the battery is an authorized battery, and the battery is charged for the second time, it is necessary to determine whether the verification passing time exceeds a predetermined time. When the time for passing the verification does not exceed the predetermined time, the validity of the passed verification is delayed. For example, the predetermined time is determined to be one month, and when the battery determined to be authorized is charged for the second time, as long as the authorization time to the second charging time is within one month, it is determined that the time to pass the verification does not exceed the predetermined time. At this time The validity of said verification pass may be delayed. That is, no authorization verification is required when charging for the second time.
本公开实施例提供一种电子设备的充电装置,应用于与所述电子设备通信连接的云端服务器。图7是根据一示例性实施例示出的一种电子设备的充电装置结构示意图一。如图7所示,所述充电装置,包括:An embodiment of the present disclosure provides a charging device for electronic equipment, which is applied to a cloud server that is communicatively connected to the electronic equipment. FIG. 7 is a schematic structural diagram of a charging device for electronic equipment according to an exemplary embodiment. As shown in Figure 7, the charging device includes:
第一处理单元61,用于接收所述电子设备传输的认证信息;The first processing unit 61 is configured to receive authentication information transmitted by the electronic device;
第二处理单元62,用于通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果;The second processing unit 62 is configured to use the authentication information to verify whether the battery of the electronic device is an authorized battery and obtain an authentication result;
第三处理单元63,用于反馈所述认证结果至所述电子设备。The third processing unit 63 is used to feed back the authentication result to the electronic device.
本公开实施例中,云端服务器可对接收的认证信息进行认证,来验证所述电子设备的电池是否为授权电池。例如,云端服务器可对接收的认证信息认证通过,则可验证所述电子设备的电池为授权电池,或,云端服务器可对接收的认证信息认证不通过,则可验证所述电子设备的电池为未授权电池。反馈所述认证结果至所述电子设备即将该电池是否为授权电池的结果反馈给电子设备。本申请中,由于对认证信息的认证工作由云端服务器完成,云端服务器内存储的认证过程中用到的对应信息不容易被计算器破解,从而可减少电池加密被破解的概率。In this disclosed embodiment, the cloud server can authenticate the received authentication information to verify whether the battery of the electronic device is an authorized battery. For example, if the cloud server can authenticate the received authentication information successfully, then it can be verified that the battery of the electronic device is an authorized battery; or if the cloud server cannot authenticate the received authentication information, it can be verified that the battery of the electronic device is an authorized battery. Unauthorized battery. Feeding back the authentication result to the electronic device means feeding back the result of whether the battery is an authorized battery to the electronic device. In this application, since the authentication work of the authentication information is completed by the cloud server, the corresponding information used in the authentication process stored in the cloud server is not easily cracked by the calculator, thereby reducing the probability of the battery encryption being cracked.
在一些实施例中,所述第二处理单元,用于In some embodiments, the second processing unit is used to
通过第二公钥对所述认证信息进行解密,得到第四字符码;Decrypt the authentication information using the second public key to obtain a fourth character code;
基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果;所述第一字符码为所述电子设备对所述电池进行第一加密认证时生成。The authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
本公开实施例中,云端服务器对认证信息进行认证时,可通过云端服务器内的第二公钥对所述认证信息进行解密,得到第四字符码。In this disclosed embodiment, when the cloud server authenticates the authentication information, the authentication information can be decrypted using the second public key in the cloud server to obtain the fourth character code.
本公开实施例中,所述基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果,包括:In the embodiment of the present disclosure, determining the authentication result based on the matching result of the fourth character code and the first character code includes:
若所述第四字符码与第一字符码的相匹配,则确定所述电池为授权电池;If the fourth character code matches the first character code, it is determined that the battery is an authorized battery;
若所述第四字符码与第一字符码的不匹配,则确定所述电池为未授权电池。If the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
本公开实施例中,所述第二处理单元,用于In this embodiment of the present disclosure, the second processing unit is used to
若所述第四字符码与第一字符码的相匹配,则确定所述电池为授权电池;If the fourth character code matches the first character code, it is determined that the battery is an authorized battery;
若所述第四字符码与第一字符码的不匹配,则确定所述电池为未授权电池。If the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
本公开实施例中,当第四字符码与第一字符码的相匹配,则确定所述电池为授权电池。当第四字符码与第一字符码的不匹配,则确定所述电池为未授权电池。此时第四字符码与第一字符码的相匹配可以包括:第四字符码与第一字符码均为符合同一预定规则下的字符码,例如均为字母与数字排序相同的字符码。第四字符码与第一字符码的不匹配,则第四字符码与第一字符码为不符合同一预定规则下的字符码。例如预定规则为字符码为6为字符串,且顺序为字母与数字间隔设置,例如:q1w1e3,与a1s2f3均为6为字符串且顺序为字母与数字间隔设置,则此时可认为q1w1e3,与a1s2f3符合同一预定规则下的字符码。In the embodiment of the present disclosure, when the fourth character code matches the first character code, it is determined that the battery is an authorized battery. When the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery. At this time, the matching of the fourth character code and the first character code may include: the fourth character code and the first character code are both character codes that comply with the same predetermined rule, for example, both are character codes with the same order of letters and numbers. If the fourth character code does not match the first character code, then the fourth character code and the first character code are character codes that do not comply with the same predetermined rule. For example, the predetermined rule is that the character code is 6, which is a string, and the order is the interval setting between letters and numbers. For example: q1w1e3, and a1s2f3 are both 6 is a string, and the order is the interval setting between letters and numbers. At this time, it can be considered that q1w1e3, and a1s2f3 conforms to the character code under the same predetermined rule.
本公开实施例提供一种电子设备,包括:An embodiment of the present disclosure provides an electronic device, including:
处理器和用于存储能够在处理器上运行的计算机程序的存储器;A processor and memory for storing a computer program capable of running on the processor;
电池,所述电子设备的电池具有加密单元;其中,所述处理器用于运行所述计算机程序时,执行上述各实施例所述方法的步骤。A battery, the battery of the electronic device has an encryption unit; wherein the processor is used to execute the steps of the methods described in the above embodiments when running the computer program.
本公开实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行上述各实施例所述方法的步骤。Embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored, and the computer program is used by a processor to execute the steps of the methods described in the above embodiments.
图8是根据一示例性实施例示出的一种电子设备的设备框图。例如,电子设备可以是移动电话,计算机,数字广播电子设备,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。FIG. 8 is a device block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
参照图8,电子设备可以包括以下一个或多个组件:处理组件802,存储器804,电力组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。Referring to Figure 8, the electronic device may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communications component 816.
处理组件802通常控制电子设备的整体操作,诸如与触摸,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。 Processing component 802 generally controls the overall operation of the electronic device, such as operations associated with touch, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
存储器804被配置为存储各种类型的数据以支持在电子设备的操作。这些数据的示例包括用于在电子设备上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 804 is configured to store various types of data to support operations in the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
电力组件806为电子设备的各种组件提供电力。电力组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备生成、管理和分配电力相关联的组件。 Power component 806 provides power to various components of the electronic device. Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic devices.
多媒体组件808包括在电子设备和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 808 includes a screen that provides an output interface between the electronic device and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. A touch sensor can not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device is in an operating mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。 Audio component 810 is configured to output and/or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or sent via communication component 816 . In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
传感器组件814包括一个或多个传感器,用于为电子设备提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备的打开/关闭状态,组件的相对定位,例如组件为电子设备的显示器和小键盘,传感器组件814还可以检测电子设备或电子设备一个组件的位置改变,用户与电子设备接触的存在或不存在,电子设备方位或加速/减速和电子设备的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor component 814 includes one or more sensors for providing various aspects of status assessment for the electronic device. For example, the sensor component 814 can detect the open/closed state of the electronic device, the relative positioning of components, such as the display and keypad of the electronic device, the sensor component 814 can also detect the position change of the electronic device or a component of the electronic device, the user The presence or absence of contact with the electronic device, the orientation or acceleration/deceleration of the electronic device and the temperature changes of the electronic device. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件816被配置为便于电子设备和其他设备之间有线或无线方式的通信。电子设备可以接入基于通信标准的无线网络,如WiFi,4G或5G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件816包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 816 is configured to facilitate wired or wireless communications between electronic devices and other devices. Electronic devices can access wireless networks based on communication standards, such as WiFi, 4G or 5G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communications component 816 includes a near field communications (NFC) module to facilitate short-range communications. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In exemplary embodiments, the electronic device may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common common sense or customary technical means in the technical field that are not disclosed in the disclosure. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended claims.

Claims (19)

  1. 一种电子设备的充电方法,其特征在于,所述电子设备的电池具有加密单元,所述充电方法,包括:A charging method for electronic equipment, characterized in that the battery of the electronic equipment has an encryption unit, and the charging method includes:
    通过所述加密单元对所述电池进行第一加密认证,其中,所述第一加密认证用于对所述电池是否为授权电池进行认证;Perform a first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery;
    在所述第一加密认证通过的情况下,向云端服务器发送认证信息,其中,所述认证信息与所述电池相关联;If the first encrypted authentication passes, send authentication information to the cloud server, where the authentication information is associated with the battery;
    接收所述云端服务器反馈的认证结果,其中,所述认证结果根据所述认证信息确定,所述认证结果用于指示所述电池是否为授权电池;Receive an authentication result fed back by the cloud server, wherein the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
    根据所述认证结果,确定所述电子设备的充电模式,其中不同充电模式下对所述电池进行充电的充电功率不同。According to the authentication result, the charging mode of the electronic device is determined, wherein the charging power for charging the battery is different in different charging modes.
  2. 根据权利要求1所述的电子设备的充电方法,其特征在于,所述第一加密认证确定为基于第一加密方式对所述电池进行加密认证;The charging method of electronic equipment according to claim 1, characterized in that the first encryption authentication is determined to perform encryption authentication on the battery based on a first encryption method;
    所述在所述第一加密认证通过的情况下,向云端服务器发送认证信息,包括:If the first encryption authentication passes, sending authentication information to the cloud server includes:
    在所述第一加密认证通过的情况下,基于第二加密方式对所述电池进行加密认证,生成所述认证信息;所述第二加密方式不同于所述第一加密方式。If the first encryption authentication passes, the battery is encrypted and authenticated based on a second encryption method to generate the authentication information; the second encryption method is different from the first encryption method.
  3. 根据权利要求2所述的电子设备的充电方法,其特征在于,所述基于第一加密方式对所述电池进行加密认证,包括:The charging method of electronic equipment according to claim 2, characterized in that, performing encryption authentication on the battery based on the first encryption method includes:
    基于第一公钥与第一私钥,对所述电池进行加密认证,其中所述第一公钥存储于所述电子设备的认证系统,所述第一私钥存储于所述电池的加密单元;Encryption authentication is performed on the battery based on a first public key and a first private key, where the first public key is stored in the authentication system of the electronic device, and the first private key is stored in the encryption unit of the battery ;
    所述基于第二加密方式对所述电池进行加密认证,包括:The encryption and authentication of the battery based on the second encryption method includes:
    基于所述第二公钥与第二私钥,对所述电池进行加密认证,其中所述公钥存储于所述云端服务器,所述第二私钥存储于所述电池的加密单元;所述第一公钥不同于所述第二公钥,所述第一私钥不同于所述第二私钥。Encryption authentication is performed on the battery based on the second public key and the second private key, where the public key is stored in the cloud server and the second private key is stored in the encryption unit of the battery; The first public key is different from the second public key, and the first private key is different from the second private key.
  4. 根据权利要求3所述的电子设备的充电方法,其特征在于,所述基于第一公钥与第一私钥,对所述电池进行加密认证,包括:The charging method of electronic equipment according to claim 3, characterized in that, performing encryption authentication on the battery based on the first public key and the first private key includes:
    获取第一字符码;Get the first character code;
    基于所述第一公钥对所述第一字符码进行加密,得到第一密文;Encrypt the first character code based on the first public key to obtain a first ciphertext;
    通过所述加密单元,基于所述第一私钥对所述第一密文解密,得到第二字符码;Decrypt the first ciphertext based on the first private key through the encryption unit to obtain a second character code;
    通过所述加密单元,基于所述第一私钥对所述第二字符码加密,得到第二密文;Through the encryption unit, the second character code is encrypted based on the first private key to obtain a second ciphertext;
    通过所述第一公钥,对所述第二密文进行解密,得到第三字符码;Decrypt the second ciphertext using the first public key to obtain a third character code;
    若所述第一字符码与所述第三字符码匹配,则确定对所述电池的所述第一加密认证通过。If the first character code matches the third character code, it is determined that the first encryption authentication of the battery is passed.
  5. 根据权利要求4所述的电子设备的充电方法,其特征在于,所述基于所述第二公钥与第二私 钥,对所述电池进行加密认证,包括:The charging method of electronic equipment according to claim 4, characterized in that, performing encryption authentication on the battery based on the second public key and the second private key includes:
    通过所述加密单元,基于所述第二私钥对所述第二字符码加密,得到所述认证信息。The encryption unit encrypts the second character code based on the second private key to obtain the authentication information.
  6. 根据权利要求1所述的电子设备的充电方法,其特征在于,所述根据所述认证结果,确定所述电子设备的充电模式,包括:The charging method of electronic equipment according to claim 1, characterized in that, determining the charging mode of the electronic equipment according to the authentication result includes:
    若所述认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电;If the authentication result determines that the battery is an authorized battery, it is determined to charge the electronic device in the first charging mode;
    若所述认证结果确定为所述电池为未授权电池,则确定以第二充电模式对所述电子设备进行充电;其中,所述第一充电模式对应于第一充电功率,所述第二充电模式对应于第二充电功率,所述第一充电功率大于所述第二充电功率。If the authentication result determines that the battery is an unauthorized battery, it is determined to charge the electronic device in a second charging mode; wherein the first charging mode corresponds to the first charging power, and the second charging mode The mode corresponds to a second charging power, the first charging power being greater than the second charging power.
  7. 根据权利要求6所述的电子设备的充电方法,其特征在于,所述若所述认证结果确定为所述电池为授权电池,则确定以第一充电模式对所述电子设备进行充电,包括:The charging method of electronic equipment according to claim 6, characterized in that if the authentication result determines that the battery is an authorized battery, then determining to charge the electronic equipment in the first charging mode includes:
    若所述认证结果确定为所述电池为授权电池,则预定时间内以第一充电功率对所述电池充电;If the authentication result determines that the battery is an authorized battery, charge the battery with the first charging power within a predetermined time;
    所述预定时间后,重新认证所述电池是否为授权电池,包括:更新用于加密认证的第二公钥与第二私钥;其中,所述预定时间为所述电池被云端服务器认证为授权电池后以第一充电模式进行充电的有效期限的时间长度。After the predetermined time, re-certify whether the battery is an authorized battery, including: updating the second public key and the second private key used for encryption authentication; wherein the predetermined time is when the battery is certified as authorized by the cloud server The length of time the battery is valid after being charged in the first charging mode.
  8. 根据权利要求3所述的电子设备的充电方法,其特征在于,所述充电方法还包括:The charging method of electronic equipment according to claim 3, characterized in that the charging method further includes:
    若所述第一加密认证通过,且所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则更新所述第一公钥和所述第一私钥。If the first encryption authentication passes and the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, the first public key and the first private key are updated.
  9. 根据权利要求1所述的电子设备的充电方法,其特征在于,所述向云端服务器发送认证信息,包括:The charging method of electronic equipment according to claim 1, wherein the sending authentication information to the cloud server includes:
    确定所述电子设备是否与所述云端服务器建立通信连接;Determine whether the electronic device has established a communication connection with the cloud server;
    若所述电子设备与所述云端服务器建立通信连接,则向云端服务器发送所述认证信息。If the electronic device establishes a communication connection with the cloud server, the authentication information is sent to the cloud server.
  10. 根据权利要求9所述的电子设备的充电方法,其特征在于,所述充电方法,包括:The charging method of electronic equipment according to claim 9, characterized in that the charging method includes:
    若所述电子设备未与所述云端服务器建立通信连接,则确定以第三充电功率对所述电子设备进行充电。If the electronic device does not establish a communication connection with the cloud server, it is determined to charge the electronic device with the third charging power.
  11. 根据权利要求1所述的电子设备的充电方法,其特征在于,所述确定所述电子设备的充电模式,包括:The charging method of electronic equipment according to claim 1, characterized in that determining the charging mode of the electronic equipment includes:
    所述云端服务器反馈的所述认证结果确定为所述电池为未授权电池,则标记所述电池为伪装电池;If the authentication result fed back by the cloud server determines that the battery is an unauthorized battery, then the battery is marked as a disguised battery;
    上传所述伪装电池的标记信息至所述云端服务器。Upload the tag information of the disguised battery to the cloud server.
  12. 根据权利要求1或7所述的电子设备的充电方法,其特征在于,所述充电方法还包括:The charging method of electronic equipment according to claim 1 or 7, characterized in that the charging method further includes:
    当所述云端服务器反馈的所述认证结果确定为所述电池为授权电池,对所述电池进行第二次充电时,确定验证通过的时间是否超过预定时间;When the authentication result fed back by the cloud server determines that the battery is an authorized battery and the battery is charged for the second time, it is determined whether the time to pass the verification exceeds a predetermined time;
    若验证通过的时间未超过所述预定时间,则延时所述验证通过的有效性;If the time for passing the verification does not exceed the predetermined time, delay the validity of the passing verification;
    若所述验证通过的时间超过所述预定时间,则重新验证所述电池是否为授权电池。If the verification time exceeds the predetermined time, whether the battery is an authorized battery is re-verified.
  13. 一种电子设备的充电方法,其特征在于,应用于与所述电子设备通信连接的云端服务器,所述充电方法,包括:A charging method for electronic equipment, characterized in that it is applied to a cloud server that is communicatively connected to the electronic equipment. The charging method includes:
    接收所述电子设备传输的认证信息;Receive authentication information transmitted by the electronic device;
    通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果;Verify whether the battery of the electronic device is an authorized battery through the authentication information, and obtain the authentication result;
    反馈所述认证结果至所述电子设备。Feed back the authentication result to the electronic device.
  14. 根据权利要求13所述的电子设备的充电方法,其特征在于,所述通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果,包括:The charging method of electronic equipment according to claim 13, characterized in that, verifying whether the battery of the electronic equipment is an authorized battery through the authentication information and obtaining the authentication result includes:
    通过第二公钥对所述认证信息进行解密,得到第四字符码;Decrypt the authentication information using the second public key to obtain a fourth character code;
    基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果;所述第一字符码为所述电子设备对所述电池进行第一加密认证时生成。The authentication result is determined based on the matching result of the fourth character code and the first character code; the first character code is generated when the electronic device performs first encryption authentication on the battery.
  15. 根据权利要求14所述的电子设备的充电方法,其特征在于,所述基于所述第四字符码与第一字符码的匹配结果,确定所述认证结果,包括:The charging method of electronic equipment according to claim 14, wherein the determining the authentication result based on the matching result of the fourth character code and the first character code includes:
    若所述第四字符码与第一字符码的相匹配,则确定所述电池为授权电池;If the fourth character code matches the first character code, it is determined that the battery is an authorized battery;
    若所述第四字符码与第一字符码的不匹配,则确定所述电池为未授权电池。If the fourth character code does not match the first character code, it is determined that the battery is an unauthorized battery.
  16. 一种电子设备的充电装置,其特征在于,所述电子设备的电池具有加密单元,所述充电装置,包括:A charging device for electronic equipment, characterized in that the battery of the electronic equipment has an encryption unit, and the charging device includes:
    第一处理单元,用于通过所述加密单元对所述电池进行第一加密认证,其中,所述第一加密认证用于对所述电池是否为授权电池进行认证;A first processing unit configured to perform first encryption authentication on the battery through the encryption unit, wherein the first encryption authentication is used to authenticate whether the battery is an authorized battery;
    第二处理单元,用于在所述第一加密认证通过的情况下,向云端服务器发送认证信息,其中,所述认证信息与所述电池相关联;A second processing unit configured to send authentication information to the cloud server when the first encryption authentication passes, wherein the authentication information is associated with the battery;
    第三处理单元,用于接收所述云端服务器反馈的认证结果,其中,所述认证结果根据所述认证信息确定,所述认证结果用于指示所述电池是否为授权电池;A third processing unit configured to receive an authentication result fed back by the cloud server, where the authentication result is determined based on the authentication information, and the authentication result is used to indicate whether the battery is an authorized battery;
    第四处理单元,用于根据所述认证结果,确定所述电子设备的充电模式,其中不同充电模式下对所述电池进行充电的充电功率不同。The fourth processing unit is configured to determine the charging mode of the electronic device according to the authentication result, wherein the charging power for charging the battery is different in different charging modes.
  17. 一种电子设备的充电装置,其特征在于,应用于与所述电子设备通信连接的云端服务器,所述充电装置,包括:A charging device for electronic equipment, characterized in that it is applied to a cloud server that is communicatively connected to the electronic equipment. The charging device includes:
    第一处理单元,用于接收所述电子设备传输的认证信息;A first processing unit configured to receive authentication information transmitted by the electronic device;
    第二处理单元,用于通过所述认证信息,验证所述电子设备的电池是否为授权电池,得到认证结果;A second processing unit, configured to verify whether the battery of the electronic device is an authorized battery through the authentication information, and obtain an authentication result;
    第三处理单元,用于反馈所述认证结果至所述电子设备。A third processing unit configured to feed back the authentication result to the electronic device.
  18. 一种电子设备,其特征在于,包括:An electronic device, characterized by including:
    处理器和用于存储能够在处理器上运行的计算机程序的存储器;A processor and memory for storing a computer program capable of running on the processor;
    电池,所述电子设备的电池具有加密单元;其中,所述处理器用于运行所述计算机程序时,执行权利要求1至12或13至15任一项所述方法的步骤。A battery, the battery of the electronic device has an encryption unit; wherein the processor is used to execute the steps of the method described in any one of claims 1 to 12 or 13 to 15 when running the computer program.
  19. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至12或13至15任一项所述方法的步骤。A computer-readable storage medium with a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 12 or 13 to 15 are implemented.
PCT/CN2022/099918 2022-06-20 2022-06-20 Charging method and apparatus for electronic device, and electronic device and storage medium WO2023245356A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2022/099918 WO2023245356A1 (en) 2022-06-20 2022-06-20 Charging method and apparatus for electronic device, and electronic device and storage medium
CN202280004266.6A CN117616658A (en) 2022-06-20 2022-06-20 Charging method and device for electronic equipment, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/099918 WO2023245356A1 (en) 2022-06-20 2022-06-20 Charging method and apparatus for electronic device, and electronic device and storage medium

Publications (1)

Publication Number Publication Date
WO2023245356A1 true WO2023245356A1 (en) 2023-12-28

Family

ID=89378904

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099918 WO2023245356A1 (en) 2022-06-20 2022-06-20 Charging method and apparatus for electronic device, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN117616658A (en)
WO (1) WO2023245356A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101331707A (en) * 2005-12-20 2008-12-24 松下电器产业株式会社 Authentication system and authentication device
CN102255109A (en) * 2011-04-06 2011-11-23 宇龙计算机通信科技(深圳)有限公司 Authentication method for mobile terminal battery, and mobile terminal thereof
CN107483184A (en) * 2017-07-19 2017-12-15 北京摩拜科技有限公司 Battery management method, equipment, battery, article and system
CN110545535A (en) * 2018-05-28 2019-12-06 中兴通讯股份有限公司 authentication method, authentication device and computer readable storage medium
CN113759259A (en) * 2020-06-04 2021-12-07 北京小米移动软件有限公司 Battery identification method, identification device, battery, identification device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101331707A (en) * 2005-12-20 2008-12-24 松下电器产业株式会社 Authentication system and authentication device
CN102255109A (en) * 2011-04-06 2011-11-23 宇龙计算机通信科技(深圳)有限公司 Authentication method for mobile terminal battery, and mobile terminal thereof
CN107483184A (en) * 2017-07-19 2017-12-15 北京摩拜科技有限公司 Battery management method, equipment, battery, article and system
CN110545535A (en) * 2018-05-28 2019-12-06 中兴通讯股份有限公司 authentication method, authentication device and computer readable storage medium
CN113759259A (en) * 2020-06-04 2021-12-07 北京小米移动软件有限公司 Battery identification method, identification device, battery, identification device and storage medium

Also Published As

Publication number Publication date
CN117616658A (en) 2024-02-27

Similar Documents

Publication Publication Date Title
EP3657370B1 (en) Methods and devices for authenticating smart card
KR101693130B1 (en) Information interaction method and device
US11196553B2 (en) Command transmission method and apparatus, electronic device
CN104219058B (en) Authentication, identification authorization method and device
WO2016050037A1 (en) Operation authorization method and device
CN108269334A (en) Method for unlocking, terminal device and smart lock
CN109146470B (en) Method and device for generating payment code
US10129228B1 (en) Authenticated communication between devices
CN104955031A (en) Information transmission method and device
CN113132091B (en) Method for sharing equipment and electronic equipment
TWI761843B (en) Access control method and device, electronic device and storage medium
US9892249B2 (en) Methods and devices for authorizing operation
CN104093119B (en) unlocking method and device
WO2016011739A1 (en) Method, device, and system for anti-counterfeiting verification
CN106060098B (en) Processing method, processing unit and the processing system of identifying code
CN111917728A (en) Password verification method and device
CN114221764A (en) Public key updating method, device and equipment based on block chain
CN106534083B (en) Brush machine Tool validation method and device
CN112115464A (en) Unlocking processing method and device, electronic equipment and storage medium
WO2023245356A1 (en) Charging method and apparatus for electronic device, and electronic device and storage medium
CN107302519B (en) Identity authentication method and device for terminal equipment, terminal equipment and server
CN107294985A (en) Information Authentication method, apparatus and system
WO2023230768A1 (en) Battery encryption circuit, battery check method and apparatus, device and storage medium
CN116032504A (en) Data decryption method, device and storage medium
CN115333728A (en) Data decryption method, data decryption device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22947137

Country of ref document: EP

Kind code of ref document: A1