Charging method and device of electronic equipment, electronic equipment and storage medium
By monitoring the voltage changes of the Type-C charging port, determining the target voltage value, and optimizing the charging process, the charging function abnormality caused by the short circuit of the Type-C port is solved, and normal charging and performance improvement are achieved.
Patent Information
- Application Number
- CN202310639848.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-01
- Publication Date
- 2024-12-03
AI Technical Summary
The pin spacing of the Type-C charging port is small, and short circuits are prone to occur, resulting in abnormal charging function. It is difficult for the prior art to charge normally in this situation.
By monitoring the voltage changes of the first and second pins, the target voltage value is determined and the target voltage value is charged according to the target voltage value, so as to ensure that the voltage of the second pin does not exceed the preset voltage value during the charging process, the Optimization of abnormal charging function.
When the Type-C charging port is short-circuited, it can charge normally, improve charging performance, and avoid abnormal charging function.
Smart Images

Figure CN119070413A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of charging technology, and in particular to a charging method and device for an electronic device, an electronic device, and a storage medium. Background Art
[0002] At present, many electronic devices have Type-C ports as charging ports, but the internal pin spacing of Type-C ports is relatively small, which is very easy to cause problems. For example, if the Type-C port is dirty or corroded by liquid, a short circuit or micro short circuit will form between the two pins, which will cause functional abnormalities. Charging is the most used function at present, and any abnormality of Type-C will cause abnormal charging function. How to charge when the Type-C charging function is abnormal is an urgent problem to be solved. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a charging method and device for an electronic device, an electronic device and a storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a charging method of an electronic device is provided, wherein a charging port of the electronic device comprises a first pin and a second pin, and the method comprises:
[0005] When the first pin and the second pin are short-circuited, determining a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin;
[0006] Charging is performed based on the target voltage value, so that during the charging process, the second voltage value of the second pin does not exceed a preset voltage value.
[0007] In some embodiments, determining a target voltage value associated with the first pin based on a voltage change of the first pin and a change of a second voltage value of the second pin includes:
[0008] Repeating the step of increasing the first voltage value until the first voltage value is increased and the second voltage value meets a preset condition, and determining the current first voltage value as the target voltage value;
[0009] The second voltage value satisfies a preset condition that: the second voltage value is less than the preset voltage value, and the difference between the preset voltage value and the second voltage value is less than a first value.
[0010] In some embodiments, determining a target voltage value associated with the first pin based on a voltage change of the first pin and a change of a second voltage value of the second pin includes:
[0011] The step of increasing the first voltage value is repeatedly performed until the first voltage value is increased to the maximum voltage value of the first pin and the second voltage value does not exceed the preset voltage value, and the maximum voltage value is determined as the target voltage value.
[0012] In some embodiments, the step of increasing the first voltage value includes:
[0013] When the difference between the preset voltage value and the second voltage value is greater than a second value, the first voltage value is increased according to a first preset value; when the difference between the preset voltage value and the second voltage value is less than or equal to the second value, the first voltage value is increased according to a second preset value, wherein the second preset value is less than the first preset value;
[0014] or,
[0015] The first voltage value is increased according to a third preset value.
[0016] In some embodiments, when the first pin and the second pin are short-circuited, determining a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin includes:
[0017] When the first voltage value increases, the second voltage value increases, and the increased second voltage value does not exceed the preset voltage value, the target voltage value is determined based on changes in the first voltage value and changes in the second voltage value.
[0018] In some embodiments, the charging protocol of the electronic device includes a first charging protocol, and the first charging protocol is communicated via the second pin;
[0019] When any of the following situations occurs, charging is performed according to the first charging protocol:
[0020] Charging based on the target voltage value;
[0021] The first voltage value is increased, the second voltage value is not increased, and the second voltage value does not exceed the preset voltage value.
[0022] In some embodiments, the charging protocol of the electronic device includes a second charging protocol, and the second charging protocol is communicated through other pins except the second pin;
[0023] When any of the following situations occurs, charging is performed in accordance with the second charging protocol:
[0024] The second pin is disconnected;
[0025] The first voltage value is increased, the second voltage value is increased, and the increased second voltage value exceeds the preset voltage value;
[0026] The first voltage value is increased, the second voltage value is not increased, and the second voltage value exceeds the preset voltage value.
[0027] According to a second aspect of an embodiment of the present disclosure, a charging device for an electronic device is provided, wherein a charging port of the electronic device comprises a first pin and a second pin, and the device comprises:
[0028] a voltage value determination module configured to determine a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin when the first pin and the second pin are short-circuited;
[0029] The charging module is configured to charge based on the target voltage value so that the second voltage value of the second pin does not exceed a preset voltage value during the charging process.
[0030] In some embodiments, the voltage value determination module is configured to:
[0031] Repeating the step of increasing the first voltage value until the first voltage value is increased and the second voltage value meets a preset condition, and determining the current first voltage value as the target voltage value;
[0032] The second voltage value satisfies a preset condition that: the second voltage value is less than the preset voltage value, and the difference between the preset voltage value and the second voltage value is less than a first value.
[0033] In some embodiments, the voltage value determination module is configured to:
[0034] The step of increasing the first voltage value is repeatedly performed until the first voltage value is increased to the maximum voltage value of the first pin and the second voltage value does not exceed the preset voltage value, and the maximum voltage value is determined as the target voltage value.
[0035] In some embodiments, the voltage value determination module is configured to:
[0036] When the difference between the preset voltage value and the second voltage value is greater than a second value, the first voltage value is increased according to a first preset value; when the difference between the preset voltage value and the second voltage value is less than or equal to the second value, the first voltage value is increased according to a second preset value, wherein the second preset value is less than the first preset value;
[0037] or,
[0038] The first voltage value is increased according to a third preset value.
[0039] In some embodiments, the voltage value determination module is configured to:
[0040] When the first voltage value increases, the second voltage value increases, and the increased second voltage value does not exceed the preset voltage value, the target voltage value is determined based on changes in the first voltage value and changes in the second voltage value.
[0041] In some embodiments, the charging protocol of the electronic device includes a first charging protocol, and the first charging protocol is communicated via the second pin;
[0042] When any of the following situations occurs, charging is performed according to the first charging protocol:
[0043] Charging based on the target voltage value;
[0044] The first voltage value is increased, the second voltage value is not increased, and the second voltage value does not exceed the preset voltage value.
[0045] In some embodiments, the charging protocol of the electronic device includes a second charging protocol, and the second charging protocol is communicated through other pins except the second pin;
[0046] When any of the following situations occurs, charging is performed in accordance with the second charging protocol:
[0047] The second pin is disconnected;
[0048] The first voltage value is increased, the second voltage value is increased, and the increased second voltage value exceeds the preset voltage value;
[0049] The first voltage value is increased, the second voltage value is not increased, and the second voltage value exceeds the preset voltage value.
[0050] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0051] processor;
[0052] a memory for storing processor-executable instructions;
[0053] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.
[0054] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method described in the first aspect of the embodiment of the present disclosure.
[0055] The above method of the present disclosure has the following beneficial effects:
[0056] The method provided by the embodiment of the present disclosure determines a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin when a short circuit occurs between a first pin and a second pin of a charging port of an electronic device. The target voltage value is a voltage value suitable for current charging corresponding to the first pin. Then charging is performed based on the target voltage value, thereby ensuring that when a short circuit occurs between the first pin and the second pin of the electronic device, the second voltage value of the second pin does not exceed a preset voltage value during charging, and normal charging can be achieved, thereby optimizing existing charging function abnormalities and improving the charging performance of the electronic device after a charging function abnormality occurs.
[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0059] Figure 1 is a schematic diagram showing an abnormal charging function according to an exemplary embodiment;
[0060] Figure 2 is a flow chart showing a charging method for an electronic device according to an exemplary embodiment;
[0061] Figure 3 is a flow chart showing another method for charging an electronic device according to an exemplary embodiment;
[0062] Figure 4 is a flow chart showing another method for charging an electronic device according to an exemplary embodiment;
[0063] Figure 5 is a block diagram of a charging device for an electronic device according to an exemplary embodiment;
[0064] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0065] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0066] Before introducing the charging method of the electronic device provided by the embodiment of the present disclosure, the abnormal situation of the charging function involved is first described:
[0067] With the popularity of Type-C ports, electronic devices support PD (Power Delivery) charging (a fast charging protocol), and PD charging relies heavily on CC signals for communication. In the pin distribution of Type-C, the CC pin and the VBUS pin are adjacent, and among the multiple pins of Type-C, VBUS and CC are more susceptible to corrosion, resulting in abnormal charging functions, such as open circuits on the CC pin, short circuits between the CC pin and the VBUS pin, etc. If the CC pin is open, the communication path based on the CC signal cannot be used at all, and charging cannot be performed normally; if a short circuit occurs between the CC pin and the VBUS pin, the charging abnormality will be different depending on the short circuit impedance.
[0068] For example, in the event of a short circuit between the CC pin and the VBUS pin, see Figure 1 When the charger is connected to the electronic device through the data cable, the charger provides power to the electronic device. At this time, the internal current source of the charger will pull up the CC; while the CC of the electronic device is 5.1K pull-down, generating a 5.1K pull-down resistor.
[0069] In this case, the current on the pull-down resistor of the electronic device is the superposition of two power sources, the normal current source i1 of the charger, and the power source generated by the short circuit also forms a current i2. After these two currents are superimposed on the 5.1K pull-down resistor of the electronic device, the voltage of the 5.1K pull-down resistor is raised, that is, the voltage is V=R*(i1+i2). As the resistance generated by the short circuit decreases, the current i2 will increase, causing the voltage of the 5.1K pull-down resistor to increase, and the voltage of the CC pin of the electronic device is the voltage of the 5.1K pull-down resistor, thereby causing the voltage of the CC pin to increase, and eventually causing the voltage of the CC pin to exceed the protection voltage point allowed by the electronic device. After exceeding the protection voltage point, the electronic device will disconnect the communication path of the CC pin to protect the electronic device. The CC signal is the communication path when the electronic device is charging, which leads to abnormal charging, disconnection or slow charging, and other problems.
[0070] The method provided in the embodiment of the present disclosure optimizes the problem of abnormal charging function mentioned above, so that the electronic device still retains the charging function and maintains a certain charging speed after the CC signal becomes abnormal.
[0071] The method provided in the embodiment of the present disclosure is performed by an electronic device, the charging port of the electronic device includes a first pin and a second pin, for example, the first pin is a VBUS pin, and the second pin is a CC pin. The electronic device may be a terminal with a charging function such as a mobile phone, a tablet computer, a laptop computer, a wearable smart device, a smart home device, etc.
[0072] Figure 2 is a flowchart of a charging method of an electronic device according to an exemplary embodiment, which is executed by the electronic device, wherein the charging port of the electronic device includes a first pin and a second pin, see Figure 2 , the method comprising:
[0073] Step S201 : when a first pin and a second pin are short-circuited, determining a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin.
[0074] In the case of a short circuit between the first pin and the second pin, when the first voltage value of the first pin changes, the second voltage value of the second pin will also change accordingly. For example, when the first voltage value increases, the second voltage value will also increase until a target voltage value is determined, which is the first voltage value when the second voltage value changes to a suitable voltage value.
[0075] That is, in the case of a short circuit between the first pin and the second pin, the first voltage value is gradually increased, and then a suitable target voltage value is determined according to the change of the second voltage value, and the target voltage value needs to meet the following conditions: when the voltage value of the first pin is the target voltage value, the second voltage value of the second pin does not exceed the preset voltage value, and the preset voltage value is the maximum voltage value of the second pin. If the voltage value of the second pin exceeds the preset voltage value, the second pin will be unable to communicate. The preset voltage value is determined according to the actual situation of the electronic device, and the preset voltage values of different electronic devices may be different. For example, the preset voltage value can be 4.35V, 4.2V or other values.
[0076] Step S202, charging is performed based on the target voltage value, so that during the charging process, the second voltage value of the second pin does not exceed a preset voltage value.
[0077] In order to ensure normal charging, the second voltage value cannot exceed the preset voltage value during the charging process. The target voltage value is determined based on this premise. After the target voltage value is determined, the voltage value of the first pin is maintained at the target voltage value, and then charging is performed, so that the second pin is within an acceptable voltage range that can work normally without causing charging interruption.
[0078] The method provided by the embodiment of the present disclosure determines a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin when a short circuit occurs between a first pin and a second pin of a charging port of an electronic device. The target voltage value is a voltage value suitable for current charging corresponding to the first pin. Then charging is performed based on the target voltage value, thereby ensuring that when a short circuit occurs between the first pin and the second pin of the electronic device, the second voltage value of the second pin does not exceed a preset voltage value during charging, and normal charging can be achieved, thereby optimizing existing charging function abnormalities and improving the charging performance of the electronic device after a charging function abnormality occurs.
[0079] Figure 3 is a flowchart of another charging method of an electronic device according to an exemplary embodiment, which is executed by the electronic device, wherein the charging port of the electronic device includes a first pin and a second pin, see Figure 3 , the method comprising:
[0080] Step S301: when a first voltage value of a first pin increases and a second voltage value of a second pin increases, it is determined that a short circuit occurs between the first pin and the second pin.
[0081] In the disclosed embodiment, by increasing the first voltage value of the first pin, and then detecting whether the second voltage value of the second pin increases with the increase of the first voltage value, that is, by determining whether the second voltage value increases when the first voltage value increases, it is determined whether there is a short circuit between the first pin and the second pin. When the first voltage value increases and the second voltage value also increases, it is determined that there is a short circuit between the first pin and the second pin. In the case of a short circuit, the operation of the subsequent step S302 is performed.
[0082] When the first voltage value increases and the second voltage value does not increase, it is determined that there is no short circuit between the first pin and the second pin.
[0083] In some embodiments, when it is determined that there is no short circuit between the first pin and the second pin, it is further determined whether the second voltage value exceeds the preset voltage value at this time. When the second voltage value does not exceed the preset voltage value, it means that the entire charging communication path is normal, and normal charging can be performed at this time, and fast charging can be started quickly, that is, when the first voltage value is increased, the second voltage value is not increased, and the second voltage value does not exceed the preset voltage value, the first charging protocol is followed for charging, and the first charging protocol communicates through the second pin, for example, the first charging protocol is a CC charging protocol, or other suitable charging protocols. When the second voltage value does not exceed the preset voltage value, it means that there are other abnormalities in the communication path at this time, and the first charging protocol cannot be normally followed for charging, and other charging protocols need to be followed for charging, that is, when the first voltage value is increased, the second voltage value is not increased, and the second voltage value exceeds the preset voltage value, the second charging protocol is followed for charging, and the second charging protocol communicates through other pins other than the second pin, for example, other pins can be D+ pins, D- pins and other pins, for example, the second charging protocol is a DPDM charging protocol, or other suitable charging protocols.
[0084] It should be noted that after the electronic device is connected to the charger, the first pin has an initial first voltage value, and similarly, the second pin also has an initial second voltage value. When the first voltage value is increased, it is increased based on the initial first voltage value.
[0085] Step S302 , when the first pin and the second pin are short-circuited and the boosted second voltage value does not exceed the preset voltage value, determining a target voltage value based on a change in the first voltage value and a change in the second voltage value.
[0086] In the embodiment of the present disclosure, considering that there is a short circuit between the first pin and the second pin, if charging needs to be performed in accordance with the first charging protocol, it is necessary to ensure that the boosted second voltage value does not exceed the preset voltage value.
[0087] In some embodiments, determining the target voltage value includes the following two cases:
[0088] First case:
[0089] Repeat the step of increasing the first voltage value until the first voltage value is increased and the second voltage value meets the preset condition, and the current first voltage value is determined as the target voltage value. The second voltage value meeting the preset condition is set to: the second voltage value is less than the preset voltage value, and the difference between the preset voltage value and the second voltage value is less than the first value, the first value is a preset value, for example, the first value is 0.05, 0.1 or other smaller values; the current first voltage value is the voltage value of the first pin when the second voltage value meets the preset condition.
[0090] During the charging process, when the first voltage value of the first pin changes, the second voltage value of the second pin will also change accordingly. Therefore, the second voltage value can be adjusted by controlling the magnitude of the first voltage value. That is, the first voltage value is first increased once, and the corresponding second voltage value after the first voltage value is increased is detected to determine whether the second voltage value meets the preset condition. If the second voltage value does not meet the preset condition at this time, the first voltage value is increased again, and the corresponding second voltage value after the first voltage value is increased again is continuously detected. If the second voltage value does not meet the preset condition at this time, the above operation is continued until the second voltage value meets the preset condition. Among them, the second voltage value corresponding to the first voltage value after the first voltage value is increased is: the voltage value of the second pin when the voltage value of the first pin is the first voltage value after the increase. For a certain first voltage value, the second voltage value corresponding to the first voltage value is the voltage value of the second pin when the voltage value of the first pin is the first voltage value.
[0091] It should be noted that, in some embodiments, in order to charge as quickly as possible, it is necessary to ensure that the second voltage value is as large as possible and cannot exceed the preset voltage value, that is, the first value needs to be as small as possible so that the second voltage value is as close to the preset voltage value as possible.
[0092] Second case:
[0093] The first voltage value is repeatedly increased until the first voltage value is increased to the maximum voltage value of the first pin and the second voltage value does not exceed the preset voltage value, and the maximum voltage value is determined as the target voltage value.
[0094] The second case is different from the first case in that in the second case, when the second voltage value has not yet exceeded the preset voltage value, the first voltage value is first increased to the maximum voltage value of the first pin, and the first voltage value cannot be further increased. Therefore, it is only necessary to maintain the voltage value of the first pin at the maximum voltage value for charging.
[0095] In some embodiments, the first voltage may be increased according to a preset value.
[0096] Optionally, the first voltage value is increased according to a third preset value. To prevent the first voltage value from increasing too much at one time, causing the second voltage value to exceed the preset voltage value, the third preset value may be a preset smaller value, for example, the third preset value is 20 mV (millivolts), so that the first voltage value is increased slowly.
[0097] Optionally, when the difference between the preset voltage value and the second voltage value is greater than the second value, the first voltage value is increased according to the first preset value; when the difference between the preset voltage value and the second voltage value is less than or equal to the second value, the first voltage value is increased according to the second preset value. The second preset value is less than the first preset value, and the second value is a preset value. For example, the second voltage value is 20mV, the first voltage value is 50mV, and the second value is 0.5V, 0.3V, etc.
[0098] The disclosed embodiment takes into account that if the first voltage value is increased slowly all the time, the increasing speed of the first voltage value is slow. In order to speed up the increasing speed, a second numerical value is set. When the difference between the preset voltage value and the second voltage value is greater than the second numerical value, it means that there is a large difference between the preset voltage value and the second voltage value. At this time, even if the first voltage value is increased by a large amount at one time, it will not cause the second voltage value to suddenly exceed the preset voltage value. Therefore, the first voltage value can be increased based on the larger first preset value; and when the difference between the preset voltage value and the second voltage value is less than or equal to the second numerical value, it means that there is a small difference between the preset voltage value and the second voltage value. At this time, if the first voltage value is increased by a large amount at one time, it will cause the second voltage value to suddenly exceed the preset voltage value. Therefore, the first voltage value can be increased based on the smaller second preset value.
[0099] Step S303: follow the first charging protocol and charge based on the target voltage value.
[0100] In the disclosed embodiment, after the target voltage value is determined, the voltage value of the first pin is maintained at the target voltage value, and then charging is performed according to the first charging protocol, so that the second pin is within an acceptable voltage range that can operate normally without causing charging interruption.
[0101] It should be noted that, in the case of a short circuit between the first pin and the second pin, the abnormal charging function will be different due to different short-circuit impedances. If the short-circuit impedance is too small, even if the first voltage value of the first pin is maintained at a relatively small voltage value, the second voltage value of the second pin will exceed the preset voltage value, which is the maximum voltage value corresponding to the second pin. When the second voltage value exceeds the preset voltage value, it is completely impossible to communicate based on the CC signal to complete charging; if the short-circuit impedance is large, the first voltage value can be gradually increased, and then a suitable target voltage value can be determined according to the change in the second voltage value, so that the first pin is within an acceptable and normal working voltage range without causing charging to be interrupted.
[0102] In some embodiments, when the first voltage value increases, the second voltage value increases, and the increased second voltage value exceeds a preset voltage value, charging is performed in accordance with a second charging protocol.
[0103] Another point that needs to be explained is that, in some embodiments, before making a short circuit judgment, the second pin is first judged to be open circuit. In the case where the second pin is open circuit, charging cannot be performed in accordance with the first charging protocol under any circumstances. At this time, charging is performed directly in accordance with the second charging protocol. In the case where the second pin is not open circuit, the above steps S301-S303 are executed.
[0104] The method provided by the embodiment of the present disclosure determines a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin when a short circuit occurs between a first pin and a second pin of a charging port of an electronic device. The target voltage value is a voltage value suitable for current charging corresponding to the first pin. Then charging is performed based on the target voltage value, thereby ensuring that when a short circuit occurs between the first pin and the second pin of the electronic device, the second voltage value of the second pin does not exceed a preset voltage value during charging, and normal charging can be achieved, thereby optimizing existing charging function abnormalities and improving the charging performance of the electronic device after a charging function abnormality occurs.
[0105] Furthermore, when the voltage value of the first pin is the target voltage value, the second voltage value can be as close to the preset voltage value as possible, so that charging is performed at a larger voltage value and the charging speed is increased as much as possible.
[0106] Figure 4 FIG. 1 is a flow chart of another charging method of an electronic device according to an exemplary embodiment. Taking the first pin as the VBUS pin and the second pin as the CC pin as an example, the charging process is described:
[0107] 1. Connect the electronic device to the charger.
[0108] 2. Determine whether the CC pin is open circuit. If it is open circuit, execute step 9. If it is not open circuit, execute step 3.
[0109] 3. Increase the VBUS voltage by 20mV.
[0110] 4. Detect the CC voltage and determine whether the CC voltage increases. If the CC voltage increases, execute step 5; if the CC voltage does not increase, execute step 7.
[0111] 5. Determine whether the CC voltage exceeds the protection point. If the CC voltage exceeds the protection point, execute step 9; if the CC voltage does not exceed the protection point, execute step 6.
[0112] 6. Determine whether the VBUS voltage meets the charging requirements. If the charging requirements are met, execute step 8. If the charging requirements are not met, execute step 3.
[0113] Meeting the charging requirement means that the CC voltage does not exceed the protection point, and the difference between the protection point and the CC voltage is less than the first value, or the VBUS voltage increases to the maximum voltage value of the VBUS pin, and the CC voltage does not exceed the protection point.
[0114] 7. Determine whether the CC voltage exceeds the protection point. If the CC voltage exceeds the protection point, execute step 9; if the CC voltage does not exceed the protection point, execute step 8.
[0115] 8. Charge in accordance with the CC charging protocol.
[0116] 9. Charge in accordance with the DPDM charging protocol.
[0117] It should be noted that the VBUS voltage corresponds to the above-mentioned first voltage value, the CC voltage corresponds to the above-mentioned second voltage value, and the protection point corresponds to the above-mentioned preset voltage value.
[0118] Figure 5 is a block diagram of a charging device of an electronic device according to an exemplary embodiment, wherein a charging port of the electronic device includes a first pin and a second pin, and the device includes:
[0119] The voltage value determination module 501 is configured to determine a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin when a short circuit occurs between the first pin and the second pin;
[0120] The charging module 502 is configured to charge based on the target voltage value so that the second voltage value of the second pin does not exceed a preset voltage value during the charging process.
[0121] The device provided by the embodiment of the present disclosure determines a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin when a short circuit occurs between a first pin and a second pin of a charging port of an electronic device. The target voltage value is a voltage value suitable for current charging corresponding to the first pin. Charging is then performed based on the target voltage value, thereby ensuring that when a short circuit occurs between the first pin and the second pin of the electronic device, the second voltage value of the second pin does not exceed a preset voltage value during charging, and normal charging can be achieved, thereby optimizing existing charging function abnormalities and improving the charging performance of the electronic device after a charging function abnormality occurs.
[0122] In some embodiments, the voltage value determination module 501 is configured to:
[0123] Repeat the step of increasing the first voltage value until the first voltage value is increased and the second voltage value meets a preset condition, and the current first voltage value is determined as the target voltage value;
[0124] The second voltage value satisfies a preset condition that: the second voltage value is less than a preset voltage value, and a difference between the preset voltage value and the second voltage value is less than a first value.
[0125] In some embodiments, the voltage value determination module 501 is configured to:
[0126] The step of increasing the first voltage value is repeatedly performed until the first voltage value is increased to the maximum voltage value of the first pin and the second voltage value does not exceed the preset voltage value, and the maximum voltage value is determined as the target voltage value.
[0127] In some embodiments, the voltage value determination module 501 is configured to:
[0128] When the difference between the preset voltage value and the second voltage value is greater than the second value, the first voltage value is increased according to the first preset value; when the difference between the preset voltage value and the second voltage value is less than or equal to the second value, the first voltage value is increased according to the second preset value, wherein the second preset value is less than the first preset value;
[0129] or,
[0130] The first voltage value is increased according to the third preset value.
[0131] In some embodiments, the voltage value determination module 501 is configured to:
[0132] When the first voltage value increases, the second voltage value increases, and the increased second voltage value does not exceed the preset voltage value, a target voltage value is determined based on changes in the first voltage value and changes in the second voltage value.
[0133] In some embodiments, the charging protocol of the electronic device includes a first charging protocol, and the first charging protocol is communicated via the second pin;
[0134] When any of the following situations occurs, charging is performed according to the first charging protocol:
[0135] Charging based on a target voltage value;
[0136] The first voltage value increases, the second voltage value does not increase, and the second voltage value does not exceed the preset voltage value.
[0137] In some embodiments, the charging protocol of the electronic device includes a second charging protocol;
[0138] When any of the following situations occurs, charging is performed in accordance with the second charging protocol, and the second charging protocol communicates through pins other than the second pin:
[0139] The second pin is open circuit;
[0140] The first voltage value is increased, the second voltage value is increased, and the increased second voltage value exceeds the preset voltage value;
[0141] The first voltage value increases, the second voltage value does not increase, and the second voltage value exceeds a preset voltage value.
[0142] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0143] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the charging method of the electronic device in the above embodiment.
[0144] Figure 6 is a block diagram of an electronic device 600 according to an exemplary embodiment.
[0145] Reference Figure 6 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0146] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0147] The memory 604 is configured to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0148] The power supply component 606 provides power to the various components of the electronic device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.
[0149] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0150] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0151] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0152] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0153] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0154] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0155] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0156] The embodiments of the present disclosure also provide a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the charging method of the electronic device in the above embodiment.
[0157] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0158] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for charging an electronic device, characterized in that: The charging port of the electronic device includes a first pin and a second pin, and the method includes: When the first pin and the second pin are short-circuited, determining a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin; Charging is performed based on the target voltage value, so that during the charging process, the second voltage value of the second pin does not exceed a preset voltage value.
2. The charging method according to claim 1, characterized in that: The determining a target voltage value associated with the first pin based on the voltage change of the first pin and the change of the second voltage value of the second pin comprises: Repeating the step of increasing the first voltage value until the first voltage value is increased and the second voltage value meets a preset condition, and determining the current first voltage value as the target voltage value; The second voltage value satisfies a preset condition that: the second voltage value is less than the preset voltage value, and the difference between the preset voltage value and the second voltage value is less than a first value.
3. The charging method according to claim 1, characterized in that: The determining a target voltage value associated with the first pin based on the voltage change of the first pin and the change of the second voltage value of the second pin comprises: The step of increasing the first voltage value is repeatedly performed until the first voltage value is increased to the maximum voltage value of the first pin and the second voltage value does not exceed the preset voltage value, and the maximum voltage value is determined as the target voltage value.
4. The charging method according to claim 2 or 3, characterized in that: The step of increasing the first voltage value includes: When the difference between the preset voltage value and the second voltage value is greater than a second value, the first voltage value is increased according to a first preset value; when the difference between the preset voltage value and the second voltage value is less than or equal to the second value, the first voltage value is increased according to the second preset value; wherein the second preset value is less than the first preset value; or, The first voltage value is increased according to a third preset value.
5. The charging method according to any one of claims 1 to 3, characterized in that: The method of determining a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin when the first pin and the second pin are short-circuited comprises: When the first voltage value increases, the second voltage value increases, and the increased second voltage value does not exceed the preset voltage value, the target voltage value is determined based on changes in the first voltage value and changes in the second voltage value.
6. The charging method according to claim 1, characterized in that: The charging protocol of the electronic device includes a first charging protocol, and the first charging protocol is communicated through the second pin; When any of the following situations occurs, charging is performed according to the first charging protocol: Charging based on the target voltage value; The first voltage value is increased, the second voltage value is not increased, and the second voltage value does not exceed the preset voltage value.
7. The charging method according to claim 1 or 6, characterized in that: The charging protocol of the electronic device includes a second charging protocol, and the second charging protocol is communicated through other pins except the second pin; When any of the following situations occurs, charging is performed in accordance with the second charging protocol: The second pin is disconnected; The first voltage value is increased, the second voltage value is increased, and the increased second voltage value exceeds the preset voltage value; The first voltage value is increased, the second voltage value is not increased, and the second voltage value exceeds the preset voltage value.
8. A charging device for an electronic device, characterized in that: The charging port of the electronic device comprises a first pin and a second pin, and the device comprises: a voltage value determination module configured to determine a target voltage value associated with the first pin based on a change in a first voltage value of the first pin and a change in a second voltage value of the second pin when the first pin and the second pin are short-circuited; The charging module is configured to charge based on the target voltage value so that the second voltage value of the second pin does not exceed a preset voltage value during the charging process.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 7.
