Disclosure of Invention
The invention mainly aims to provide a mobile terminal and a charging switching control method, and aims to solve the technical problem that the use experience of a user is reduced due to the fact that adverse effects are avoided in the switching process of a charging mode.
In order to achieve the above object, the present invention provides a mobile terminal having a wired charging mode and a wireless charging mode, the mobile terminal comprising:
the switching module is used for closing the wireless charging and starting the wired charging when the mobile terminal is currently in wireless charging and wired charging access exists;
the control module is used for judging whether the mobile terminal is switched from wired charging to wireless charging when the mobile terminal is detected to have a USB pull-out event currently, and shielding the USB pull-out event if the mobile terminal is switched from wired charging to wireless charging; when the current USB plug-in event of the mobile terminal is detected, judging whether the mobile terminal is switched from wireless charging to wired charging or not, if so, shielding the USB plug-in event, and reporting the current charging mode of the mobile terminal.
Optionally, the control module is further configured to:
when a USB pull-out event of the mobile terminal is detected, monitoring whether the mobile terminal is still in a wireless charging range or not, and if yes, determining that the mobile terminal is switched from wired charging to wireless charging; when detecting that the mobile terminal has a current USB plug-in event, monitoring whether the mobile terminal is still in a wireless charging range currently and the USB plug-in event is generated by starting wired charging, and if so, determining that the mobile terminal is switched from wireless charging to wired charging currently.
Optionally, the control module is further configured to:
and if the mobile terminal does not switch from wired charging to wireless charging currently, reporting the USB pull-out event.
Optionally, the control module is further configured to:
and if the mobile terminal does not switch from wireless charging to wired charging currently, reporting the USB insertion event.
Optionally, the control module is further configured to:
and if the mobile terminal has a USB insertion event currently and the wireless charging is switched to the wired charging, reporting that the current charging mode of the mobile terminal is the wired charging mode, and starting the wired charging.
Further, to achieve the above object, the present invention further provides a charging switching control method applied to a mobile terminal having a wired charging mode and a wireless charging mode, the charging switching control method comprising:
when the mobile terminal is currently charged wirelessly and wired charging is accessed, the wireless charging is closed and the wired charging is started;
when the USB pulling-out event of the mobile terminal is detected to exist currently, judging whether the mobile terminal is switched from wired charging to wireless charging currently, and if so, shielding the USB pulling-out event;
when the current USB plug-in event of the mobile terminal is detected, judging whether the mobile terminal is switched from wireless charging to wired charging or not, if so, shielding the USB plug-in event, and reporting the current charging mode of the mobile terminal.
Optionally, when it is detected that the USB unplugging event currently exists in the mobile terminal, the determining whether the mobile terminal currently performs the switching from the wired charging to the wireless charging includes:
when a USB pull-out event of the mobile terminal is detected, monitoring whether the mobile terminal is still in a wireless charging range or not, and if yes, determining that the mobile terminal is switched from wired charging to wireless charging;
when the USB plug-in event of the mobile terminal is detected to exist at present, the step of judging whether the mobile terminal is switched from wireless charging to wired charging or not currently comprises the following steps:
when detecting that the mobile terminal has a current USB plug-in event, monitoring whether the mobile terminal is still in a wireless charging range currently and the USB plug-in event is generated by starting wired charging, and if so, determining that the mobile terminal is switched from wireless charging to wired charging currently.
Optionally, the charge switching control method further includes:
and if the mobile terminal does not switch from wired charging to wireless charging currently, reporting the USB pull-out event.
Optionally, the charge switching control method further includes:
and if the mobile terminal does not switch from wireless charging to wired charging currently, reporting the USB insertion event.
Optionally, the charge switching control method includes:
and if the mobile terminal has a USB insertion event currently and the wireless charging is switched to the wired charging, reporting that the current charging mode of the mobile terminal is the wired charging mode, and starting the wired charging.
According to the method and the device, the reporting of the USB pulling-out event and the USB inserting event generated when the mobile terminal is in the state of switching the wireless charging mode into the wired charging mode is shielded according to the current charging state of the mobile terminal, so that various adverse effects generated in the switching process of the charging mode are avoided, and the use experience of a user in charging the mobile terminal by using the wired and wireless charging modes is further improved.
Detailed Description
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, fig. 1 is a circuit connection diagram of a charging module in a mobile terminal according to the present invention.
As shown in fig. 1, the mobile terminal has two charging modes: one is to connect with the external wired charging equipment through a USB port for wired charging; the other is to wirelessly charge with an external wireless charging device through a built-in wireless charging receiving and converting circuit.
Wherein, Battery is the mobile terminal Battery; the charge IC is a charging management integrated circuit of the mobile terminal; the PMIC is a power management integrated circuit of the mobile terminal; the Gator Board is a wireless charging component; BUCK is a voltage-reducing conversion circuit; the MCU is a microprocessor and is mainly responsible for wireless charging management of the mobile terminal.
Based on the charging module structure of the mobile terminal shown in fig. 1, the mobile terminal will necessarily involve the selection and switching of the charging mode, which is as follows:
firstly, the selection of a single charging mode, such as either selecting a USB wired charging mode or selecting a wireless charging mode, is simple in the charging selection process under such situations, and therefore, redundant description is not given.
Secondly, the two charging modes are selected simultaneously, for example, the selection is performed according to the priority level, and usually the default USB wired charging mode of the mobile terminal system is preferred. Under the situation, the charging sequence can correspond to two situations:
the first situation is as follows: the wired charging mode is firstly charged, and then the wireless charging mode is accessed. In such a situation, the wireless charging mode access will not be successful because the priority of the wired charging mode is higher.
Case two: the wireless charging mode is firstly charged, and then the wired charging mode is accessed. In such a situation, the access of the wired charging mode interrupts the wireless charging process, specifically, as shown in fig. 2, the power switching and communication timing diagram corresponding to the access of the wired charging mode in the wireless charging process.
As shown in fig. 2, when the mobile terminal is placed on the charging board of the external wireless charging device, VRECT will get up, IC State will enter REST State from OFF State, and after a series of initialization and other work, the mobile terminal will be informed through terminal INT _ AP before enable buck, and after obtaining the feedback of enable buck allowed to be performed by the mobile terminal, enable buck is performed, and at this time, the IC will enter WPT (wireless charging) stage, and during WPT stage, if there is USB access, VBUS corresponding to the USB access will get up, and at the same time, since the priority of IC defaults to USB is high, the USB buck will be disabled, and the AP controller will be informed through the terminal to handshake with the accessed external wired charging device, and after the handshake is successful, the corresponding USB charging loop will be opened through VBUS _ EN, at this time, the IC has wireless charging source (in wireless charging range), thus entering the READY state.
Based on the above embodiments of the mobile terminal, embodiments of the mobile terminal and the charging switching control method of the present invention are provided.
Referring to fig. 3, fig. 3 is a block diagram of a mobile terminal according to an embodiment of the present invention. In this embodiment, the mobile terminal has a wired charging mode and a wireless charging mode, for example, the wired charging mode is performed by using a USB connection mode, and the wireless charging mode is performed by using a magnetic resonance mode.
In order to avoid various adverse effects generated in the charging mode switching process, in this embodiment, the mobile terminal includes:
the switching module 210 is configured to close wireless charging and open wired charging when the mobile terminal is currently in wireless charging and wired charging access exists;
the control module 220 is configured to, when it is detected that a USB pull-out event currently exists in the mobile terminal, determine whether the mobile terminal currently performs a switch from wired charging to wireless charging, and if so, shield the USB pull-out event; when the current USB plug-in event of the mobile terminal is detected, judging whether the mobile terminal is switched from wireless charging to wired charging or not, if so, shielding the USB plug-in event, and reporting the current charging mode of the mobile terminal.
Wired charging is generally more efficient than wireless charging, and therefore, a mobile terminal system generally prefers wired charging by default. Therefore, in this embodiment, when the mobile terminal is currently performing wireless charging and there is wired charging access, the switching module 210 defaults to performing wired charging and needs to perform a switching process of the charging mode. It should be noted that, the charging mode switching in this embodiment is a process, and includes closing and exiting of wireless charging and accessing and opening of wired charging.
In this embodiment, the charging of the mobile terminal needs to be performed through connection (wireless connection or wired connection) with the external charging device, that is, the corresponding USB plug-in event or USB plug-out event is generated on the mobile terminal when the charging connection is established or disconnected between the mobile terminal and the external charging device. However, the USB pull-out event and the USB insertion event need to be reported to the application layer of the system by default, so that various adverse effects generated in the application layer for reporting the USB pull-out event or the USB insertion event, such as prompting a user to pull out or insert the USB device, etc., are avoided, and therefore the reporting of the USB pull-out event generated by disconnection of wired charging needs to be shielded.
In addition, it should be further described in this embodiment that shielding the USB pulling-out event or the USB inserting event does not only avoid that the USB device of the user is pulled out or inserted on the application layer, but also further avoids other adverse effects caused by the pulling-out or the inserting of the USB device, such as a low power alarm prompt generated after the wired charging device is pulled out when the mobile terminal is in a low power state, or a shutdown restart operation generated in a state where the charging machine is turned off.
Since the control module 220 shields the USB plug-out and plug-in events generated during the process of switching the mobile terminal from the wireless charging to the wired charging, the control module 220 is further configured to report the current charging mode of the mobile terminal after the switching from the wireless charging to the wired charging is successfully completed, so that a user can know the current charging mode of the mobile terminal.
Optionally, the control module 220 is further configured to: and if the mobile terminal has a USB insertion event currently and the wireless charging is switched to the wired charging, reporting that the current charging mode of the mobile terminal is the wired charging mode, and starting the wired charging. That is, if there is a USB insertion event generated by wired charging access in the switching process, it indicates that the switching is successful, so the application layer can be reported: the current charging mode of the mobile terminal is a wired charging mode. At the same time, the control module 220 will start to charge the battery in the mobile terminal in a wired charging manner.
In this embodiment, according to the current charging state of the mobile terminal, reporting of a USB pull-out event and a USB plug-in event generated when the mobile terminal is in a state where wireless charging is switched to wired charging is shielded, so that various adverse effects generated in a charging mode switching process are avoided, and the use experience of a user in charging the mobile terminal by using wired and wireless charging modes is further improved.
Further optionally, in another embodiment of the mobile terminal of the present invention, the control module 220 is specifically configured to:
when a USB pull-out event of the mobile terminal is detected, monitoring whether the mobile terminal is still in a wireless charging range or not, and if yes, determining that the mobile terminal is switched from wired charging to wireless charging; when detecting that the mobile terminal has a current USB plug-in event, monitoring whether the mobile terminal is still in a wireless charging range currently and the USB plug-in event is generated by starting wired charging, and if so, determining that the mobile terminal is switched from wireless charging to wired charging currently.
In this embodiment, only when the mobile terminal is currently performing wireless charging and has access to wired charging, and is within the wireless charging range, the mobile terminal can perform wireless-to-wired charging mode switching.
Considering that there may be a transition state during the switching process, such as wireless charging currently being performed and wired charging access, if there is an external influence during the switching process and the wireless charging is suddenly interrupted, in such a case, there are two charging operations: the first time is wireless charging, and the second time is wired charging after the wireless charging is interrupted by the outside world, that is, an active switching process from wireless charging to wired charging does not exist under the condition (that is, the wireless charging is actively cut off and the wired charging is started).
Therefore, whether the mobile terminal is currently in the wireless charging range or not is monitored, the specific monitoring mode is not limited, for example, whether a signal broadcasted by an external wireless charging device exists or not is monitored, and if the signal exists, the current switching from the wireless charging to the wired charging of the mobile terminal can be determined.
Further optionally, the control module 220 is further configured to: if the mobile terminal does not switch from wired charging to wireless charging currently, reporting the USB pulling-out event; and if the mobile terminal does not switch from wireless charging to wired charging currently, reporting the USB insertion event. Since the USB pull-out event and the USB plug-in event are not generated by switching the charging modes, the USB pull-out event and the USB plug-in event under the above situation can be reported to the system application layer of the mobile terminal.
Referring to fig. 4, fig. 4 is a schematic circuit diagram of a mobile terminal according to an embodiment of the present invention. For convenience of description and illustration, in this embodiment, hardware corresponding to each module in the mobile terminal is specifically illustrated.
In this embodiment, the mobile terminal mainly includes an AP Controller (Wireless Access Point Controller) and a Wireless charging receiving and converting terminal, where the AP Controller includes a switching module 210 and a control module 220.
As shown in fig. 4, in the process of wireless charging of the mobile terminal, when a wired USB is inserted, the receiving converter detects that a USB is inserted through the detection line, and then notifies the AP controller of the USB insertion through the signal line, and after receiving the notification, the AP controller sets a flag variable, for example, the set variable USBIN is 1, and then notifies the receiving converter to turn off the wireless charging through the control bus, and turns on the switch K to turn on the wired charging.
In the process that the receiving conversion terminal closes the wireless charging and opens the wired charging, the voltage output of an OUT line for performing the wireless charging is correspondingly closed, the USB voltage input for performing the wired charging is correspondingly opened by closing the switch K, and then a corresponding USB pull-OUT event and a corresponding USB plug-in event are generated on the AP controller, and a USB plug-in prompt is generated after the USB plug-OUT prompt is reported to an application layer, even the mobile terminal is shut down and restarted to influence the user experience, so that the USB pull-OUT event and the USB plug-in event which cause the adverse effects are required to be shielded.
When the AP controller detects a USB pull-out event, whether USBIN is equal to 1 or not is judged, namely whether the current mobile terminal switches from wireless charging to wired charging or not is judged, if yes, the USB pull-out event of the application layer is not reported, and therefore corresponding prompt or operation cannot be generated on the application layer of the mobile terminal. Similarly, when the AP controller further detects a USB insertion event, it first determines whether the USB is equal to 1, and if so, does not report the USB insertion event of the application layer, and does not generate a corresponding prompt or operation on the application layer of the mobile terminal. Finally, the flag variable is cleared, for example, setting USBIN to 0. In addition, since the charging type of the current mobile terminal is changed, the charging type of the current mobile terminal needs to be reported to the application layer. Meanwhile, the AP controller starts to charge the battery in the mobile terminal in a wired charging mode.
Referring to fig. 5, fig. 5 is a flowchart illustrating a charging switching control method according to an embodiment of the present invention. In this embodiment, the charge switching control method includes:
step S10, when the mobile terminal is currently in wireless charging and wired charging access exists, the wireless charging is closed and the wired charging is started;
step S20, when detecting that the mobile terminal has a USB pull-out event currently, judging whether the mobile terminal switches from wired charging to wireless charging currently, if so, shielding the USB pull-out event;
wired charging is generally more efficient than wireless charging, and therefore, a mobile terminal system generally prefers wired charging by default. Therefore, in this embodiment, when the mobile terminal is currently performing wireless charging and there is wired charging access, it is determined that wired charging is performed and a process of switching the charging method is required. It should be noted that, the charging mode switching in this embodiment is a process, and includes closing and exiting of wireless charging and accessing and opening of wired charging.
In this embodiment, the charging of the mobile terminal needs to be performed through connection (wireless connection or wired connection) with the external charging device, that is, the corresponding USB plug-in event or USB plug-out event is generated on the mobile terminal when the charging connection is established or disconnected between the mobile terminal and the external charging device. However, the USB pull-out event and the USB insertion event need to be reported to the application layer of the system by default, so that various adverse effects generated in the application layer for reporting the USB pull-out event or the USB insertion event, such as prompting a user to pull out or insert the USB device, etc., are avoided, and therefore the reporting of the USB pull-out event generated by disconnection of wired charging needs to be shielded.
In addition, it should be further described in this embodiment that shielding the USB pulling-out event or the USB inserting event does not only avoid that the USB device of the user is pulled out or inserted on the application layer, but also further avoids other adverse effects caused by the pulling-out or the inserting of the USB device, such as a low power alarm prompt generated after the wired charging device is pulled out when the mobile terminal is in a low power state, or a shutdown restart operation generated in a state where the charging machine is turned off.
Step S30, when detecting that the mobile terminal has a USB plug-in event at present, judging whether the mobile terminal switches from wireless charging to wired charging at present, if so, shielding the USB plug-in event, and reporting the charging mode of the current mobile terminal.
In the process of switching the mobile terminal from wireless charging to wired charging, the mobile terminal shields USB plug-out and plug-in events generated in the process, so that a user can know the current charging mode of the mobile terminal conveniently, and the charging mode of the current mobile terminal is reported after the switching from wireless charging to wired charging is completed successfully.
Optionally, the charging switching control method further includes: and if the mobile terminal has a USB insertion event currently and the wireless charging is switched to the wired charging, reporting that the current charging mode of the mobile terminal is the wired charging mode, and starting the wired charging. That is, if there is a USB insertion event generated by wired charging access in the switching process, it indicates that the switching is successful, so the application layer can be reported: the current charging mode of the mobile terminal is a wired charging mode. Meanwhile, the mobile terminal will start to charge the battery in the mobile terminal in a wired charging mode.
In this embodiment, according to the current charging state of the mobile terminal, reporting of a USB pull-out event and a USB plug-in event generated when the mobile terminal is in a state where wireless charging is switched to wired charging is shielded, so that various adverse effects generated in a charging mode switching process are avoided, and the use experience of a user in charging the mobile terminal by using wired and wireless charging modes is further improved.
Further, a flow chart of another embodiment of the charging switching control method of the present invention is schematically shown. In this embodiment, the step S20 includes: when a USB pull-out event of the mobile terminal is detected, monitoring whether the mobile terminal is still in a wireless charging range or not, and if yes, determining that the mobile terminal is switched from wired charging to wireless charging;
the step S30 includes: when the current USB inserting event of the mobile terminal is detected, whether the mobile terminal is still in a wireless charging range or not is monitored, and the USB inserting event is generated by starting wired charging, and if yes, the mobile terminal is determined to be switched from the wireless charging to the wired charging currently.
In this embodiment, only when the mobile terminal is currently performing wireless charging and has access to wired charging, and is within the wireless charging range, the mobile terminal can perform wireless-to-wired charging mode switching.
Considering that there may be a transition state during the switching process, such as wireless charging currently being performed and wired charging access, if there is an external influence during the switching process and the wireless charging is suddenly interrupted, in such a case, there are two charging operations: the first time is wireless charging, and the second time is wired charging after the wireless charging is interrupted by the outside world, that is, an active switching process from wireless charging to wired charging does not exist under the condition (that is, the wireless charging is actively cut off and the wired charging is started).
Therefore, whether the mobile terminal is currently in the wireless charging range or not is monitored, the specific monitoring mode is not limited, for example, whether a signal broadcasted by an external wireless charging device exists or not is monitored, and if the signal exists, the current switching from the wireless charging to the wired charging of the mobile terminal can be determined.
Further optionally, the charge switching control method further includes: if the mobile terminal does not switch from wireless charging to wired charging currently, reporting a USB pull-out event; and if the mobile terminal does not switch from wireless charging to wired charging currently, reporting a USB insertion event. Since the USB pull-out event and the USB plug-in event are not generated by switching the charging modes, the USB pull-out event and the USB plug-in event under the condition can be reported to the system application layer of the mobile terminal.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.