CN114050634B - Charging test method, electronic device, adapter and charging test system - Google Patents

Charging test method, electronic device, adapter and charging test system Download PDF

Info

Publication number
CN114050634B
CN114050634B CN202210030422.8A CN202210030422A CN114050634B CN 114050634 B CN114050634 B CN 114050634B CN 202210030422 A CN202210030422 A CN 202210030422A CN 114050634 B CN114050634 B CN 114050634B
Authority
CN
China
Prior art keywords
adapter
protocol
charging
protocol code
code
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202210030422.8A
Other languages
Chinese (zh)
Other versions
CN114050634A (en
Inventor
杨强强
朱枝纲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Glory Intelligent Machine Co ltd
Original Assignee
Shenzhen Glory Intelligent Machine Co ltd
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 Shenzhen Glory Intelligent Machine Co ltd filed Critical Shenzhen Glory Intelligent Machine Co ltd
Priority to CN202210030422.8A priority Critical patent/CN114050634B/en
Publication of CN114050634A publication Critical patent/CN114050634A/en
Application granted granted Critical
Publication of CN114050634B publication Critical patent/CN114050634B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • H02J7/00045Authentication, i.e. circuits for checking compatibility between one component, e.g. a battery or a battery charger, and another component, e.g. a power source
    • 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]
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/44Methods for charging or discharging
    • 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
    • H02J7/007Regulation of charging or discharging current or voltage
    • H02J7/007188Regulation of charging or discharging current or voltage the charge cycle being controlled or terminated in response to non-electric parameters
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J2207/00Indexing scheme relating to details of circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J2207/30Charge provided using DC bus or data bus of a computer
    • 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
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B40/00Technologies aiming at improving the efficiency of home appliances, e.g. induction cooking or efficient technologies for refrigerators, freezers or dish washers

Abstract

The embodiment of the application provides a charging test method, electronic equipment, an adapter and a charging test system, which are applied to the adapter, wherein the method comprises the following steps: sending a protocol code of an adapter to the electronic equipment, wherein the protocol code of the adapter corresponds to a charging protocol pre-configured by the adapter, and the adapter is configured with a plurality of charging protocols; if the protocol code of the adapter is consistent with the protocol code of the electronic equipment, charging the electronic equipment according to the charging protocol corresponding to the protocol code of the adapter; stopping charging when the charging time reaches the test time corresponding to the protocol code of the adapter; if the protocol code of the adapter to be sent exists, the electronic equipment sends the protocol code of the adapter again; if there is no protocol code of the adapter to be sent, the test is ended. The application provides an adapter of multiple charging protocol has been disposed, only need insert this adapter with electronic equipment and just can accomplish the test of multiple charging protocol when carrying out the test of charging, has improved the efficiency of the test of charging.

Description

Charging test method, electronic device, adapter and charging test system
Technical Field
The present disclosure relates to the field of testing technologies, and in particular, to a charging test method, an electronic device, an adapter, and a charging test system.
Background
In order to ensure that the charging function of the electronic device can be used normally, the electronic device generally needs to be subjected to a charging test before being shipped from a factory, so as to detect which charging protocols are supported by the electronic device, and whether the electronic device is abnormal (such as heating, stuck, and the like) during charging based on different charging protocols.
The existing testing method is that a plurality of adapters respectively configured with different charging protocols are connected to the tested electronic equipment through an automatic testing switch box, and the automatic testing switch box is utilized to control each adapter to sequentially charge the tested electronic equipment so as to complete the test. The problem with this approach is that testing one piece of electronic equipment requires multiple adapters, which is inefficient.
Disclosure of Invention
The application provides a charging test method, electronic equipment, an adapter and a charging test system, and aims to provide an efficient charging test scheme.
In order to achieve the above object, the present application provides the following technical solutions:
the first aspect of the present application provides a charging test method, which is applied to an adapter, and the method includes:
after detecting that the electronic equipment is connected to the adapter, sending a protocol code of the adapter to the electronic equipment, wherein the protocol code of the adapter corresponds to a charging protocol pre-configured by the adapter, and the adapter is configured with a plurality of charging protocols;
if the protocol code of the adapter is consistent with the protocol code of the electronic equipment, charging the electronic equipment according to the charging protocol corresponding to the protocol code of the adapter which is consistent with the protocol code of the electronic equipment;
stopping charging when the charging time reaches the test time corresponding to the protocol code of the adapter;
if the protocol code of the adapter to be sent exists, returning to the step of executing the protocol code of the adapter to be sent to the electronic equipment;
and if the protocol code of the adapter to be sent does not exist, sending a test ending instruction to the electronic equipment.
In some optional embodiments, the sending the protocol encoding of the adapter to the electronic device includes:
transmitting a type of protocol encoding of the adapter to the electronic device;
and if the first type protocol code of the adapter is consistent with the first type protocol code of the electronic equipment, sending the second type protocol code of the adapter to the electronic equipment.
In some optional embodiments, if there is a protocol code of the adapter to be sent, returning to execute the step of sending the protocol code of the adapter to the electronic device, includes:
if the second type protocol code of the adapter to be sent exists, returning to execute the step of sending the second type protocol code of the adapter to the electronic equipment;
and if the protocol code of the adapter to be sent exists, returning to execute the step of sending the protocol code of the adapter to the electronic equipment.
In some optional embodiments, if the second type protocol code of the adapter is consistent with the second type protocol code of the electronic device, the electronic device is charged according to a charging protocol corresponding to the second type protocol code of the adapter consistent with the second type protocol code of the electronic device.
In some optional embodiments, after the charging time reaches the test time corresponding to the protocol code of the adapter, before stopping charging, the method further includes:
collecting electrical parameters of the adapter during charging;
comparing the collected electrical parameters with the electrical parameters corresponding to the protocol codes of the adapter;
and performing negative feedback regulation on the control output circuit of the adapter according to the comparison result.
A second aspect of the present application provides a charging test method applied to an electronic device, the method including:
receiving a protocol code of an adapter, wherein the protocol code of the adapter corresponds to a charging protocol pre-configured by the adapter, and the adapter is configured with a plurality of charging protocols;
comparing whether the protocol code of the adapter is consistent with the protocol code of the electronic equipment;
if the protocol code of the adapter is consistent with the protocol code of the electronic equipment, feeding back the protocol code of the adapter to the adapter, and enabling the adapter to charge the electronic equipment according to a charging protocol corresponding to the protocol code of the adapter;
detecting whether the electronic equipment is in an abnormal state or not when the adapter is charged and recording a detection result;
if the test ending instruction of the adapter is not received, returning to the step of executing the protocol coding of the receiving adapter;
and if a test ending instruction of the adapter is received, outputting a test result, wherein the test result at least comprises the detection result.
In some optional embodiments, the comparing whether the protocol code of the adapter and the protocol code of the electronic device are consistent includes:
if the first type of protocol code of the adapter is received, comparing whether the first type of protocol code of the adapter is consistent with the first type of protocol code of the electronic equipment or not;
and if the second type protocol code of the adapter is received, comparing whether the second type protocol code of the adapter is consistent with the second type protocol code of the electronic equipment.
In some optional embodiments, before detecting whether the electronic device has an abnormal state when the adapter is charged and recording a detection result, the method further includes:
detecting whether the charging input of the adapter is matched with the electrical parameter corresponding to the protocol code of the electronic equipment;
if the charging input of the adapter is not matched with the electrical parameter corresponding to the protocol code of the electronic equipment, feeding back information of parameter matching failure to the adapter;
and if the charging input of the adapter is matched with the electrical parameter corresponding to the protocol code of the electronic equipment, detecting whether the electronic equipment is in an abnormal state or not when the adapter is charged and recording a detection result.
A third aspect of the present application provides an adapter comprising: a control loop, a current loop, a protocol loop and a USB interface;
the control loop is configured to execute one or more programs to cause the adapter to perform the charging test method provided in any one of the first aspects of the present application.
A fourth aspect of the present application provides an electronic device, comprising: one or more processors, memory;
the memory is used for storing one or more programs;
the one or more processors are configured to execute the one or more programs, so that the electronic device executes the charging test method provided in any one of the second aspects of the present application.
A fifth aspect of the present application provides a charging test system, including an adapter and an electronic device, where the adapter is connected with the electronic device;
the adapter is used for charging the electronic device according to the charging test method provided by any one of the first aspects of the application;
the electronic device is configured to execute the charging test method provided in any one of the second aspects of the present application to obtain a test result, where the test result at least includes a detection result, and the detection result is used to indicate whether the electronic device is in an abnormal state when the adapter is charged.
The embodiment of the application provides a charging test method, equipment and a storage medium of electronic equipment, which are suitable for an adapter, wherein the method comprises the following steps: sending a protocol code of an adapter to the electronic equipment, wherein the protocol code of the adapter corresponds to a charging protocol pre-configured by the adapter, and the adapter is configured with a plurality of charging protocols; if the protocol code of the adapter is consistent with the protocol code of the electronic equipment, charging the electronic equipment according to the charging protocol corresponding to the protocol code of the adapter; stopping charging when the charging time reaches the test time corresponding to the protocol code of the adapter; if the protocol code of the adapter to be sent exists, the electronic equipment sends the protocol code of the adapter again; if there is no protocol code of the adapter to be sent, the test is ended. The application provides an adapter of multiple charging protocol has been disposed, only need insert this adapter with electronic equipment and just can accomplish the test of multiple charging protocol when carrying out the test of charging, neither need frequently plug electronic equipment in the testing process, also need not occupy a plurality of adapters and test an electronic equipment, has improved the efficiency of the test of charging.
Drawings
Fig. 1 is a schematic view of a charging test scenario provided in an embodiment of the present application;
fig. 2 is a schematic diagram of a technical architecture of a charging test method according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an adapter for a charging test according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a charging test method for an electronic device according to an embodiment of the present disclosure;
fig. 5 is a flowchart of another charging test method for an electronic device according to an embodiment of the present disclosure;
fig. 6 is a schematic signaling interaction diagram of a charging test method for an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the embodiments of the present application, "one or more" means one, two, or more than two; "and/or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, a and/or B, may represent: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In order to ensure that the charging function of the electronic device can be normally used, the electronic device often needs to be subjected to a charging test before being shipped from a factory.
Referring to fig. 1, in a charging test, an electronic device 100 to be tested is connected to an adapter 200 for testing by a data line. After the connection is completed, the adaptor 200 charges the electronic device 100 based on a preset charging protocol, and during the charging, the electronic device 100 detects whether an abnormality, such as an over-temperature, occurs by using an internally configured sensor.
If no abnormality occurs in the electronic device 100 during charging, it is assumed that the electronic device 100 supports the charging protocol configured in the adapter 200, and if an abnormality occurs in the electronic device 100 during charging, it is assumed that the electronic device 100 does not support the charging protocol configured in the adapter 200.
Generally, only one charging protocol is configured for the adapter, so to test the support condition of the electronic device for multiple charging protocols, it is necessary to perform charging test on the electronic device by using multiple adapters configured with different charging protocols.
The method comprises the steps of preparing a plurality of adapters configured with different charging protocols, connecting the tested electronic equipment to one of the adapters, so as to test whether the electronic equipment supports the charging protocol of the adapter, pulling out the electronic equipment after the test is finished, then connecting the electronic equipment to the other adapter, so as to test whether the electronic equipment supports the charging protocol of the other adapter, and so on until each adapter is tested.
The problem of this kind of test method is that the plugging and unplugging of the electronic device needs to be frequently performed in the test process, the test efficiency is low, and the missing test and the mistest are easy to occur.
The other testing method is that a plurality of adapters configured with different charging protocols and the electronic equipment to be tested are simultaneously connected into an automatic testing switch box, and the automatic testing switch box controls the on and off of a circuit between each adapter and the electronic equipment in sequence, so that the testing of each charging protocol is completed in sequence.
For example, the automated test switch box may conduct a circuit between an adapter and an electronic device to charge the adapter for the electronic device, and after testing of the adapter is completed, the automated test switch box may turn off the circuit between the adapter and the electronic device, conduct a circuit between another adapter and the electronic device to charge the electronic device for the another adapter, and so on until each adapter is tested.
The second method has the problems that a plurality of adapters are required to be occupied at the same time when each electronic device is tested, the plurality of adapters cannot be used for testing the plurality of electronic devices at the same time, and the testing efficiency is low.
In view of the foregoing problems, an embodiment of the present application provides a method for testing charging of an electronic device. The technical architecture of the method can be seen in fig. 2.
The adapter comprises a USB interface, a current loop, a control loop and a protocol loop.
Before the test is started, the adapter is connected with a computer through a download data line, the computer writes a protocol stack into a protocol loop of the adapter through the download data line, and the protocol stack comprises a plurality of charging protocols.
During testing, one section of the charging data line is connected with the USB interface of the adapter, and the other end of the charging data line is connected with the USB interface of the mobile phone. The protocol loop of the adapter is communicated with the mobile phone, so that the protocol stack of the adapter is compared with the protocol stack of the mobile phone, and the charging protocols in the protocol stacks need to be tested through comparison. And then the control loop controls the opening and closing of a corresponding channel in the current loop based on the charging protocol to be tested, so that the current loop charges the mobile phone according to the corresponding charging protocol.
Through the scheme, when the mobile phone is subjected to charging test, the test of various charging protocols can be completed only by connecting one mobile phone with one adapter, the adapter does not need to be frequently plugged and pulled in the charging process so as to be changed, and a plurality of adapters do not need to be simultaneously connected to one mobile phone, so that the charging test efficiency is improved.
It should be noted that fig. 2 is an exemplary architecture of the method. In alternative embodiments, the protocol stack may be written to the adapter in other ways, not limited to being written by the computer via a download data line as shown in fig. 2.
The mobile phone shown in fig. 2 is an example of an electronic device that needs to be subjected to a charging test, and in some alternative embodiments, the present solution may also be used for performing a charging test on other electronic devices besides the mobile phone.
The hardware structure of the adapter can be seen in fig. 3. The adapter provided by the embodiment comprises an alternating current-direct current conversion circuit, a multi-power conversion circuit, a control output circuit, a USB interface, a sensor 1, a sensor 2, a first controller, a second controller and a memory.
The second controller and the memory in fig. 3 can be regarded as a protocol loop shown in fig. 2; the control output circuit, the multi-power conversion circuit, the AC-DC converter, the sensor 1 and the sensor 2 can be used as a current loop shown in FIG. 2; the control output circuit and the first controller may be considered as a control loop as shown in fig. 2.
The alternating current-direct current converter is connected with the socket and used for converting alternating current input into the adapter into direct current.
The multi-power conversion circuit is used for adjusting the output power of the adapter.
The control output circuit is used to adjust output parameters of the adapter, including but not limited to output voltage, output current, etc.
The USB interface is used to access the charged electronic device 100. Illustratively, the electronic device 100 may be a mobile phone, a tablet computer, a notebook computer, or the like.
The sensor 1 is used for collecting and controlling the electrical parameters of the output end of the output circuit and feeding the collected electrical parameters back to the first controller; the sensor 2 is used for collecting the electrical parameters of the output end of the alternating current-direct current converter and feeding the collected electrical parameters back to the first controller.
The first controller is used for sending an instruction to the control output circuit according to the charging protocol to be tested so as to instruct the control output circuit to adjust the output parameter of the adapter according to the charging protocol, so that the adapter charges the electronic equipment based on the charging protocol.
The first controller is also used for carrying out negative feedback regulation according to the electric parameters collected by the sensor 1 and the sensor 2 in the charging process so as to ensure that the output parameters of the adapter are consistent with the charging protocol to be tested in the charging process.
The memory is used for storing a plurality of charging protocols pre-configured on the adapter.
The second controller is used for interacting with the electronic equipment to determine the charging protocol to be tested, reading the charging protocol to be tested from the memory and sending the charging protocol to the first controller so as to trigger the first controller to send a corresponding instruction to the control output circuit.
Illustratively, the first controller and the second controller may be two Micro Control Units (MCUs) in the adapter.
Referring to the flowchart of the charging test method shown in fig. 4, the method provided in this embodiment may include the following steps:
in some embodiments, a processor of an electronic device under test (e.g., a cell phone) may execute computer instructions that cause the electronic device to perform the method steps in the present embodiments.
S401, receiving the protocol coding of the adapter.
The adapter may read the protocol code from the protocol stack of the adapter and send the protocol code to the electronic device upon detecting that the electronic device is coupled to the adapter.
In this embodiment, a plurality of charging protocols configured on the adapter are stored in the memory in the form of a protocol stack, different charging protocols in the protocol stack are distinguished by the form of protocol codes, and the protocol codes can be divided into two parts, namely first-class protocol codes and second-class protocol codes.
In some embodiments, the adapter may transmit the protocol encoding and the identification one representing the one type of protocol encoding or the two type of protocol encoding to the electronic device so that the electronic device determines whether the received protocol encoding is the one type of protocol encoding or the two type of protocol encoding. For example, the adapter may send the code 0000 and an identifier representing a type of protocol code to the electronic device, and the electronic device may determine that the type of protocol code 0000 is received upon receipt.
The protocol code corresponding to each charging protocol may be configured according to an actual situation, which is not limited in this embodiment. In some embodiments, one type of protocol code may represent a certain type of charging protocol, and the corresponding two types of protocol codes represent each charging protocol specific to the type.
For example, a plurality of charging protocols of low-voltage and high-current type can be represented by a type of protocol code 00000000, and a plurality of charging protocols of high-voltage and low-current can be represented by a type of protocol code 01000000. For a plurality of different low-voltage and large-current charging protocols, different second-class Protocol codes are respectively configured, for example, a Super Charging Protocol (SCP) configures the second-class Protocol code 00000010, a Flash charging Protocol configures the second-class Protocol code 00000001, and a VOOC Protocol configures the second-class Protocol code 00000100.
Illustratively, the protocol stack may be represented in the form of table 1 below:
TABLE 1
Figure 499137DEST_PATH_IMAGE001
In some embodiments, one type of protocol code may represent a specific test scenario, a plurality of two types of protocol codes corresponding to one type of protocol code, a plurality of charging protocols that need to be tested under the specific test scenario, and electrical parameters and test time of the charging protocols.
Taking table 1 as an example, the first-type protocol code 0000 may represent a Man-Machine interface (MMI) scenario, and the corresponding second-type protocol codes 0000 and 0001 may represent two charging protocols to be tested in the MMI scenario; one type of protocol encoding 0100 may represent a burn-in test scenario, and the corresponding two types of protocol encoding 0100 and 0110 may represent two charging protocols that need to be tested in the burn-in test scenario.
It is understood that table 1 is merely an example of one protocol stack provided in the present embodiment. In an actual test scenario, the contents in the protocol stack of the adapter may be updated and adjusted as needed, and are not limited to the contents shown in table 1. Moreover, the charging test method provided by this embodiment may be applicable to any protocol stack, and the adjustment of the content of the protocol stack does not affect the implementation of the charging test method of this embodiment.
If the protocol code sent by the adapter is the first-type protocol code, step S402 is executed, and if the protocol code sent by the adapter is the second-type protocol code, step S405 is executed.
S402, comparing whether the protocol code of the adapter is consistent with the protocol code of the electronic equipment.
The electronic device itself is also provided with at least one charging protocol, which is likewise stored on the electronic device in the form of a protocol stack, which may be stored in an internal memory of the electronic device, and the same charging protocol corresponds to the same protocol coding in the electronic device and in the adapter. Therefore, when the adapter charges the electronic equipment according to the charging protocol corresponding to the compared and consistent protocol code, the electronic equipment can determine which charging protocol is currently tested through the protocol code, and accuracy of a finally output test result is ensured.
In this embodiment, in order to improve the universality of the adapter, each known charging protocol may be configured in the adapter, and the electronic device only needs to configure several charging protocols that the electronic device needs to test, and then, one adapter may be used to test multiple types of electronic devices.
For example, one electronic device needs to test a charging protocol for low voltage and high current, another electronic device needs to test a charging protocol for high voltage and low current, and the adapter is configured with the two types of charging protocols, so that the two electronic devices can be tested by using the adapter.
In step S402, the electronic device may find out whether an adapter sends a type of protocol code in a protocol stack stored in the electronic device.
If there is a type of protocol code sent by the adapter in the protocol stack of the electronic device, it indicates that the electronic device needs to test the charging protocol corresponding to the type of protocol code, and then the electronic device determines that the type of protocol code of the adapter is consistent with the type of protocol code of the electronic device, and executes step S403.
If the protocol stack of the electronic device does not have the protocol code of the same type sent by the adapter, it indicates that the electronic device does not need to test the charging protocol corresponding to the protocol code of the same type, and then the electronic device determines that the protocol code of the same type of the adapter is not consistent with the protocol code of the same type of the adapter, and executes step S404.
And S403, feeding back the consistent protocol codes to the adapter.
In step S403, the electronic device feeds back the compared and consistent protocol codes to the second controller.
In step S403, the electronic device may also send the protocol code and the identifier one indicating the first type protocol code or the second type protocol code to the electronic device, so that the electronic device determines whether the received protocol code is the first type protocol code or the second type protocol code.
Taking table 1 as an example, after the second controller sends a type of protocol code 0000 to the electronic device, the electronic device compares the protocol code with a type of protocol code stored in the electronic device, and finds that there is a type of protocol code 0000 in a protocol stack of the electronic device, then step S403 is executed, and the code 0000 and an identifier representing the type of protocol code are fed back to the adapter.
S404, feeding back the information of the comparison failure to the adapter.
In some embodiments, the information of the failed comparison is fed back to the second controller of the adapter by the electronic device. The information of the comparison failure is used for explaining to the adapter, and the protocol code sent by the adapter last time is inconsistent with the protocol code stored by the electronic device, that is, the electronic device does not store the protocol code sent by the adapter last time.
For example, the alignment failure information may carry a protocol code of the alignment failure.
Taking table 1 as an example, after the second controller sends a type of protocol code 0000 to the electronic device, the electronic device compares and finds that there is no type of protocol code 0000, so that the information of comparison failure is fed back to the second controller.
S405, whether the second type protocol code of the adapter is consistent with the second type protocol code of the electronic equipment is compared.
Similar to step S402, in step S405, the electronic device determines whether the second-type protocol code sent by the adapter is consistent with the second-type protocol code corresponding to the first-type protocol code that is compared and consistent in its own protocol stack.
Taking table 1 as an example, after the second controller sends the second type protocol code 0000 to the electronic device, the electronic device compares the code with the second type protocol code stored in the protocol stack of the electronic device, if the second type protocol code 0000 is recorded in the protocol stack of the electronic device, it is determined that the second type protocol code of the adapter is consistent with the second type protocol code of the electronic device, and if the second type protocol code 0000 is recorded in the protocol stack of the electronic device, it is determined that the second type protocol code of the adapter is inconsistent with the second type protocol code of the electronic device.
If the second-type protocol code of the adapter is not consistent with the second-type protocol code of the electronic device, step S404 is executed, and if the second-type protocol code of the adapter is consistent with the second-type protocol code of the electronic device, step S406 is executed.
S406, the two types of protocol codes which are consistent in comparison are fed back to the adapter.
In step S406, the two types of protocol codes that are consistent in comparison are fed back to the second controller of the adapter by the electronic device, and after the adapter receives the two types of protocol codes that are consistent in comparison and fed back by the electronic device, the adapter may perform a test based on the corresponding charging protocol.
In step S406, referring to step S403, after the electronic device successfully compares the first-type protocol code with the second-type protocol code, the electronic device sends the code and the identifier indicating the first-type protocol code or the second-type protocol code to the adapter, for example, the code 0000 and the identifier indicating the first-type protocol code are fed back to the adapter.
S407, receives a charging input of the adapter.
After the adapter receives the two types of protocol codes which are fed back by the electronic equipment and are consistent in comparison, the electronic equipment can be charged according to the corresponding charging protocol, and correspondingly, the electronic equipment can receive the charging input of the adapter.
In some optional embodiments, the electronic device may feed back information of the start of charging to the adapter after receiving the charging input, so that the adapter confirms the start of charging.
And S408, detecting whether the charging input is matched with the electrical parameters of the second-class protocol code.
The protocol stack of the electronic equipment also stores the electrical parameters corresponding to each of the two types of protocol codes. In step S408, the electronic device may compare the electrical parameter of the USB interface with the electrical parameter corresponding to the second-type protocol code currently being tested, and if the difference between the two is within a certain acceptable range, it is determined that the charging input matches the electrical parameter of the second-type protocol code; if the difference between the two is outside the acceptable range, the charging input and the electrical parameter encoded by the second type of protocol are considered not to match.
If the charging input is not matched with the electrical parameter of the second type protocol code, step S409 is executed, and if the charging input is matched with the electrical parameter of the second type protocol code, step S410 is executed.
S409, feeding back the information of the parameter matching failure to the adapter.
In step S409, the electronic device feeds back information of parameter matching failure to the second controller of the adapter. The information of the failed parameter matching is used for indicating that the electronic equipment does not support the charging protocol corresponding to the two types of protocol codes which are compared and consistent currently.
And S410, detecting whether the electronic equipment is in an abnormal state or not during the charging period and recording the detection result.
In some embodiments, step S410 may be performed by an electronic device.
The specific content of the abnormal state is not limited in this embodiment, and the abnormal state may include, for example, a charging interruption, a program running halt, an excessive temperature, and the like.
In some alternative embodiments, the electronic device may detect whether the temperature of the electronic device is too high during the charging process by using the temperature sensor shown in fig. 1, and detect whether the charging input of the USB interface is interrupted, and if the above is detected, the electronic device may consider that there is an abnormal state.
S411, judging whether receiving the test ending instruction.
If the test end command is received, step S414 is executed, and if the test end command is not received, step S401 is executed again.
Step S411 may be performed by the electronic device after the adapter closes the output channel. When the adapter closes the output channel, the electronic device detects that the charging input stops, so that the electronic device can determine whether the adapter closes the output channel by detecting whether the charging input stops.
And S412, outputting the test ending information and the test result.
The test end information is used for explaining that the charging test of the electronic equipment is ended. The test result is used for explaining which charging protocols are supported by the electronic equipment, which charging protocols are not supported by the electronic equipment, and abnormal states of the electronic equipment when the electronic equipment is charged based on which charging protocols.
After the electronic equipment feeds back the two types of protocol codes which are compared to be consistent to the adapter every time, the adapter charges the electronic equipment according to the charging protocol corresponding to the two types of protocol codes which are compared to be consistent. Therefore, during each charging, the electronic equipment can determine the charging protocol used by the adapter in the current charging process according to the two types of protocol codes fed back to the adapter, and then the electronic equipment can determine whether the charging protocol used by the adapter is supported during each charging and whether an abnormal state exists according to the charging protocol by combining the detection result of whether the charging input is matched with the corresponding electrical parameter during each charging and whether the abnormal state occurs during the charging.
The method for the charging test provided by the embodiment has the following beneficial effects:
the adapter charges the electronic equipment by traversing the protocol codes in the protocol stack and utilizing the pre-configured charging protocol one by one, so that the charging test of the electronic equipment can be completed only by one adapter, and the efficiency of the charging test of the electronic equipment is improved.
Referring to the flowchart of the charging test method shown in fig. 5, the method provided in this embodiment may include the following steps:
in some embodiments, a controller internal to the adapter for charging tests may execute computer instructions that cause the adapter to perform the method steps in this embodiment.
S501, detecting the access of the electronic equipment.
As shown in fig. 3, the second controller of the adapter is connected to the USB interface. When a tester connects the electronic device to the adapter through the data line, the USB interface outputs a specific electric signal, and when the second controller detects the specific electric signal, the electronic device can be determined to be connected to the adapter.
S502, sending a type of protocol code to the electronic equipment.
In some optional embodiments, the adapter may send one type of protocol code one by one according to the sequence in the protocol stack when performing step S502. That is to say, when the adapter executes step S502 for the first time, the first protocol code recorded in the protocol stack may be sent, when the adapter executes S502 again, the second protocol code recorded in the protocol stack is sent, when the adapter executes S502 for the third time, the third protocol code recorded in the protocol stack is sent, and so on until each protocol code in the protocol stack is traversed.
S503, judging whether the sent second-class protocol code is consistent with the second-class protocol code of the electronic equipment.
If the sent first-type protocol code is consistent with the first-type protocol code of the electronic device, step S504 is executed, and if the sent first-type protocol code is not consistent with the first-type protocol code of the electronic device, step S512 is executed.
In step S503, the adaptor may specifically determine whether the sent second-type protocol code is consistent with the second-type protocol code of the electronic device based on the information fed back by the electronic device after sending the first-type protocol code. Referring to steps S402 to S404 in the embodiment corresponding to fig. 4, if the adaptor receives the information that the comparison fails and is fed back by the electronic device after performing step S502, it may be determined that the sent second-type protocol code is not consistent with the second-type protocol code of the electronic device, and if the adaptor receives the first-type protocol code fed back by the electronic device after performing step S502, it may be determined that the sent second-type protocol code is consistent with the second-type protocol code of the electronic device.
S504, searching and comparing a consistent protocol code in the protocol stack.
After receiving the compared and consistent first-class protocol codes fed back by the electronic device, the adapter can find the first-class protocol codes in a protocol stack of the adapter so as to further send second-class protocol codes corresponding to the first-class protocol codes.
And S505, sending a second type of protocol code corresponding to the first type of protocol code to the electronic equipment.
It will be appreciated that one type of protocol encoding may correspond to a plurality of type two protocol encodings. In step S505, the adapter sends the two types of protocol codes corresponding to the first type of protocol code that are compared and consistent one by one according to the sequence recorded in the protocol stack. That is, when the adapter first executes S505, the adapter sends the first second-type protocol code corresponding to the first-type protocol code, and then executes the subsequent steps. When the adapter executes S505 again, the second type of protocol code corresponding to the first type of protocol code is sent, and so on until the second type of protocol code corresponding to the first type of protocol code that is compared with the second type of protocol code that is consistent is sent.
Taking table 1 as an example, the second type of protocol code corresponding to the first type of protocol code 0000 includes 0000 and 0001. If the first-class protocol code fed back by the electronic device and compared consistently is 0000, the second-class protocol code sent by the adapter when the adapter executes S505 for the first time may be that the first-class protocol code 0000 corresponds to the first second-class protocol code 0000, and when the adapter executes S505 again, the first-class protocol code 0000 corresponds to the second-class protocol code 0001.
The adapter transmits the protocol codes to the electronic device one by one, so that the electronic device can determine the charging protocol used by the adapter each time the electronic device is charged.
Referring to step S412, each time the adapter charges the electronic device, the electronic device needs to determine a charging protocol used by the adapter during the current charging, and detect whether an abnormal state occurs during the charging process, so as to determine whether the electronic device has an abnormal state when being charged according to the current charging protocol.
If the adapter transmits the plurality of second-type protocol codes to the electronic device at one time, and the transmitted plurality of second-type protocol codes are consistent with the second-type protocol codes of the electronic device, after the adapter starts to be charged, the electronic device is difficult to determine the charging protocol used by the adapter each time the adapter is charged, and accordingly, it is difficult to determine which charging protocols the electronic device supports or does not support, and which charging protocols according to which charging protocols are abnormal.
S506, judging whether the sent second-class protocol code is consistent with the second-class protocol code of the electronic equipment.
If the transmitted second-type protocol code is consistent with the second-type protocol code of the electronic device, step S507 is executed, and if the transmitted second-type protocol code is not consistent with the second-type protocol code of the electronic device, step S511 is executed.
The implementation manner of step S506 is similar to that of step S503, that is, the adapter may specifically determine whether the sent second-type protocol code is consistent with the second-type protocol code of the electronic device based on the information fed back by the electronic device after the second-type protocol code is sent. Referring to steps S404 to S406 in the embodiment corresponding to fig. 4, if the adapter receives the information that the comparison fails and is fed back by the electronic device after performing step S505, it may be determined that the sent second-type protocol code is not consistent with the second-type protocol code of the electronic device, and if the adapter receives the second-type protocol code and is fed back by the electronic device after performing step S505, it may be determined that the sent second-type protocol code is consistent with the second-type protocol code of the electronic device.
In some alternative embodiments, steps S501 to S506 may all be performed by a second controller of the adapter.
In some optional embodiments, in order to avoid erroneous judgment when the electronic device compares the two types of protocol codes, the second controller may retry receiving the information of the comparison failure, that is, send the two types of protocol codes of the comparison failure to the electronic device again, and send a new two types of protocol codes after the same two types of protocol codes fail to be compared for many times by the electronic device.
One implementation manner of retrying after the comparison of the second type protocol codes fails is that, when the adapter first sends a second type protocol code to the electronic device, the number of retries is initialized to 1, when the adapter determines that the comparison of the second type protocol code fails in step S506, it first determines whether the number of retries is smaller than a threshold, if the number of retries is not smaller than the threshold, the adapter adds 1 to the number of retries, and returns to step S505, that is, the second type protocol code that has failed in comparison is sent again, and if it is determined that the number of retries is not smaller than the threshold after it is determined that the comparison of the second type protocol code fails, which indicates that the second type protocol code has been compared for multiple times and all the comparison fails, the adapter performs step S511.
The threshold may be set according to actual conditions, which is not limited in this embodiment. Illustratively, the threshold may be set to 3.
Taking the threshold value set to be 3 as an example, after a second type protocol code is sent to the electronic device for the first time, the electronic device performs comparison inconsistency and feeds back comparison failure information to the second controller, at this time, the retry number is 1, and then the second controller sends the second type protocol code for the second time and adds 1 to the retry number. After the second transmission, the electronic device compares and finds inconsistency, the retry number is 2, and then the second controller transmits the two-type protocol code for the third time and adds 1 to the retry number. After the second transmission, the comparison result of the electronic device is still inconsistent, and since the retry number is 3 at this time and is not less than the threshold, the second controller executes step S511 and does not repeat the transmission of the second type protocol code.
And S507, charging the electronic equipment according to the charging protocol corresponding to the two types of protocol codes which are consistent in comparison.
In some alternative embodiments, step S507 may be implemented as follows:
the second controller searches and compares the two types of protocol codes which are consistent in the protocol stack of the adapter. After the two types of protocol codes which are compared consistently are found, the second controller sends the two types of protocol codes which are compared consistently in the protocol stack, and the electrical parameters and the test time which correspond to the two types of protocol codes which are compared consistently are sent to the first controller.
Referring to table 1, each of the two types of protocol codes in the protocol stack corresponds to a specific electrical parameter and a specific test time, where the test time refers to a duration of time for which the adapter charges the electronic device based on the corresponding charging protocol, and the corresponding electrical parameter may be used as a standard value for performing negative feedback adjustment by the first controller.
And the first controller receives the two types of protocol codes which are compared to be consistent, and opens an output channel corresponding to the two types of protocol codes which are compared to be consistent in the control output circuit after comparing the electrical parameters and the test time corresponding to the two types of protocol codes which are compared to be consistent.
A control output circuit of the adapter is provided with a plurality of mutually independent output channels, and each output channel is used for outputting current which accords with specific electrical parameters. After receiving the second-type protocol codes, the first controller can send an instruction for opening the corresponding output channel to the control output circuit according to the corresponding relationship between the second-type protocol codes configured on the first controller and the output channel, so that the corresponding output channel in the control output circuit is opened, and the adapter can charge the electronic equipment according to the corresponding electrical parameters.
In some optional embodiments, after the first controller opens the output channel corresponding to the two-type protocol code that is aligned consistently, the first controller may feed back information that the output channel has been opened to the second controller.
The implementation of step S507 is described below with reference to the example of table 1:
and after the second controller determines that the two types of protocol codes 0000 are compared and consistent, the second controller sends the two types of protocol codes 0000, the corresponding test time 20s and the corresponding electrical parameters 9V and 2A to the first controller. The first controller then opens the output channel corresponding to the second type protocol code 0000 in the control output circuit, so that the adapter charges the electronic device with a voltage of 9V and a current of 2A.
S508, whether the information of the parameter matching failure is received is judged.
If the information of failed parameter matching is not received, step S509 is executed, and if the information of failed parameter matching is received, step S510 is executed.
Referring to steps S408 and S409, after the adapter starts to charge the electronic device, if the electronic device detects that the charging input does not match the two-type protocol code that is consistent in comparison, the electronic device sends a parameter matching failure message to the adapter. The adapter receives the information that the parameter matching fails, and the electronic equipment does not support the charging protocol corresponding to the two types of protocol codes which are compared in a consistent mode, so that the electronic equipment needs to be stopped from being charged.
And S509, judging whether the charging time reaches the set testing time.
The charging time can be regarded as the time when the output channel corresponding to the second type protocol code is opened. If the charging time reaches the set test time, step S510 is executed, and if the charging time does not reach the test time, step S509 is executed again until the charging time reaches the set test time.
In some embodiments, step S509 may be performed by the first controller.
To perform the above steps, the first controller may start a timer that starts from zero after the output channel corresponding to the second type protocol code is opened, and when the reading of the timer reaches the test time, the first controller may determine that the charging time reaches the test time.
In some optional embodiments, in order to ensure that the electrical parameters output by the USB interface of the adapter during the charging process are matched with the corresponding charging protocol, the first controller may acquire the electrical parameters at the corresponding positions in real time through the sensor 1 and the sensor 2 shown in fig. 3, compare the acquired electrical parameters with the electrical parameters sent by the second controller, and perform negative feedback adjustment on the control output circuit according to the comparison result.
Illustratively, the first controller may adjust the control output circuit as follows:
when the electrical parameter collected by the first controller is higher than the electrical parameter sent by the second controller, the first controller reduces the output of the control output circuit. Specifically, if the voltage collected by the first controller is higher than the voltage sent by the second controller, the first controller decreases the voltage output by the control output circuit, if the current collected by the first controller is higher than the current sent by the second controller, the first controller decreases the current output by the control output circuit, and if the power collected by the first controller is higher than the power sent by the second controller, the first controller decreases the power output by the control output circuit.
When the electrical parameter collected by the first controller is lower than the electrical parameter sent by the second controller, the first controller increases the output of the control output circuit. Specifically, if the voltage collected by the first controller is lower than the voltage sent by the second controller, the first controller increases the voltage output by the control output circuit, if the current collected by the first controller is lower than the current sent by the second controller, the first controller increases the current output by the control output circuit, and if the power collected by the first controller is lower than the power sent by the second controller, the first controller increases the power output by the control output circuit.
And S510, stopping charging.
In this embodiment, the adapter may stop charging the electronic device in the following manner:
and after the first controller judges that the charging time reaches the test time or the second controller receives the information of parameter matching failure, the second controller sends a channel closing instruction to the first controller, wherein the instruction is used for instructing the first controller to close the currently opened output channel in the control output circuit so as to stop charging the electronic equipment. And after receiving the instruction of closing the channel, the first controller closes the currently opened output channel in the control output circuit, so that the adapter stops charging the electronic equipment.
Adopt the mode that the second controller sent the instruction of closing the passageway to stop charging, its effect lies in: the second controller may determine the time for stopping charging each time by sending an instruction for closing the channel, so that after the charging is stopped each time (i.e., after the instruction for closing the channel is sent), the protocol code of the next charging protocol is read from the protocol stack of the adapter in time and sent to the electronic device, and then the test of the next charging protocol is started.
The first controller may send a request for closing the channel to the second controller after determining that the charging time reaches the test time, so as to trigger the second controller to send an instruction for closing the channel to the first controller.
In some optional embodiments, the implementation manner of step S510 may also be that, if the second controller receives the information that the parameter matching fails, the second controller sends an instruction to close the channel to the first controller, so that the adapter stops charging; if the first controller judges that the charging time reaches the testing time, the first controller directly closes the output channel, and the adapter stops charging.
When the first controller directly closes the output channel, the first controller may send a notification that the channel is closed to the second controller, so that the second controller determines that the adapter has stopped charging according to the current charging protocol, and thus starts sending subsequent protocol codes in the protocol stack to the electronic device.
And S511, judging whether the second-class protocol code to be sent exists.
In step S511, the second controller determines whether the two types of protocol codes corresponding to the first type of protocol code that is currently compared and consistent in the protocol stack are all sent to the electronic device, if there is a code that is not sent to the electronic device in the two types of protocol codes corresponding to the first type of protocol code that is compared and consistent, it is determined that there is a second type of protocol code to be sent, step S505 is executed, and if both the two types of protocol codes corresponding to the first type of protocol code that is compared and consistent have been sent to the electronic device, it is determined that there is no second type of protocol code to be sent, and step S512 is executed.
S512, judging whether a non-transmitted protocol code exists.
If there is a non-transmitted type of protocol code, step S502 is executed, and if there is no non-transmitted type of protocol code, step S513 is executed.
In some optional embodiments, if the second controller sends one type of protocol codes to the electronic device one by one according to the sequence recorded in the protocol stack, in S512, the second controller may determine whether the most recently sent one type of protocol code is the last one in the protocol stack. If the last protocol code is the first type, it may be determined that each protocol code of the first type in the protocol stack has been sent to the electronic device, and there is no unsent protocol code of the first type, and step S513 is executed and the test is ended.
If the last transmitted protocol code is not the last protocol code, it may be determined that there is a protocol code in the protocol stack that is not transmitted to the electronic device, and step S502 is performed again to transmit a new protocol code to the electronic device.
Taking table 1 as an example, when the second controller executes S502 for the first time, the first protocol code 0000 in table 1 is sent, after the electronic device performs comparison and feeds back information of failed comparison, the second controller executes S512 to find that there is an unsent protocol code in table 1, and then executes S502 again to send the second protocol code 0100 of the protocol stack shown in table 1 to the electronic device.
And S513, sending a test ending instruction to the electronic equipment.
Referring to fig. 6, a test procedure of the charging test method provided in this embodiment is described by taking the protocol stack shown in the adapter configuration table 1 as an example.
After the tester inserts the tested electronic device into the adapter through the data line, the second controller of the adapter executes step S600 to detect that the electronic device is accessed.
The second controller then reads the first protocol code 0000 from the protocol stack stored in the memory, and executes step S610 to send the first protocol code 0000. After the first-class protocol code 0000 is sent to the electronic device, the electronic device executes step S611, and compares that the protocol stack of the electronic device does not have the first-class protocol code 0000, and the specific implementation process of step S611 may refer to step S402 of the embodiment shown in fig. 4.
After determining that the protocol stack of the electronic device does not have a type of protocol code, the electronic device executes step S612 to feed back information of the comparison failure.
After receiving the information of the comparison failure, the second controller of the adapter determines that there is an unsent protocol code in the protocol stack, and then continues to read the second protocol code 0100 from the protocol stack of the adapter, and executes step S613 to send the protocol code 0100.
After receiving the first-type protocol code 0100, the electronic device executes step S614 to find that the protocol stack of the electronic device has the first-type protocol code 0100. Then, after determining that the protocol stack of the electronic device has the first-type protocol code 0100, the electronic device executes step S615 to feed back the first-type protocol code 0100.
After receiving the first-class protocol code 0100 fed back by the electronic device, the adapter determines that the charging protocol corresponding to the first-class protocol code 0100 can be used for testing, and therefore, the second-class protocol code corresponding to the first-class protocol code 0100 needs to be sent to the electronic device.
As shown in table 1, the first second-type protocol code corresponding to the first-type protocol code 0100 is 0100, so the second controller executes step S616 to send the second-type protocol code 0100.
After receiving the second-type protocol code 0100, the electronic device executes step S617, finds that the protocol stack of the electronic device has the second-type protocol code 0100 through comparison, and after determining that the protocol stack of the electronic device has the second-type protocol code 0100, executes step S618, and feeds back the second-type protocol code 0100.
After receiving the second type of protocol code fed back by the electronic device, the second controller reads out the second type of protocol code 0100, the corresponding test time 20S and the corresponding electrical parameter 60W from the protocol stack of the memory of the adapter, and then executes step S619 to send the second type of protocol code 0100, the test time 20S and the electrical parameter 60W.
After the data is sent to the first controller, the first controller executes step S620 to open the output channel of the second-type protocol code 0100. When the output channel corresponding to the second-type protocol code 0100 in the control output circuit is opened, the control output circuit starts to charge the electronic device according to the electrical parameter corresponding to the second-type protocol code 0100, that is, the power of 60W.
After detecting the charging input, the electronic device performs step S621 to feed back information for starting charging, and detect whether there is an abnormal state during charging.
After the charging period, the first controller executes step S622 to determine that the open time reaches the test time 20S and step S623 to send a request for closing the channel. The second controller executes step S624 in response to the request to close the channel, and sends an instruction to close the channel. After receiving the command, the first controller executes step S625 to close the output channel.
As shown in table 1, after the second controller sends the instruction to close the channel, it is determined that one of the two-type protocol codes corresponding to the first-type protocol code 0100 and another one of the two-type protocol code 0110 are not sent, that is, the second controller executes step S626 to send the second-type protocol code 0110.
After receiving the second type protocol code 0110, the electronic device executes step S627, compares the found protocol stack of the electronic device with the second type protocol code 0110 and step S628, and feeds back the second type protocol code 0110.
After receiving the second type protocol code 0110 fed back by the electronic device, the second controller reads the second type protocol code 0110, the corresponding test time 20S and the corresponding electrical parameter 100W from the protocol stack of the adapter, and then executes step S629 to send the second type protocol code 0110, the test time 20S and the electrical parameter 100W.
After receiving the data, the first controller executes step S630 to open the output channel of the second type protocol code 0110. Then, the control output circuit starts charging the electronic device with 100W of power, and the electronic device executes step S631 after detecting the charging input, and feeds back information for starting charging.
After the charging time reaches the test time 20S, the first controller performs step S632, determines that the open time reaches the test time 20S, and transmits a request for closing the channel at step S633. The second controller then performs step S634 to send an instruction to close the channel, and the first controller performs step S635 to close the output channel in response to the instruction.
After step S634 is executed, the second controller determines that both two types of protocol codes corresponding to the first type protocol code 0100 in the protocol stack shown in table 1 have completed corresponding tests. Therefore, the second controller transmits the next unsent protocol code 1000 of one type in the protocol stack to the electronic device, that is, executes step S636 to transmit the protocol code 1000 of one type.
After receiving the first-class protocol code, the electronic device executes step S637, compares the protocol stack of the electronic device with the first-class protocol code 1000, and feeds back information of the comparison failure.
After receiving the information of the comparison failure, the second controller determines that each class of protocol code in the protocol stack shown in table 1 has been sent, and may determine that the charging test is finished, and execute step S639 to send test end information. After receiving the test end information, the electronic device executes step S640 to output the test end information and the test result.
As can be seen from the flow shown in fig. 6, with the charging test method provided in this embodiment, the electronic device can be tested under multiple charging protocols (two charging protocols, respectively 60W power charging protocol and 100W power charging protocol in the example of fig. 6) by using the adapter only by connecting the electronic device to one adapter, so that a situation that one electronic device occupies multiple adapters during the charging test is avoided. In addition, the adapters connected with the electronic equipment do not need to be replaced in the whole test process, the test of various charging protocols can be realized by using the same adapter, and the test efficiency is effectively improved.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically stated.
The embodiments of the present application relate to a plurality of numbers greater than or equal to two. It should be noted that, in the description of the embodiments of the present application, the terms "first", "second", and the like are used for distinguishing the description, and are not to be construed as indicating or implying relative importance or order.

Claims (8)

1. A charging test method is applied to an adapter, and comprises the following steps:
after detecting that the electronic equipment is connected to the adapter, sending a first-class protocol code of the adapter to the electronic equipment, wherein the first-class protocol code of the adapter corresponds to a plurality of second-class protocol codes, and the first-class protocol code of the adapter identifies a preset test scene;
if the first-class protocol code of the adapter is consistent with the first-class protocol code of the electronic equipment, sending a second-class protocol code of the adapter corresponding to the first-class protocol code to the electronic equipment, wherein the second-class protocol code of the adapter corresponds to a charging protocol to be tested in the test scene, and the adapter is configured with a plurality of charging protocols;
if the second type protocol code of the adapter is consistent with the second type protocol code of the electronic equipment, charging the electronic equipment according to a charging protocol corresponding to the second type protocol code of the adapter;
stopping charging when the charging time reaches the test time corresponding to the protocol code of the adapter;
if the protocol code of the adapter to be sent exists, returning to execute the step of sending the protocol code of the adapter to the electronic equipment;
and if the protocol code of the adapter to be sent does not exist, sending a test ending instruction to the electronic equipment.
2. The method according to claim 1, wherein the step of returning to execute the protocol encoding for sending the adapter to the electronic device if there is a protocol encoding for the adapter to be sent comprises:
if the second type protocol code of the adapter to be sent exists, returning to execute the step of sending the second type protocol code of the adapter to the electronic equipment;
and if the protocol code of the adapter to be sent exists, returning to execute the step of sending the protocol code of the adapter to the electronic equipment.
3. The method according to claim 1 or 2, wherein before stopping charging after the charging time reaches the test time corresponding to the protocol code of the adapter, the method further comprises:
collecting electrical parameters of the adapter during charging;
comparing the collected electrical parameters with the electrical parameters corresponding to the protocol codes of the adapter;
and carrying out negative feedback regulation on the control output circuit of the adapter according to the comparison result.
4. A charging test method is applied to electronic equipment, and the method comprises the following steps:
receiving a protocol code of an adapter, wherein the protocol code of the adapter corresponds to a charging protocol pre-configured by the adapter, and the adapter is configured with a plurality of charging protocols;
if the first-class protocol code of the adapter is received, comparing whether the first-class protocol code of the adapter is consistent with the first-class protocol code of the electronic equipment or not, wherein the first-class protocol code of the adapter corresponds to a plurality of second-class protocol codes, and the first-class protocol code of the adapter identifies a preset test scene;
if the protocol code of one type of the adapter is consistent with the protocol code of one type of the electronic equipment, feeding back the protocol code of one type of the adapter to the adapter;
if the second type of protocol code of the adapter is received, comparing whether the second type of protocol code of the adapter is consistent with the second type of protocol code of the electronic equipment or not, wherein the second type of protocol code of the adapter corresponds to a charging protocol to be tested in the test scene;
if the second type protocol code of the adapter is consistent with the second type protocol code of the electronic equipment, feeding the second type protocol code of the adapter back to the adapter so that the adapter charges the electronic equipment according to a charging protocol corresponding to the second type protocol code of the adapter;
detecting whether the electronic equipment is in an abnormal state or not when the adapter is charged and recording a detection result;
if the test ending instruction of the adapter is not received, returning to the step of executing the protocol coding of the receiving adapter;
and if a test ending instruction of the adapter is received, outputting a test result, wherein the test result at least comprises the detection result.
5. The method of claim 4, wherein before detecting whether the electronic device has an abnormal state while the adapter is being charged and recording the detection result, the method further comprises:
detecting whether the charging input of the adapter is matched with the electrical parameter corresponding to the protocol code of the electronic equipment;
if the charging input of the adapter is not matched with the electrical parameter corresponding to the protocol code of the electronic equipment, feeding back information of parameter matching failure to the adapter;
and if the charging input of the adapter is matched with the electrical parameter corresponding to the protocol code of the electronic equipment, detecting whether the electronic equipment is in an abnormal state or not when the adapter is charged and recording a detection result.
6. An adapter, comprising: the control circuit, the current circuit, the protocol circuit and the USB interface;
the control loop is configured to execute one or more programs to cause the adapter to perform the charging test method of any of claims 1 to 3.
7. An electronic device, comprising: one or more processors, memory;
the memory is used for storing one or more programs;
the one or more processors are configured to execute the one or more programs to cause an electronic device to perform the charge testing method of claim 4 or 5.
8. A charging test system is characterized by comprising an adapter and an electronic device, wherein the adapter is connected with the electronic device;
the adapter is used for charging the electronic equipment according to the charging test method of any one of claims 1 to 3;
the electronic device is configured to execute the charging test method according to claim 4 or 5 to obtain a test result, where the test result at least includes a detection result, and the detection result is used to indicate whether the electronic device has an abnormal state when the adapter is charged.
CN202210030422.8A 2022-01-12 2022-01-12 Charging test method, electronic device, adapter and charging test system Active CN114050634B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210030422.8A CN114050634B (en) 2022-01-12 2022-01-12 Charging test method, electronic device, adapter and charging test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210030422.8A CN114050634B (en) 2022-01-12 2022-01-12 Charging test method, electronic device, adapter and charging test system

Publications (2)

Publication Number Publication Date
CN114050634A CN114050634A (en) 2022-02-15
CN114050634B true CN114050634B (en) 2022-06-17

Family

ID=80196292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210030422.8A Active CN114050634B (en) 2022-01-12 2022-01-12 Charging test method, electronic device, adapter and charging test system

Country Status (1)

Country Link
CN (1) CN114050634B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077216A (en) * 2013-03-28 2014-10-01 腾讯科技(深圳)有限公司 Software test method and test device
CN107064682A (en) * 2017-04-20 2017-08-18 北京小米移动软件有限公司 Assembly detection apparatus
CN107453437A (en) * 2017-09-04 2017-12-08 深圳支点电子智能科技有限公司 The method and charger of scene adaptive charging
CN109491919A (en) * 2018-11-28 2019-03-19 中电科西北集团有限公司 A kind of method for testing software and test platform

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130346025A1 (en) * 2012-06-22 2013-12-26 Green Charge Networks Llc Electric vehicle charging protocol selection and testing
CN103986217B (en) * 2014-05-30 2018-02-23 努比亚技术有限公司 A kind of charger and its implementation for adaptively exporting different voltages
CN106655415B (en) * 2017-03-14 2021-01-22 成都智朴思互联科技有限公司 Intelligent universal charging identification and control device based on USB interface
CN111381181A (en) * 2018-12-29 2020-07-07 深圳市瑞能实业股份有限公司 Quick charging and quick discharging test device for mobile power supply and quick charging and quick discharging test method
CN110514925A (en) * 2019-08-13 2019-11-29 Oppo(重庆)智能科技有限公司 Test method and system and storage medium
CN110729792A (en) * 2019-10-30 2020-01-24 深圳市沃特沃德股份有限公司 Charging method, charging device, storage medium and computer equipment
CN111337783A (en) * 2020-04-03 2020-06-26 深圳英集芯科技有限公司 Test circuit and test method thereof
CN111711240B (en) * 2020-06-24 2023-08-08 江西联智集成电路有限公司 Method and device for testing wireless charging equipment
CN111896884B (en) * 2020-07-31 2023-11-14 北京小米移动软件有限公司 Charging detection method and device
CN111953049A (en) * 2020-08-15 2020-11-17 广东省博康电子有限公司 QC quick-charging test method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077216A (en) * 2013-03-28 2014-10-01 腾讯科技(深圳)有限公司 Software test method and test device
CN107064682A (en) * 2017-04-20 2017-08-18 北京小米移动软件有限公司 Assembly detection apparatus
CN107453437A (en) * 2017-09-04 2017-12-08 深圳支点电子智能科技有限公司 The method and charger of scene adaptive charging
CN109491919A (en) * 2018-11-28 2019-03-19 中电科西北集团有限公司 A kind of method for testing software and test platform

Also Published As

Publication number Publication date
CN114050634A (en) 2022-02-15

Similar Documents

Publication Publication Date Title
CN107807290B (en) Direct current charging pile detection system and detection method
US5627451A (en) Control method and control apparatus for secondary battery charging in constant current charging method
US6211644B1 (en) Method and apparatus for identifying a battery
EP3086433A1 (en) Charging method, alternating current adaptor, charging management device and terminal
US11356824B2 (en) Wireless control system, wireless control method, and battery pack
WO1994010718A1 (en) Battery pack
CN111201689A (en) Electronic equipment and charging control method
CN102981916B (en) A kind of mobile terminal and control method thereof and device
WO2008090378A1 (en) Battery connection unit
US20200161607A1 (en) Battery charging circuit integrated inside battery pack
KR101000870B1 (en) Battery charger for electric vehicle
CN103530250A (en) Portable electronic device and accessory device thereof, and operating method for the portable electronic device
CN114050634B (en) Charging test method, electronic device, adapter and charging test system
US20220166232A1 (en) Charging management system and method, device, and storage medium
US20200119574A1 (en) Charger circuit and intelligent charging control method thereof
CN111201690A (en) Charging control method, electronic device, power adapter and charging control system
CN111381181A (en) Quick charging and quick discharging test device for mobile power supply and quick charging and quick discharging test method
CN105493381A (en) Method and apparatus for charging a battery
JP2015154661A (en) Different type battery sharing charging device and method
CN105824732A (en) USB detection method and detection system
WO2004084581A1 (en) Method of programming a hearing aid by a programming device
KR20090095029A (en) Control method for programable power control unit and test system for semiconductor
CN211528668U (en) Voltage ripple detection device and system
CN107204645B (en) Portable charging device
CN112398202A (en) Configuration method and device of chip power supply power, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant