WO2023097961A1 - Battery authentication method and apparatus for terminal, electronic device and storage medium - Google Patents

Battery authentication method and apparatus for terminal, electronic device and storage medium Download PDF

Info

Publication number
WO2023097961A1
WO2023097961A1 PCT/CN2022/090265 CN2022090265W WO2023097961A1 WO 2023097961 A1 WO2023097961 A1 WO 2023097961A1 CN 2022090265 W CN2022090265 W CN 2022090265W WO 2023097961 A1 WO2023097961 A1 WO 2023097961A1
Authority
WO
WIPO (PCT)
Prior art keywords
battery
authentication
terminal
authenticated
cloud
Prior art date
Application number
PCT/CN2022/090265
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 北京小米移动软件有限公司
Publication of WO2023097961A1 publication Critical patent/WO2023097961A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/371Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC] with remote indication, e.g. on external chargers
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/385Arrangements for measuring battery or accumulator variables
    • G01R31/387Determining ampere-hour charge capacity or SoC
    • G01R31/388Determining ampere-hour charge capacity or SoC involving voltage measurements
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/389Measuring internal impedance, internal conductance or related variables
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/396Acquisition or processing of data for testing or for monitoring individual cells or groups of cells within a battery
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Definitions

  • the present disclosure relates to the technical field of terminals, and in particular, to a terminal battery authentication method and device, electronic equipment, and a storage medium.
  • the present disclosure provides a terminal battery authentication method and device, electronic equipment, and a storage medium, capable of accurately authenticating a terminal battery based on battery information of a legal battery stored in a cloud.
  • a battery authentication method for a terminal is provided, which is applied to a terminal, including:
  • An authentication result returned by the cloud is received.
  • a terminal battery authentication method is provided, which is applied to the cloud, including:
  • the battery information contained in the authentication request is authenticated, and the authentication result is returned to the terminal.
  • a battery authentication device for a terminal which is applied to a terminal, including:
  • an acquiring unit acquiring battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated;
  • the sending unit sends the authentication request to the cloud, so that the cloud authenticates the battery information contained in the authentication request based on the battery information of the legal battery stored in advance;
  • the receiving unit receives the authentication result returned by the cloud.
  • a battery authentication device for a terminal which is applied to the cloud, including:
  • a receiving unit configured to receive an authentication request sent by a terminal, where the authentication request is generated by the terminal based on the battery information of the battery to be authenticated;
  • the authenticating unit authenticates the battery information included in the authentication request based on pre-stored battery information of legal batteries, and returns an authentication result to the terminal.
  • an electronic device comprising:
  • memory for storing processor-executable instructions
  • the processor implements the method as described in the first aspect or the second aspect by running the executable instruction.
  • a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
  • the terminal when the terminal needs to authenticate the assembled battery, it can send an authentication request to the cloud based on the battery information of the battery, so that the cloud can verify the received battery information based on the pre-stored battery information of the legal battery.
  • the battery information contained in the authentication request is used for authentication, and the authentication result is returned to the terminal.
  • this disclosure is based on the battery information of legal batteries stored in the cloud, and authenticates the batteries assembled in the terminal.
  • the authentication operation does not depend on the authentication logic deployed locally on the terminal, which avoids the local
  • the deployed authentication logic is easily cracked, resulting in inaccurate authentication results.
  • FIG. 1 is a flow chart of a terminal battery authentication method shown in an exemplary embodiment of the present disclosure
  • Fig. 2 is a flowchart of another terminal battery authentication method shown in an exemplary embodiment of the present disclosure
  • Fig. 3 is an interaction diagram of a mobile phone battery authentication method for a smart phone shown in an exemplary embodiment of the present disclosure
  • Fig. 4 is a flow chart of a mobile phone battery authentication method for a smart phone shown in an exemplary embodiment of the present disclosure
  • Fig. 5 is a block diagram of a battery authentication device applied to a terminal shown in an exemplary embodiment of the present disclosure
  • Fig. 6 is a block diagram of another battery authentication device applied to a terminal according to an exemplary embodiment of the present disclosure
  • Fig. 7 is a block diagram of a battery authentication device applied to the cloud according to an exemplary embodiment of the present disclosure
  • Fig. 8 is a block diagram of another battery authentication device applied to the cloud according to an exemplary embodiment of the present disclosure.
  • Fig. 9 is a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
  • first, second, third, etc. may be used in the present disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present disclosure, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word “if” as used herein may be interpreted as “at” or “when” or “in response to a determination.”
  • the terminal in order to avoid excessive charging power resulting in exceeding the battery load, before charging the battery, the terminal usually firstly performs authentication operations on the battery to determine whether the battery is a legal battery with high safety . On this basis, the terminal can charge the battery with a charging strategy that matches the authentication result. Specifically, when the authentication is passed, the battery is charged with the preset fast charging strategy; , use the normal charging scheme to charge the battery. In this way, the charging efficiency can be improved as much as possible under the premise of ensuring the safety of the battery.
  • an authentication operation is generally performed locally on a battery installed in a terminal. For example, technicians can save the same secret key in the battery chip contained in the battery and in the terminal equipped with the battery in advance. Then, when the terminal needs to authenticate the battery, it can preferentially read the secret key stored in the battery chip. Key, and judge whether the read key is consistent with the key stored locally on the terminal, if they are consistent, the authentication passes, otherwise, the authentication fails.
  • the relevant technology only performs authentication operations on the battery locally in the terminal, and the authentication logic is relatively simple. Once the authentication logic is cracked by illegal elements, it is very easy for the authentication result to be inaccurate, which leads to fast charging.
  • a case where the policy charges an illegal battery with less security For example, after an illegal person cracks the local authentication logic of the terminal, he can produce an illegal battery according to the authentication logic obtained by the cracking, so that after the illegal battery is assembled into the terminal, it can pass the authentication operation smoothly, causing serious security risks.
  • Hidden dangers for another example, criminals can modify the cracked authentication logic, so that illegal batteries produced by themselves can pass the modified authentication logic, which also causes serious security risks.
  • this disclosure proposes a terminal battery authentication method.
  • the terminal needs to rely on the relevant information of the legal battery stored in the cloud to perform authentication on the assembled battery, which avoids relying only on
  • the local authentication logic of the terminal performs an authentication operation on the battery, which leads to the authentication logic being easily cracked, and the problem of inaccurate authentication occurs.
  • Fig. 1 is a flow chart of a terminal battery authentication method according to an exemplary embodiment of the present disclosure. The method is applied to a terminal, as shown in Figure 1, the method may include the following steps:
  • Step 102 acquiring battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated.
  • the present disclosure introduces the cloud, so as to authenticate the battery installed in the terminal through the cloud.
  • the cloud can pre-store the battery information of the legal battery, so that when the cloud receives the authentication request sent by the terminal, it can check the battery information of the battery to be authenticated contained in the authentication request based on the pre-stored battery information of the legal battery. The battery information is authenticated, and the authentication result is returned to the terminal.
  • the authentication operation is performed by the cloud, which obviously can avoid the problem of inaccurate authentication results caused by the terminal's local authentication logic being cracked.
  • the cloud in this disclosure relies on the battery information of the legal battery stored in the cloud to authenticate the battery to be authenticated, and can accurately identify whether the battery to be authenticated is a legitimate battery.
  • the authentication logic is more complicated and not easy to crack.
  • a legitimate battery can be understood as: a battery produced by a predefined battery manufacturer that supplies batteries to terminal manufacturers.
  • the battery information of the legal batteries can be uploaded to the cloud for storage by the cloud.
  • the battery information of a legitimate battery may include: the battery identification of the battery (for example, battery SN, serial number, serial number), the battery's PCM (battery protection module) information, and other information of the battery itself.
  • the battery information of legal batteries may also include chip information such as the chip identification of the battery chip (for example, the Code of the battery chip), and the private key of the battery chip.
  • the battery information of the legal battery above is only illustrative, and what kind of battery information is stored in the cloud can be determined by those skilled in the art according to the actual situation, which is not limited in the present disclosure.
  • Step 104 sending the authentication request to the cloud, so that the cloud authenticates the battery information included in the authentication request based on the pre-stored battery information of the legal battery.
  • the battery information contained in the authentication request can be authenticated based on the battery information of the legitimate battery in various ways.
  • the cloud may match the battery information contained in the authentication request with the battery information of legal batteries pre-stored in the cloud. If the battery information contained in the authentication request can be matched, it proves that the battery to be authenticated is a legitimate battery, and correspondingly, the cloud can generate an authentication result that indicates that the battery to be authenticated has passed the authentication; If the battery information contained in the authorization request proves that the battery to be authenticated is not a legal battery with battery information stored in the cloud, the cloud can generate an authentication result indicating that the battery to be authenticated has not passed the authentication.
  • the battery information of legal batteries stored in the cloud includes: the corresponding relationship between the battery identification of each legal battery and the chip identification of the battery chip contained in each.
  • the battery information contained in the authentication request uploaded by the terminal may be: the battery ID of the battery to be authenticated, and the chip ID of the battery chip contained in the battery to be authenticated.
  • the cloud receives the authentication request, it can judge whether there is any set of the stored corresponding relationship between the battery identification of the combined battery and the chip identification of the battery chip, whether there is any group that records the information contained in the authentication request. Battery identification and chip identification. If it exists, an authentication result indicating that the battery to be authenticated has passed the authentication may be generated.
  • the battery to be authenticated can be authenticated through the public and private key pair of the battery to be authenticated.
  • the battery information of legal batteries pre-stored in the cloud may include: the public key of each legal battery; and the battery information contained in the authentication request may be: a digital signature generated based on the private key of the battery to be authenticated .
  • the cloud can verify the digital signature contained in the authentication request based on the pre-stored public key of the legal battery; among them, if the verification is successful, it can generate It is used to represent the authentication result of the battery to be authenticated passing the authentication.
  • the cloud can associate and store the battery identification of the legal battery with the public key; correspondingly, the battery information of the battery to be authenticated contained in the authentication request can also include: the battery to be authenticated identification information. Then, after receiving the authentication request, the cloud can obtain the public key of the battery to be authenticated according to the battery identification of the battery to be authenticated, and verify the digital signature in the authentication request according to the obtained public key. In this case, if the corresponding public key cannot be obtained based on the battery identification of the battery to be authenticated, or the signature verification fails after the public key is obtained, it can be considered that the authentication operation on the battery to be authenticated has failed.
  • the cloud can sequentially verify the digital signature contained in the authentication request through the public keys of all legal batteries. As long as any public key successfully verifies the digital signature, the generated An authentication result indicating that the battery to be authenticated has passed the authentication; and when all public keys fail to successfully verify the digital signature, an authentication result indicating that the battery to be authenticated has not passed the authentication is generated.
  • the cloud in addition to authenticating the battery to be authenticated installed in the terminal, the cloud can also authenticate the terminal itself. Specifically, terminal information of legal terminals may also be pre-stored in the cloud. On this basis, the terminal can send its own terminal information to the cloud, so that the cloud can authenticate the received terminal information based on the pre-stored terminal information of the legal terminal, and return the authentication result about the terminal to the terminal.
  • the cloud can also determine whether the terminal passes the authentication by matching the terminal information sent by the terminal with the terminal information of the legal terminal stored in the cloud. Among them, if the terminal information sent by the terminal can be matched, it proves that the terminal is a legal terminal. Correspondingly, the cloud can generate an authentication result to indicate that the terminal has passed the authentication; if the terminal information sent by the terminal cannot be matched, It proves that the terminal is not a legal terminal with terminal information stored in the cloud, and accordingly, the cloud can generate an authentication result indicating that the terminal has not passed the authentication.
  • the cloud can also authenticate the team terminal through the public and private keys of the terminal.
  • the terminal information of the legal terminal pre-stored in the cloud may include: the public key of each legal terminal; and the terminal information sent by the terminal may be: a digital signature generated based on the private key of the terminal.
  • the cloud can verify the digital signature based on the pre-stored public key of the legal terminal; where, if the verification is successful, it can generate The authentication result of the authentication.
  • how to obtain the public key and how to verify the digital signature based on the public key are similar to the authentication of the battery to be authenticated, and will not be repeated here.
  • the above cloud authentication process of the terminal and the battery to be authenticated is actually verifying the legitimacy of the cloud and the battery to be authenticated.
  • the cloud may further establish a corresponding relationship between the terminal information of the terminal and the battery information of the battery.
  • the cloud can authenticate the battery to be authenticated without using the pre-stored battery information of the legal battery and the terminal information of the legal terminal.
  • the authentication operation for the battery to be authenticated can be completed directly according to the corresponding relationship.
  • the battery to be authenticated can be re-authenticated by using the established corresponding relationship in various ways.
  • the cloud can further generate a legality certificate, which is used to prove that: the cloud has established a corresponding relationship between the terminal information of the terminal and the battery information of the battery to be authenticated .
  • the legitimacy certificate is used to prove that: the cloud has established a binding relationship between the terminal and the battery to be authenticated.
  • the legitimacy certificate is sent to the terminal for storage by the terminal, and is used for re-authentication of the battery to be authenticated subsequently.
  • the cloud can generate the above-mentioned legality certificate based on its own private key.
  • the terminal can verify the signature of the legitimacy certificate through the public key in the cloud, and store the legitimacy certificate when the signature verification is successful.
  • the terminal needs to re-authenticate the battery to be authenticated, it can obtain the battery information of the battery to be authenticated and the terminal information of the terminal, and judge whether the obtained battery information and terminal information are recorded in the legality certificate , if so, it is determined that the battery to be authenticated has passed the authentication.
  • the battery to be authenticated can be authenticated based on the corresponding relationship stored in the cloud by initiating an authentication request to the cloud in real time.
  • the terminal can obtain its own terminal information and the battery information of the battery to be authenticated, and send them to the cloud, so that the cloud can determine whether the corresponding relationship between the battery information and the terminal information has been established.
  • the batteries to be authenticated have all passed the legality verification and are bound to each other, and it is determined that the batteries to be authenticated have passed the authentication.
  • the terminal can only send the battery information of the battery to be authenticated to the cloud, so that the cloud can return the terminal information bound to the battery information according to the established correspondence, and the terminal can further determine whether the returned terminal information is It matches with its own information, and if it matches, it is determined that the battery to be authenticated has passed the authentication.
  • the terminal can also only send its own terminal information to the cloud, so that the cloud can return the battery information bound to the terminal information according to the established correspondence, and the terminal can further determine whether the returned battery information is compatible with its own The battery information of the battery to be authenticated matches, and if it matches, it is determined that the battery to be authenticated has passed the authentication.
  • the battery information included in the above correspondence is usually the battery identifier of the corresponding battery
  • the terminal information included is usually the terminal identifier of the corresponding terminal. That is, after both the terminal and the battery to be authenticated pass the legality verification, a correspondence between the battery ID and the terminal ID is usually constructed.
  • the authentication process described above is: through the information stored in the cloud, the battery and terminal to be authenticated are authenticated. Therefore, it can be called cloud authentication.
  • the battery to be authenticated may also be authenticated locally in the terminal as in the related art.
  • the terminal may perform local authentication on the battery information of the battery to be authenticated based on its own terminal information. Specifically, the terminal can obtain its own terminal information and the battery information of the battery to be detected assembled by itself, and determine whether the acquired terminal information and battery information match. If they match, then determine that the local authentication has passed; Authentication failed.
  • the battery manufacturer usually knows what type of terminal the battery will be used in. Therefore, when determining the battery identification of the produced battery, it can add a A specific field that applies to which model of terminal. On this basis, when the terminal needs to perform local authentication on its own battery, it can obtain the battery identification of the battery, and determine the above-mentioned specific field from the battery identification, so as to determine the battery to be authenticated according to the specific field. Applied terminal model. Wherein, when the terminal model used by the battery to be authenticated is consistent with the model of the terminal equipped with the battery to be authenticated, it is determined that the battery to be authenticated has passed the local authentication.
  • the local authentication of the battery to be authenticated based on a specific field in the battery identifier is only illustrative, and other ways can also be used to perform local authentication on the battery to be authenticated. For example, it may be determined whether the battery to be authenticated has passed the local authentication by judging whether the battery to be authenticated and the terminal store the same secret key as in the related art.
  • the battery chip of the battery to be authenticated can store the battery identification of the battery to be authenticated and the digital signature generated based on the private key of the battery chip, then the terminal can read the battery identification and digital signature in the battery chip, and The public key of the battery chip is obtained according to the read battery identification, and the digital signature is verified based on the obtained public key. If the verification is successful, it is determined that the battery to be authenticated has passed the local authentication.
  • the above local authentication operations can be performed before cloud authentication.
  • the terminal can initiate an authentication request to the cloud after the local authentication is passed, so that the cloud can authenticate the battery to be authenticated on the cloud through the stored battery information of the legal battery.
  • Step 106 receiving the authentication result returned by the cloud.
  • the terminal can authenticate the assembled battery to be authenticated in various situations.
  • the battery to be authenticated is authenticated.
  • a target charging strategy matching the authentication result can be selected from the predefined charging strategies to charge the battery to be authenticated. For example, if the authentication result indicates that the battery to be authenticated passes the authentication, the battery to be authenticated is charged through a predefined fast charging strategy; otherwise, the battery to be authenticated is charged through a conventional charging strategy.
  • the battery to be authenticated is authenticated.
  • the authentication result shows that the battery to be authenticated has passed the authentication, it means that the battery to be authenticated is a legal battery with high security, and the battery to be authenticated can be set to the power mode to be used for other devices Charging; if the authentication result shows that the battery to be authenticated has not passed the authentication, it means that the battery to be authenticated is an illegal battery with poor security, and other devices will not be charged by the battery to be authenticated.
  • the terminal in this disclosure can be any type of electronic device.
  • the terminal can be a mobile terminal such as a smart phone or a tablet computer; it can be a portable device such as AR glasses or a smart watch; A fixed terminal such as a powered PC (Personal Computer, personal computer).
  • What kind of device the terminal in the present disclosure is specifically can be determined by those skilled in the art according to the actual situation, and the present disclosure does not limit it.
  • the cloud in this disclosure can be deployed in any form, for example, it can be deployed on a certain server or server cluster (such as a server or server cluster of a certain terminal manufacturer), or it can be deployed on a certain virtual machine or Virtual machine cluster.
  • the cloud in this disclosure refers to a logical subject that pre-stores the battery information of a legal battery and can authenticate the battery based on the stored battery information.
  • the specific form of deployment can be determined by those skilled in the art. The personnel are determined according to the actual situation, which is not limited in the present disclosure.
  • the terminal when the terminal needs to authenticate the assembled battery, it can send an authentication request to the cloud based on the battery information of the battery, so that the cloud can authenticate the received battery based on the pre-stored battery information of the legal battery.
  • the battery information contained in the request is authenticated, and the authentication result is returned to the terminal.
  • this disclosure is based on the battery information of legal batteries stored in the cloud, and authenticates the batteries assembled in the terminal.
  • the authentication operation does not depend on the authentication logic deployed locally on the terminal, which avoids the local
  • the deployed authentication logic is easily cracked, resulting in inaccurate authentication results.
  • it can avoid the situation that the fast charging strategy is used to charge the illegal battery with poor security due to inaccurate authentication results, which may cause potential safety hazards.
  • the cloud will also establish a corresponding relationship between the terminal information of the terminal and the battery information of the battery to be authenticated, which is equivalent to the legal terminal It is bound with the legal battery it is equipped with.
  • the terminal needs to perform an authentication operation on the battery to be authenticated again, it can perform cloud authentication on the battery based on the corresponding relationship stored in the cloud. In this case, there is no need to repeatedly verify the validity of the terminal and the battery to be authenticated, which greatly simplifies the operation of cloud authentication.
  • the cloud can also generate a legality certificate for proving that the corresponding battery and the terminal have been bound, and send it to the terminal for storage.
  • the battery can be authenticated only by passing the legality certificate. In this way, even if there is no interaction with the cloud, the cloud authentication for the battery can be completed based on the corresponding relationship stored in the cloud, which avoids the problem of many cloud authentication interactions.
  • Fig. 2 is a flow chart of another terminal battery authentication method according to an exemplary embodiment of the present disclosure.
  • the method is applied to the cloud, as shown in Figure 2, the method may include the following steps:
  • Step 202 receiving an authentication request sent by the terminal, where the authentication request is generated by the terminal based on the battery information of the battery to be authenticated.
  • the present disclosure can authenticate the battery information contained in the authentication request based on the battery information of the legal battery in various ways.
  • the cloud can match the battery information contained in the authentication request with the stored battery information of legal batteries. Wherein, when the battery information contained in the authentication request is matched, an authentication result representing that the battery to be authenticated passes the authentication is generated; when the battery information contained in the authentication request is not matched, an authentication result is generated to represent the The authentication result that the authentication battery fails the authentication.
  • the battery to be authenticated may be authenticated through the public and private key pair of the battery to be authenticated.
  • the battery information of legal batteries pre-stored in the cloud may include: the public key of each legal battery; and the battery information contained in the authentication request may be: a digital signature generated based on the private key of the battery to be authenticated.
  • the cloud can verify the digital signature contained in the authentication request based on the pre-stored public key of the legal battery; among them, if the verification is successful, it can generate It is used to represent the authentication result of the battery to be authenticated passing the authentication.
  • the cloud can also authenticate the terminal itself.
  • terminal information of legal terminals may also be pre-stored in the cloud.
  • the terminal can send its own terminal information to the cloud, so that the cloud can authenticate the received terminal information based on the pre-stored terminal information of the legal terminal, and return the authentication result about the terminal to the terminal.
  • Step 204 Based on the pre-stored battery information of legal batteries, perform authentication on the battery information included in the authentication request, and return the authentication result to the terminal.
  • the cloud may further determine whether the authentication request is the first authentication request for the battery to be authenticated. Among them, when it is determined that the received authentication request is the first authentication request for the battery to be authenticated, and both the authentication operation for the terminal and the authentication operation for the battery to be authenticated have passed, the cloud can further establish the terminal The corresponding relationship between the terminal information of the battery to be authenticated and the battery information of the battery to be authenticated; and if it is determined that the received authentication request is not the first authentication request for the battery to be authenticated, it can be treated based on the established correspondence The authentication battery performs authentication.
  • the cloud can also generate a legality certificate for proving that the terminal and the battery to be authenticated have been bound.
  • the legitimacy certificate is sent to the terminal for storage by the terminal; wherein, the legitimacy certificate stored in the terminal is used for re-authentication of the battery to be authenticated.
  • the terminal when the terminal needs to authenticate the assembled battery, it can send an authentication request to the cloud based on the battery information of the battery, so that the cloud can authenticate the received battery based on the pre-stored battery information of the legal battery.
  • the battery information contained in the request is authenticated, and the authentication result is returned to the terminal.
  • this disclosure is based on the battery information of legal batteries stored in the cloud, and authenticates the batteries assembled in the terminal.
  • the authentication operation does not depend on the authentication logic deployed locally on the terminal, which avoids the local
  • the deployed authentication logic is easily cracked, resulting in inaccurate authentication results.
  • it can avoid the situation that the fast charging strategy is used to charge the illegal battery with poor security due to inaccurate authentication results, which may cause potential safety hazards.
  • Fig. 3 is an interaction diagram of a mobile phone battery authentication method for a smart phone according to an exemplary embodiment of the present disclosure. As shown in Figure 3, the method may include the following steps:
  • Step 301 the smart phone reads the SN of the mobile phone battery, the Code of the battery chip, and the PCM information of the mobile phone battery from the battery chip of the mobile phone battery.
  • the authentication operation for the battery of the smart phone can be triggered.
  • the battery information may include the SN and PCM information of the mobile phone battery, and the Code of the battery chip assembled therein.
  • step 302 the smart phone performs local authentication on the battery of the mobile phone based on its own model and the SN of the battery of the mobile phone.
  • the authentication operation for the mobile phone battery includes two parts: local authentication and cloud authentication. Among them, only when the local authentication passes, the smart phone will initiate cloud authentication for the mobile phone battery to the cloud.
  • the smart phone in this embodiment can obtain its own model information on the one hand, and can analyze the SN of the mobile phone battery on the other hand to determine the specific field contained therein for representing the model of the mobile phone it is applied to. On this basis, it can be determined according to the specific field whether the mobile phone model used by the mobile phone battery assembled in the smart phone is consistent with the model of the smart phone. If they are consistent, it is determined that the local authentication is passed through the battery of the mobile phone.
  • step 303 the smart phone generates a digital signature based on the private key of the smart phone when the local authentication passes.
  • the smart phone After the smart phone passes the local authentication, it can initiate cloud authentication for the mobile phone battery to the cloud.
  • the smart phone before cloud authentication is performed on the mobile phone battery, it is first necessary to prove the legitimacy of the smart phone itself to the cloud. Therefore, after the smart phone passes local authentication, it can generate a digital signature based on its own private key, and send the digital signature and the smart phone's ID to the cloud, so that the cloud can authenticate the smart phone based on the digital signature and the smart phone's ID. verify its legitimacy.
  • Step 304 the smartphone uploads the generated digital signature and the ID of the smartphone to the cloud.
  • Step 305 the cloud obtains the public key of the smart phone from the pre-stored public keys of the legitimate mobile phone based on the ID of the smart phone, so as to verify the received digital signature.
  • the cloud may pre-store the corresponding relationship between the IDs of each legal mobile phone and the public key. Therefore, after the cloud receives the smart phone's ID and digital signature, it can obtain the corresponding public key based on the smart phone's ID, and verify the received digital signature based on the obtained public key.
  • the smart phone is a legitimate mobile phone with mobile phone information pre-stored in the cloud.
  • Step 306 if the signature verification is successful, the cloud returns to the smart phone a confirmation message including a random number, which is used to indicate that the smart phone has passed the legality verification.
  • the cloud can return a confirmation message to the smart phone to inform the smart phone that it has passed the legality verification.
  • the confirmation message may include a random number randomly generated by the cloud to ensure that the battery information has not been tampered with when the smart phone uploads the battery information of the battery of the mobile phone.
  • step 307 the smart phone packs and uploads the random number contained in the confirmation message, the SN of the mobile phone battery, the Code of the battery chip, and the PCM information of the mobile phone battery to the cloud.
  • the battery information of the mobile phone battery may include the SN of the mobile phone battery, the PCM (battery protection module) information of the mobile phone battery, and the Code of the battery chip contained in the mobile phone battery.
  • the information is read by the smartphone, and when the confirmation message returned by the cloud is received, it is packaged and uploaded to the cloud together with the received random number.
  • step 308 the cloud verifies the legality of the mobile phone battery based on the pre-established correspondence between the SN of the legal battery, the Code of the battery chip contained therein, and its PCM information.
  • the manufacturer can upload the SN, PCM information of each legal battery, and the Code of the battery chip contained in each to the cloud, so that the cloud can establish the SN, PCM information of each legal battery. Correspondence between PCM information and the Code it contains.
  • the cloud when the cloud receives the random number and battery information uploaded by the smartphone, it can first confirm whether the received random number is consistent with the delivered random number, and if it is consistent, based on the received mobile phone
  • the SN of the battery looks up the Code and PCM information of the corresponding legal battery, and compares the found Code and PCM information with the received Code and PCM of the mobile phone battery. If the comparison results show that the two are consistent, it is determined that the mobile phone battery has passed the legality verification. .
  • Step 309 in the case that the battery of the mobile phone passes the legality verification, establish a corresponding relationship between the SN of the battery of the mobile phone and the mobile phone ID of the smart phone.
  • the binding relationship between the smart phone and the battery of the mobile phone has not been established yet. Therefore, it is only necessary to confirm that the mobile phone battery and the smart phone have passed the legality verification, and it can be determined that the mobile phone battery has passed the cloud authentication. At this time, on the one hand, a notification message that the mobile phone battery has passed the cloud authentication can be returned to the smartphone.
  • the corresponding relationship between the ID of the smartphone and the SN of the battery of the mobile phone can be established, so that when the battery of the mobile phone needs to be authenticated in the future, the authentication can be directly based on the established corresponding relationship without repeated verification legal operation.
  • step 310 the cloud generates a legality certificate for representing the binding of the mobile phone battery with the smart phone based on its own private key.
  • a legality certificate representing the binding of the mobile phone battery and the smart phone can also be generated and sent to the smart phone, so that the smart phone needs to verify the assembled mobile phone in the future.
  • the cloud authentication can be completed directly based on the legality certificate stored locally.
  • Step 311 the cloud returns the generated legality certificate and cloud authentication result to the smart phone.
  • the aforementioned notification message for indicating that the mobile phone battery has passed the cloud authentication and the legality certificate can be returned together, so as to reduce the number of interactions between the cloud and the smart phone.
  • the smart phone when the authentication result received by the smart phone indicates that the battery of the mobile phone has passed the cloud authentication, the smart phone can use the predefined fast charging strategy to charge the battery of the mobile phone; In the case of cloud authentication, the mobile phone battery can be charged using a predefined conventional charging strategy.
  • the smart phone when charging the mobile phone battery in the smart phone for the first time, the smart phone can perform local authentication on the mobile phone battery, and the cloud can perform cloud authentication on the mobile phone battery. And only after the mobile phone battery has passed the local authentication and cloud authentication, the fast charging strategy is used to charge the mobile phone battery, which avoids the mismatch between the charging strategy and the mobile phone battery due to inaccurate authentication results in related technologies, and there is a security hidden dangers.
  • the cloud binds the smart phone and the mobile phone battery by establishing a corresponding relationship between the ID of the smart phone and the SN of the mobile phone battery.
  • the smart phone needs to replace the battery of the mobile phone in the future, it can directly perform cloud authentication based on the corresponding relationship; For example, there may be legal batteries that are scrapped and repaired, and then reassembled into legitimate mobile phones. In this case, if the smartphone is bound with other normal batteries, the mobile phone battery is considered to be a legal battery. , and cannot be authenticated by the cloud.
  • Fig. 4 is a flow chart of a mobile phone battery authentication method for a smart phone according to an exemplary embodiment of the present disclosure. The method is applied to a smart phone, as shown in Figure 4, the method may include the following steps:
  • Step 401 read the SN of the mobile phone battery from the battery chip of the mobile phone battery.
  • Step 402 perform local authentication on the mobile phone battery based on its own model and the SN of the mobile phone battery.
  • the mobile phone model used by the mobile phone battery is consistent with the model of the smart phone as in the previous embodiment.
  • the specific local authentication process reference may be made to the description of the previous embodiment, which will not be repeated here.
  • Step 403 verifying the stored legality certificate based on the cloud public key.
  • this embodiment can directly authenticate the mobile phone battery on the cloud based on the saved legitimacy certificate without interacting with the cloud.
  • Authorization since the legitimacy certificate is used to indicate the existence of the above-mentioned corresponding relationship, it is equivalent to authenticating the battery of the mobile phone based on the information stored in the cloud, so it can also be regarded as cloud authentication).
  • the reliability of the legality certificate itself needs to be determined. Therefore, the public key in the cloud can be obtained to verify the validity of the certificate. Wherein, in the case of successful signature verification, it can be determined that the legitimacy certificate is issued by the cloud, and the content recorded therein is reliable.
  • Step 404 if the signature verification is successful, perform cloud authentication on the battery of the mobile phone according to the legality certificate.
  • the content in the legality certificate can be parsed to determine whether the ID contained in it is the ID of the above-mentioned smart phone, and whether the SN contained in it is the SN of the mobile phone battery equipped with the smart phone , if so, it is determined that the battery of the mobile phone passes the cloud authentication, otherwise, it does not pass the cloud authentication.
  • Step 405 obtain a comprehensive authentication result according to the local authentication result and the cloud authentication result.
  • the comprehensive authentication results can include the following three types: 1. Both local authentication and cloud authentication pass; 2. Local authentication passes, cloud authentication fails; 3. Local authentication fails, cloud authentication fails; Authentication passed.
  • Step 406 adopt the charging strategy matching the comprehensive authentication result to charge the battery of the mobile phone.
  • the mobile phone battery is charged using the fast charging strategy, and in other cases, the mobile phone battery is charged using the conventional charging strategy .
  • the matching relationship between the charging strategy and the comprehensive authentication result can be determined by those skilled in the art according to actual needs, which is not limited in this embodiment.
  • the cloud authentication can be completed based on the binding relationship without repeatedly verifying the battery of the mobile phone and The legality of smartphones.
  • the smart phone can complete cloud authentication without even interacting with the cloud, which greatly improves the efficiency of cloud authentication.
  • Fig. 5 is a block diagram showing a battery authentication device applied to a terminal according to an exemplary embodiment of the present disclosure.
  • the device includes an acquiring unit 501 , a sending unit 502 and a receiving unit 503 . in,
  • the acquiring unit 501 acquires battery information of the battery to be authenticated, and generates an authentication request based on the battery information of the battery to be authenticated;
  • the sending unit 502 is configured to send the authentication request to the cloud, so that the cloud can authenticate the battery information contained in the authentication request based on the pre-stored battery information of legal batteries;
  • the receiving unit 503 receives the authentication result returned by the cloud.
  • the battery information contained in the authentication request is used by the cloud to match the battery information of a legal battery pre-stored in the cloud;
  • the authentication result is used to indicate that the battery to be authenticated has passed the authentication;
  • the authentication result is used to indicate that the battery to be authenticated has not passed the authentication.
  • the battery information of the legal battery pre-stored in the cloud includes: the public key of the legal battery; the battery information of the battery to be authenticated includes: a digital signature generated based on the private key of the battery to be authenticated ;
  • the sending unit 502 is further configured to: send the authentication request to the cloud, so that the cloud can verify the digital signature contained in the authentication request based on the pre-stored public key of the legal battery; wherein, in If the signature verification is successful, the authentication result is used to indicate that the battery to be authenticated has passed the authentication.
  • the sending unit 502 is further configured to: send the terminal information of the terminal to the cloud, so that the cloud authenticates the received terminal information based on the pre-stored terminal information of the legal terminal;
  • the receiving unit 503 is further configured to: receive an authentication result about the terminal returned by the cloud.
  • terminal information of the terminal and battery information of the battery to be authenticated are established in the cloud corresponding relationship.
  • the receiving unit 503 is also used for:
  • the legality certificate is stored for re-authentication of the battery to be authenticated.
  • FIG. 5 is a block diagram of another battery authentication device applied to a terminal according to an exemplary embodiment of the present disclosure.
  • this embodiment further includes: Authentication unit 504 and selection unit 505 .
  • the authenticating unit 504 performs local authentication on the battery information of the battery to be authenticated based on the terminal information of the terminal;
  • the authentication request is generated when the battery to be authenticated passes local authentication.
  • the selection unit 505 selects a target charging strategy that matches the authentication result from predefined charging strategies, and charges the battery to be authenticated.
  • Fig. 7 is a block diagram of a battery authentication device applied to the cloud according to an exemplary embodiment of the present disclosure.
  • the device includes a receiving unit 701 and an authenticating unit 702 .
  • the receiving unit 701 receives an authentication request sent by the terminal, the authentication request is generated by the terminal based on the battery information of the battery to be authenticated;
  • the authenticating unit 702 is configured to authenticate the battery information included in the authentication request based on the pre-stored battery information of legal batteries, and return the authentication result to the terminal.
  • the authentication unit 702 is further used to:
  • the battery information of the legal battery pre-stored in the cloud includes: the public key of the legal battery;
  • the authentication unit 702 is further used to: read the digital signature contained in the battery information in the authentication request, the digital signature is generated based on the private key of the battery to be authenticated; Verifying the digital signature, and generating an authentication result indicating that the battery to be authenticated has passed the authentication if the signature verification is successful.
  • the authentication unit 702 is also used to:
  • FIG. 8 is a block diagram of another battery authentication device applied to the cloud according to an exemplary embodiment of the present disclosure.
  • this embodiment also includes: A building unit 703 and a generating unit 704 .
  • the establishing unit 703 when it is determined that the authentication request is the first authentication request for the battery to be authenticated, and both the authentication operation for the terminal and the authentication operation for the battery to be authenticated pass Next, establish a corresponding relationship between the terminal information of the terminal and the battery information of the battery to be authenticated;
  • the authenticating unit 702 is further configured to: in a case where it is determined that the authentication request is not the first authentication request for the battery to be authenticated, authenticate the battery to be authenticated based on the corresponding relationship.
  • the generating unit 704 when the corresponding relationship is established, generates a legality certificate for proving that the terminal and the battery to be authenticated have been bound; and sends the legality certificate to the terminal, to be stored by the terminal; wherein, the legitimacy certificate stored in the terminal is used for re-authentication of the battery to be authenticated.
  • the device embodiment since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. It can be understood and implemented by those skilled in the art without creative effort.
  • the present disclosure also provides a battery authentication device for a terminal, including: a processor; a memory for storing instructions executable by the processor;
  • the battery authentication method of the terminal described above for example, the method may include: obtaining battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated; sending the authentication request to the cloud, Authenticating the battery information contained in the authentication request based on the pre-stored battery information of the legal battery by the cloud; receiving an authentication result returned by the cloud.
  • the present disclosure also provides an electronic device, the electronic device includes a memory, and one or more programs, wherein the one or more programs are stored in the memory, and are configured to be operated by one or more processors
  • Executing the one or more programs includes instructions for implementing the battery authentication method of the terminal as described in any of the above embodiments.
  • the method may include: obtaining battery information of the battery to be authenticated, and based on the The battery information of the battery to be authenticated generates an authentication request; the authentication request is sent to the cloud, so that the cloud authenticates the battery information contained in the authentication request based on the pre-stored battery information of the legal battery ; Receive the authentication result returned by the cloud.
  • Fig. 9 is a block diagram of an apparatus 900 for implementing a process scheduling method according to an exemplary embodiment.
  • the apparatus 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
  • device 900 may include one or more of the following components: processing component 902, memory 904, power supply component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916 .
  • the processing component 902 generally controls the overall operations of the device 900, such as those associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 902 may include one or more modules that facilitate interaction between processing component 902 and other components.
  • the processing component 902 may include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
  • the memory 904 is configured to store various types of data to support operations at the device 900 . Examples of such data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, and the like.
  • the memory 904 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable 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
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • the power supply component 906 provides power to the various components of the device 900 .
  • Power components 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for device 900 .
  • the multimedia component 908 includes a screen that provides an output interface between the device 900 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 a user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action.
  • the multimedia component 908 includes a front camera and/or a rear camera. When the device 900 is in an operation 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 camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
  • the audio component 910 is configured to output and/or input audio signals.
  • the audio component 910 includes a microphone (MIC) configured to receive external audio signals when the device 900 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 904 or sent via communication component 916 .
  • the audio component 910 also includes a speaker for outputting audio signals.
  • the I/O interface 912 provides an interface between the processing component 902 and a peripheral interface module.
  • the peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
  • Sensor assembly 914 includes one or more sensors for providing status assessments of various aspects of device 900 .
  • the sensor component 914 can detect the open/closed state of the device 900, the relative positioning of components, such as the display and keypad of the device 900, and the sensor component 914 can also detect a change in the position of the device 900 or a component of the device 900 , the presence or absence of user contact with the device 900 , the device 900 orientation or acceleration/deceleration and the temperature change of the device 900 .
  • Sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 914 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 916 is configured to facilitate wired or wireless communication between the apparatus 900 and other devices.
  • the device 900 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G LTE, 5G NR (New Radio) or a combination thereof.
  • the communication component 916 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may 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
  • apparatus 900 may be programmed by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A gate array
  • controller microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • non-transitory computer-readable storage medium including instructions, such as the memory 904 including instructions, which can be executed by the processor 920 of the device 900 to implement the above method.
  • the non-transitory computer readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

A battery authentication method and apparatus for a terminal, and an electronic device and a storage medium. The method comprises: acquiring battery information of a battery to be authenticated, and generating an authentication request on the basis of the battery information of said battery (102); sending the authentication request to a cloud end, such that the cloud end performs, on the basis of pre-stored battery information of a legitimate battery, authentication on the battery information which is included in the authentication request (104); and receiving an authentication result, which is returned by the cloud (106). The authentication operation does not rely on authentication logic which is locally deployed in a terminal, thereby avoiding the problem of an authentication result being inaccurate due to the authentication logic which is locally deployed in the terminal being prone to breaking.

Description

终端的电池鉴权方法及装置、电子设备、存储介质Terminal battery authentication method and device, electronic equipment, storage medium
相关申请的交叉引用Cross References to Related Applications
本申请基于申请日为2021年11月30日、申请号为202111444097.1号的中国专利申请,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入作为参考。This application is based on a Chinese patent application with a filing date of November 30, 2021 and application number 202111444097.1, and claims the priority of this Chinese patent application. The entire content of this Chinese patent application is hereby incorporated by reference.
技术领域technical field
本公开涉及终端技术领域,尤其涉及一种终端的电池鉴权方法及装置、电子设备、存储介质。The present disclosure relates to the technical field of terminals, and in particular, to a terminal battery authentication method and device, electronic equipment, and a storage medium.
背景技术Background technique
在采用快充技术对终端的电池进行充电时,越高的充电功率,通常意味着越高的安全风险。在实际应用中,若终端装配的电池本身安全性较差,仍采用功率较高的快速充电策略对电池进行充电,极易出现充电功率超出电池负荷,而导致电池损坏或***的问题。When fast charging technology is used to charge the battery of the terminal, a higher charging power usually means a higher safety risk. In practical applications, if the safety of the battery installed in the terminal is poor, the high-power fast charging strategy is still used to charge the battery. It is very easy for the charging power to exceed the battery load, resulting in battery damage or explosion.
因此,随着电池快充技术的普及与发展,以及用户安全意识的不断提高,如何提高电池的安全性,已经成为了各大厂商亟待解决的问题。Therefore, with the popularization and development of battery fast charging technology and the continuous improvement of user safety awareness, how to improve battery safety has become an urgent problem for major manufacturers to solve.
发明内容Contents of the invention
本公开提供一种终端的电池鉴权方法及装置、电子设备、存储介质,能够基于云端存储的合法电池的电池信息,对终端的电池进行准确鉴权。The present disclosure provides a terminal battery authentication method and device, electronic equipment, and a storage medium, capable of accurately authenticating a terminal battery based on battery information of a legal battery stored in a cloud.
根据本公开的第一方面,提供一种终端的电池鉴权方法,应用于终端,包括:According to the first aspect of the present disclosure, a battery authentication method for a terminal is provided, which is applied to a terminal, including:
获取待鉴权电池的电池信息,并基于所述待鉴权电池的电池信息生成鉴权请求;Acquiring battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated;
将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权;sending the authentication request to the cloud, so that the cloud authenticates the battery information contained in the authentication request based on the pre-stored battery information of legal batteries;
接收所述云端返回的鉴权结果。An authentication result returned by the cloud is received.
根据本公开的第二方面,提供一种终端的电池鉴权方法,应用于云端,包括:According to the second aspect of the present disclosure, a terminal battery authentication method is provided, which is applied to the cloud, including:
接收终端发送的鉴权请求,所述鉴权请求由所述终端基于待鉴权电池的电池信息生成;receiving an authentication request sent by the terminal, where the authentication request is generated by the terminal based on the battery information of the battery to be authenticated;
基于预先存储的合法电池的电池信息,对所述鉴权请求中包含的电池信息进行鉴权,并将鉴权结果返回至所述终端。Based on the battery information of the legal battery stored in advance, the battery information contained in the authentication request is authenticated, and the authentication result is returned to the terminal.
根据本公开的第三方面,提供一种终端的电池鉴权装置,应用于终端,包括:According to a third aspect of the present disclosure, a battery authentication device for a terminal is provided, which is applied to a terminal, including:
获取单元,获取待鉴权电池的电池信息,并基于所述待鉴权电池的电池信息生成鉴权请求;an acquiring unit, acquiring battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated;
发送单元,将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权;The sending unit sends the authentication request to the cloud, so that the cloud authenticates the battery information contained in the authentication request based on the battery information of the legal battery stored in advance;
接收单元,接收所述云端返回的鉴权结果。The receiving unit receives the authentication result returned by the cloud.
根据本公开的第四方面,提供一种终端的电池鉴权装置,应用于云端,包括:According to a fourth aspect of the present disclosure, there is provided a battery authentication device for a terminal, which is applied to the cloud, including:
接收单元,接收终端发送的鉴权请求,所述鉴权请求由所述终端基于待鉴权电池的电池信息生成;a receiving unit, configured to receive an authentication request sent by a terminal, where the authentication request is generated by the terminal based on the battery information of the battery to be authenticated;
鉴权单元,基于预先存储的合法电池的电池信息,对所述鉴权请求中包含的电池信息进行鉴权,并将鉴权结果返回至所述终端。The authenticating unit authenticates the battery information included in the authentication request based on pre-stored battery information of legal batteries, and returns an authentication result to the terminal.
根据本公开的第五方面,提供一种电子设备,包括:According to a fifth aspect of the present disclosure, there is provided an electronic device, comprising:
处理器;processor;
用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
其中,所述处理器通过运行所述可执行指令以实现如第一方面或第二方面所述的方法。Wherein, the processor implements the method as described in the first aspect or the second aspect by running the executable instruction.
根据本公开的第六方面,提供一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面或第二方面所述方法的步骤。According to a sixth aspect of the present disclosure, there is provided a computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
在本公开的技术方案中,当终端需要对所装配的电池进行鉴权时,可以基于电池的电池信息向云端发送鉴权请求,使得云端可以基于预先存储的合法电池的电池信息,对接收到的鉴权请求中包含的电池信息进行鉴权,并向终端返回鉴权结果。In the technical solution of the present disclosure, when the terminal needs to authenticate the assembled battery, it can send an authentication request to the cloud based on the battery information of the battery, so that the cloud can verify the received battery information based on the pre-stored battery information of the legal battery. The battery information contained in the authentication request is used for authentication, and the authentication result is returned to the terminal.
应当理解的是,本公开是基于云端存储的合法电池的电池信息,对终端装配的电池进行鉴权,鉴权操作并不依赖于终端本地部署的鉴权逻辑,避免了相关技术中由于终端本地部署的鉴权逻辑易被破解,而导致鉴权结果不准确的问题。It should be understood that this disclosure is based on the battery information of legal batteries stored in the cloud, and authenticates the batteries assembled in the terminal. The authentication operation does not depend on the authentication logic deployed locally on the terminal, which avoids the local The deployed authentication logic is easily cracked, resulting in inaccurate authentication results.
附图说明Description of 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 disclosure.
图1是本公开一示例性实施例示出的一种终端的电池鉴权方法的流程图;FIG. 1 is a flow chart of a terminal battery authentication method shown in an exemplary embodiment of the present disclosure;
图2是本公开一示例性实施例示出的另一种终端的电池鉴权方法的流程图;Fig. 2 is a flowchart of another terminal battery authentication method shown in an exemplary embodiment of the present disclosure;
图3是本公开一示例性实施例示出的一种智能手机的手机电池鉴权方法的交互图;Fig. 3 is an interaction diagram of a mobile phone battery authentication method for a smart phone shown in an exemplary embodiment of the present disclosure;
图4是本公开一示例性实施例示出的一种智能手机的手机电池鉴权方法的流程图;Fig. 4 is a flow chart of a mobile phone battery authentication method for a smart phone shown in an exemplary embodiment of the present disclosure;
图5是本公开一示例性实施例示出的一种应用于终端的电池鉴权装置的框图;Fig. 5 is a block diagram of a battery authentication device applied to a terminal shown in an exemplary embodiment of the present disclosure;
图6是本公开一示例性实施例示出的另一种应用于终端的电池鉴权装置的框图;Fig. 6 is a block diagram of another battery authentication device applied to a terminal according to an exemplary embodiment of the present disclosure;
图7是本公开一示例性实施例示出的一种应用于云端的电池鉴权装置的框图;Fig. 7 is a block diagram of a battery authentication device applied to the cloud according to an exemplary embodiment of the present disclosure;
图8是本公开一示例性实施例示出的另一种应用于云端的电池鉴权装置的框图;Fig. 8 is a block diagram of another battery authentication device applied to the cloud according to an exemplary embodiment of the present disclosure;
图9是本公开一示例性实施例中一种电子设备的结构示意图。Fig. 9 is a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图 时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in the present disclosure is for the purpose of describing particular embodiments only, and is not intended to limit the present disclosure. As used in this disclosure and the appended claims, the singular forms "a", "the", and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should 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 in the present disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present disclosure, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "at" or "when" or "in response to a determination."
在相关技术中,为了避免充电功率过大,而导致超出电池负荷的情况,终端在对电池进行充电之前,通常会优先对电池进行鉴权操作,以确定电池是否为安全性较高的合法电池。在此基础上,终端即可采用与鉴权结果相适配的充电策略对电池进行充电,具体的,在鉴权通过时,采用预置的快速充电策略对电池进行充电,在鉴权未通过时,则采用常规充电方案对电池进行充电。通过该方式,即可在保证电池安全性的前提下,尽可能的提高充电效率。In related technologies, in order to avoid excessive charging power resulting in exceeding the battery load, before charging the battery, the terminal usually firstly performs authentication operations on the battery to determine whether the battery is a legal battery with high safety . On this basis, the terminal can charge the battery with a charging strategy that matches the authentication result. Specifically, when the authentication is passed, the battery is charged with the preset fast charging strategy; , use the normal charging scheme to charge the battery. In this way, the charging efficiency can be improved as much as possible under the premise of ensuring the safety of the battery.
在相关技术中,通常在终端本地对所装配的电池执行鉴权操作。举例而言,技术人员可以预先在电池包含的电池芯片中和装配有该电池的终端中保存同一秘钥,那么,在终端需要对电池进行鉴权时,即可优先读取电池芯片中保存的秘钥,并判断读取到的秘钥是否与终端本地保存的秘钥一致,若一致则鉴权通过,否则,鉴权不通过。In related technologies, an authentication operation is generally performed locally on a battery installed in a terminal. For example, technicians can save the same secret key in the battery chip contained in the battery and in the terminal equipped with the battery in advance. Then, when the terminal needs to authenticate the battery, it can preferentially read the secret key stored in the battery chip. Key, and judge whether the read key is consistent with the key stored locally on the terminal, if they are consistent, the authentication passes, otherwise, the authentication fails.
不难看出,相关技术仅在终端本地对电池执行了鉴权操作,且鉴权逻辑较为简单,一旦该鉴权逻辑被非法份子破解,便极易出现鉴权结果不准确,而导致通过快速充电策略对安全性较差的非法电池进行充电的情况。例如,在非法份子破解终端本地的鉴权逻辑后,即可根据破解得到的鉴权逻辑,生产非法电池,以使该非法电池被装配至终端之后,可以顺利通过鉴权操作,造成严重的安全隐患;再例如,非法份子可以对破解后的鉴权逻辑进行修改,以使自己生产的非法电池可以通过修改后的鉴权逻辑,同样造成严重的安全隐患。It is not difficult to see that the relevant technology only performs authentication operations on the battery locally in the terminal, and the authentication logic is relatively simple. Once the authentication logic is cracked by illegal elements, it is very easy for the authentication result to be inaccurate, which leads to fast charging. A case where the policy charges an illegal battery with less security. For example, after an illegal person cracks the local authentication logic of the terminal, he can produce an illegal battery according to the authentication logic obtained by the cracking, so that after the illegal battery is assembled into the terminal, it can pass the authentication operation smoothly, causing serious security risks. Hidden dangers; for another example, criminals can modify the cracked authentication logic, so that illegal batteries produced by themselves can pass the modified authentication logic, which also causes serious security risks.
为此,本公开提出了一种终端的电池鉴权方法,在该方法中,终端需要依赖于云端存储的合法电池的相关信息,对所装配的电池执行鉴权,避免了相关技术中仅依赖于终端本地的鉴权逻辑对电池执行鉴权操作,而导致鉴权逻辑极易被破解,出现鉴权不准确的问题。To this end, this disclosure proposes a terminal battery authentication method. In this method, the terminal needs to rely on the relevant information of the legal battery stored in the cloud to perform authentication on the assembled battery, which avoids relying only on The local authentication logic of the terminal performs an authentication operation on the battery, which leads to the authentication logic being easily cracked, and the problem of inaccurate authentication occurs.
图1为本公开一示例性实施例示出的一种终端的电池鉴权方法的流程图。该方法应用于终端,如图1所示,该方法可以包括以下步骤:Fig. 1 is a flow chart of a terminal battery authentication method according to an exemplary embodiment of the present disclosure. The method is applied to a terminal, as shown in Figure 1, the method may include the following steps:
步骤102,获取待鉴权电池的电池信息,并基于所述待鉴权电池的电池信息生成鉴权请求。 Step 102, acquiring battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated.
由上述内容可知,相关技术中之所以存在鉴权结果不准确的问题,是由于相关技术仅通过终端本地部署的鉴权逻辑对电池执行鉴权而导致的。It can be seen from the foregoing that the problem of inaccurate authentication results in the related art is caused by the fact that the related art performs authentication on the battery only through the authentication logic deployed locally in the terminal.
有鉴于此,本公开引入了云端,以通过云端对终端所装配的电池进行鉴权。具体的,云端可以预先存储有合法电池的电池信息,进而使得云端在接收到终端发送的鉴权请求时,可以基于预先存储的合法电池的电池信息对鉴权请求中包含的待鉴权电池的电池信息进行鉴权,并将鉴权结果返回至终端。In view of this, the present disclosure introduces the cloud, so as to authenticate the battery installed in the terminal through the cloud. Specifically, the cloud can pre-store the battery information of the legal battery, so that when the cloud receives the authentication request sent by the terminal, it can check the battery information of the battery to be authenticated contained in the authentication request based on the pre-stored battery information of the legal battery. The battery information is authenticated, and the authentication result is returned to the terminal.
应当理解的是,本公开由云端执行鉴权操作,显然能够避免由于终端本地鉴权逻辑被破解而导致鉴权结果不准确的问题。除此之外,本公开中的云端依赖于云端存储的合法电池的电池信息对待鉴权电池进行鉴权,能够准确识别待鉴权电池是否为合法电池,相较于相关技术中在终端本地部署的鉴权逻辑更为复杂且不易破解。It should be understood that in the present disclosure, the authentication operation is performed by the cloud, which obviously can avoid the problem of inaccurate authentication results caused by the terminal's local authentication logic being cracked. In addition, the cloud in this disclosure relies on the battery information of the legal battery stored in the cloud to authenticate the battery to be authenticated, and can accurately identify whether the battery to be authenticated is a legitimate battery. The authentication logic is more complicated and not easy to crack.
在本公开中,合法电池可以理解为:预定义的向终端厂商供应电池的电池厂商所生产的电池。在实际操作中,电池厂商在完成合法电池的生产之后,即可将合法电池的电池信息上传至云端,以由云端存储。In the present disclosure, a legitimate battery can be understood as: a battery produced by a predefined battery manufacturer that supplies batteries to terminal manufacturers. In actual operation, after the battery manufacturer completes the production of legal batteries, the battery information of the legal batteries can be uploaded to the cloud for storage by the cloud.
在本公开中,合法电池的电池信息可以包括:电池的电池标识(例如,电池SN,serial number,序列号)、电池的PCM(电池保模组)信息等电池自身的信息。由于合法电池中通常还包含电池厂商定制的电池芯片,因此,合法电池的电池信息还可以包括:电池芯片的芯片标识(例如,电池芯片的Code)、电池芯片的秘钥Key等芯片信息。当然,上述合法电池的电池信息仅是示意性的,云端存储的电池信息具体为何种信息可由本领域技术人员根据实际情况确定,本公开对此不作限制。In the present disclosure, the battery information of a legitimate battery may include: the battery identification of the battery (for example, battery SN, serial number, serial number), the battery's PCM (battery protection module) information, and other information of the battery itself. Since legal batteries usually also contain battery chips customized by battery manufacturers, the battery information of legal batteries may also include chip information such as the chip identification of the battery chip (for example, the Code of the battery chip), and the private key of the battery chip. Of course, the battery information of the legal battery above is only illustrative, and what kind of battery information is stored in the cloud can be determined by those skilled in the art according to the actual situation, which is not limited in the present disclosure.
步骤104,将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权。 Step 104, sending the authentication request to the cloud, so that the cloud authenticates the battery information included in the authentication request based on the pre-stored battery information of the legal battery.
在本公开中,可以通过多种方式基于合法电池的电池信息,对鉴权请求中包含的电池信息进行鉴权。In the present disclosure, the battery information contained in the authentication request can be authenticated based on the battery information of the legitimate battery in various ways.
在一实施例中,云端在接收到鉴权请求后,可以在云端预先存储的合法电池的电池信息中,匹配鉴权请求中包含的电池信息。若能够匹配到鉴权请求中包含的电池信息,则证明待鉴权电池为合法电池,相应的,云端可以生成用于表征待鉴权电池通过鉴权的鉴权结果;若未能够匹配到鉴权请求中包含的电池信息,则证明待鉴权电池并非在云端存储有电池信息的合法电池,相应的,云端可以生成用于表征待鉴权电池未通过鉴权的鉴权结果。In an embodiment, after receiving the authentication request, the cloud may match the battery information contained in the authentication request with the battery information of legal batteries pre-stored in the cloud. If the battery information contained in the authentication request can be matched, it proves that the battery to be authenticated is a legitimate battery, and correspondingly, the cloud can generate an authentication result that indicates that the battery to be authenticated has passed the authentication; If the battery information contained in the authorization request proves that the battery to be authenticated is not a legal battery with battery information stored in the cloud, the cloud can generate an authentication result indicating that the battery to be authenticated has not passed the authentication.
举例而言,若云端存储的合法电池的电池信息包含:各个合法电池的电池标识与各自所含电池芯片的芯片标识的对应关系。那么,终端上传的鉴权请求中包含的电池信息可以为:待鉴权电池的电池标识,以及待鉴权电池所含电池芯片的芯片标识。在此基础上,云端接收到鉴权请求后,即可判断已存储的若干组合法电池的电池标识与电池芯片的芯片标识的对应关系中,是否存在任一组记录了鉴权请求中包含的电池标识与芯片标识。若存在,则可以生成用于表征待鉴权电池通过鉴权的鉴权结果。For example, if the battery information of legal batteries stored in the cloud includes: the corresponding relationship between the battery identification of each legal battery and the chip identification of the battery chip contained in each. Then, the battery information contained in the authentication request uploaded by the terminal may be: the battery ID of the battery to be authenticated, and the chip ID of the battery chip contained in the battery to be authenticated. On this basis, after the cloud receives the authentication request, it can judge whether there is any set of the stored corresponding relationship between the battery identification of the combined battery and the chip identification of the battery chip, whether there is any group that records the information contained in the authentication request. Battery identification and chip identification. If it exists, an authentication result indicating that the battery to be authenticated has passed the authentication may be generated.
在另一实施例中,可以通过待鉴权电池的公私钥对,对待鉴权电池进行鉴权。在该实 施例中,云端预先存储的合法电池的电池信息可以包括:各个合法电池的公钥;而鉴权请求中包含的电池信息则可以为:基于待鉴权电池的私钥生成的数字签名。在此基础上,云端接收到鉴权请求后,即可基于预先存储的合法电池的公钥对鉴权请求中包含的数字签名进行验签;其中,在验签成功的情况下,即可生成用于表征待鉴权电池通过鉴权的鉴权结果。In another embodiment, the battery to be authenticated can be authenticated through the public and private key pair of the battery to be authenticated. In this embodiment, the battery information of legal batteries pre-stored in the cloud may include: the public key of each legal battery; and the battery information contained in the authentication request may be: a digital signature generated based on the private key of the battery to be authenticated . On this basis, after the cloud receives the authentication request, it can verify the digital signature contained in the authentication request based on the pre-stored public key of the legal battery; among them, if the verification is successful, it can generate It is used to represent the authentication result of the battery to be authenticated passing the authentication.
在本实施例的一种情况下,云端可以将合法电池的电池标识与公钥进行关联存储;相应的,鉴权请求中包含的待鉴权电池的电池信息中还可以包括:待鉴权电池的标识信息。那么,云端在接收到鉴权请求后,即可根据待鉴权电池的电池标识,获取待鉴权电池的公钥,以根据获取到的公钥对鉴权请求中的数字签名进行验签。在该情况下,若基于待鉴权电池的电池标识无法获取到相应的公钥、或获取到公钥后验签失败,均可视为针对待鉴权电池的鉴权操作未通过。In one case of this embodiment, the cloud can associate and store the battery identification of the legal battery with the public key; correspondingly, the battery information of the battery to be authenticated contained in the authentication request can also include: the battery to be authenticated identification information. Then, after receiving the authentication request, the cloud can obtain the public key of the battery to be authenticated according to the battery identification of the battery to be authenticated, and verify the digital signature in the authentication request according to the obtained public key. In this case, if the corresponding public key cannot be obtained based on the battery identification of the battery to be authenticated, or the signature verification fails after the public key is obtained, it can be considered that the authentication operation on the battery to be authenticated has failed.
在本实施例的另一种情况下,云端可以依次通过所有合法电池的公钥对鉴权请求中包含的数字签名进行验签,只要有任一公钥对数字签名验证成功,则生成用于表征待鉴权电池通过鉴权的鉴权结果;而在所有公钥都无法对数字签名验签成功时,则生成用于表征待鉴权电池未通过鉴权的鉴权结果。In another case of this embodiment, the cloud can sequentially verify the digital signature contained in the authentication request through the public keys of all legal batteries. As long as any public key successfully verifies the digital signature, the generated An authentication result indicating that the battery to be authenticated has passed the authentication; and when all public keys fail to successfully verify the digital signature, an authentication result indicating that the battery to be authenticated has not passed the authentication is generated.
在本公开中,云端除了对终端装配的待鉴权电池进行鉴权以外,还可以对终端本身进行鉴权。具体的,云端中也可以预先存储有合法终端的终端信息。在此基础上,终端可以将自身的终端信息发送至云端,以由云端基于预先存储的合法终端的终端信息对接收到的终端信息进行鉴权,并向终端返回关于终端的鉴权结果。In the present disclosure, in addition to authenticating the battery to be authenticated installed in the terminal, the cloud can also authenticate the terminal itself. Specifically, terminal information of legal terminals may also be pre-stored in the cloud. On this basis, the terminal can send its own terminal information to the cloud, so that the cloud can authenticate the received terminal information based on the pre-stored terminal information of the legal terminal, and return the authentication result about the terminal to the terminal.
在一实施例中,与对待鉴权电池鉴权相类似,云端也可以通过在云端存储的合法终端的终端信息中,匹配终端发送的终端信息的方式,确定终端是否鉴权通过。其中,若能够匹配到终端发送的终端信息,则证明该终端为合法终端,相应的,云端可以生成用于表征该终端通过鉴权的鉴权结果;若未能够匹配到终端发送的终端信息,则证明该终端并非在云端存储有终端信息的合法终端,相应的,云端可以生成用于表征该终端未通过鉴权的鉴权结果。In an embodiment, similar to battery authentication to be authenticated, the cloud can also determine whether the terminal passes the authentication by matching the terminal information sent by the terminal with the terminal information of the legal terminal stored in the cloud. Among them, if the terminal information sent by the terminal can be matched, it proves that the terminal is a legal terminal. Correspondingly, the cloud can generate an authentication result to indicate that the terminal has passed the authentication; if the terminal information sent by the terminal cannot be matched, It proves that the terminal is not a legal terminal with terminal information stored in the cloud, and accordingly, the cloud can generate an authentication result indicating that the terminal has not passed the authentication.
在另一实施例中,云端也可以通过终端的公私钥对队终端进行鉴权。在该实施例中,云端预先存储的合法终端的终端信息可以包括:各个合法中终端的公钥;而终端发送的终端信息则可以为:基于该终端的私钥生成的数字签名。在此基础上,云端接收到数字签名后,即可基于预先存储的合法终端的公钥对该数字签名进行验签;其中,在验签成功的情况下,即可生成用于表征该终端通过鉴权的鉴权结果。在实际操作中,如何获取公钥,以及如何基于公钥对数字签名进行验签过程,与对待鉴权电池进行鉴权时相类似,在此不再赘述。In another embodiment, the cloud can also authenticate the team terminal through the public and private keys of the terminal. In this embodiment, the terminal information of the legal terminal pre-stored in the cloud may include: the public key of each legal terminal; and the terminal information sent by the terminal may be: a digital signature generated based on the private key of the terminal. On this basis, after the cloud receives the digital signature, it can verify the digital signature based on the pre-stored public key of the legal terminal; where, if the verification is successful, it can generate The authentication result of the authentication. In actual operation, how to obtain the public key and how to verify the digital signature based on the public key are similar to the authentication of the battery to be authenticated, and will not be repeated here.
上述云端对终端和待鉴权电池进行鉴权的过程,实际上是在验证云端和待鉴权电池的合法性。在确定终端和待鉴权电池均通过鉴权操作,或者说均通过合法性验证时,云端可以进一步建立该终端的终端信息与电池的电池信息的对应关系。在此基础上,当需要再次 对该待鉴权电池进行鉴权时,云端可以无需再借助预先存储的合法电池的电池信息、以及合法终端的终端信息,对待鉴权电池进行鉴权,而只需直接根据该对应关系即可完成针对待鉴权电池的鉴权操作。The above cloud authentication process of the terminal and the battery to be authenticated is actually verifying the legitimacy of the cloud and the battery to be authenticated. When it is determined that both the terminal and the battery to be authenticated have passed the authentication operation, or passed the legality verification, the cloud may further establish a corresponding relationship between the terminal information of the terminal and the battery information of the battery. On this basis, when the battery to be authenticated needs to be authenticated again, the cloud can authenticate the battery to be authenticated without using the pre-stored battery information of the legal battery and the terminal information of the legal terminal. The authentication operation for the battery to be authenticated can be completed directly according to the corresponding relationship.
在本公开中,可以通过多种方式借助建立的对应关系,对待鉴权电池进行再次鉴权。In the present disclosure, the battery to be authenticated can be re-authenticated by using the established corresponding relationship in various ways.
在一实施例中,云端在生成上述对应关系后,云端可以进一步生成合法性证书,该合法性证书用于证明:云端已建立有终端的终端信息与上述待鉴权电池的电池信息的对应关系。换言之,该合法性证书用于证明:云端已建立终端与其所装配的待鉴权电池的绑定关系。该合法性证书被下发至终端,以由终端进行存储,用于后续对待鉴权电池进行再次鉴权。In an embodiment, after the cloud generates the above corresponding relationship, the cloud can further generate a legality certificate, which is used to prove that: the cloud has established a corresponding relationship between the terminal information of the terminal and the battery information of the battery to be authenticated . In other words, the legitimacy certificate is used to prove that: the cloud has established a binding relationship between the terminal and the battery to be authenticated. The legitimacy certificate is sent to the terminal for storage by the terminal, and is used for re-authentication of the battery to be authenticated subsequently.
在实际操作中,云端可以基于自身私钥生成上述合法性证书。终端在接收到该合法性证书后,即可通过云端的公钥对该合法性证书进行验签,并在验签成功的情况下,对该合法性证书进行存储。在此基础上,当终端需要对待鉴权电池进行再次鉴权时,即可获取待鉴权电池的电池信息、终端的终端信息,并判断合法性证书中是否记录有获取到的电池信息和终端信息,若是,则认定待鉴权电池通过鉴权。In actual operation, the cloud can generate the above-mentioned legality certificate based on its own private key. After receiving the legitimacy certificate, the terminal can verify the signature of the legitimacy certificate through the public key in the cloud, and store the legitimacy certificate when the signature verification is successful. On this basis, when the terminal needs to re-authenticate the battery to be authenticated, it can obtain the battery information of the battery to be authenticated and the terminal information of the terminal, and judge whether the obtained battery information and terminal information are recorded in the legality certificate , if so, it is determined that the battery to be authenticated has passed the authentication.
在另一实施例中,可以通过实时向云端发起鉴权请求的方式,基于云端存储的对应关系对待鉴权电池进行鉴权。例如,终端可以获取自身的终端信息和待鉴权电池的电池信息,并发送至云端,以由云端确定是否已建立该电池信息和该终端信息的对应关系,若已建立,则表明该终端和待鉴权电池均通过合法性验证、且相互绑定,确定待鉴权电池通过鉴权。再例如,终端可以仅将待鉴权电池的电池信息发送至云端,以由云端根据已建立的对应关系,返回与该电池信息绑定的终端信息,而终端则可以进一步判断返回的终端信息是否与自身信息匹配,若匹配,则确定待鉴权电池通过鉴权。当然,终端也可以仅将自身的终端信息发送至云端,以由云端根据已建立的对应关系,返回与该终端信息绑定的电池信息,而终端则可以进一步判断返回的电池信息是否与自身装配的待鉴权电池的电池信息匹配,若匹配,则确定待鉴权电池通过鉴权。In another embodiment, the battery to be authenticated can be authenticated based on the corresponding relationship stored in the cloud by initiating an authentication request to the cloud in real time. For example, the terminal can obtain its own terminal information and the battery information of the battery to be authenticated, and send them to the cloud, so that the cloud can determine whether the corresponding relationship between the battery information and the terminal information has been established. The batteries to be authenticated have all passed the legality verification and are bound to each other, and it is determined that the batteries to be authenticated have passed the authentication. For another example, the terminal can only send the battery information of the battery to be authenticated to the cloud, so that the cloud can return the terminal information bound to the battery information according to the established correspondence, and the terminal can further determine whether the returned terminal information is It matches with its own information, and if it matches, it is determined that the battery to be authenticated has passed the authentication. Of course, the terminal can also only send its own terminal information to the cloud, so that the cloud can return the battery information bound to the terminal information according to the established correspondence, and the terminal can further determine whether the returned battery information is compatible with its own The battery information of the battery to be authenticated matches, and if it matches, it is determined that the battery to be authenticated has passed the authentication.
需要声明的是,在大多数情况下,上述对应关系中包含的电池信息通常为相应电池的电池标识、包含的终端信息通常为相应终端的终端标识。即在终端和待鉴权电池均通过合法性验证后,构建的通常为:电池标识和终端标识之间的对应关系。It should be stated that, in most cases, the battery information included in the above correspondence is usually the battery identifier of the corresponding battery, and the terminal information included is usually the terminal identifier of the corresponding terminal. That is, after both the terminal and the battery to be authenticated pass the legality verification, a correspondence between the battery ID and the terminal ID is usually constructed.
上文介绍的鉴权过程为:通过云端存储的信息,对待鉴权电池和终端进行鉴权。因此,可以被称作云端鉴权。在本公开中,还可以如相关技术在终端本地对待鉴权电池进行鉴权。The authentication process described above is: through the information stored in the cloud, the battery and terminal to be authenticated are authenticated. Therefore, it can be called cloud authentication. In the present disclosure, the battery to be authenticated may also be authenticated locally in the terminal as in the related art.
在本公开中,终端可以基于自身的终端信息,对待鉴权电池的电池信息进行本地鉴权。具体的,终端可以获取自身的终端信息,以及自身所装配的待检测电池的电池信息,并确定获取到的终端信息和电池信息是否匹配,若匹配,则确定本地鉴权通过,否则,确定本地鉴权不通过。In the present disclosure, the terminal may perform local authentication on the battery information of the battery to be authenticated based on its own terminal information. Specifically, the terminal can obtain its own terminal information and the battery information of the battery to be detected assembled by itself, and determine whether the acquired terminal information and battery information match. If they match, then determine that the local authentication has passed; Authentication failed.
举例而言,在通常情况下,电池厂商通常知晓生产的电池将被应用于何种型号的终端,因此,其在确定生产得到的电池的电池标识时,可以在该电池标识中添加用于表征应用于 哪一型号的终端的特定字段。在此基础上,当终端需要对自身所装配的电池进行本地鉴权时,即可获取电池的电池标识,并从该电池标识中确定出上述特定字段,以根据该特定字段确定待鉴权电池所应用的终端型号。其中,当待鉴权电池所应用的终端型号与装配有该待鉴权电池的终端的型号一致时,确定该待鉴权电池通过本地鉴权。For example, under normal circumstances, the battery manufacturer usually knows what type of terminal the battery will be used in. Therefore, when determining the battery identification of the produced battery, it can add a A specific field that applies to which model of terminal. On this basis, when the terminal needs to perform local authentication on its own battery, it can obtain the battery identification of the battery, and determine the above-mentioned specific field from the battery identification, so as to determine the battery to be authenticated according to the specific field. Applied terminal model. Wherein, when the terminal model used by the battery to be authenticated is consistent with the model of the terminal equipped with the battery to be authenticated, it is determined that the battery to be authenticated has passed the local authentication.
当然,基于电池标识中的特定字段对待鉴权电池进行本地鉴权仅是示意性,还可以采用其他方式对该待鉴权电池进行本地鉴权。例如,可以如相关技术,通过判断待鉴权电池和终端是否保存同一秘钥的方式,确定待鉴权电池是否通过本地鉴权。再例如,待鉴权电池的电池芯片中可以存储有待鉴权电池的电池标识、以及基于电池芯片的私钥生成的数字签名,那么,终端可以读取电池芯片中的电池标识和数字签名,并根据读取到的电池标识获取电池芯片的公钥,以基于获取到的公钥对数字签名进行验签,若验签成功,则确定待鉴权电池通过本地鉴权。Of course, the local authentication of the battery to be authenticated based on a specific field in the battery identifier is only illustrative, and other ways can also be used to perform local authentication on the battery to be authenticated. For example, it may be determined whether the battery to be authenticated has passed the local authentication by judging whether the battery to be authenticated and the terminal store the same secret key as in the related art. For another example, the battery chip of the battery to be authenticated can store the battery identification of the battery to be authenticated and the digital signature generated based on the private key of the battery chip, then the terminal can read the battery identification and digital signature in the battery chip, and The public key of the battery chip is obtained according to the read battery identification, and the digital signature is verified based on the obtained public key. If the verification is successful, it is determined that the battery to be authenticated has passed the local authentication.
应当理解的是,上述本地鉴权的方式仅是示意性的,具体如何实现本地鉴权操作,可由本领域技术人员根据实际需求确定。It should be understood that the foregoing local authentication manner is only illustrative, and how to implement the local authentication operation can be determined by those skilled in the art according to actual requirements.
在实际操作中,上述本地鉴权的操作可以在云端鉴权之前执行。换言之,终端可以在本地鉴权通过的情况下,再向云端发起鉴权请求,以使云端通过存储的合法电池的电池信息对待鉴权电池进行云端鉴权。In actual operation, the above local authentication operations can be performed before cloud authentication. In other words, the terminal can initiate an authentication request to the cloud after the local authentication is passed, so that the cloud can authenticate the battery to be authenticated on the cloud through the stored battery information of the legal battery.
步骤106,接收所述云端返回的鉴权结果。 Step 106, receiving the authentication result returned by the cloud.
在本公开中,终端可以在多种情况下对所装配的待鉴权电池进行鉴权。In the present disclosure, the terminal can authenticate the assembled battery to be authenticated in various situations.
在一种情况下,当终端需要确定通过何种充电策略对待鉴权电池进行充电时,对待鉴权电池进行鉴权。在该情况下,在得到的鉴权结果后,即可从预定义的充电策略中,选取出与该鉴权结果相匹配的目标充电策略,对待鉴权电池进行充电。例如,若鉴权结果表明待鉴权电池通过鉴权,则通过预定义的快速充电策略对待鉴权电池进行充电;否则,通过常规充电策略对待鉴权电池进行充电。In one case, when the terminal needs to determine which charging strategy is used to charge the battery to be authenticated, the battery to be authenticated is authenticated. In this case, after obtaining the authentication result, a target charging strategy matching the authentication result can be selected from the predefined charging strategies to charge the battery to be authenticated. For example, if the authentication result indicates that the battery to be authenticated passes the authentication, the battery to be authenticated is charged through a predefined fast charging strategy; otherwise, the battery to be authenticated is charged through a conventional charging strategy.
在另一情况下,当终端需要将待鉴权电池作为电源为其他设备充电时,对待鉴权电池进行鉴权。在该情况下,若鉴权结果表明待鉴权电池通过鉴权,则说明待鉴权电池为安全性较高的合法电池,可以将待鉴权电池设置为电源模式,以用于对其他设备充电;若鉴权结果表明待鉴权电池未通过鉴权,则说明待鉴权电池为安全性较差的非法电池,则不通过该待鉴权电池对其他设备进行充电。In another case, when the terminal needs to use the battery to be authenticated as a power source to charge other devices, the battery to be authenticated is authenticated. In this case, if the authentication result shows that the battery to be authenticated has passed the authentication, it means that the battery to be authenticated is a legal battery with high security, and the battery to be authenticated can be set to the power mode to be used for other devices Charging; if the authentication result shows that the battery to be authenticated has not passed the authentication, it means that the battery to be authenticated is an illegal battery with poor security, and other devices will not be charged by the battery to be authenticated.
需要声明的是,本公开中的终端可以为任一类型的电子设备,例如,该终端可以为智能手机、平板电脑等移动终端;可以为AR眼镜、智能手表等便携式设备;也可以为通过电池供电的PC(Personal Computer,个人电脑)等固定终端。本公开中的终端具体为何种设备,可由本领域技术人员根据实际情况确定,本公开对此不作限制。It should be stated that the terminal in this disclosure can be any type of electronic device. For example, the terminal can be a mobile terminal such as a smart phone or a tablet computer; it can be a portable device such as AR glasses or a smart watch; A fixed terminal such as a powered PC (Personal Computer, personal computer). What kind of device the terminal in the present disclosure is specifically can be determined by those skilled in the art according to the actual situation, and the present disclosure does not limit it.
除此之外,本公开中的云端可以以任意形式部署,例如,可以部署于某一服务器或服务器集群(如,某一终端厂商的服务器或服务器集群),也可以部署于某一虚拟机或虚拟机集群。应当理解的是,本公开中的云端指的是:预先存储有合法电池的电池信息、且能 够基于存储的电池信息对电池进行鉴权的逻辑主体,具体以何种形式部署,可由本领域技术人员根据实际情况确定,本公开对此不作限制。In addition, the cloud in this disclosure can be deployed in any form, for example, it can be deployed on a certain server or server cluster (such as a server or server cluster of a certain terminal manufacturer), or it can be deployed on a certain virtual machine or Virtual machine cluster. It should be understood that the cloud in this disclosure refers to a logical subject that pre-stores the battery information of a legal battery and can authenticate the battery based on the stored battery information. The specific form of deployment can be determined by those skilled in the art. The personnel are determined according to the actual situation, which is not limited in the present disclosure.
由上述技术方案可知,当终端需要对所装配的电池进行鉴权时,可以基于电池的电池信息向云端发送鉴权请求,使得云端可以基于预先存储的合法电池的电池信息,对接收到的鉴权请求中包含的电池信息进行鉴权,并向终端返回鉴权结果。It can be seen from the above technical solution that when the terminal needs to authenticate the assembled battery, it can send an authentication request to the cloud based on the battery information of the battery, so that the cloud can authenticate the received battery based on the pre-stored battery information of the legal battery. The battery information contained in the request is authenticated, and the authentication result is returned to the terminal.
应当理解的是,本公开是基于云端存储的合法电池的电池信息,对终端装配的电池进行鉴权,鉴权操作并不依赖于终端本地部署的鉴权逻辑,避免了相关技术中由于终端本地部署的鉴权逻辑易被破解,而导致鉴权结果不准确的问题。其中,在应用于充电场景下时,可以避免由于鉴权结果不准确,而采用快速充电策略对安全性较差的非法电池进行充电,造成安全隐患的情况。It should be understood that this disclosure is based on the battery information of legal batteries stored in the cloud, and authenticates the batteries assembled in the terminal. The authentication operation does not depend on the authentication logic deployed locally on the terminal, which avoids the local The deployed authentication logic is easily cracked, resulting in inaccurate authentication results. Among them, when applied to the charging scene, it can avoid the situation that the fast charging strategy is used to charge the illegal battery with poor security due to inaccurate authentication results, which may cause potential safety hazards.
进一步的,在终端及其所装配的待鉴权电池均通过合法性验证的情况下,云端还会建立终端的终端信息与待鉴权电池的电池信息之间的对应关系,相当于对合法终端及其装配的合法电池进行了绑定。在此基础上,当终端再次需要对该待鉴权电池进行鉴权操作时,即可基于云端存储的该对应关系对电池进行云端鉴权。在该情况下,无需重复对终端及其装配的待鉴权电池进行合法性验证,大幅简化了云端鉴权的操作。Furthermore, when the terminal and the battery to be authenticated have passed the legality verification, the cloud will also establish a corresponding relationship between the terminal information of the terminal and the battery information of the battery to be authenticated, which is equivalent to the legal terminal It is bound with the legal battery it is equipped with. On this basis, when the terminal needs to perform an authentication operation on the battery to be authenticated again, it can perform cloud authentication on the battery based on the corresponding relationship stored in the cloud. In this case, there is no need to repeatedly verify the validity of the terminal and the battery to be authenticated, which greatly simplifies the operation of cloud authentication.
再进一步的,云端在建立终端信息和电池信息的对应关系后,还可以生成用于证明已将相应的电池和终端进行绑定的合法性证书,并下发至终端,以由其进行存储。在此基础上,在后续需要对该电池进行鉴权时,只需通过该合法性证书,即可对电池进行鉴权。通过该方式,即便不与云端进行交互,也可以基于云端存储的对应关系,完成针对电池的云端鉴权,避免了云端鉴权交互次数较多的问题。Furthermore, after establishing the corresponding relationship between the terminal information and the battery information, the cloud can also generate a legality certificate for proving that the corresponding battery and the terminal have been bound, and send it to the terminal for storage. On this basis, when the battery needs to be authenticated later, the battery can be authenticated only by passing the legality certificate. In this way, even if there is no interaction with the cloud, the cloud authentication for the battery can be completed based on the corresponding relationship stored in the cloud, which avoids the problem of many cloud authentication interactions.
在本公开中,还提出了另一种终端的电池鉴权方法。在该方法中,大多操作方式,例如,如何对待鉴权电池进行鉴权、如何对终端进行鉴权等均与上述方法一致。两者的差别仅在于,该方法应用于云端,而非终端。因此,在对该方法的介绍中,相关内容均可参照上一方法的介绍,不在下文中赘述。In this disclosure, another terminal battery authentication method is also proposed. In this method, most of the operation methods, for example, how to authenticate the battery to be authenticated, how to authenticate the terminal, etc. are consistent with the above method. The only difference between the two is that the method is applied to the cloud, not the terminal. Therefore, in the introduction of this method, the relevant content can refer to the introduction of the previous method, and will not be described in detail below.
图2为本公开一示例性实施例示出的另一种终端的电池鉴权方法的流程图。该方法应用于云端,如图2所示,该方法可以包括以下步骤:Fig. 2 is a flow chart of another terminal battery authentication method according to an exemplary embodiment of the present disclosure. The method is applied to the cloud, as shown in Figure 2, the method may include the following steps:
步骤202,接收终端发送的鉴权请求,所述鉴权请求由所述终端基于待鉴权电池的电池信息生成。 Step 202, receiving an authentication request sent by the terminal, where the authentication request is generated by the terminal based on the battery information of the battery to be authenticated.
如上所述,本公开可以通过多种方式基于合法电池的电池信息,对鉴权请求中包含的电池信息进行鉴权。As mentioned above, the present disclosure can authenticate the battery information contained in the authentication request based on the battery information of the legal battery in various ways.
例如,云端可以在已存储的合法电池的电池信息中匹配鉴权请求中包含的电池信息。其中,当匹配到鉴权请求中包含的电池信息时,生成用于表征待鉴权电池通过鉴权的鉴权结果;当未匹配到鉴权请求中包含的电池信息时,生成用于表征待鉴权电池未通过鉴权的鉴权结果。For example, the cloud can match the battery information contained in the authentication request with the stored battery information of legal batteries. Wherein, when the battery information contained in the authentication request is matched, an authentication result representing that the battery to be authenticated passes the authentication is generated; when the battery information contained in the authentication request is not matched, an authentication result is generated to represent the The authentication result that the authentication battery fails the authentication.
再例如,可以通过待鉴权电池的公私钥对,对待鉴权电池进行鉴权。具体的,云端预 先存储的合法电池的电池信息可以包括:各个合法电池的公钥;而鉴权请求中包含的电池信息则可以为:基于待鉴权电池的私钥生成的数字签名。在此基础上,云端接收到鉴权请求后,即可基于预先存储的合法电池的公钥对鉴权请求中包含的数字签名进行验签;其中,在验签成功的情况下,即可生成用于表征待鉴权电池通过鉴权的鉴权结果。For another example, the battery to be authenticated may be authenticated through the public and private key pair of the battery to be authenticated. Specifically, the battery information of legal batteries pre-stored in the cloud may include: the public key of each legal battery; and the battery information contained in the authentication request may be: a digital signature generated based on the private key of the battery to be authenticated. On this basis, after the cloud receives the authentication request, it can verify the digital signature contained in the authentication request based on the pre-stored public key of the legal battery; among them, if the verification is successful, it can generate It is used to represent the authentication result of the battery to be authenticated passing the authentication.
如上所述,云端除了对终端装配的待鉴权电池进行鉴权以外,还可以对终端本身进行鉴权。具体的,云端中也可以预先存储有合法终端的终端信息。在此基础上,终端可以将自身的终端信息发送至云端,以由云端基于预先存储的合法终端的终端信息对接收到的终端信息进行鉴权,并向终端返回关于终端的鉴权结果。As mentioned above, in addition to authenticating the battery to be authenticated installed in the terminal, the cloud can also authenticate the terminal itself. Specifically, terminal information of legal terminals may also be pre-stored in the cloud. On this basis, the terminal can send its own terminal information to the cloud, so that the cloud can authenticate the received terminal information based on the pre-stored terminal information of the legal terminal, and return the authentication result about the terminal to the terminal.
步骤204,基于预先存储的合法电池的电池信息,对所述鉴权请求中包含的电池信息进行鉴权,并将鉴权结果返回至所述终端。Step 204: Based on the pre-stored battery information of legal batteries, perform authentication on the battery information included in the authentication request, and return the authentication result to the terminal.
在本公开中,云端在接收到鉴权请求后,还可以判断该鉴权请求是否为针对待鉴权电池的首次鉴权请求。其中,在确定接收到的鉴权请求为针对待鉴权电池的首次鉴权请求、且针对终端的鉴权操作和针对待鉴权电池的鉴权操作均通过的情况下,云端可以进一步建立终端的终端信息和待鉴权电池的电池信息之间的对应关系;而在确定接收到的鉴权请求并非针对待鉴权电池的首次鉴权请求的情况下,则可以基于已建立的对应关系对待鉴权电池进行鉴权。In the present disclosure, after receiving the authentication request, the cloud may further determine whether the authentication request is the first authentication request for the battery to be authenticated. Among them, when it is determined that the received authentication request is the first authentication request for the battery to be authenticated, and both the authentication operation for the terminal and the authentication operation for the battery to be authenticated have passed, the cloud can further establish the terminal The corresponding relationship between the terminal information of the battery to be authenticated and the battery information of the battery to be authenticated; and if it is determined that the received authentication request is not the first authentication request for the battery to be authenticated, it can be treated based on the established correspondence The authentication battery performs authentication.
如上所述,云端在建立有终端信息与电池信息的对应关系的情况下,还可以生成用于证明已将终端和待鉴权电池绑定的合法性证书。该合法性证书被发送至终端,以由终端进行存储;其中,被存储于终端的合法性证书用于针对待鉴权电池进行再次鉴权。As mentioned above, when the corresponding relationship between the terminal information and the battery information is established, the cloud can also generate a legality certificate for proving that the terminal and the battery to be authenticated have been bound. The legitimacy certificate is sent to the terminal for storage by the terminal; wherein, the legitimacy certificate stored in the terminal is used for re-authentication of the battery to be authenticated.
由上述技术方案可知,当终端需要对所装配的电池进行鉴权时,可以基于电池的电池信息向云端发送鉴权请求,使得云端可以基于预先存储的合法电池的电池信息,对接收到的鉴权请求中包含的电池信息进行鉴权,并向终端返回鉴权结果。It can be seen from the above technical solution that when the terminal needs to authenticate the assembled battery, it can send an authentication request to the cloud based on the battery information of the battery, so that the cloud can authenticate the received battery based on the pre-stored battery information of the legal battery. The battery information contained in the request is authenticated, and the authentication result is returned to the terminal.
应当理解的是,本公开是基于云端存储的合法电池的电池信息,对终端装配的电池进行鉴权,鉴权操作并不依赖于终端本地部署的鉴权逻辑,避免了相关技术中由于终端本地部署的鉴权逻辑易被破解,而导致鉴权结果不准确的问题。其中,在应用于快速充电场景下时,可以避免由于鉴权结果不准确,而采用快速充电策略对安全性较差的非法电池进行充电,造成安全隐患的情况。It should be understood that this disclosure is based on the battery information of legal batteries stored in the cloud, and authenticates the batteries assembled in the terminal. The authentication operation does not depend on the authentication logic deployed locally on the terminal, which avoids the local The deployed authentication logic is easily cracked, resulting in inaccurate authentication results. Among them, when applied to the fast charging scenario, it can avoid the situation that the fast charging strategy is used to charge the illegal battery with poor security due to inaccurate authentication results, which may cause potential safety hazards.
下面,以在智能手机出厂后,首次对智能手机中装配的手机电池进行鉴权为例,对本公开的技术方案进行介绍。In the following, the technical solution of the present disclosure will be introduced by taking the first authentication of the mobile phone battery assembled in the smart phone after the smart phone leaves the factory as an example.
图3为本公开一示例性实施例示出的一种智能手机的手机电池鉴权方法的交互图。如图3所示,该方法可以包括以下步骤:Fig. 3 is an interaction diagram of a mobile phone battery authentication method for a smart phone according to an exemplary embodiment of the present disclosure. As shown in Figure 3, the method may include the following steps:
步骤301,智能手机从手机电池的电池芯片中读取该手机电池的SN、电池芯片的Code、手机电池的PCM信息。Step 301, the smart phone reads the SN of the mobile phone battery, the Code of the battery chip, and the PCM information of the mobile phone battery from the battery chip of the mobile phone battery.
在本实施例中,在智能手机出厂激活后,首次将充电线接入智能手机的充电接口时,即可触发针对其所装配的手机电池的鉴权操作。In this embodiment, after the smart phone is activated at the factory, when the charging cable is connected to the charging interface of the smart phone for the first time, the authentication operation for the battery of the smart phone can be triggered.
在进行鉴权之前,首先需要从手机电池的电池芯片中读取手机电池的电池信息。在本实施例中,电池信息可以包含手机电池的SN、PCM信息,以及其所装配的电池芯片的Code等。Before performing authentication, it is first necessary to read the battery information of the battery of the mobile phone from the battery chip of the battery of the mobile phone. In this embodiment, the battery information may include the SN and PCM information of the mobile phone battery, and the Code of the battery chip assembled therein.
步骤302,智能手机基于自身型号和手机电池的SN对该手机电池进行本地鉴权。In step 302, the smart phone performs local authentication on the battery of the mobile phone based on its own model and the SN of the battery of the mobile phone.
在本实施例中,针对手机电池的鉴权操作包含本地鉴权和云端鉴权两部分。其中,仅在本地鉴权通过的情况下,智能手机才会向云端发起针对手机电池的云端鉴权。In this embodiment, the authentication operation for the mobile phone battery includes two parts: local authentication and cloud authentication. Among them, only when the local authentication passes, the smart phone will initiate cloud authentication for the mobile phone battery to the cloud.
在实际应用中,各批次生产的手机电池,所应用的手机型号通常是固定的。因此,本实施例中的智能手机一方面可以获取自身的型号信息,另一方面可以对手机电池的SN进行解析,以确定出其中包含的用于表征自身所应用手机型号的特定字段。在此基础上,即可根据该特定字段确定智能手机所装配的手机电池所应用的手机型号,是否与该智能手机的型号一致。若一致,则判定通过手机电池通过本地鉴权。In practical applications, the mobile phone batteries used in each batch of production are usually fixed in the mobile phone model. Therefore, the smart phone in this embodiment can obtain its own model information on the one hand, and can analyze the SN of the mobile phone battery on the other hand to determine the specific field contained therein for representing the model of the mobile phone it is applied to. On this basis, it can be determined according to the specific field whether the mobile phone model used by the mobile phone battery assembled in the smart phone is consistent with the model of the smart phone. If they are consistent, it is determined that the local authentication is passed through the battery of the mobile phone.
步骤303,智能手机在本地鉴权通过的情况下,基于智能手机的私钥生成数字签名。In step 303, the smart phone generates a digital signature based on the private key of the smart phone when the local authentication passes.
当智能手机通过本地鉴权之后,即可向云端发起针对手机电池的云端鉴权。After the smart phone passes the local authentication, it can initiate cloud authentication for the mobile phone battery to the cloud.
在本实施例中,在对手机电池进行云端鉴权之前,首先需要向云端证明智能手机本身的合法性。因此,智能手机在本地鉴权通过之后,可以基于自身私钥生成一数字签名,并将该数字签名和智能手机的ID发送至云端,以由云端基于该数字签名和智能手机的ID对智能手机的合法性进行验证。In this embodiment, before cloud authentication is performed on the mobile phone battery, it is first necessary to prove the legitimacy of the smart phone itself to the cloud. Therefore, after the smart phone passes local authentication, it can generate a digital signature based on its own private key, and send the digital signature and the smart phone's ID to the cloud, so that the cloud can authenticate the smart phone based on the digital signature and the smart phone's ID. verify its legitimacy.
步骤304,智能手机将生成的数字签名和智能手机的ID上传至云端。Step 304, the smartphone uploads the generated digital signature and the ID of the smartphone to the cloud.
步骤305,云端基于智能手机的ID从预先存储的合法手机的公钥中获取该智能手机的公钥,以对接收到的数字签名进行验签。Step 305, the cloud obtains the public key of the smart phone from the pre-stored public keys of the legitimate mobile phone based on the ID of the smart phone, so as to verify the received digital signature.
在本实施例中,云端可以预先存储有各个合法手机的ID与公钥的对应关系。因此,云端在接收到智能手机的ID和数字签名之后,即可根据智能手机的ID获取相应的公钥,并基于获取到的公钥对接收到的数字签名进行验签。In this embodiment, the cloud may pre-store the corresponding relationship between the IDs of each legal mobile phone and the public key. Therefore, after the cloud receives the smart phone's ID and digital signature, it can obtain the corresponding public key based on the smart phone's ID, and verify the received digital signature based on the obtained public key.
其中,若验签成功,则证明智能手机为在云端预先存储有手机信息的合法手机。Among them, if the signature verification is successful, it proves that the smart phone is a legitimate mobile phone with mobile phone information pre-stored in the cloud.
步骤306,在验签成功的情况下,云端向智能手机返回包含一随机数的、用于表征智能手机通过合法性验证的确认消息。Step 306, if the signature verification is successful, the cloud returns to the smart phone a confirmation message including a random number, which is used to indicate that the smart phone has passed the legality verification.
在本实施例中,云端在完成针对智能手机的合法性验证后,即可向智能手机返回一确认消息,以告知智能手机其已通过合法性验证。其中,在该确认消息中,可以包含一云端随机生成的随机数,以用于在智能手机上传手机电池的电池信息时,保证电池信息未经篡改。In this embodiment, after completing the legality verification for the smart phone, the cloud can return a confirmation message to the smart phone to inform the smart phone that it has passed the legality verification. Wherein, the confirmation message may include a random number randomly generated by the cloud to ensure that the battery information has not been tampered with when the smart phone uploads the battery information of the battery of the mobile phone.
步骤307,智能手机将确认消息中包含的随机数、手机电池的SN、电池芯片的Code、手机电池的PCM信息打包上传至云端。In step 307, the smart phone packs and uploads the random number contained in the confirmation message, the SN of the mobile phone battery, the Code of the battery chip, and the PCM information of the mobile phone battery to the cloud.
在本实施例中,手机电池的电池信息可以包含手机电池的SN、手机电池的PCM(电池保模组)信息,以及手机电池包含的电池芯片的Code。这些信息由智能手机读取,并在接收到云端返回的确认消息时,与接收到的随机数一同打包上传至云端。In this embodiment, the battery information of the mobile phone battery may include the SN of the mobile phone battery, the PCM (battery protection module) information of the mobile phone battery, and the Code of the battery chip contained in the mobile phone battery. The information is read by the smartphone, and when the confirmation message returned by the cloud is received, it is packaged and uploaded to the cloud together with the received random number.
步骤308,云端基于预先建立有合法电池的SN、其所包含的电池芯片的Code、其PCM信息,三者之间的对应关系,对手机电池进行合法性验证。In step 308, the cloud verifies the legality of the mobile phone battery based on the pre-established correspondence between the SN of the legal battery, the Code of the battery chip contained therein, and its PCM information.
在本实施例中,厂商在生产得到各个合法电池后,即可将各个合法电池的SN、PCM信息,以及各自所包含的电池芯片的Code上传至云端,以由云端建立各个合法电池的SN、PCM信息、其所包含Code之间的对应关系。In this embodiment, after producing each legal battery, the manufacturer can upload the SN, PCM information of each legal battery, and the Code of the battery chip contained in each to the cloud, so that the cloud can establish the SN, PCM information of each legal battery. Correspondence between PCM information and the Code it contains.
在此基础上,当云端接收到智能手机上传的随机数和电池信息时,可以优先确认接收到的随机数是否与下发的随机数一致,并在一致的情况下,基于接收到的手机电池的SN查找相应合法电池的Code和PCM信息,并将查找到的Code、PCM信息与接收到的手机电池的Code、PCM比较,若比较结果表明两者一致,则确定手机电池通过合法性验证。On this basis, when the cloud receives the random number and battery information uploaded by the smartphone, it can first confirm whether the received random number is consistent with the delivered random number, and if it is consistent, based on the received mobile phone The SN of the battery looks up the Code and PCM information of the corresponding legal battery, and compares the found Code and PCM information with the received Code and PCM of the mobile phone battery. If the comparison results show that the two are consistent, it is determined that the mobile phone battery has passed the legality verification. .
步骤309,在手机电池通过合法性验证的情况下,建立手机电池的SN与智能手机的手机ID之间的对应关系。Step 309, in the case that the battery of the mobile phone passes the legality verification, establish a corresponding relationship between the SN of the battery of the mobile phone and the mobile phone ID of the smart phone.
在本实施例中,由于是首次对智能手机进行鉴权,尚未建立智能手机与手机电池之间的绑定关系。因此,只需确定手机电池和智能手机均通过合法性验证,即可确定为手机电池通过云端鉴权,此时,一方面,可以向智能手机返回手机电池已通过云端鉴权的通知消息,另一方面,可以建立该智能手机的ID与手机电池的SN之间的对应关系,以在后续需要对该手机电池进行鉴权时,直接基于已建立的对应关系鉴权即可,而无需重复执行验证合法性的操作。In this embodiment, since the smart phone is authenticated for the first time, the binding relationship between the smart phone and the battery of the mobile phone has not been established yet. Therefore, it is only necessary to confirm that the mobile phone battery and the smart phone have passed the legality verification, and it can be determined that the mobile phone battery has passed the cloud authentication. At this time, on the one hand, a notification message that the mobile phone battery has passed the cloud authentication can be returned to the smartphone. On the one hand, the corresponding relationship between the ID of the smartphone and the SN of the battery of the mobile phone can be established, so that when the battery of the mobile phone needs to be authenticated in the future, the authentication can be directly based on the established corresponding relationship without repeated verification legal operation.
步骤310,云端基于自身私钥生成用于表征已将手机电池与智能手机绑定的合法性证书。In step 310, the cloud generates a legality certificate for representing the binding of the mobile phone battery with the smart phone based on its own private key.
在本实施例中,在建立上述对应关系后,还可以生成用于表征已将手机电池与智能手机绑定的合法性证书,并发送至智能手机,使得智能手机在后续需要对所装配的手机电池进行鉴权时,直接基于本地保存的合法性证书即可完成云端鉴权。In this embodiment, after the above-mentioned corresponding relationship is established, a legality certificate representing the binding of the mobile phone battery and the smart phone can also be generated and sent to the smart phone, so that the smart phone needs to verify the assembled mobile phone in the future. When the battery is authenticated, the cloud authentication can be completed directly based on the legality certificate stored locally.
步骤311,云端将生成的合法性证书和云端鉴权结果返回至智能手机。Step 311, the cloud returns the generated legality certificate and cloud authentication result to the smart phone.
在实际操作中,上述用于表征手机电池已通过云端鉴权的通知消息和该合法性证书可以一并返回,以减少云端与智能手机之间的交互次数。In actual operation, the aforementioned notification message for indicating that the mobile phone battery has passed the cloud authentication and the legality certificate can be returned together, so as to reduce the number of interactions between the cloud and the smart phone.
在本实施例中,智能手机在接收到的鉴权结果表明手机电池已通过云端鉴权的情况下,可以采用预定义的快速充电策略对手机电池进行充电;而在鉴权结果表明手机电池未通过云端鉴权的情况下,可以采用预定义的常规充电策略对手机电池进行充电。In this embodiment, when the authentication result received by the smart phone indicates that the battery of the mobile phone has passed the cloud authentication, the smart phone can use the predefined fast charging strategy to charge the battery of the mobile phone; In the case of cloud authentication, the mobile phone battery can be charged using a predefined conventional charging strategy.
由上述技术方案可知,本实施例可以在首次对智能手机中的手机电池进行充电时,由智能手机对该手机电池进行本地鉴权、由云端对该手机电池进行云端鉴权。并且仅在手机电池通过本地鉴权和云端鉴权后,才采用快速充电策略对手机电池进行充电,避免了相关技术中由于鉴权结果不准确,而导致充电策略与手机电池不匹配,存在安全隐患的问题。It can be seen from the above technical solution that in this embodiment, when charging the mobile phone battery in the smart phone for the first time, the smart phone can perform local authentication on the mobile phone battery, and the cloud can perform cloud authentication on the mobile phone battery. And only after the mobile phone battery has passed the local authentication and cloud authentication, the fast charging strategy is used to charge the mobile phone battery, which avoids the mismatch between the charging strategy and the mobile phone battery due to inaccurate authentication results in related technologies, and there is a security hidden dangers.
进一步的,本实施例在手机电池和智能手机均通过合法性验证时,云端通过建立智能手机的ID和手机电池的SN的对应关系的方式,将智能手机与手机电池进行了绑定。一方面,使得智能手机在后续需要对手机电池进行建去时,可以直接基于该对应关系进行云 端鉴权;另一方面,使得智能手机与手机电池一一对应,避免了未与智能手机绑定的手机电池通过云端鉴定的情况,例如,可能存在合法电池报废翻修后,被重新装配至合法手机的,在该情况下,若智能手机已与其他正常电池绑定,该手机电池即便为合法电池,也无法通过云端鉴定。Further, in this embodiment, when both the mobile phone battery and the smart phone pass the legality verification, the cloud binds the smart phone and the mobile phone battery by establishing a corresponding relationship between the ID of the smart phone and the SN of the mobile phone battery. On the one hand, when the smart phone needs to replace the battery of the mobile phone in the future, it can directly perform cloud authentication based on the corresponding relationship; For example, there may be legal batteries that are scrapped and repaired, and then reassembled into legitimate mobile phones. In this case, if the smartphone is bound with other normal batteries, the mobile phone battery is considered to be a legal battery. , and cannot be authenticated by the cloud.
下面,以对智能手机中装配的手机电池进行再次鉴权为例,对本公开的技术方案进行介绍。In the following, the technical solution of the present disclosure will be introduced by taking re-authentication of a mobile phone battery assembled in a smart phone as an example.
图4为本公开一示例性实施例示出的一种智能手机的手机电池鉴权方法的流程图。该方法应用于智能手机,如图4所示,该方法可以包括以下步骤:Fig. 4 is a flow chart of a mobile phone battery authentication method for a smart phone according to an exemplary embodiment of the present disclosure. The method is applied to a smart phone, as shown in Figure 4, the method may include the following steps:
步骤401,从手机电池的电池芯片中读取该手机电池的SN。 Step 401, read the SN of the mobile phone battery from the battery chip of the mobile phone battery.
在本实施例中,由于在首次鉴权过程中,已经对智能手机和手机电池的合法性进行了验证,且建立了智能手机的ID与手机电池的SN的对应关系。因此,在本次鉴权过程中,无需再对手机电池和智能手机的合法性进行再次验证,只需确定智能手机与手机电池的装配关系,是否符合云端已建立的绑定关系即可。而验证装配关系是否符合云端已建立的对应关系,无需获取手机电池的详细信息,只需获取其SN即可。In this embodiment, since the legitimacy of the smart phone and the battery of the mobile phone has been verified during the first authentication process, and the corresponding relationship between the ID of the smart phone and the SN of the battery of the mobile phone has been established. Therefore, in this authentication process, there is no need to verify the legitimacy of the mobile phone battery and the smart phone again. It is only necessary to determine whether the assembly relationship between the smart phone and the mobile phone battery conforms to the binding relationship established in the cloud. To verify whether the assembly relationship conforms to the corresponding relationship established in the cloud, it is not necessary to obtain the detailed information of the mobile phone battery, but only to obtain its SN.
步骤402,基于自身型号和手机电池的SN对该手机电池进行本地鉴权。 Step 402, perform local authentication on the mobile phone battery based on its own model and the SN of the mobile phone battery.
在获取手机电池的SN后,即可如上一实施例确定该手机电池所应用的手机型号是否与智能手机的型号一致。具体的本地鉴权过程可参照上一实施例的说明,在此不再赘述。After obtaining the SN of the mobile phone battery, it can be determined whether the mobile phone model used by the mobile phone battery is consistent with the model of the smart phone as in the previous embodiment. For the specific local authentication process, reference may be made to the description of the previous embodiment, which will not be repeated here.
步骤403,基于云端公钥对已存储的合法性证书进行验签。 Step 403, verifying the stored legality certificate based on the cloud public key.
由于在首次鉴权时,已在本地保存了用于证明已建立上述对应关系的合法性证书,因此,本实施例无需与云端交互,便可以直接基于保存的合法性证书,对手机电池进行云端鉴权(由于合法性证书用于表征已存在上述对应关系,相当于基于云端存储的信息对手机电池进行鉴权,因此也可以被视为是云端鉴权)。Since the legitimacy certificate used to prove the establishment of the above-mentioned corresponding relationship has been saved locally during the first authentication, this embodiment can directly authenticate the mobile phone battery on the cloud based on the saved legitimacy certificate without interacting with the cloud. Authorization (since the legitimacy certificate is used to indicate the existence of the above-mentioned corresponding relationship, it is equivalent to authenticating the battery of the mobile phone based on the information stored in the cloud, so it can also be regarded as cloud authentication).
需要声明的是,在基于合法性证书对手机电池进行鉴权之前,还需确定合法性证书本身的可靠性。因此,可以获取云端的公钥,以对该合法性证书进行验签。其中,在验签成功的情况下,即可确定该合法性证书由云端发放,其中记载的内容可靠。It needs to be stated that before the mobile phone battery is authenticated based on the legality certificate, the reliability of the legality certificate itself needs to be determined. Therefore, the public key in the cloud can be obtained to verify the validity of the certificate. Wherein, in the case of successful signature verification, it can be determined that the legitimacy certificate is issued by the cloud, and the content recorded therein is reliable.
步骤404,在验签成功的情况下,根据合法性证书对手机电池进行云端鉴权。 Step 404, if the signature verification is successful, perform cloud authentication on the battery of the mobile phone according to the legality certificate.
在根据合法性证书对手机电池进行鉴权时,可以解析合法性证书中的内容,以判断其中包含的ID是否为上述智能手机的ID、其中包含的SN是否为该智能手机装配的手机电池的SN,若是,则确定手机电池通过云端鉴权,否则,不通过云端鉴权。When authenticating the mobile phone battery according to the legality certificate, the content in the legality certificate can be parsed to determine whether the ID contained in it is the ID of the above-mentioned smart phone, and whether the SN contained in it is the SN of the mobile phone battery equipped with the smart phone , if so, it is determined that the battery of the mobile phone passes the cloud authentication, otherwise, it does not pass the cloud authentication.
步骤405,根据本地鉴权结果和云端鉴权结果得到综合鉴权结果。 Step 405, obtain a comprehensive authentication result according to the local authentication result and the cloud authentication result.
在本实施例中,综合鉴权结果可以包括以下三种:1、本地鉴权与云端鉴权均通过;2、本地鉴权通过、云端鉴权不通过;3、本地鉴权不通过、云端鉴权通过。In this embodiment, the comprehensive authentication results can include the following three types: 1. Both local authentication and cloud authentication pass; 2. Local authentication passes, cloud authentication fails; 3. Local authentication fails, cloud authentication fails; Authentication passed.
步骤406,采用与综合鉴权结果匹配的充电策略对手机电池进行充电。 Step 406, adopt the charging strategy matching the comprehensive authentication result to charge the battery of the mobile phone.
在本实施例中,唯有在综合鉴权结果表明本地鉴权与云端鉴权均通过时,采用快速充电策略对手机电池进行充电,在其他情况下,均通过常规充电策略对手机电池进行充电。In this embodiment, only when the comprehensive authentication result shows that both the local authentication and the cloud authentication pass, the mobile phone battery is charged using the fast charging strategy, and in other cases, the mobile phone battery is charged using the conventional charging strategy .
当然,充电策略与综合鉴权结果的匹配关系可由本领域技术人员根据实际需求确定,本实施例对此不作限制。Of course, the matching relationship between the charging strategy and the comprehensive authentication result can be determined by those skilled in the art according to actual needs, which is not limited in this embodiment.
由上述技术方案可知,本实施例在首次鉴权完成智能手机与手机电池的绑定之后,在后续鉴权过程中,即可基于该绑定关系完成云端鉴权,而无需重复验证手机电池和智能手机的合法性。It can be seen from the above technical solution that after the first authentication completes the binding of the smart phone and the battery of the mobile phone in this embodiment, in the subsequent authentication process, the cloud authentication can be completed based on the binding relationship without repeatedly verifying the battery of the mobile phone and The legality of smartphones.
其中,在智能手机中存储有合法性证书的情况下,智能手机甚至无需与云端进行交互即可完成云端鉴权,大幅提高了云端鉴权的效率。Among them, in the case of a legality certificate stored in the smart phone, the smart phone can complete cloud authentication without even interacting with the cloud, which greatly improves the efficiency of cloud authentication.
图5是本公开一示例性实施例示出的一种应用于终端的电池鉴权装置的框图。参照图5,该装置包括获取单元501、发送单元502和接收单元503。其中,Fig. 5 is a block diagram showing a battery authentication device applied to a terminal according to an exemplary embodiment of the present disclosure. Referring to FIG. 5 , the device includes an acquiring unit 501 , a sending unit 502 and a receiving unit 503 . in,
获取单元501,获取待鉴权电池的电池信息,并基于所述待鉴权电池的电池信息生成鉴权请求;The acquiring unit 501 acquires battery information of the battery to be authenticated, and generates an authentication request based on the battery information of the battery to be authenticated;
发送单元502,将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权;The sending unit 502 is configured to send the authentication request to the cloud, so that the cloud can authenticate the battery information contained in the authentication request based on the pre-stored battery information of legal batteries;
接收单元503,接收所述云端返回的鉴权结果。The receiving unit 503 receives the authentication result returned by the cloud.
可选的,所述鉴权请求中包含的电池信息被所述云端用于与所述云端中预先存储的合法电池的电池信息进行匹配;Optionally, the battery information contained in the authentication request is used by the cloud to match the battery information of a legal battery pre-stored in the cloud;
其中,当在预先存储的合法电池的电池信息中匹配到所述鉴权请求中包含的电池信息时,所述鉴权结果用于表征所述待鉴权电池通过鉴权;当在预先存储的合法电池的电池信息中未匹配到所述鉴权请求中包含的电池信息时,所述鉴权结果用于表征所述待鉴权电池未通过鉴权。Wherein, when the battery information contained in the authentication request is matched with the battery information of the legal battery stored in advance, the authentication result is used to indicate that the battery to be authenticated has passed the authentication; When the battery information of the legitimate battery does not match the battery information included in the authentication request, the authentication result is used to indicate that the battery to be authenticated has not passed the authentication.
可选的,所述云端预先存储的合法电池的电池信息包括:所述合法电池的公钥;所述待鉴权电池的电池信息包括:基于所述待鉴权电池的私钥生成的数字签名;Optionally, the battery information of the legal battery pre-stored in the cloud includes: the public key of the legal battery; the battery information of the battery to be authenticated includes: a digital signature generated based on the private key of the battery to be authenticated ;
发送单元502被进一步用于:将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的公钥对所述鉴权请求中包含的数字签名进行验签;其中,在验签成功的情况下,所述鉴权结果用于表征所述待鉴权电池通过鉴权。The sending unit 502 is further configured to: send the authentication request to the cloud, so that the cloud can verify the digital signature contained in the authentication request based on the pre-stored public key of the legal battery; wherein, in If the signature verification is successful, the authentication result is used to indicate that the battery to be authenticated has passed the authentication.
可选的,optional,
发送单元502还被用于:将所述终端的终端信息发送至所述云端,以由所述云端基于预先存储的合法终端的终端信息对接收到的终端信息进行鉴权;The sending unit 502 is further configured to: send the terminal information of the terminal to the cloud, so that the cloud authenticates the received terminal information based on the pre-stored terminal information of the legal terminal;
接收单元503还被用于:接收所述云端返回的关于所述终端的鉴权结果。The receiving unit 503 is further configured to: receive an authentication result about the terminal returned by the cloud.
可选的,在所述终端和所述待鉴权电池均通过所述云端的鉴权操作的情况下,所述云端中建立有所述终端的终端信息和所述待鉴权电池的电池信息的对应关系。Optionally, in the case that both the terminal and the battery to be authenticated have passed the authentication operation of the cloud, terminal information of the terminal and battery information of the battery to be authenticated are established in the cloud corresponding relationship.
可选的,接收单元503还被用于:Optionally, the receiving unit 503 is also used for:
接收所述云端返回的所述合法性证书,所述合法性证书由所述云端在建立有所述对应关系的情况下生成;receiving the legality certificate returned by the cloud, where the legality certificate is generated by the cloud when the corresponding relationship is established;
对所述合法性证书进行存储,以用于对所述待鉴权电池进行再次鉴权。The legality certificate is stored for re-authentication of the battery to be authenticated.
如图6所示,图5是本公开一示例性实施例示出的另一种应用于终端的电池鉴权装置的框图,该实施例在前述图5所示实施例的基础上,还包括:鉴权单元504和选取单元505。As shown in FIG. 6, FIG. 5 is a block diagram of another battery authentication device applied to a terminal according to an exemplary embodiment of the present disclosure. On the basis of the foregoing embodiment shown in FIG. 5, this embodiment further includes: Authentication unit 504 and selection unit 505 .
可选的,还包括:Optionally, also include:
鉴权单元504,基于所述终端的终端信息,对所述待鉴权电池的电池信息进行本地鉴权;The authenticating unit 504 performs local authentication on the battery information of the battery to be authenticated based on the terminal information of the terminal;
其中,所述鉴权请求在所述待鉴权电池通过本地鉴权的情况下生成。Wherein, the authentication request is generated when the battery to be authenticated passes local authentication.
可选的,还包括:Optionally, also include:
选取单元505,从预先定义的充电策略中,选取与所述鉴权结果相匹配的目标充电策略,对所述待鉴权电池进行充电。The selection unit 505 selects a target charging strategy that matches the authentication result from predefined charging strategies, and charges the battery to be authenticated.
图7是本公开一示例性实施例示出的一种应用于云端的电池鉴权装置的框图。参照图7,该装置包括接收单元701和鉴权单元702。Fig. 7 is a block diagram of a battery authentication device applied to the cloud according to an exemplary embodiment of the present disclosure. Referring to FIG. 7 , the device includes a receiving unit 701 and an authenticating unit 702 .
接收单元701,接收终端发送的鉴权请求,所述鉴权请求由所述终端基于待鉴权电池的电池信息生成;The receiving unit 701 receives an authentication request sent by the terminal, the authentication request is generated by the terminal based on the battery information of the battery to be authenticated;
鉴权单元702,基于预先存储的合法电池的电池信息,对所述鉴权请求中包含的电池信息进行鉴权,并将鉴权结果返回至所述终端。The authenticating unit 702 is configured to authenticate the battery information included in the authentication request based on the pre-stored battery information of legal batteries, and return the authentication result to the terminal.
可选的,鉴权单元702被进一步用于:Optionally, the authentication unit 702 is further used to:
在已存储的合法电池的电池信息中匹配所述鉴权请求中包含的电池信息;matching the battery information contained in the authentication request with the stored battery information of legal batteries;
当匹配到所述鉴权请求中包含的电池信息时,生成用于表征所述待鉴权电池通过鉴权的鉴权结果;When the battery information contained in the authentication request is matched, an authentication result indicating that the battery to be authenticated has passed authentication is generated;
当未匹配到所述鉴权请求中包含的电池信息时,生成用于表征所述待鉴权电池未通过鉴权的鉴权结果。When the battery information included in the authentication request is not matched, an authentication result indicating that the battery to be authenticated fails to be authenticated is generated.
可选的,所述云端预先存储的合法电池的电池信息包括:所述合法电池的公钥;Optionally, the battery information of the legal battery pre-stored in the cloud includes: the public key of the legal battery;
鉴权单元702被进一步用于:读取所述鉴权请求中的电池信息包含的数字签名,所述数字签名基于所述待鉴权电池的私钥生成;通过预先存储的合法电池的公钥对所述数字签名进行验签,并在验签成功的情况下,生成用于表征所述待鉴权电池通过鉴权的鉴权结果。The authentication unit 702 is further used to: read the digital signature contained in the battery information in the authentication request, the digital signature is generated based on the private key of the battery to be authenticated; Verifying the digital signature, and generating an authentication result indicating that the battery to be authenticated has passed the authentication if the signature verification is successful.
可选的,鉴权单元702还被用于:Optionally, the authentication unit 702 is also used to:
接收所述终端的终端信息,并基于预先存储的合法终端的终端信息对接收到的终端信息进行鉴权;receiving the terminal information of the terminal, and authenticating the received terminal information based on the pre-stored terminal information of the legal terminal;
将关于所述终端的鉴权结果返回至所述终端。Returning the authentication result about the terminal to the terminal.
如图8所示,图8是本公开一示例性实施例示出的另一种应用于云端的电池鉴权装置的框图,该实施例在前述图7所示实施例的基础上,还包括:建立单元703和生成单元704。As shown in FIG. 8, FIG. 8 is a block diagram of another battery authentication device applied to the cloud according to an exemplary embodiment of the present disclosure. On the basis of the aforementioned embodiment shown in FIG. 7, this embodiment also includes: A building unit 703 and a generating unit 704 .
可选的,optional,
建立单元703,在确定所述鉴权请求为针对所述待鉴权电池的首次鉴权请求、且针对所述终端的鉴权操作和针对所述待鉴权电池的鉴权操作均通过的情况下,建立所述终端的终端信息和所述待鉴权电池的电池信息之间的对应关系;The establishing unit 703, when it is determined that the authentication request is the first authentication request for the battery to be authenticated, and both the authentication operation for the terminal and the authentication operation for the battery to be authenticated pass Next, establish a corresponding relationship between the terminal information of the terminal and the battery information of the battery to be authenticated;
鉴权单元702还被用于:在确定所述鉴权请求并非针对所述待鉴权电池的首次鉴权请求的情况下,基于所述对应关系对所述待鉴权电池进行鉴权。The authenticating unit 702 is further configured to: in a case where it is determined that the authentication request is not the first authentication request for the battery to be authenticated, authenticate the battery to be authenticated based on the corresponding relationship.
可选的,optional,
生成单元704,在建立有所述对应关系的情况下,生成用于证明已将所述终端和所述待鉴权电池绑定的合法性证书;将所述合法性证书发送至所述终端,以由所述终端进行存储;其中,被存储于所述终端的合法性证书用于针对所述待鉴权电池的再次鉴权。The generating unit 704, when the corresponding relationship is established, generates a legality certificate for proving that the terminal and the battery to be authenticated have been bound; and sends the legality certificate to the terminal, to be stored by the terminal; wherein, the legitimacy certificate stored in the terminal is used for re-authentication of the battery to be authenticated.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本公开方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment. The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. It can be understood and implemented by those skilled in the art without creative effort.
相应的,本公开还提供一种终端的电池鉴权装置,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为实现如上述实施例中任一所述的终端的电池鉴权方法,比如该方法可以包括:获取待鉴权电池的电池信息,并基于所述待鉴权电池的电池信息生成鉴权请求;将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权;接收所述云端返回的鉴权结果。Correspondingly, the present disclosure also provides a battery authentication device for a terminal, including: a processor; a memory for storing instructions executable by the processor; The battery authentication method of the terminal described above, for example, the method may include: obtaining battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated; sending the authentication request to the cloud, Authenticating the battery information contained in the authentication request based on the pre-stored battery information of the legal battery by the cloud; receiving an authentication result returned by the cloud.
相应的,本公开还提供一种电子设备,所述电子设备包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于实现如上述实施例中任一所述的终端的电池鉴权方法的指令,比如该方法可以包括:获取待鉴权电池的电池信息,并基于所述待鉴权电池的电池信息生成鉴权请求;将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权;接收所述云端返回的鉴权结果。Correspondingly, the present disclosure also provides an electronic device, the electronic device includes a memory, and one or more programs, wherein the one or more programs are stored in the memory, and are configured to be operated by one or more processors Executing the one or more programs includes instructions for implementing the battery authentication method of the terminal as described in any of the above embodiments. For example, the method may include: obtaining battery information of the battery to be authenticated, and based on the The battery information of the battery to be authenticated generates an authentication request; the authentication request is sent to the cloud, so that the cloud authenticates the battery information contained in the authentication request based on the pre-stored battery information of the legal battery ; Receive the authentication result returned by the cloud.
图9是根据一示例性实施例示出的一种用于实现进程调度方法的装置900的框图。例如,装置900可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。Fig. 9 is a block diagram of an apparatus 900 for implementing a process scheduling method according to an exemplary embodiment. For example, the apparatus 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
参照图9,装置900可以包括以下一个或多个组件:处理组件902,存储器904,电源组件906,多媒体组件908,音频组件910,输入/输出(I/O)的接口912,传感器组件914,以及通信组件916。9, device 900 may include one or more of the following components: processing component 902, memory 904, power supply component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916 .
处理组件902通常控制装置900的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件902可以包括一个或多个处理器920来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件902可以包括一个或多个模块,便于处理组件902和其他组件之间的交互。例如,处理组件902可以包括多媒体模块,以 方便多媒体组件908和处理组件902之间的交互。The processing component 902 generally controls the overall operations of the device 900, such as those associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 902 may include one or more modules that facilitate interaction between processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
存储器904被配置为存储各种类型的数据以支持在装置900的操作。这些数据的示例包括用于在装置900上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器904可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 904 is configured to store various types of data to support operations at the device 900 . Examples of such data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, and the like. The memory 904 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
电源组件906为装置900的各种组件提供电力。电源组件906可以包括电源管理***,一个或多个电源,及其他与为装置900生成、管理和分配电力相关联的组件。The power supply component 906 provides power to the various components of the device 900 . Power components 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for device 900 .
多媒体组件908包括在所述装置900和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件908包括一个前置摄像头和/或后置摄像头。当装置900处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜***或具有焦距和光学变焦能力。The multimedia component 908 includes a screen that provides an output interface between the device 900 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 a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 908 includes a front camera and/or a rear camera. When the device 900 is in an operation 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 camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件910被配置为输出和/或输入音频信号。例如,音频组件910包括一个麦克风(MIC),当装置900处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器904或经由通信组件916发送。在一些实施例中,音频组件910还包括一个扬声器,用于输出音频信号。The audio component 910 is configured to output and/or input audio signals. For example, the audio component 910 includes a microphone (MIC) configured to receive external audio signals when the device 900 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 904 or sent via communication component 916 . In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.
I/O接口912为处理组件902和***接口模块之间提供接口,上述***接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 912 provides an interface between the processing component 902 and a peripheral interface module. The peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
传感器组件914包括一个或多个传感器,用于为装置900提供各个方面的状态评估。例如,传感器组件914可以检测到装置900的打开/关闭状态,组件的相对定位,例如所述组件为装置900的显示器和小键盘,传感器组件914还可以检测装置900或装置900一个组件的位置改变,用户与装置900接触的存在或不存在,装置900方位或加速/减速和装置900的温度变化。传感器组件914可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件914还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件914还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 914 includes one or more sensors for providing status assessments of various aspects of device 900 . For example, the sensor component 914 can detect the open/closed state of the device 900, the relative positioning of components, such as the display and keypad of the device 900, and the sensor component 914 can also detect a change in the position of the device 900 or a component of the device 900 , the presence or absence of user contact with the device 900 , the device 900 orientation or acceleration/deceleration and the temperature change of the device 900 . Sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 914 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
通信组件916被配置为便于装置900和其他设备之间有线或无线方式的通信。装置900可以接入基于通信标准的无线网络,如WiFi,2G或3G,4G LTE、5G NR(New Radio)或它们的组合。在一个示例性实施例中,通信组件916经由广播信道接收来自外部广播管 理***的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件916还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 916 is configured to facilitate wired or wireless communication between the apparatus 900 and other devices. The device 900 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G LTE, 5G NR (New Radio) or a combination thereof. In an exemplary embodiment, the communication component 916 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,装置900可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, apparatus 900 may be programmed by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器904,上述指令可由装置900的处理器920执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as the memory 904 including instructions, which can be executed by the processor 920 of the device 900 to implement the above method. For example, the non-transitory computer readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. The present disclosure is intended to cover any modification, use or adaptation of the present disclosure. These modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. . The specification and examples are to be considered exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
以上所述仅为本公开的较佳实施例而已,并不用以限制本公开,凡在本公开的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开保护的范围之内。The above descriptions are only preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the present disclosure within the scope of protection.

Claims (18)

  1. 一种终端的电池鉴权方法,应用于终端,包括:A battery authentication method for a terminal, applied to a terminal, comprising:
    获取待鉴权电池的电池信息,并基于所述待鉴权电池的电池信息生成鉴权请求;Acquiring battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated;
    将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权;sending the authentication request to the cloud, so that the cloud authenticates the battery information contained in the authentication request based on the pre-stored battery information of legal batteries;
    接收所述云端返回的鉴权结果。An authentication result returned by the cloud is received.
  2. 根据权利要求1所述的方法,其中,The method according to claim 1, wherein,
    所述鉴权请求中包含的电池信息被所述云端用于与所述云端中预先存储的合法电池的电池信息进行匹配;The battery information contained in the authentication request is used by the cloud to match the battery information of a legal battery pre-stored in the cloud;
    其中,当在预先存储的合法电池的电池信息中匹配到所述鉴权请求中包含的电池信息时,所述鉴权结果用于表征所述待鉴权电池通过鉴权;当在预先存储的合法电池的电池信息中未匹配到所述鉴权请求中包含的电池信息时,所述鉴权结果用于表征所述待鉴权电池未通过鉴权。Wherein, when the battery information contained in the authentication request is matched with the battery information of the legal battery stored in advance, the authentication result is used to indicate that the battery to be authenticated has passed the authentication; When the battery information of the legitimate battery does not match the battery information included in the authentication request, the authentication result is used to indicate that the battery to be authenticated has not passed the authentication.
  3. 根据权利要求1所述的方法,其中,所述云端预先存储的合法电池的电池信息包括:所述合法电池的公钥;所述待鉴权电池的电池信息包括:基于所述待鉴权电池的私钥生成的数字签名;The method according to claim 1, wherein the battery information of the legal battery pre-stored in the cloud includes: the public key of the legal battery; the battery information of the battery to be authenticated includes: The digital signature generated by the private key;
    所述将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权,包括:将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的公钥对所述鉴权请求中包含的数字签名进行验签;其中,在验签成功的情况下,所述鉴权结果用于表征所述待鉴权电池通过鉴权。The sending the authentication request to the cloud, so that the cloud authenticates the battery information contained in the authentication request based on the pre-stored battery information of the legal battery, includes: sending the authentication request To the cloud, the digital signature contained in the authentication request is verified by the cloud based on the pre-stored legal battery public key; wherein, in the case of successful verification, the authentication result is used to represent The battery to be authenticated passes the authentication.
  4. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    将所述终端的终端信息发送至所述云端,以由所述云端基于预先存储的合法终端的终端信息对接收到的终端信息进行鉴权;sending the terminal information of the terminal to the cloud, so that the cloud authenticates the received terminal information based on the pre-stored terminal information of the legal terminal;
    接收所述云端返回的关于所述终端的鉴权结果。An authentication result about the terminal returned by the cloud is received.
  5. 根据权利要求4所述的方法,其中,在所述终端和所述待鉴权电池均通过所述云端的鉴权操作的情况下,所述云端中建立有所述终端的终端信息和所述待鉴权电池的电池信息的对应关系。The method according to claim 4, wherein, when both the terminal and the battery to be authenticated have passed the authentication operation of the cloud, the terminal information of the terminal and the The corresponding relationship of the battery information of the battery to be authenticated.
  6. 根据权利要求5所述的方法,其中,还包括:The method according to claim 5, further comprising:
    接收所述云端返回的合法性证书,所述合法性证书由所述云端在建立有所述对应关系的情况下生成;receiving the legitimacy certificate returned by the cloud, where the legitimacy certificate is generated by the cloud when the corresponding relationship is established;
    对所述合法性证书进行存储,以用于对所述待鉴权电池进行再次鉴权。The legality certificate is stored for re-authentication of the battery to be authenticated.
  7. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    基于所述终端的终端信息,对所述待鉴权电池的电池信息进行本地鉴权;performing local authentication on the battery information of the battery to be authenticated based on the terminal information of the terminal;
    其中,所述鉴权请求在所述待鉴权电池通过本地鉴权的情况下生成。Wherein, the authentication request is generated when the battery to be authenticated passes local authentication.
  8. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    从预先定义的充电策略中,选取与所述鉴权结果相匹配的目标充电策略,对所述待鉴权电池进行充电。From the predefined charging strategies, select a target charging strategy that matches the authentication result, and charge the battery to be authenticated.
  9. 一种终端的电池鉴权方法,应用于云端,包括:A terminal battery authentication method applied to the cloud, including:
    接收终端发送的鉴权请求,所述鉴权请求由所述终端基于待鉴权电池的电池信息生成;receiving an authentication request sent by the terminal, where the authentication request is generated by the terminal based on the battery information of the battery to be authenticated;
    基于预先存储的合法电池的电池信息,对所述鉴权请求中包含的电池信息进行鉴权,并将鉴权结果返回至所述终端。Based on the battery information of the legal battery stored in advance, the battery information contained in the authentication request is authenticated, and the authentication result is returned to the terminal.
  10. 根据权利要求9所述的方法,其中,所述基于预先存储的合法电池的电池信息,对所述鉴权请求中包含的电池信息进行鉴权,包括:The method according to claim 9, wherein said authenticating the battery information contained in the authentication request based on the pre-stored battery information of the legal battery comprises:
    在已存储的合法电池的电池信息中匹配所述鉴权请求中包含的电池信息;matching the battery information contained in the authentication request with the stored battery information of legal batteries;
    当匹配到所述鉴权请求中包含的电池信息时,生成用于表征所述待鉴权电池通过鉴权的鉴权结果;When the battery information contained in the authentication request is matched, an authentication result indicating that the battery to be authenticated has passed authentication is generated;
    当未匹配到所述鉴权请求中包含的电池信息时,生成用于表征所述待鉴权电池未通过鉴权的鉴权结果。When the battery information included in the authentication request is not matched, an authentication result indicating that the battery to be authenticated fails to be authenticated is generated.
  11. 根据权利要求9所述的方法,其中,所述云端预先存储的合法电池的电池信息包括:所述合法电池的公钥;所述基于预先存储的合法电池的电池信息,对所述鉴权请求中包含的电池信息进行鉴权,包括:The method according to claim 9, wherein the battery information of the legal battery pre-stored in the cloud includes: the public key of the legal battery; The battery information contained in is authenticated, including:
    读取所述鉴权请求中的电池信息包含的数字签名,所述数字签名基于所述待鉴权电池的私钥生成;Reading the digital signature contained in the battery information in the authentication request, the digital signature is generated based on the private key of the battery to be authenticated;
    通过预先存储的合法电池的公钥对所述数字签名进行验签,并在验签成功的情况下,生成用于表征所述待鉴权电池通过鉴权的鉴权结果。The digital signature is verified by the pre-stored public key of the legal battery, and if the verification is successful, an authentication result for indicating that the battery to be authenticated has passed the authentication is generated.
  12. 根据权利要求9所述的方法,还包括:The method of claim 9, further comprising:
    接收所述终端的终端信息,并基于预先存储的合法终端的终端信息对接收到的终端信息进行鉴权;receiving the terminal information of the terminal, and authenticating the received terminal information based on the pre-stored terminal information of the legal terminal;
    将关于所述终端的鉴权结果返回至所述终端。Returning the authentication result about the terminal to the terminal.
  13. 根据权利要求12所述的方法,还包括:The method of claim 12, further comprising:
    在确定所述鉴权请求为针对所述待鉴权电池的首次鉴权请求、且针对所述终端的鉴权操作和针对所述待鉴权电池的鉴权操作均通过的情况下,建立所述终端的终端信息和所述待鉴权电池的电池信息之间的对应关系;When it is determined that the authentication request is the first authentication request for the battery to be authenticated, and both the authentication operation for the terminal and the authentication operation for the battery to be authenticated pass, establish the The corresponding relationship between the terminal information of the terminal and the battery information of the battery to be authenticated;
    在确定所述鉴权请求并非针对所述待鉴权电池的首次鉴权请求的情况下,基于所述对应关系对所述待鉴权电池进行鉴权。If it is determined that the authentication request is not the first authentication request for the battery to be authenticated, the battery to be authenticated is authenticated based on the corresponding relationship.
  14. 根据权利要求13所述的方法,还包括:The method of claim 13, further comprising:
    在建立有所述对应关系的情况下,生成用于证明已将所述终端和所述待鉴权电池绑定的合法性证书;When the corresponding relationship is established, generate a legality certificate for proving that the terminal and the battery to be authenticated have been bound;
    将所述合法性证书发送至所述终端,以由所述终端进行存储;其中,被存储于所述终 端的合法性证书用于针对所述待鉴权电池的再次鉴权。Sending the legality certificate to the terminal for storage by the terminal; wherein, the legality certificate stored in the terminal is used for re-authentication of the battery to be authenticated.
  15. 一种终端的电池鉴权装置,应用于终端,包括:A battery authentication device for a terminal, applied to a terminal, comprising:
    获取单元,获取待鉴权电池的电池信息,并基于所述待鉴权电池的电池信息生成鉴权请求;an acquiring unit, acquiring battery information of the battery to be authenticated, and generating an authentication request based on the battery information of the battery to be authenticated;
    发送单元,将所述鉴权请求发送至云端,以由所述云端基于预先存储的合法电池的电池信息对所述鉴权请求中包含的电池信息进行鉴权;The sending unit sends the authentication request to the cloud, so that the cloud authenticates the battery information contained in the authentication request based on the battery information of the legal battery stored in advance;
    接收单元,接收所述云端返回的鉴权结果。The receiving unit receives the authentication result returned by the cloud.
  16. 一种终端的电池鉴权装置,应用于云端,包括:A terminal battery authentication device, applied to the cloud, comprising:
    接收单元,接收终端发送的鉴权请求,所述鉴权请求由所述终端基于待鉴权电池的电池信息生成;a receiving unit, configured to receive an authentication request sent by a terminal, where the authentication request is generated by the terminal based on the battery information of the battery to be authenticated;
    鉴权单元,基于预先存储的合法电池的电池信息,对所述鉴权请求中包含的电池信息进行鉴权,并将鉴权结果返回至所述终端。The authenticating unit authenticates the battery information included in the authentication request based on pre-stored battery information of legal batteries, and returns an authentication result to the terminal.
  17. 一种电子设备,包括:An electronic device comprising:
    处理器;processor;
    用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-14中任一项所述的方法。Wherein, the processor implements the method according to any one of claims 1-14 by running the executable instructions.
  18. 一种计算机可读存储介质,其上存储有计算机指令,其中,该指令被处理器执行时实现如权利要求1-14中任一项所述方法的步骤。A computer-readable storage medium on which computer instructions are stored, wherein the steps of the method according to any one of claims 1-14 are implemented when the instructions are executed by a processor.
PCT/CN2022/090265 2021-11-30 2022-04-29 Battery authentication method and apparatus for terminal, electronic device and storage medium WO2023097961A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111444097.1A CN116203442A (en) 2021-11-30 2021-11-30 Battery authentication method and device of terminal, electronic equipment and storage medium
CN202111444097.1 2021-11-30

Publications (1)

Publication Number Publication Date
WO2023097961A1 true WO2023097961A1 (en) 2023-06-08

Family

ID=86517833

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/090265 WO2023097961A1 (en) 2021-11-30 2022-04-29 Battery authentication method and apparatus for terminal, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN116203442A (en)
WO (1) WO2023097961A1 (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1177269A (en) * 1996-07-24 1998-03-25 摩托罗拉公司 Apparatus and method for identifying type and brand of battery for portable device
KR20000041020A (en) * 1998-12-21 2000-07-15 김영환 Circuit for detecting battery types in mobile communication terminal
CN1510777A (en) * 2002-12-20 2004-07-07 北京六合万通微电子技术有限公司 Anti-fogery system of chargeable battery
CN1753527A (en) * 2004-09-23 2006-03-29 乐金电子(中国)研究开发中心有限公司 Mobile communication terminal with positive plate battery identification function and control method thereof
JP2007329983A (en) * 2006-06-06 2007-12-20 Oki Electric Ind Co Ltd Charger and automatic teller's machine incorporating it and charging adapter
CN101841814A (en) * 2010-04-06 2010-09-22 中兴通讯股份有限公司 Terminal authentication method and system
CN102255109A (en) * 2011-04-06 2011-11-23 宇龙计算机通信科技(深圳)有限公司 Authentication method for mobile terminal battery, and mobile terminal thereof
CN105340147A (en) * 2013-03-06 2016-02-17 睿能创意公司 Apparatus, method and article for authentication, security and control of portable charging devices and power storage devices, such as batteries
CN106602654A (en) * 2016-12-26 2017-04-26 广东欧珀移动通信有限公司 Charging authentication method, correlation devices and system
CN109795359A (en) * 2019-01-11 2019-05-24 广州小鹏汽车科技有限公司 A kind of charging method for authenticating, device, system and charging system
CN112364341A (en) * 2020-11-25 2021-02-12 蔚来汽车科技(安徽)有限公司 Vehicle charging authentication method, charging pile, vehicle to be charged and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1177269A (en) * 1996-07-24 1998-03-25 摩托罗拉公司 Apparatus and method for identifying type and brand of battery for portable device
KR20000041020A (en) * 1998-12-21 2000-07-15 김영환 Circuit for detecting battery types in mobile communication terminal
CN1510777A (en) * 2002-12-20 2004-07-07 北京六合万通微电子技术有限公司 Anti-fogery system of chargeable battery
CN1753527A (en) * 2004-09-23 2006-03-29 乐金电子(中国)研究开发中心有限公司 Mobile communication terminal with positive plate battery identification function and control method thereof
JP2007329983A (en) * 2006-06-06 2007-12-20 Oki Electric Ind Co Ltd Charger and automatic teller's machine incorporating it and charging adapter
CN101841814A (en) * 2010-04-06 2010-09-22 中兴通讯股份有限公司 Terminal authentication method and system
CN102255109A (en) * 2011-04-06 2011-11-23 宇龙计算机通信科技(深圳)有限公司 Authentication method for mobile terminal battery, and mobile terminal thereof
CN105340147A (en) * 2013-03-06 2016-02-17 睿能创意公司 Apparatus, method and article for authentication, security and control of portable charging devices and power storage devices, such as batteries
CN106602654A (en) * 2016-12-26 2017-04-26 广东欧珀移动通信有限公司 Charging authentication method, correlation devices and system
CN109795359A (en) * 2019-01-11 2019-05-24 广州小鹏汽车科技有限公司 A kind of charging method for authenticating, device, system and charging system
CN112364341A (en) * 2020-11-25 2021-02-12 蔚来汽车科技(安徽)有限公司 Vehicle charging authentication method, charging pile, vehicle to be charged and storage medium

Also Published As

Publication number Publication date
CN116203442A (en) 2023-06-02

Similar Documents

Publication Publication Date Title
JP6374010B2 (en) Information communication method, apparatus, and electronic apparatus
CN106302762B (en) Smart machine binding method and device
WO2020103284A1 (en) Smart card authentication method, smart lock, smart card, system and device
KR101855602B1 (en) Methods, apparatuses, program and recoding medium for controlling device
WO2017092417A1 (en) Intelligent terminal equipment-based network access method and device
CN105791309B (en) A kind of method, apparatus and system executing business processing
CN104717622B (en) Information forwarding method and device, terminal and server
CN104363631A (en) Connection method, device and system of wireless router
CN108811179B (en) Wireless network connection method, device and storage medium
US20210326429A1 (en) Access control method and device, electronic device and storage medium
KR20140005306A (en) Continuous voice authentication for a mobile device
CN104091376A (en) Intelligent lock control method and apparatus thereof
KR101642019B1 (en) Method, apparatus, program, and recording medium of verifying terminal
CN110049062B (en) Verification code verification method, device, system, server, electronic equipment and storage medium
WO2016011739A1 (en) Method, device, and system for anti-counterfeiting verification
JP2016537904A (en) WI-FI network connection method, apparatus, program, and recording medium
CN104639533A (en) Safety control method and device based on terminal
CN109039860A (en) Send and show method and device, the identity authentication method and device of message
CN105407070A (en) Logging-in authorization method and device
US9667784B2 (en) Methods and devices for providing information in voice service
CN111917728A (en) Password verification method and device
CN107612058B (en) Charging method and device
CN104618987B (en) Access the method and device of network
CN106534083B (en) Brush machine Tool validation method and device
CN104967966B (en) A kind of method and device of binding bluetooth equipment

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: 22899784

Country of ref document: EP

Kind code of ref document: A1