Disclosure of Invention
In view of this, embodiments of the present invention provide a charging control method, a charging control system, a charging box, and a storage medium, so as to solve the problem that the charging box has high power consumption, and cannot continue to charge an earphone due to too low power consumption after being used for a long time or being idle, or even has abnormal functions, which affects user experience.
The technical scheme adopted by the embodiment of the invention for solving the technical problems is as follows:
according to an aspect of an embodiment of the present invention, there is provided a charging control method applied to a charging box, wherein the charging control method includes:
when detecting that no earphone is in the charging box, controlling the charging box to enter a sleep mode, if the charging box is in an open state, waking up the charging box every first preset time, and detecting whether an earphone is in the charging box;
when detecting that the earphone is charged in the charging box, the charging box inquires the electric quantity of the earphone regularly, and when the electric quantity of the earphone is full, the charging voltage is closed, and the charging box is controlled to enter a sleep mode.
Preferably, when detecting that there is an earphone in the charging box to charge, regularly inquiring the electric quantity of the earphone, when the electric quantity of the earphone is full, closing the charging voltage, and controlling the charging box to enter the sleep mode further comprises:
when the charging box enters the sleep mode and reaches a second preset time, waking up the charging box, detecting the electric quantity of the earphone, and judging whether the electric quantity of the earphone is full;
if the earphone is in a full power state, the charging box is controlled to enter a sleep mode again;
and if the electric quantity of the earphone is in a non-full-electricity state, starting charging voltage to supplement electricity for the earphone, and controlling the charging box to enter a sleep mode after the earphone is supplemented with the electricity.
Preferably, the charge control method further includes:
and when the electric quantity of the charging box is lower than a preset threshold value, controlling the charging box to actively enter a sleep mode.
Preferably, the charge control method further includes:
when detecting that there is the external charger to insert for the box that charges, the box that charges continuously gives the earphone charges, when the earphone with the box that charges all is full of, control the pilot lamp of the box that charges instructs to charge and accomplishes.
Preferably, the charge control method further includes:
when a control instruction for entering a shipping mode is received, the charging box is controlled to enter the shipping mode according to the control instruction, and all functions of the charging box are in a closed state in the shipping mode and do not actively supplement electric quantity for the earphone.
Preferably, the charge control method further includes:
when the box cover of the charging box is closed or opened, a corresponding box cover closing/opening instruction is sent to the earphone, so that the earphone identifies the state of the box cover of the charging box according to the box cover closing/opening instruction, when the box cover is closed, the Bluetooth connection is disconnected, the charging box enters a dormant state, and when the box cover is opened, the Bluetooth is opened, and the charging box is restored to a working state.
Preferably, the charge control method further includes:
when the charging box is in a sleep mode, if a preset trigger event occurs, waking up the charging box; the preset trigger event comprises at least one of opening/closing of a box cover, entering of the charging box into USB charging and timing.
According to another aspect of the embodiments of the present invention, there is provided a charging control system applied to a charging box, the charging control system including:
the first control unit is used for controlling the charging box to enter a sleep mode when no earphone is detected in the charging box, and awakening the charging box once every first preset time if the charging box is in an open state to detect whether an earphone is put into the charging box;
and the second control unit is used for inquiring the electric quantity of the earphone at regular time when the charging box is detected to be charged with the earphone, and closing the charging voltage to control the charging box to enter a sleep mode when the electric quantity of the earphone is full.
According to a further aspect of an embodiment of the present invention, there is provided a charging box including a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the charging control method according to any one of the above.
According to still another aspect of an embodiment of the present invention, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the charging control method according to any one of the above.
According to the charging control method, the charging control system, the charging box and the storage medium provided by the embodiment of the invention, the charging box is controlled to enter the sleep mode when the charging box is detected to be in the idle state or the earphone in the charging box is full of electric quantity, so that the power consumption of the charging box can be reduced, the waste of electric quantity caused by long-time use or idling of the charging box is avoided, the endurance time of the charging box is prolonged, and the user experience is improved.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, an external architecture of a charging box 1 provided in the embodiment of the present invention includes an earphone 2 and a charger 3, wherein the charging box 1 includes a USB interface, and the charger 3 is electrically connected to the charging box 1 through the USB interface to charge the charging box 1; the charging box 1 is internally provided with a charging contact and a serial port contact, and the charging box 1 is electrically connected with the earphone 2 through the charging contact and is in communication connection with the earphone 2 through the serial port contact. Preferably, the charging contact and the serial contact may share a metal contact. Preferably, the headset 2 includes, but is not limited to, a TWS Bluetooth headset 2.
Based on the above system configuration, the following embodiments of the present invention are proposed.
Example one
Fig. 2 is a schematic diagram of a specific implementation flow of a charging control method according to an embodiment of the present invention, where an execution main body of the method is the charging box 1 shown in fig. 1. Referring to fig. 1, the charging control method provided in this embodiment includes:
step S201, when detecting that no earphone 2 is in the charging box 1, controlling the charging box 1 to enter a sleep mode, if the charging box 1 is in an open box state, waking up the charging box 1 once every first preset time, and detecting whether an earphone 2 is put into the box.
In this embodiment, when the charging box 1 detects that there is no earphone 2 in the charging box in the open state, the charging box 1 actively enters the sleep mode, and then wakes up once every first preset time to detect whether there is an earphone 2 entering the charging box, and if it is detected that there is no earphone 2 entering the charging box, the charging box enters the sleep mode again; if it is detected that the headset 2 is plugged, the charging control flow after the headset 2 is plugged is executed according to the flow in step S202. Preferably, the first preset time is 10 s. When the charging box 1 detects that no earphone 2 exists in the charging box under the state that the box cover is closed, the charging box actively enters a long-time sleep mode. When the charging box 1 is in a sleep mode, the MCU in the charging box 1 is in a sleep state, and peripheral devices with large power consumption in the charging box 1 are, for example: the serial port, the ADC detection and the charging voltage are all in a closed state.
Step S202, when detecting that the earphone 2 is charged in the charging box 1, regularly inquiring the electric quantity of the earphone 2, and when the electric quantity of the earphone 2 is full, closing the charging voltage and controlling the charging box 1 to enter a sleep mode.
In this embodiment, when charging the box 1 in have earphone 2 to charge, the box 1 that charges can pass through the serial ports with earphone 2 communication regularly inquires the electric quantity of earphone 2, when inquiring earphone 2's electric quantity is full of, the box 1 that charges closes the charging voltage of the contact that charges that earphone 2 corresponds. Because there may be two earphones 2 simultaneously in the box 1 that charges, the box 1 that charges can the charging voltage that one of them earphone 2 corresponds of individual control closes or opens, only when two earphones 2 in the box 1 that charges all charge the back, just control charge box 1 gets into sleep mode.
Preferably, when the charging box 1 is in the sleep mode, if a preset trigger event occurs, the charging box 1 is awakened; the preset trigger event comprises at least one of opening/closing of a box cover, entering of the charging box 1 into USB charging and timing.
Preferably, when detecting that an external charger 3 is inserted into the charging box 1 to charge, the charging box 1 continuously charges the earphone 2, and when the electric quantity of the earphone 2 and the electric quantity of the charging box 1 are full, the indicator light of the charging box 1 is controlled to indicate that the charging is completed.
In this embodiment, when the charging box 1 is in the sleep mode, if the box of the charging box 1 is turned on or off, the charging box 1 is triggered to switch from the sleep mode to the wake-up state, and whether the earphone 2 is in the charging box 1 is detected, and then the process flow of steps S201 and S202 is entered.
In this embodiment, when the box 1 that charges is in sleep mode, if there is the insertion of external charger 3 the USB interface of box 1 that charges gives the box 1 that charges, then can trigger the box 1 that charges switches to the state of awakening from sleep mode, the box 1 that charges can not enter into sleep mode under USB charging state, can close the charging voltage when earphone 2 charges and accomplishes, but the MCU and ADC, the serial ports etc. of box 1 that charges still are in normal operating condition, just the box 1 that charges can control the pilot lamp of box 1 that charges and instruct to charge and accomplish after self electric quantity and earphone 2 electric quantity all are full of.
Preferably, when the box cover is closed or opened, the charging box 1 sends a corresponding box cover closing/opening instruction to the earphone 2, so that the earphone 2 identifies the state of the box cover of the charging box 1 according to the box cover closing/opening instruction, when the box cover is closed, the Bluetooth connection is disconnected, the dormant state is entered, and when the box cover is opened, the Bluetooth is opened, and the working state is recovered. Preferably, be provided with magnet on the lid of box 1 charges, be provided with hall sensor in the box 1 charges, box 1 charges passes through hall sensor with opening or closing of magnetic induction identification lid between the magnet.
In this embodiment, when the charging box 1 detects an action of closing or opening the box cover, the charging box switches between a sleep state and an awake state, and simultaneously sends a corresponding box cover closing or opening instruction to the earphone 2 through the serial port, so that the earphone 2 identifies the state of the box cover of the charging box 1 according to the instruction, and when the earphone 2 detects that the box cover is closed, the Bluetooth connection with the terminal device is disconnected, and the charging box enters the sleep state, so as to further save electric quantity; when the box cover is opened, the earphone 2 is switched to the working state from the dormant state, and the Bluetooth is opened, so that the earphone 2 can be directly connected to the terminal device after being taken out of the box, and the user experience is improved.
Above can find out that the control method that charges that this embodiment provided is because when detecting that the box 1 that charges is in idle state or the earphone 2 electric quantity in the box 1 that charges is full of, control the box 1 that charges and get into sleep mode, make the MCU of box 1 that charges enters into the low-power consumption state, closes the ADC, the serial ports and the charging voltage of box 1 that charges simultaneously to can reduce the consumption of box 1 that charges, avoid the waste of the box 1 electric quantity that charges, prolong the time of endurance of box 1 that charges, promote user experience.
Example two
Fig. 3 is a schematic diagram of a specific implementation flow of a charging control method according to a second embodiment of the present invention, where an execution main body of the method is the charging box 1 shown in fig. 1. Referring to fig. 3, the charging control method provided in this embodiment further includes:
step S301, when detecting that no earphone 2 is in the charging box 1, controlling the charging box 1 to enter a sleep mode, if the charging box 1 is in an open box state, waking up the charging box 1 once every first preset time, and detecting whether an earphone 2 is put into the box.
Step S302, when detecting that the earphone 2 is charged in the charging box 1, regularly inquiring the electric quantity of the earphone 2, and when the electric quantity of the earphone 2 is full, closing the charging voltage and controlling the charging box 1 to enter a sleep mode.
It should be noted that, since the specific implementation manners of step S301 to step S302 in this embodiment are completely the same as the implementation manners of step S201 to step S202 in the previous embodiment, detailed descriptions thereof are omitted here.
Step S303, when the charging box 1 enters the sleep mode and reaches a second preset time, waking up the charging box 1, detecting the electric quantity of the earphone 2, and judging whether the electric quantity of the earphone 2 is full; if the earphone 2 is in a full-power state, the charging box 1 is controlled to enter a sleep mode again; if the electric quantity of the earphone 2 is in a non-full-electricity state, starting charging voltage to supplement electricity for the earphone 2, and controlling the charging box 1 to enter a sleep mode after the electricity is supplemented fully.
In this embodiment, when the headset 2 is not used for a long time after being fully charged with the charging box 1, the charging box 1 wakes up once every second preset time to inquire the remaining power of the headset 2, if the remaining power of the headset 2 is less than 100%, the charging voltage is turned on to supplement power for the headset 2, and the charging voltage is turned off again until the headset 2 is fully charged, so as to enter the sleep mode; if the remaining power of the headset 2 is 100%, the sleep mode is entered again. Therefore, the problem that the power of the earphone 2 is lost due to the fact that the earphone 2 is not used for a long time and the user finds that the power of the earphone 2 is insufficient when the user uses the earphone can be avoided.
Preferably, the charge control method further includes:
step S304, when a control instruction for entering a shipping mode is received, the charging box 1 is controlled to enter the shipping mode according to the control instruction, and all functions of the charging box 1 are in a closed state in the shipping mode and do not actively supplement electric quantity for the earphone 2.
In this embodiment, the charging box 1 still includes the shipping mode, and under the condition that the box that charges 1 and earphone 2 need long-time storage or transportation, terminal equipment can issue the instruction to earphone 2, makes earphone 2 send the order to the charging box 1 through the serial ports, and control charging box 1 and get into the shipping mode, all functions can be closed to charging box 1 in the shipping mode, and can not initiatively supply the electric quantity for earphone 2 to enter into extremely low consumption state, guarantee charging box 1's function normal, prevent that the box 1 electric quantity loss that charges among the shipping process is too big, when leading to the product to arrive in the user's hand, charging box 1 electric quantity is low excessively, can't provide the problem of sufficient electric quantity for earphone 2. Further, when the box cover of the charging box 1 is opened, the charging box 1 can be automatically switched from the shipping mode to the wake-up state, and in the using process of a user, the charging box 1 only can enter the sleep mode and cannot actively enter the shipping mode.
Preferably, the charge control method further includes:
and when the electric quantity of the charging box 1 is lower than a preset threshold value, controlling the charging box 1 to actively enter a sleep mode.
In this embodiment, when the charging box 1 detects that the electric quantity of the charging box is lower than the preset threshold, the charging box actively enters the sleep mode, and the earphone 2 is no longer charged. Preferably, the preset threshold is 10% of the total charge of the charging box 1. This can avoid the problem that the charging box 1 becomes dysfunctional due to its own electric quantity being too low.
As can be seen from the above, the charging control method provided by this embodiment can reduce the power consumption of the charging box 1, avoid the waste of the electric quantity of the charging box 1, prolong the endurance time of the charging box 1, and improve the user experience; in addition, compared with the previous embodiment, the charging control method provided by this embodiment wakes up once every a period of time to supplement power to the headset 2 when the charging box 1 enters the sleep state and is not used for a long time, so that the problem that the power consumption of the headset 2 is lost due to long-time non-use and further user experience is affected can be avoided; compared with the previous embodiment, the charging box 1 in the embodiment further has a shipping mode, which can further save unnecessary electric quantity waste in the product transportation process, and further prolong the endurance time of the charging box 1.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a charging control system according to a third embodiment of the present invention, and the charging control system is applied to the charging box 1. Only the portions related to the present embodiment are shown for convenience of explanation.
Referring to fig. 4, the charging control system 4 provided in the present embodiment includes:
the first control unit 41 is configured to control the charging box 1 to enter a sleep mode when it is detected that no earphone 2 is in the charging box 1, and if the charging box 1 is in an open state, wake up the charging box 1 every first preset time to detect whether an earphone 2 is in the charging box;
and the second control unit 42 is configured to query the electric quantity of the headset 2 at regular time when detecting that the headset 2 is charged in the charging box 1, and close the charging voltage to control the charging box 1 to enter a sleep mode when the electric quantity of the headset 2 is fully charged.
The charging control system of the embodiment of the present invention and the charging control method of the first and second embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments, and technical features in the method embodiments are correspondingly applicable in the apparatus embodiments, and are not described herein again.
Example four
Fig. 5 is a schematic structural diagram of the charging box 1 according to the fourth embodiment of the present invention. Only the portions related to the present embodiment are shown for convenience of explanation.
Referring to fig. 5, the charging box 1 provided in this embodiment includes a memory 12, a processor 11, and a computer program 13 stored in the memory 12 and executable on the processor 11, wherein when the computer program 13 is executed by the processor 11, the steps of the charging control method according to the first embodiment or the second embodiment are implemented.
The charging box 1 of the embodiment of the present invention and the charging control method of the first embodiment and the second embodiment belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments, and technical features in the method embodiments are correspondingly applicable in the apparatus embodiments, and are not described herein again.
EXAMPLE five
A fifth embodiment of the present invention provides a storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the charging control method according to the first embodiment or the second embodiment are implemented.
The storage medium of the embodiment of the present invention and the charging control method of the first and second embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments, and technical features in the method embodiments are correspondingly applicable in the apparatus embodiments, and are not described herein again.
It will be understood by those of ordinary skill in the art that all or some of the steps of the disclosed methods of the present embodiments may be implemented as software, firmware, hardware, or any suitable combination thereof.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, and are not to be construed as limiting the scope of the invention. Any modifications, equivalents and improvements which may occur to those skilled in the art without departing from the scope and spirit of the present invention are intended to be within the scope of the claims.