CN113890144A - Charging and discharging control method, device, equipment and medium - Google Patents

Charging and discharging control method, device, equipment and medium Download PDF

Info

Publication number
CN113890144A
CN113890144A CN202111154142.XA CN202111154142A CN113890144A CN 113890144 A CN113890144 A CN 113890144A CN 202111154142 A CN202111154142 A CN 202111154142A CN 113890144 A CN113890144 A CN 113890144A
Authority
CN
China
Prior art keywords
mode
usb
equipment
power
electric quantity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111154142.XA
Other languages
Chinese (zh)
Inventor
赵廷法
戚建成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN202111154142.XA priority Critical patent/CN113890144A/en
Publication of CN113890144A publication Critical patent/CN113890144A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0068Battery or charger load switching, e.g. concurrent charging and load supply
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0029Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0047Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits
    • H02J7/0048Detection of remaining charge capacity or state of charge [SOC]

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)
  • Power Sources (AREA)

Abstract

The application discloses a charge and discharge control method, a charge and discharge control device, charge and discharge control equipment and a charge and discharge control medium. In the embodiment of the application, for the USB device with the Source mode, when the remaining power is less than the preset power threshold, the USB device is controlled to enter the stop mode, wherein the USB device is not charged or discharged in the stop mode, so that the USB device with the Source mode does not discharge all the time, which causes power exhaustion, and other USB devices are not required to supply power to the USB device, thereby avoiding the power exhaustion of the two USB devices.

Description

Charging and discharging control method, device, equipment and medium
Technical Field
The present disclosure relates to the field of charging and discharging technologies, and in particular, to a charging and discharging control method, device, apparatus, and medium.
Background
With the continuous development of the USB charging technology, the USB type-C interface has been generally applied in USB devices, and the USB type-C interface has many advantages, including: the plug-in type USB interface can plug in the front and the back, has high data transmission speed, can transmit analog signals, has a large extension range and supports a Power transmission (USB PD) protocol. The USB PD protocol is a rapid charging specification established by a USB-IF organization, increases cable transmission through a USB cable and a connector, expands the cable bus power supply capacity of USB application, realizes higher voltage and current, transmits the power up to 100 watts, and can freely change the transmission direction of the power.
When charging for USB equipment through USBType-C interface, in order to distinguish the role of both ends USB equipment, have one set of negotiation mechanism to be convenient for carry out the role and confirm, based on USB PD agreement, according to the power supply of USBType-C interface, perhaps receive the electric condition, the power mode of USB Type-C interface includes: a power supply (Source) mode and a Sink (Sink) mode, the USB device in the Source mode is also called a power supply device, and supplies power to the outside; a USB device in Sink mode is also referred to as a power-absorbing device, which absorbs power of other USB devices connected thereto.
The USB PD protocol based protocol brings strong charging and discharging capabilities to USB devices and also brings some problems: after the power mode of the USB Type-C interface is established and stabilized, if the USB device is in the Source mode, the USB device can continuously supply power to the outside until the power of the USB device is exhausted or the USB Type-C line is pulled out. When the user actually uses the power sharing function, if the power consumption of the USB device may be completed without attention, the USB device that originally absorbs the power may supply power to the dead USB device in reverse, and the above steps are repeated until the power consumption of the two USB devices is completed.
Disclosure of Invention
The application provides a charge and discharge control method, a charge and discharge control device, charge and discharge control equipment and a charge and discharge control medium, and the charge and discharge control method, the charge and discharge control device and the charge and discharge control medium are used for solving the problems that in the prior art, when USB equipment is in a Source mode, the USB equipment can continuously supply power outwards until the electric quantity of the USB equipment is exhausted, the original USB equipment absorbing the electric quantity can supply power to the unpowered USB equipment in return until the electric quantities of the two USB equipment are completely consumed.
In a first aspect, the present application provides a charge and discharge control method, including:
when the current power mode of the USB equipment is recognized to be a Source mode, acquiring the information of the residual electric quantity;
and if the residual electric quantity is smaller than a preset electric quantity threshold value, controlling the USB equipment to enter a stop state mode, wherein the USB equipment is not charged or discharged after entering the stop state mode.
In a second aspect, the present application also provides a charge and discharge control device, the device comprising:
the acquisition module is used for acquiring the information of the residual electric quantity when the current power mode of the USB equipment is recognized as a Source mode;
and the control module is used for controlling the USB equipment to enter a stop state mode if the residual electric quantity is smaller than a preset electric quantity threshold value, wherein the USB equipment is not charged or discharged after entering the stop state mode.
In a third aspect, the present application further provides an electronic device, where the electronic device at least includes a processor and a memory, and the processor is configured to implement any of the steps of the charging and discharging control method when executing a computer program stored in the memory.
In a fourth aspect, the present application further provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of any of the charge and discharge control methods described above.
The embodiment of the application provides a charge and discharge control method, a charge and discharge control device, charge and discharge control equipment and a charge and discharge control medium. In the embodiment of the application, for the USB device with the Source mode, when the remaining power is less than the preset power threshold, the USB device is controlled to enter the stop mode, wherein the USB device is not charged or discharged in the stop mode, so that the USB device with the Source mode does not discharge all the time, which causes power exhaustion, and other USB devices are not required to supply power to the USB device, thereby avoiding the power exhaustion of the two USB devices.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic view of a charge and discharge control process provided in an embodiment of the present application;
FIG. 2 is a diagram illustrating power mode switching based on the USB PD protocol in the related art;
fig. 3 is a schematic diagram illustrating power mode switching of a USB device according to an embodiment of the present application;
fig. 4 is a control flowchart of a charging and discharging control method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a charge and discharge control device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments that can be derived from the embodiments given herein by a person of ordinary skill in the art are intended to be within the scope of the present disclosure.
The embodiment of the application provides a charge and discharge control method, a charge and discharge control device, charge and discharge control equipment and a charge and discharge control medium. In the embodiment of the application, for the USB device with the Source mode, when the remaining power is less than the preset power threshold, the USB device is controlled to enter the stop mode, wherein the USB device is not charged or discharged in the stop mode, so that the USB device with the Source mode does not discharge all the time, which causes power exhaustion, and other USB devices are not required to supply power to the USB device, thereby avoiding the power exhaustion of the two USB devices.
Fig. 1 is a schematic view of a charge and discharge control process provided in an embodiment of the present application, where the process specifically includes the following steps:
s101: and when the current power mode of the USB equipment is recognized to be the Source mode, acquiring the information of the residual electric quantity.
The embodiment of the application is applied to any USB device based on the USB Type-C interface connection, and the USB device can be a mobile terminal, a tablet computer and the like.
Two USB equipment through USB Type-C interface connection can charge and discharge based on the USB PD agreement, in order to can distinguish the power mode that the both ends USB equipment is located, can discern based on the power mode of USB Type-C interface of USB equipment. If the current power mode of the USB device is identified as the Source mode, that is, the power supply mode, in order to avoid the problem that the power supply of the USB device is always supplied to the outside, which causes the power amount of the USB device to be too low, in the embodiment of the present application, the information of the remaining power amount of the USB device may be obtained when the power mode of the USB device is identified as the Source mode.
In the embodiment of the application, in order to control the USB device in time, the power mode of the USB device may be obtained according to a set time interval, and when it is recognized that the current power mode of the USB device is a Source mode, information of the remaining power of the USB device is obtained.
S102: and judging whether the residual electric quantity of the USB equipment is smaller than a preset electric quantity threshold, if so, executing S103, otherwise, executing S104.
In order to prevent the USB device from consuming power, the USB device that originally absorbs power supplies power to the USB device that is not powered, in turn, until the power consumption of the two USB devices is completed, in this embodiment of the present application, a power threshold is preset, where the power threshold may be a specific power value or a specific value. If the power mode is the Source mode, the USB equipment has more residual capacity when exiting the Source mode, the capacity threshold value can be set to be larger, if the USB equipment wants to supply power to other USB equipment as far as possible, the capacity threshold value can be set to be smaller, and the capacity threshold value can be flexibly set according to the requirement.
S103: and if the residual electric quantity is smaller than a preset electric quantity threshold value, controlling the USB equipment to enter a stop state mode, wherein the USB equipment is not charged or discharged after entering the stop state mode.
When the USB device continuously supplies power to other USB devices connected to the USB device, the remaining power of the USB device itself is inevitably reduced. In the embodiment of the application, in order to control the USB device in time, the power mode of the USB device may be obtained according to a set time interval, and when it is recognized that the current power mode of the USB device is a Source mode, information of the remaining power of the USB device is obtained.
After the residual electric quantity of the USB equipment is obtained, comparing the residual electric quantity with a preset electric quantity threshold value, judging whether the residual electric quantity of the USB equipment is smaller than the preset electric quantity threshold value, if the residual electric quantity is smaller than the preset electric quantity threshold value, indicating that the USB equipment can not continuously supply power to other USB equipment connected with the USB equipment at the moment, controlling the USB equipment to close a power supply and stop supplying power to other USB equipment connected with the USB equipment, simultaneously controlling the USB equipment to exit a Source mode, setting a stop sign, and entering a stop state mode. The stop state mode is an intermediate state, which is different from the Source mode and the Sink mode, and the USB device does not discharge nor recharge after entering the stop state mode.
S104: and if the residual electric quantity is not less than a preset electric quantity threshold value, controlling the USB equipment to be kept in the Source mode.
If the residual electric quantity is not less than the preset electric quantity threshold value, which indicates that the USB equipment still has enough electric quantity to supply power outwards, the USB equipment is controlled to be kept in the Source mode, and power is continuously supplied to other USB equipment connected with the USB equipment.
In the embodiment of the application, for the USB device with the Source mode, when the remaining power is less than the preset power threshold, the USB device is controlled to enter the stop mode, wherein the USB device is not charged or discharged when in the stop mode, so that the USB device with the Source mode does not discharge all the time, which causes power exhaustion, and other USB devices are not required to supply power to the USB device, thereby avoiding the power exhaustion of the two USB devices.
On the basis of the above embodiment, in the embodiment of the present application, if it is recognized that the current power mode of the USB device is the Sink mode, the USB device is controlled to absorb the power of other devices connected to the USB device.
For two USB devices connected via a USB Type-C interface, the power modes of the USB Type-C interface occur in pairs, i.e., one USB device is supplying power and the other is necessarily drawing power, and vice versa. Therefore, when two USB devices are connected based on the USB Type-C interface, the power mode of one of the two USB devices is the Source mode, and the power mode of the other USB device is the Sink mode. When the current power mode of the USB device is identified to be the Sink mode, the USB device in the Sink mode is powered up, that is, charged, and as long as the USB device in the Source mode supplies power to the outside, the USB device in the Sink mode can continue to be kept in the Sink mode and continue to absorb the electric quantity of other USB devices connected with the USB device.
On the basis of the foregoing embodiments, in the embodiment of the present application, the entering of the USB device into the Source mode specifically includes:
the USB equipment and other equipment connected with the USB equipment determine to enter a Source mode through USB PD interactive negotiation; or receiving an instruction of switching from a Sink mode to a Source mode, and enabling the USB equipment to enter the Source mode.
Based on the USB PD protocol, the power modes of the USB devices may be switched, as shown in fig. 2, which is a schematic diagram illustrating power mode switching based on the USB PD protocol in the related art, as shown in fig. 2, after the two USB devices successfully establish a connection and the power mode of the USB Type-C interface is established, one of the USB devices is in a Source mode, i.e., a discharge state, and the other USB device is in a Sink mode, i.e., a power-up state, and the two USB devices may switch the power modes based on the USB PD protocol.
In addition, when two USB devices are connected for the first time, the power mode of the USB Type-C interface is determined based on the negotiation of the USB PD protocol, the USB devices are randomly in a Source mode or a Sink mode, and the mode switching can be performed through manual control of a switch of the USB devices. Specifically, in the later stage, when the power mode of the USB device is switched, a mode switching instruction may be sent to the USB device, and the USB device enters the corresponding mode after receiving the instruction. If the USB equipment is controlled to be switched from the Sink mode to the Source mode, an instruction for switching from the Sink mode to the Source mode can be sent to the USB equipment, and after the USB equipment receives the instruction for switching from the Sink mode to the Source mode, the USB equipment enters the Source mode.
In order to implement the relevant switching between the modes, on the basis of the foregoing embodiments, in an embodiment of the present application, the method further includes:
receiving an instruction for switching from a stop state mode to a Sink mode;
and controlling the USB equipment to enter a Sink mode according to the instruction.
When the USB equipment is in the stop state mode, the USB equipment can be controlled to be switched to the Sink mode from the current state through the control menu. Specifically, when mode switching is implemented, an instruction for switching to a Sink mode may be sent to the USB device, where the instruction may specifically be an instruction for switching to the Sink mode input through a control menu, and when the USB device receives the instruction for switching to the Sink mode, the USB device is controlled to enter the Sink mode and start to absorb electric quantities of other USB devices connected to the USB device.
Fig. 3 is a schematic diagram illustrating power mode switching of a USB device according to an embodiment of the present application, where after two USB devices are successfully connected based on a USB Type-C interface, a power mode of the USB device may be in a Source mode or a Sink mode, and when a remaining power of the USB device in the Source mode is smaller than a preset power threshold, the USB device is in a stop state mode.
As shown in fig. 3, after the two USB devices successfully establish a connection and the power mode of the USB Type-C interface is established, one of the USB devices is in a Source mode, i.e., a discharge state, and the other USB device is in a Sink mode, i.e., a power-up state, the two USB devices may switch the power modes based on the USB PD protocol.
The USB device can be switched from the Source mode in the discharge state to the Sink mode in the power absorption state through manual control or control of a control menu, and can also be switched from the Sink mode in the power absorption state to the Source mode in the discharge state.
When the current power mode of the USB equipment is recognized to be the Source mode, the USB equipment acquires the information of the self residual electric quantity, if the residual electric quantity is smaller than a preset electric quantity threshold value, the USB equipment exits the Source mode and enters a stop state mode, and the USB equipment is not charged or discharged after entering the stop state mode.
When the USB device is in the stop state mode, the USB device may be controlled to switch from the current state to the Sink mode through the control menu, and specifically, when the USB device receives an instruction to switch to the Sink mode, the USB device is controlled to enter the Sink mode to start absorbing the electric quantity of other USB devices connected to the USB device.
According to the charge and discharge control method provided by the embodiment of the application, after the two USB devices are successfully connected based on the USB Type-C interface, the USB devices may be in a Source mode, namely a power supply mode, or may be in a Sink mode, namely a power absorption mode, based on the randomness of the negotiation of the USB PD protocol. Due to the randomness of the negotiation of the USB PD protocol, if a USB device with high electric quantity is to supply power to a device with low electric quantity, the USB device with low electric quantity may be in a Source mode to supply power to the device with high electric quantity, and at the moment, the power state of the USB device can be flexibly switched through the control menu, so that the USB device with high electric quantity is switched to the Source mode to supply power to the USB device with low electric quantity. Unnecessary troubles caused by wrong charging and discharging due to the fact that the current power mode of the USB device is not matched with the real life requirements are effectively avoided.
In addition, when the USB equipment with high power supply supplies power for the USB equipment with low power supply, and when the residual power of the USB equipment as the power supply equipment is smaller than a preset power threshold value, the USB equipment automatically exits from the Source mode, sets a stop sign, enters into a stop state mode, and is neither charged nor discharged. The embodiment of the application determines whether the current USB equipment enters the stop state mode or not based on the preset electric quantity threshold value, and avoids the phenomenon that the USB equipment exits the Source mode due to the exhaustion of electric quantity, can be switched to the Sink mode to absorb the electric quantity of other USB equipment connected with the Sink mode, and then absorbs the electric quantity provided for the USB equipment at the opposite end. The embodiment of the application provides a charge and discharge control method, which does not cause charge and discharge reciprocation, and certainly does not bring about electric quantity loss caused by heat generated by reciprocating charge and discharge.
The following describes in detail the charge and discharge control according to an embodiment of the present application with reference to a specific embodiment, and fig. 4 is a control flow chart of a charge and discharge control method according to the present application, where the specific control flow is as follows:
s401: and the two USB devices successfully establish connection based on the USB Type-C interface.
After the two USB devices are successfully connected based on the USB Type-C interface, the USB devices are subjected to interactive negotiation through a USB PD protocol, and the power mode of the USB devices is determined to be a Source mode or a Sink mode.
S402: determining whether the power mode of the USB equipment after negotiation based on the USB PD protocol is a Source mode, and if the power mode is the Source mode, executing S403; if the mode is Sink mode, S409 is executed.
S403: and acquiring the information of the residual electric quantity of the USB equipment.
The USB equipment in the Source mode needs to supply power for other USB equipment connected with the USB equipment, and in order to determine whether the USB equipment enters the stop state mode, the information of the residual capacity of the USB equipment is obtained.
S404: and determining whether the residual electric quantity is smaller than a threshold value of a preset electric quantity. If the remaining power of the USB device is less than the preset power threshold, executing S405; if the remaining power of the USB device is not less than the preset power threshold, S406 is performed.
S405: the USB equipment exits the Source mode, stops supplying power to other USB equipment connected with the USB equipment, sets a stop sign and enters a stop state mode.
When the USB device is in the stop state mode, the USB device is neither charged nor discharged. In the stop state mode, if the current state is switched to the Sink mode by manual control or by control of a control menu, S408 is performed.
S406: the USB equipment supplies power to other USB equipment connected with the USB equipment, and acquires the information of the residual capacity according to a set time interval.
And when the power supply is continued, acquiring the information of the residual power of the USB equipment according to a set time interval.
S407: and determining whether the residual electric quantity is smaller than a threshold value of a preset electric quantity, and determining whether to enter a stop state. If the remaining power of the USB device is less than the preset power threshold, controlling the USB device to execute S405; and if the residual electric quantity of the USB equipment is not less than the preset electric quantity threshold value, controlling the USB equipment to continuously keep the current power supply state. When the USB device supplies power to other USB devices connected thereto, if the current state is switched to the Sink mode by manual control or by controlling a control menu, S408 is performed.
S408: and the USB equipment receives a command of switching to the Sink mode.
S409: the USB device enters the Sink mode and absorbs energy from other USB devices connected to it.
Fig. 5 is a schematic structural view of a charge and discharge control device provided in the present application, and as shown in fig. 5, the device includes:
an obtaining module 501, configured to obtain information of remaining power when it is identified that a current power mode of the USB device is a Source mode;
a control module 502, configured to control the USB device to enter a stop state mode if the remaining power is less than a preset power threshold, where the USB device is not charged or discharged after entering the stop state mode;
in a possible implementation manner, the control module 502 is further configured to control the USB device to remain in the Source mode if the remaining power is not less than a preset power threshold.
In a possible implementation manner, the control module 502 is further configured to control the USB device to absorb power of other devices connected to the USB device when it is identified that the current power mode of the USB device is a Sink mode.
In a possible implementation manner, the control module 502 is specifically configured to determine to enter a Source mode through USB PD interactive negotiation with other devices connected thereto; or receiving an instruction of switching from a Sink mode to a Source mode, and controlling the USB equipment to enter the Source mode.
In a possible implementation manner, the control module 502 is further configured to receive an instruction to switch from a stop state mode to a Sink mode; and controlling the USB equipment to enter a Sink mode according to the instruction.
Fig. 6 is a schematic structural diagram of an electronic device provided in the present application, and on the basis of the foregoing embodiments, the present application further provides an electronic device, as shown in fig. 5, including: the system comprises a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602 and the memory 603 complete mutual communication through the communication bus 604;
the memory 603 has stored therein a computer program which, when executed by the processor 601, causes the processor 601 to perform the steps of:
when the current power mode of the USB equipment is recognized to be a Source mode, acquiring the information of the residual electric quantity;
and if the residual electric quantity is smaller than a preset electric quantity threshold value, controlling the USB equipment to enter a stop state mode, wherein the USB equipment is not charged or discharged after entering the stop state mode.
In one possible embodiment, the method further comprises:
and if the residual electric quantity is not less than a preset electric quantity threshold value, controlling the USB equipment to be kept in the Source mode.
In one possible embodiment, the method further comprises:
and when the current power mode of the USB equipment is identified to be the Sink mode, controlling the USB equipment to absorb the electric quantity of other equipment connected with the USB equipment.
In one possible embodiment, the method further comprises:
receiving an instruction for switching from a stop state mode to a Sink mode; and controlling the USB equipment to enter a Sink mode according to the instruction.
In one possible implementation, the entering the Source mode by the USB device includes:
the USB equipment and other equipment connected with the USB equipment determine to enter a Source mode through USB PD interactive negotiation; or receiving an instruction of switching from the Sink mode to the Source mode, and enabling the USB equipment to enter the Source mode.
Because the principle of solving the problem of the electronic device is similar to the charging and discharging control method, the implementation of the electronic device may refer to the above embodiments, and repeated details are not repeated.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus. The communication interface 602 is used for communication between the above-described electronic apparatus and other apparatuses. The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor. The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
On the basis of the foregoing embodiments, the present application further provides a computer-readable storage medium, in which a computer program executable by a processor is stored, and when the program is run on the processor, the processor is caused to execute the following steps:
when the current power mode of the USB equipment is recognized to be a Source mode, acquiring the information of the residual electric quantity;
and if the residual electric quantity is smaller than a preset electric quantity threshold value, controlling the USB equipment to enter a stop state mode, wherein the USB equipment is not charged or discharged after entering the stop state mode.
In one possible embodiment, the method further comprises:
and if the residual electric quantity is not less than a preset electric quantity threshold value, controlling the USB equipment to be kept in the Source mode.
In one possible embodiment, the method further comprises:
and when the current power mode of the USB equipment is identified to be the Sink mode, controlling the USB equipment to absorb the electric quantity of other equipment connected with the USB equipment.
In one possible embodiment, the method further comprises:
receiving an instruction for switching from a stop state mode to a Sink mode; and controlling the USB equipment to enter a Sink mode according to the instruction.
In one possible implementation, the entering the Source mode by the USB device includes:
the USB equipment and other equipment connected with the USB equipment determine to enter a Source mode through USB PD interactive negotiation; or receiving an instruction of switching from the Sink mode to the Source mode, and enabling the USB equipment to enter the Source mode.
Since the principle of solving the problem of the computer readable medium is similar to that of the charging and discharging control method, after the processor executes the computer program in the computer readable medium, the steps implemented may refer to the above embodiments, and repeated parts are not described again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A charge-discharge control method, characterized by comprising:
when the current power mode of the USB equipment is recognized to be a Source mode, acquiring the information of the residual electric quantity;
and if the residual electric quantity is smaller than a preset electric quantity threshold value, controlling the USB equipment to enter a stop state mode, wherein the USB equipment is not charged or discharged after entering the stop state mode.
2. The method of claim 1, wherein the method further comprises:
and if the residual electric quantity is not less than a preset electric quantity threshold value, controlling the USB equipment to be kept in the Source mode.
3. The method of claim 1, wherein the method further comprises:
and when the current power mode of the USB equipment is identified to be the Sink mode, controlling the USB equipment to absorb the electric quantity of other equipment connected with the USB equipment.
4. The method of claim 1, wherein the USB device entering a Source mode comprises:
the USB equipment and other equipment connected with the USB equipment determine to enter a Source mode through USB PD interactive negotiation; or the like, or, alternatively,
and receiving an instruction for switching from the Sink mode to the Source mode, and enabling the USB equipment to enter the Source mode.
5. The method of claim 1, wherein the method further comprises:
receiving an instruction for switching from a stop state mode to a Sink mode;
and controlling the USB equipment to enter a Sink mode according to the instruction.
6. A charge-discharge control device, characterized by comprising:
the acquisition module is used for acquiring the information of the residual electric quantity when the current power mode of the USB equipment is recognized as a Source mode;
and the control module is used for controlling the USB equipment to enter a stop state mode if the residual electric quantity is smaller than a preset electric quantity threshold value, wherein the USB equipment is not charged or discharged after entering the stop state mode.
7. The apparatus of claim 6, wherein the control module is further configured to control the USB device to remain in the Source mode if the remaining power is not less than a preset power threshold.
8. The apparatus of claim 6, wherein the control module is further configured to receive an instruction to switch from a stop state mode to a Sink mode; and controlling the USB equipment to enter a Sink mode according to the instruction.
9. An electronic device, characterized in that the electronic device comprises at least a processor and a memory, the processor being configured to implement the steps of the charge and discharge control method according to any one of claims 1-5 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps of the charge and discharge control method according to any one of claims 1 to 5.
CN202111154142.XA 2021-09-29 2021-09-29 Charging and discharging control method, device, equipment and medium Pending CN113890144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111154142.XA CN113890144A (en) 2021-09-29 2021-09-29 Charging and discharging control method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111154142.XA CN113890144A (en) 2021-09-29 2021-09-29 Charging and discharging control method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN113890144A true CN113890144A (en) 2022-01-04

Family

ID=79008252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111154142.XA Pending CN113890144A (en) 2021-09-29 2021-09-29 Charging and discharging control method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113890144A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025001A (en) * 2009-09-21 2011-04-20 联想(北京)有限公司 Terminal and charging and power supplying method thereof
US20180004277A1 (en) * 2016-07-04 2018-01-04 Canon Kabushiki Kaisha Information processing apparatus, information processing method, and recording medium on which computer-readable program is recorded
CN107577621A (en) * 2016-07-04 2018-01-12 佳能株式会社 Information processor, information processing method and recording medium
CN108323241A (en) * 2018-01-25 2018-07-24 深圳市为通博科技有限责任公司 Principal and subordinate's role transforming method, chip and data transmission system
CN208754016U (en) * 2018-07-27 2019-04-16 惠州志顺电子实业有限公司 The dead battery activated system of mobile power source and mobile power source

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025001A (en) * 2009-09-21 2011-04-20 联想(北京)有限公司 Terminal and charging and power supplying method thereof
US20180004277A1 (en) * 2016-07-04 2018-01-04 Canon Kabushiki Kaisha Information processing apparatus, information processing method, and recording medium on which computer-readable program is recorded
CN107577621A (en) * 2016-07-04 2018-01-12 佳能株式会社 Information processor, information processing method and recording medium
CN108323241A (en) * 2018-01-25 2018-07-24 深圳市为通博科技有限责任公司 Principal and subordinate's role transforming method, chip and data transmission system
CN208754016U (en) * 2018-07-27 2019-04-16 惠州志顺电子实业有限公司 The dead battery activated system of mobile power source and mobile power source

Similar Documents

Publication Publication Date Title
CN112202222B (en) Charger, charging control method and device
RU2357286C2 (en) Smart card operating system and its use
WO2016101509A1 (en) Charging control method and device
CN104135053A (en) Electric quantity sharing method and device
CN110854939A (en) Method for charging double batteries, electronic device and storage medium
CN108897416A (en) It is a kind of to control method, apparatus and computer readable storage medium electric under GPU
KR102366739B1 (en) Apparatus for controlling charge or discharge of batteries, system for controlling charge or discharge of batteries and method for controlling charge or discharge of batteries
WO2018072443A1 (en) Charging method, apparatus, and data storage medium
CN113691722B (en) Control method and device and electronic equipment
CN105468122A (en) Method and device for off-peak boot of nodes and whole cabinet server
KR101294102B1 (en) Rechargeable mult communication apparatus and method for controlling the same
KR20170098467A (en) Apparatus and method for providing usb interface between potable device and external device
CN111427412A (en) Multi-power management system and multi-power management method
CN116169758B (en) Output power adjusting method and charger
CN112910038A (en) Power conversion device and method and electronic equipment
CN113890144A (en) Charging and discharging control method, device, equipment and medium
US9831698B2 (en) Mobile power supply terminal and power supply method thereof
CN112865248A (en) Box-entering detection method and device of wireless earphone, charging box and readable storage medium
CN116231787A (en) Charging and discharging control method and device, terminal equipment and storage medium
CN115940349A (en) Electric quantity control method, device, equipment and medium of master-slave type energy storage system
CN113672067B (en) Lightning docking station and configuration device
JP6915299B2 (en) Power receiving device
CN113934661B (en) Electronic equipment, control method, device and medium
CN115391258A (en) Interface management circuit, method, apparatus, device, storage medium, and program product
CN112638700B (en) Charging and discharging switching device and method and bidirectional charging system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination