A kind of intelligent charging method embedding mobile phone type thermal imager
Technical field
The present invention relates to the equipment charge based on USB port, particularly relating to a kind of intelligent charging method for embedding mobile phone type thermal imager.
Background technology
Thermal imager at present owing to embedding mobile phone type also compares shortage in the market, a kind of charging modes cutting off mobile phone and power to thermal imager is proposed for the charging modes between mobile phone and thermal imager, and propose the method that thermal imager charges to mobile phone, so that the time that mobile phone can be made to coordinate thermal imager to use is more lasting.
Summary of the invention
The object of the present invention is to provide a kind of intelligent charging method embedding mobile phone type thermal imager, to realize the USB intelligent charge to smart mobile phone.
For achieving the above object, the solution of the present invention is achieved in that
The invention provides a kind of intelligent charging method embedding mobile phone type thermal imager, the method comprises:
When mobile phone is connected on thermal imager by USB interface, low electricity early warning voltage threshold and battery of mobile phone exit charging voltage threshold value and compare the current battery voltage value of mobile phone Real-time Collection mobile phone with battery of mobile phone respectively, judge whether mobile phone enters charged state according to comparative result; The battery electric quantity value that simultaneously mobile phone Real-time Collection thermal imager is current and the current battery electric quantity value of mobile phone compare calculating, perform the charging method after entering charged state, and in this charging modes, cut away by the mobile phone as main frame to as the thermal imager supply power mode from machine, ensured power supply one-way.
It is described when mobile phone is connected on thermal imager by USB interface, the battery voltage value that Real-time Collection thermal imager is current and the current battery voltage value of mobile phone, it is specially: described mobile phone detects the connection status of thermal imager in real time, when connection status is normal, judge whether to enter intelligent charge pattern, and when judging to enter described intelligent charge pattern, the battery voltage value that Real-time Collection thermal imager is current and the current battery voltage value of mobile phone.
Low electricity early warning voltage threshold and battery of mobile phone exit charging voltage threshold value and compare the current battery voltage value of described mobile phone Real-time Collection mobile phone with battery of mobile phone respectively, judge whether mobile phone enters charged state according to comparative result, be specially: when the current battery voltage value of the mobile phone of described collection is not higher than battery of mobile phone low electricity early warning voltage threshold, arranging the flag bit flag opening charge function is TRUE; When the battery voltage value that the mobile phone of described collection is current exits charging voltage threshold value higher than battery of mobile phone, arranging the flag bit flag opening charge function is FALSE.Wherein the low electricity early warning voltage threshold of battery of mobile phone exits charging voltage threshold value lower than battery of mobile phone.
The battery electric quantity value that described mobile phone Real-time Collection thermal imager is current and the current battery electric quantity value of mobile phone compare calculating, perform the charging method after entering charged state, are specially:
Step 1, arrange thermal imager be mobile phone charging initial voltage value be
, when setting thermal imager electricity is mobile phone charging with the function of magnitude of voltage change be in time
, setting mobile phone electricity when charging with the function of magnitude of voltage change is in time
;
Step 2, the battery electric quantity value gathering current thermal imager and mobile phone current electric quantity value are respectively
with
, and to preserve, and initial voltage variation value is set is;
Step 3, the battery electric quantity value gathering subsequent time thermal imager and mobile phone current electric quantity value are respectively
with
, then the charging voltage value of subsequent time is set
for:
Wherein
for judging the threshold value increasing or reduce charging voltage.
Step 4, subsequent time repeat step 2,3.
In this charging modes described, to cut away by the mobile phone as main frame to as the thermal imager supply power mode from machine, thermal imager can be avoided to occur charging reflux problem.
Invention increases Consumer's Experience, make the service time of mobile phone thermal imager more lasting.
Accompanying drawing explanation
Fig. 1 is the flow chart of the intelligent charging method of a kind of mobile phone thermal imager of the present invention.
Embodiment
Below in conjunction with specific embodiment, technical scheme of the present invention is further elaborated.
The present invention is directed to mobile phone when being connected with thermal imager, a kind of intelligent charging method about mobile phone proposed, its core concept is: when mobile phone is connected on thermal imager by USB interface, low electricity early warning voltage threshold and battery of mobile phone exit charging voltage threshold value and compare the current battery voltage value of mobile phone Real-time Collection mobile phone with battery of mobile phone respectively, judge whether mobile phone enters charged state according to comparative result; The battery electric quantity value that simultaneously mobile phone Real-time Collection thermal imager the is current battery electric quantity value current with mobile phone compares calculating, and execution enters the charging method after charged state.
Below in conjunction with Fig. 1, the intelligent charging method of a kind of mobile phone thermal imager proposed by the invention is described in detail, mainly comprises the following steps:
1, mobile phone is connected with thermal imager by USB interface;
2, mobile phone judges whether user selects to enter intelligent charge pattern, if perform step 3, otherwise performs step 8; (mobile phone detects USB interface connection state in real time, when detection of handset is connected with thermal imager, then judges whether user selects to enter intelligent charge pattern.So-called intelligent charge pattern, refer to after mobile phone enters intelligent charge pattern, thermal imager can charge to mobile phone according to charging method of the present invention; After mobile phone does not enter intelligent charge pattern, thermal imager will not charge for mobile phone.Whether enter intelligent charge pattern, can be selected by the user interface of mobile phone by user.)
3, mobile phone enters intelligent charge pattern;
4, under intelligent charge pattern, mobile phone is by its software systems Real-time Collection current phone battery voltage value, and low electricity early warning voltage threshold and battery of mobile phone exit charging voltage threshold value and compare with battery of mobile phone respectively;
5, cell phone software will judge that whether current phone battery voltage value is lower than battery of mobile phone low electricity early warning voltage threshold, if lower than entering step 6, otherwise enters step 8;
6, mobile phone enters charging and data transmission state;
The concrete steps of wherein charging are:
Step 1, arrange thermal imager be mobile phone charging initial voltage value be
, when setting thermal imager electricity is mobile phone charging with the function of magnitude of voltage change be in time
, setting mobile phone electricity when charging with the function of magnitude of voltage change is in time
;
Step 2, the battery electric quantity value gathering current thermal imager and mobile phone current electric quantity value are respectively
with
, and to preserve, and initial voltage variation value is set is;
Step 3, the battery electric quantity value gathering subsequent time thermal imager and mobile phone current electric quantity value are respectively
with
, then the charging voltage value of subsequent time is set
for:
Wherein
for judging the threshold value increasing or reduce charging voltage.
Step 4, subsequent time repeat step 2,3.
7, cell phone software will judge whether current phone battery voltage value exits charging voltage threshold value higher than battery of mobile phone, if higher than entering step 8, otherwise enters step 6;
8, mobile phone enters single data-transmission mode.In this mode, mobile phone Real-time Collection current phone battery voltage value, low electricity early warning voltage threshold and battery of mobile phone exit charging voltage threshold value and compare with battery of mobile phone respectively, and judge that whether current phone battery voltage value is lower than battery of mobile phone low electricity early warning voltage threshold, if yes then enter step 3.