Disclosure of Invention
In view of the above disadvantages of the prior art, an object of the present invention is to provide a method and a system for detecting a charging voltage, which can detect a peak value of a charging current and convert the peak value into a corresponding charging voltage value, thereby accurately detecting a magnitude of the charging voltage output by a charger and improving accuracy of detecting the charging voltage.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method for detecting a charging voltage includes the following steps:
A. the current detection module detects the charging current of the mobile terminal when the mobile terminal is charged;
B. detecting an average peak value of a plurality of peak values of the current charging current within a preset time by a peak value detection module;
C. and converting the average peak value of the charging current into a corresponding charging voltage value by a voltage conversion module.
In the method for detecting a charging voltage, the step B includes:
b1, detecting a plurality of peak values of the current charging current in a preset time by a peak value detection unit;
b2, performing integral summation on the plurality of peak values within a preset time by an integral unit, and outputting a summation result;
and B3, calculating the average value of a plurality of peak values of the charging current in a preset time as an average peak value by an average value calculating unit according to the summation result.
In the method for detecting a charging voltage, the step C is followed by:
D. judging whether the charging voltage value meets the preset charging condition of the current mobile terminal or not by a judging module, if so, executing the step E; if not, stopping charging;
E. the control module controls the charger to continuously output the current charging voltage to charge the mobile terminal.
In the method for detecting a charging voltage, after the step E, the method further includes:
F. and filtering the current charging current by a filtering module.
In the method for detecting a charging voltage, the step C specifically includes: and converting the average peak value of the charging current into a corresponding charging voltage value by a voltage conversion module according to the current power value.
A detection system of a charging voltage, comprising:
the current detection module is used for detecting the charging current of the mobile terminal when the mobile terminal is charged;
the peak value detection module is used for detecting the average peak value of a plurality of peak values of the current charging current within the preset time;
and the voltage conversion module is used for converting the average peak value of the charging current into a corresponding charging voltage value.
In the charging voltage detection system, the peak detection module includes:
the peak value detection unit is used for detecting a plurality of peak values of the current charging current within preset time;
the integration unit is used for integrating and summing the plurality of peak values within preset time and outputting a summation result;
and the average value calculating unit is used for calculating the average value of a plurality of peak values of the charging current within preset time according to the summation result to serve as an average peak value.
The charging voltage detection system further comprises:
the judging module is used for judging whether the charging voltage value meets the preset charging condition of the current mobile terminal;
and the control module is used for controlling the charger to continuously output the current charging voltage to charge the mobile terminal when the charging voltage value meets the preset charging condition of the current mobile terminal.
The charging voltage detection system further comprises:
and the filtering module is used for filtering the current charging current.
In the charging voltage detection system, the voltage conversion module is specifically configured to convert the average peak value of the charging current into a corresponding charging voltage value according to a current power value.
Compared with the prior art, in the detection method and the detection system of the charging voltage, the detection method of the charging voltage detects the charging current of the mobile terminal when the mobile terminal is charged through the current detection module; then, detecting the average peak value of a plurality of peak values of the current charging current in preset time by a peak value detection module; and then the average peak value of the charging current is converted into a corresponding charging voltage value by the voltage conversion module, and the average peak value of the charging current is detected and converted into a corresponding charging voltage value, so that the size of the charging voltage output by the charger is accurately detected, the accuracy of charging voltage detection is improved, the requirements of different charging currents and charging times of the intelligent mobile terminal are met, and the user experience is improved.
Detailed Description
In view of the disadvantages of the prior art, such as the low accuracy of the mobile terminal in determining the magnitude of the output voltage of the charger, the present invention provides a method and a system for detecting the charging voltage, which can detect the magnitude of the charging voltage output by the charger accurately and improve the accuracy of the detection of the charging voltage by detecting the average peak value of the charging current and converting the average peak value into a corresponding charging voltage value.
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, the method for detecting a charging voltage according to the present invention includes the following steps:
s100, a current detection module detects the charging current of the mobile terminal when the mobile terminal is charged;
s200, detecting an average peak value of a plurality of peak values of the current charging current within a preset time by a peak value detection module;
and S300, converting the average peak value of the charging current into a corresponding charging voltage value by a voltage conversion module.
The charging current of the mobile terminal is detected by the current detection module when the mobile terminal is charged; then, detecting the average peak value of a plurality of peak values of the current charging current in preset time by a peak value detection module; and then the voltage conversion module converts the average peak value of the charging current into a corresponding charging voltage value, so that the magnitude of the charging voltage output by the charger can be accurately detected by detecting the average peak value of the charging current and converting the average peak value of the charging current into the corresponding charging voltage value. The charging voltage output by the detection charger is converted into the charging current of the detection mobile terminal, because if the charging voltage of the charger is directly detected, the voltage output of the charger can only be explained, but the charging current does not exist, and the detection efficiency is improved by detecting the charging current and explaining that the voltage output of the charger is ensured at the moment.
Specifically, the step S300 includes converting, by the voltage conversion module, the average peak value of the charging current into a corresponding charging voltage value according to the current power value. In specific implementation, different charging voltages of the intelligent mobile terminal need to provide different charging currents, and under the condition that the power P supportable by the intelligent mobile terminal is constant, according to P = UI, the larger the charging voltage is, the smaller the charging current is. The charger supports the output of three charging voltages, and the charging voltage is U1, U2, U3. The charging current I1< I2< I3 is determined by the power P, so that the magnitude of the charging voltage can be accurately obtained through the current power value and the peak value of the charging current.
Further, the step S200 includes:
s201, detecting a plurality of peak values of the current charging current in preset time by a peak value detection unit;
s202, performing integral summation on the plurality of peak values within preset time by an integral unit, and outputting a summation result;
and S203, calculating the average value of a plurality of peak values of the charging current in a preset time as an average peak value by an average value calculating unit according to the summation result.
The invention judges the output of the current by detecting the peak value of the charging current, namely taking the output of three charging voltages supported by the charger as an example, three charging currents I1, I2 and I3 are corresponded, the average peak value of a plurality of peak values of the current charging current in the preset time is detected by the peak value detection module, and the current charging current is judged to be any specific charging current in I1, I2 and I3. In specific implementation, taking the charging current I1 as an example, the peak detection unit detects a plurality of peaks of the current charging current within a preset time, that is, within the preset time t, the peak detection unit detects a plurality of peaks of the charging current I1 as I1p1, I1p2, I1p3, …, I1 pn; then, the integration unit integrates and sums the plurality of peak values within a preset time and outputs a summation result, namely, the integration unit integrates the plurality of peak values I1p1, I1p2, I1p3, … and I1pn of the charging current I1 within the preset time t and outputs the integration and summation result; and then, an average value calculating unit calculates an average value of a plurality of peak values of the charging current in a preset time according to the summation result, wherein the average value is used as an average peak value, because the peak value detecting unit can always detect the existence of the current peak value in the preset time t, the charging current exists when the charger module has voltage output, therefore, the accuracy of current detection is improved by judging the size of the charging current by calculating the average value of the plurality of peak values, and because the average values of the current I1= P/U1, the current I2= P/U2, the current I3= P/U3, and the peak values of the current I1, I2 and I3 are different, the size of the charging voltage output by the current charger can be accurately judged by detecting the charging current.
In the method for detecting a charging voltage, after step S300, the method further includes:
s400, judging whether the charging voltage value meets the preset charging condition of the current mobile terminal or not by a judging module, and if so, executing the step S500; if not, stopping charging;
and S500, controlling the charger to continuously output the current charging voltage to charge the mobile terminal by the control module.
After detecting the charging voltage output by the current charger, the judging module judges whether the current charging voltage can meet the preset charging condition of the current mobile terminal, if so, the control module controls the charger to continuously output the current charging voltage to charge the mobile terminal; if not, the charging is stopped. For example, when the mobile terminal is set to the fast charging mode, a large charging current is needed, the judgment module judges whether the charging voltage meets the requirement of the charging current, if so, the control module controls the charger to continuously output the current charging voltage to charge the mobile terminal, and if not, the charging is stopped, so that a user can check or perform corresponding charging mode adjustment, the requirements of the user on different charging modes are met, and the user experience is improved.
Further, after the step S500, the method further includes: and S600, filtering the current charging current by a filtering module. Namely, when the control module controls the charger to continuously output the current charging voltage to normally charge the mobile terminal, the filtering module carries out filtering processing on the current charging current and then provides the current charging current for the mobile terminal to charge, and through the processing of the filtering module on the charging current, the current output channel can output smooth and stable charging current, so that the safety and the stability of the charging process are improved.
The invention also correspondingly provides a detection system of the charging voltage, as shown in fig. 2, the detection system of the charging voltage comprises a current detection module, a peak detection module and a voltage conversion module, the current detection module, the peak detection module and the voltage conversion module are sequentially connected, wherein the current detection module is used for detecting the charging current of the mobile terminal when the mobile terminal is charged; the peak value detection module is used for detecting the average peak value of a plurality of peak values of the current charging current within preset time; the voltage conversion module is used for converting the average peak value of the charging current into a corresponding charging voltage value.
The charging current of the mobile terminal is detected by the current detection module when the mobile terminal is charged; then, detecting the average peak value of a plurality of peak values of the current charging current in preset time by a peak value detection module; and then the voltage conversion module converts the average peak value of the charging current into a corresponding charging voltage value, so that the magnitude of the charging voltage output by the charger can be accurately detected by detecting the average peak value of the charging current and converting the average peak value of the charging current into the corresponding charging voltage value.
Specifically, the voltage conversion module is specifically configured to convert the average peak value of the charging current into a corresponding charging voltage value according to a current power value. Please refer to the corresponding embodiments of the above methods.
Further, the peak detection module comprises a peak detection unit, an integration unit and an average value calculation unit, the peak detection unit, the integration unit and the average value calculation unit are sequentially connected, the peak detection unit is further connected with the current detection module, and the average value calculation unit is further connected with the voltage conversion module. The peak value detection unit is used for detecting a plurality of peak values of the current charging current within preset time; the integration unit is used for integrating and summing the plurality of peak values within preset time and outputting a summation result; the average value calculating unit is used for calculating the average value of a plurality of peak values of the charging current in preset time according to the summation result, and the average value is used as an average peak value. Please refer to the corresponding embodiments of the above methods.
The detection system of the charging voltage further comprises a judgment module and a control module, wherein the judgment module is connected with the voltage conversion module through the control module and is used for judging whether the charging voltage value meets the preset charging condition of the current mobile terminal; the control module is used for controlling the charger to continuously output the current charging voltage to charge the mobile terminal when the charging voltage value meets the preset charging condition of the current mobile terminal. Please refer to the corresponding embodiments of the above methods.
Furthermore, the charging voltage detection system further comprises a filtering module, the filtering module is connected with the control module, and the filtering module is used for filtering the current charging current. Please refer to the corresponding embodiments of the above methods.
In summary, in the detection method and the detection system for the charging voltage provided by the present invention, the charging voltage detection method detects the charging current of the mobile terminal through the current detection module when the mobile terminal is charged; then, detecting the average peak value of a plurality of peak values of the current charging current in preset time by a peak value detection module; and then the average peak value of the charging current is converted into a corresponding charging voltage value by the voltage conversion module, and the average peak value of the charging current is detected and converted into a corresponding charging voltage value, so that the size of the charging voltage output by the charger is accurately detected, the accuracy of charging voltage detection is improved, the requirements of different charging currents and charging times of the intelligent mobile terminal are met, and the user experience is improved.
It should be understood that equivalents and modifications of the technical solution and inventive concept thereof may occur to those skilled in the art, and all such modifications and alterations should fall within the scope of the appended claims.