Switching control circuit, data line of charge and discharge module, switching control method of data line and computer equipment
By using a data line switching control circuit and method controlled by a microcontroller unit, the data line can transmit data in its initial state and switch to charging or discharging state as needed. This solves the problem of the separation between the data line and the power bank function in the prior art, and improves ease of use and transmission performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MINUS TECH CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-22
AI Technical Summary
The existing data cable and power bank functions cannot be dynamically switched and work together, which means that the needs of users to perform data transmission and charging/discharging operations at the same time cannot be met. In addition, the power bank is prone to running out of power and has insufficient transmission performance, making it impossible to balance high-power transmission and stable data transmission performance.
A data line switching control method and switching control circuit for a charging and discharging module are provided. The microcontroller controls the conduction and disconnection of voltage bus signals and configuration channel signals to enable data transmission in the initial state, switch to charging or discharging state according to charging and discharging requirements, and prioritize power supply to the output device when power is insufficient. Combined with pull-down resistor control logic and voltage signal detection, fast adaptation and reverse charging are achieved.
It enables seamless switching between data transmission and power transmission, improving ease of use, balancing high-power transmission with stable data interaction, avoiding issues such as power bank running out of power and unstable power supply, and meeting users' dual needs for fast charging and efficient data interaction.
Smart Images

Figure CN122073390A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of switching control technology for electrical devices, and in particular to a switching control circuit, a data line for a charging and discharging module, a switching control method thereof, and a computer device. Background Technology
[0002] Data cables transfer electrical energy from a power source to a device when connected to a power source. They can also be mounted on a power bank to deliver power even without a power source. However, in traditional technology, the use cases for data cables mounted on power banks are limited, failing to meet the diverse functional needs of users. Summary of the Invention
[0003] Therefore, it is necessary to provide a switching control circuit, a data line for a charging / discharging module, a switching control method, and a computer device that can meet the various functional requirements of users, in order to address the above-mentioned technical problems.
[0004] In a first aspect, this application provides a data line switching control method for a charging / discharging module, comprising:
[0005] In the initial state, the voltage bus signal controlling the charging and discharging module and the data line is turned on, and the configuration channel signal controlling the charging and discharging module and the data line is turned off, so that the data line is in the data transmission state, supporting universal serial bus data transmission between devices connected at both ends of the data line;
[0006] Obtain the charging / discharging demand signal from the charging / discharging module, and determine the charging / discharging demand based on the charging / discharging demand signal:
[0007] If the charging / discharging module requires charging, then the input channel of the charging / discharging module is turned on and the output channel of the charging / discharging module is turned off, so that the external power supply can charge the charging / discharging module through the data line;
[0008] If the charging / discharging module requires discharging, the voltage bus signal is disconnected, and the output channel of the charging / discharging module is turned on, so that the charging / discharging module can charge the device at the output end through the data line.
[0009] In one embodiment, after obtaining the charging / discharging demand signal of the charging / discharging module and determining the charging / discharging demand based on the charging / discharging demand signal, the method further includes the following steps:
[0010] If the charging and discharging requirements of the charging and discharging modules are obtained simultaneously:
[0011] The input channel of the control charging and discharging module is turned on;
[0012] The output channel of the charge / discharge control module is disconnected;
[0013] The voltage bus signal between the control charging / discharging module and the data line is turned on;
[0014] The external power supply charges the charging module through the data line and the input channel of the charging module, and simultaneously charges the device at the output end of the data line through the voltage bus signal circuit of the data line and the charging module.
[0015] In one embodiment, the data line switching control method of the charging and discharging module further includes the step of:
[0016] Determine the input power at the charging terminal of the charging / discharging module:
[0017] If the input power is insufficient to simultaneously support the charging and discharging of the module and the power supply of the output device, the input channel of the charging and discharging module will be shut down, and the device at the output end of the data line will be charged only.
[0018] In one embodiment, at least one of the control entities that controls the voltage bus signal to be turned on and off, controls the configuration channel signal to be turned off, determines the charging / discharging demand, and turns on the input and output channels of the charging / discharging module is a microcontroller unit.
[0019] In one embodiment, the steps of acquiring the charging / discharging demand signal of the charging / discharging module and determining the charging / discharging demand based on the charging / discharging demand signal further include the following steps:
[0020] When the activation command of the charging and discharging module is received, the voltage signal at the input terminal of the data line is detected;
[0021] If a voltage signal is present, it is determined that the charging / discharging module is in need of charging.
[0022] If no voltage signal is present, then the charging / discharging module is determined to be in a discharging state.
[0023] In one embodiment, the activation instruction in the step of "detecting the voltage signal at the data line input terminal when the activation instruction of the charging and discharging module is obtained" is either an operation instruction triggered by the user or a voltage change instruction at the data line input terminal detected by the microcontroller unit.
[0024] In one embodiment, after the step of "if the input power is insufficient to simultaneously support the charging of the charging and discharging module and the power supply of the output device, then shutting down the input channel of the charging and discharging module and only charging the device at the output end of the data line", the method further includes:
[0025] After a preset delay, the input channel of the charging and discharging module is turned on.
[0026] In one embodiment, the preset time in the step of "turning on the input channel of the charging and discharging module after a preset delay" ranges from 10 minutes to 60 minutes, wherein the preset time is adjusted by the software program of the microcontroller unit.
[0027] In one embodiment, the data line switching control method of the above-mentioned charging and discharging module further includes configuration logic for the pull-down resistors of the channel pins, comprising the steps of:
[0028] During the initial state and function switching process, the default control configuration channel control module turns on the pull-down resistor of the configuration channel pin, so that the connected external device can recognize the effective load and then output voltage normally.
[0029] The detection module uses a voltage source identification unit to determine the source of the detected voltage signal based on the voltage polarity and current flow direction: if the voltage signal comes from the data line input terminal, the pull-down resistor is kept on to adapt to fast charging protocol negotiation or normal charging voltage output.
[0030] If the voltage signal comes from the data line output, then output a control command to turn off the pull-down resistor of the configuration channel pin;
[0031] When the pull-down resistor is turned off, the mobile device in OTG mode stops discharging externally because no effective load is detected, and the input channel of the charging and discharging module is turned on simultaneously, so that the charging and discharging module can reverse charge the mobile device.
[0032] Secondly, this application also provides a switching control circuit for implementing the data line switching control method of the above-mentioned charging and discharging module, comprising:
[0033] The voltage bus control module includes at least two switching elements for controlling the conduction and disconnection of the voltage bus at both ends of the data line. The voltage bus control module can be configured with dual-switch parallel branches to adapt to high-power transmission.
[0034] The configuration channel control module includes switching elements for controlling the on and off of the configuration channel signal;
[0035] The detection module includes a voltage detection unit and a power detection unit, which are used to detect the voltage signal and input power at the data line input terminal and data line output terminal, respectively.
[0036] The control module, which adopts a microcontroller unit, is electrically connected to the voltage bus control module, the configuration channel control module, the detection module, and the charge / discharge control terminal of the charge / discharge module, respectively. It is used to receive the voltage signal / input power transmitted by the detection module, execute the preset software program, and output control commands.
[0037] The charging and discharging control module includes a transistor switch, which is used to control the conduction and disconnection of the input and output channels of the charging and discharging module according to the instructions of the control module;
[0038] The detection module transmits the detected voltage signal / input power to the control module in real time. The control module generates corresponding control commands based on the signal and sends them to the voltage bus control module, configuration channel control module, and charge / discharge control module, respectively, to achieve coordinated switching between data line function and charge / discharge function.
[0039] In one embodiment, the switching control circuit further includes a surge protection module, which includes an electrostatic surge protection element and a voltage divider resistor connected in series with the electrostatic surge protection element. The voltage divider resistor is used to limit the peak value of the electrostatic surge current to prevent damage to the microcontroller unit of the control module.
[0040] In one embodiment, the control module is electrically connected to the switching element of the pull-down resistor, and synchronously outputs a turn-on / turn-off command based on the voltage signal source identification result of the detection module, thereby realizing the linkage control between the pull-down resistor and the charging / discharging channel.
[0041] Thirdly, this application also provides a data cable with charging and discharging functions, including:
[0042] The data cable body uses multi-core transmission cable and has a universal serial bus interface at both ends, which includes configuration channel pins and voltage bus pins.
[0043] The charging / discharging unit is equipped with a charging input interface and a discharging output interface;
[0044] The switching control circuit is the aforementioned switching control circuit. In the switching control circuit, the microcontroller unit and the detection module are integrated inside the interface of the data cable body. The voltage bus control module and the configuration channel control module of the switching control circuit are electrically connected to the corresponding lines of the data cable body, respectively. The charge and discharge control module is electrically connected to the charge and discharge interface of the charge and discharge unit.
[0045] Fourthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any step in the above-described data line switching control method for the charging and discharging module.
[0046] The aforementioned data line switching control method for the charging / discharging module initially controls the voltage bus (Vbus) signal of the charging / discharging module and the data line to be turned on, while the configuration channel (CC) signal is turned off, putting the data line in a pure data transmission state and supporting Universal Serial Bus (USB) standard data interaction. When a charging / discharging demand signal is received, different control logic is executed according to the demand type. Specifically, when there is a charging demand, the input channel of the charging / discharging module is turned on, and the output channel of the charging / discharging module is turned off, enabling the external power supply to replenish the charging / discharging module. When there is a discharging demand, the voltage bus (Vbus) signal is turned off, and the output channel of the charging / discharging module is turned on, enabling the charging / discharging module to supply power to the output device.
[0047] It solves the problem of the separation between data transmission and charging / discharging functions in traditional Universal Serial Bus (USB) devices, and realizes seamless switching between data transmission and charging / discharging functions on the data cable, improving ease of use. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 This is an application environment diagram of the data line switching control method for the charging and discharging module in one embodiment.
[0050] Figure 2 This is one of the flowcharts illustrating the data line switching control method for a charging / discharging module in one embodiment;
[0051] Figure 3 This is a second flowchart illustrating the data line switching control method for the charging / discharging module in one embodiment.
[0052] Figure 4 This is a block diagram of the switching control circuit in one embodiment;
[0053] Figure 5 This is a structural block diagram of the data line switching control device for the charging and discharging module in one embodiment;
[0054] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0057] Power banks with built-in data cables were originally designed to solve the problem of users having to carry separate data cables and power banks. However, they still have significant technical flaws:
[0058] One type of product has a data cable that is fixedly connected to the power bank body and cannot be separated. This means that the data cable can only be used with the corresponding power bank and cannot be used as an independent universal serial bus data cable to connect to other charging devices or to realize data transmission between devices, resulting in a single function.
[0059] Another type of product has a data cable that can be separated from the power bank, but users are very likely to forget to bring the data cable after separation, which means that the power bank or data cable cannot function fully on its own, greatly reducing the convenience of use.
[0060] Therefore, in existing technologies, the functions of data cables and power banks cannot be dynamically switched or coordinated. When users need to perform data transmission and charging / discharging operations simultaneously, existing products cannot meet the requirements. Furthermore, users often forget to recharge their power banks, leaving them depleted when urgently needed. In addition, the energy transmission efficiency of existing products is limited, making it difficult to balance high-power transmission with stable data transmission performance, and thus failing to meet users' dual needs for fast charging and efficient data interaction based on power transfer protocols.
[0061] In summary, existing power banks with built-in cables and universal serial bus data cables have problems such as inconvenient function switching, easy loss of carrying, easy power bank running out of power, and insufficient transmission performance.
[0062] The data line switching control method for the charging and discharging module provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, in the initial state, the voltage bus signal controlling the charging / discharging module 102 and the data line 104 is turned on, and the configuration channel signal controlling the charging / discharging module 102 and the data line 104 is turned off, so that the data line 104 is in the data transmission state, supporting universal serial bus data transmission between devices connected at both ends of the data line 104, that is, supporting data transmission between electrical equipment and external power supply via the data line 104.
[0063] Obtain the charging / discharging demand signal from the charging / discharging module 102, and determine the charging / discharging demand based on the charging / discharging demand signal:
[0064] If the charging / discharging module 102 requires charging, then the input channel of the charging / discharging module 102 is turned on and the output channel of the charging / discharging module 102 is turned off, so that the external power supply can charge the charging / discharging module 102 through the data line 104.
[0065] If the charging / discharging module 102 requires discharging, the voltage bus signal is disconnected and the output channel of the charging / discharging module 102 is turned on, so that the charging / discharging module 102 can charge the power device at the output end through the data line 104.
[0066] In one exemplary embodiment, such as Figure 2 As shown, a data line switching control method for a charging / discharging module is provided, including:
[0067] S202, in the initial state, the voltage bus signal (Vbus signal) controlling the charging and discharging module and the data line is turned on, and the configuration channel signal (CC signal) controlling the charging and discharging module and the data line is turned off, so that the data line is in the data transmission state, supporting universal serial bus data transmission between devices connected at both ends of the data line.
[0068] S204, acquire the charging / discharging demand signal of the charging / discharging module, and determine the charging / discharging demand based on the charging / discharging demand signal:
[0069] S206, if the charging / discharging module requires charging, then the input channel of the charging / discharging module is turned on and the output channel of the charging / discharging module is turned off, so that the external power supply can charge the charging / discharging module through the data line.
[0070] S208, if the charging / discharging module requires discharging, disconnect the voltage bus signal (Vbus signal) and turn on the output channel of the charging / discharging module so that the charging / discharging module can charge the device at the output end through the data line.
[0071] In the initial state, the default state is data transmission. At this time, the voltage bus signal (Vbus signal) between the charging / discharging module and the data line is on, while the configuration channel signal (CC signal) between the charging / discharging module and the data line is off, thus putting the data line in data transmission mode. For example, if one end of the data line integrating the charging / discharging module is connected to a smart computer and the other end to a smartphone, data transmission between the smart computer and the smartphone is supported by default in the initial state.
[0072] When a charging / discharging module is detected to require charging, its input channel is activated and its output channel is deactivated. This allows power from an external power source connected to the module's input to be transferred to the module via a data cable, thus charging the module. The module's input can be connected to an external power source via an external charger or directly.
[0073] When a discharge request is detected in the charging / discharging module, the voltage bus signal (Vbus signal) is disconnected to enable the output function of the charging / discharging module and to open its output channel. This allows the charging / discharging module to charge devices connected to its output terminal via a data cable. For example, connecting a smartphone to the output terminal of the charging / discharging module allows it to charge via the data cable. This solves the problem of the separation between USB data transmission and charging / discharging functions in traditional devices, enabling seamless switching between USB data transmission and charging / discharging functions, thus improving ease of use.
[0074] Therefore, the data line switching control method of this charging and discharging module can take into account both data transmission and power transmission. The data line of the charging and discharging module equipped with this data line switching control method can realize dynamic switching and coordinated operation of data transmission and power transmission. When the user needs to transmit data, the data line of the charging and discharging module can be triggered to enter the initial state to support the universal serial bus data transmission between devices connected at both ends of the data line. When the user needs to perform charging and discharging operations, the charging and discharging module can be triggered to enter the charging and discharging state so that the external power supply can charge the charging and discharging module through the data line, or so that the charging and discharging module can charge the electrical device connected to the output end of the charging and discharging module through the data line.
[0075] Furthermore, when the input end of the data line of the charging / discharging module is connected to a smart computer, and the output end of the data line is connected to a smartphone, data transmission between the smart computer and the smartphone can be realized. The smart computer can also charge the smartphone and / or the charging / discharging module, so that even if the user forgets to specifically charge the charging / discharging module, it can still be charged via a charging demand signal, ensuring sufficient power when the charging / discharging module is urgently needed to power other electrical devices. Of course, the aforementioned smart computer can also be any other device capable of providing power and storing data, and the smartphone can also be any other electrical device capable of storing data.
[0076] Furthermore, the configuration channel signal (CC signal) is responsible for negotiating the power transmission protocol, such as determining voltage / current parameters. In other words, the configuration channel signal (CC signal) is responsible for rate negotiation and channel configuration before data transmission; the voltage bus signal (Vbus signal) is responsible for transmitting high-power electricity according to the negotiation results. Therefore, the on / off control based on the voltage bus signal (Vbus signal) and the configuration channel signal (CC signal) can balance high-power transmission with stable data transmission performance, meeting users' dual needs for fast charging and efficient data interaction based on the power transmission protocol.
[0077] It should be noted that, taking the control of the data line switching control method of the charging and discharging module in this application embodiment as an example, the control is executed by the microcontroller unit (MCU), that is, the switching of the voltage bus signal (Vbus signal), the configuration channel signal (CC signal), the input channel of the charging and discharging module and the output channel of the charging and discharging module are all controlled by the microcontroller unit (MCU).
[0078] Microcontroller units (MCUs) can integrate functions such as protocol parsing, multi-interface management, power calculation, and LED (Light-Emitting Diode) display control, thereby replacing multiple independent chips and reducing the internal hardware size and production cost of the charging / discharging module's data lines. Therefore, the functionality of the charging / discharging module's data lines can be expanded based on MCUs at a low cost, while also allowing for miniaturized and portable design of the charging / discharging module's data lines.
[0079] In one exemplary embodiment, such as Figure 3 As shown, the steps include: acquiring the charging / discharging demand signal from the charging / discharging module, and determining the charging / discharging demand based on the signal, followed by the following steps:
[0080] S210, if the charging and discharging requirements of the charging and discharging module are obtained simultaneously: control the input channel of the charging and discharging module to be turned on, control the output channel of the charging and discharging module to be turned off, control the voltage bus signal (Vbus signal) between the charging and discharging module and the data line to be turned on, so that the external power supply charges the charging and discharging module through the data line and the input channel of the charging and discharging module, and at the same time charges the device at the output end of the data line through the voltage bus signal (Vbus signal) circuit of the data line and the charging and discharging module.
[0081] When both charging and discharging demands are simultaneously received from the charging / discharging module, the system controls the input channel of the charging / discharging module to be open, allowing external power to supply power to the module via the data line and the input channel. Simultaneously, the system controls the output channel of the charging / discharging module to be closed, preventing power supply to devices connected to its output via the data line. Finally, the system controls the voltage bus signal (Vbus signal) between the charging / discharging module and the data line to be open, allowing external power to supply power to devices connected to its output via the data line. This solves the problem of chaotic power supply logic when charging / discharging demands exist simultaneously, achieving intelligent multi-path distribution of external power, ensuring self-replenishment of the charging / discharging module without affecting power supply to output devices, thus improving energy utilization.
[0082] In other words, when the charging and discharging needs of the charging and discharging module are simultaneously obtained, the external power supply is controlled to simultaneously supply power to the charging and discharging module and the electrical equipment connected to the output terminal of the charging and discharging module. This replaces the solution of supplying power to the electrical equipment through the external power supply, thereby meeting the power supply requirements of the charging and discharging module and the electrical equipment while preventing the electrical equipment from depleting the power in the charging and discharging module, thus preparing for the user to use the charging and discharging module for power at any time.
[0083] In one exemplary embodiment, such as Figure 3 As shown, the above-mentioned data line switching control method for the charging and discharging module further includes the following steps:
[0084] S212, Determine the input power at the charging terminal of the charging / discharging module:
[0085] S214 If the input power is insufficient to simultaneously support the charging of the charging and discharging module and the power supply of the output device, then the input channel of the charging and discharging module is shut down, and only the device at the output end of the data line is charged.
[0086] The electrical energy in the charging and discharging module is generally used as a backup power source. However, the urgency of the electrical devices connected to the output terminal of the charging and discharging module is much higher than that of the charging and discharging module itself. Therefore, when the input power is insufficient to support the charging and discharging module's charging and the power supply to the output devices, the input channel of the charging and discharging module is shut down so that the external power supply can prioritize powering the electrical devices connected to the output terminal of the charging and discharging module to meet the user's emergency power needs.
[0087] It solves the problems of unstable power supply and easy overload protection when the power is insufficient. It avoids circuit overload by dynamically adjusting the priority and improves power supply stability, while ensuring the continuity of power supply to the output devices.
[0088] For example, if the external power supply is a 10W adapter, the charging / discharging module requires 8W to charge, and the output terminal for powering the mobile phone requires 5W, with a total demand of 13W > 10W. Upon detecting a power shortage, the charging / discharging module's input channel is immediately shut down, supplying power only to the mobile phone. If the preset time is set to 50 minutes, the microcontroller unit (MCU) will re-detect the input power after 50 minutes. If the power is sufficient, the charging / discharging module will resume charging; if it is still insufficient, the output terminal will continue to prioritize power supply.
[0089] In an exemplary embodiment, the step of determining the charging input power of the charging module further includes the following steps:
[0090] S216, if the input power is sufficient to simultaneously support the charging of the charging and discharging module and the power supply of the output device, then the input channel and output channel of the charging and discharging module are simultaneously turned on, and the output device of the charging and discharging module and the data line is charged at the same time.
[0091] Simultaneously supplying power to both the charging / discharging module and the output device maximizes the fulfillment of user charging requirements, balancing the real-time use of the output device with the energy storage of the charging / discharging module. The energy storage of the charging / discharging module enables users to obtain power even without an external power source, thus meeting various power supply needs.
[0092] In an exemplary embodiment, at least one of the control entities that controls the voltage bus signal to be turned on and off, controls the configuration channel signal to be turned off, determines the charging / discharging demand, and turns on the input and output channels of the charging / discharging module is a microcontroller unit (MCU).
[0093] Microcontroller units (MCUs) possess high-performance computing capabilities, enabling microsecond-level response times based on this computing power and hardware-level timer resources. Simultaneously, the ADC (analog-to-digital converter) within the MCU accurately detects the voltage and current of the charging / discharging module. Combined with a closed-loop feedback algorithm, it achieves constant current / constant voltage charging control, ensuring the charging / discharging module operates within safe limits. This real-time detection capability also promptly identifies overvoltage and / or overcurrent anomalies in the charging / discharging module and, in the event of such anomalies, prevents catastrophic failures through hardware-level protection mechanisms.
[0094] Furthermore, the microcontroller unit (MCU) has low power consumption and can enter a low-power standby state when the data line of the charging and discharging module has not been used for a long time, thus extending the lifespan of the data line of the charging and discharging module.
[0095] In one exemplary embodiment, such as Figure 3 As shown, the steps include: acquiring the charging / discharging demand signal from the charging / discharging module, and determining the charging / discharging demand based on the charging / discharging demand signal; and further steps include:
[0096] S2042, when the activation command of the charging / discharging module is received, the voltage signal at the input terminal of the data line is detected.
[0097] S2044, if a voltage signal is present, then the charging / discharging module is determined to be in a charging demand.
[0098] S2046, if there is no voltage signal, then the charging / discharging module is determined to be in a discharging state.
[0099] When charging / discharging control of the charging / discharging module is required, an activation command can be issued to initiate the charging / discharging demand judgment of the module, thereby enabling charging / discharging. When charging / discharging control of the module is not required, a stop activation command can be issued to return to the initial state, thus supporting universal serial bus data transmission between devices connected at both ends of the data line.
[0100] By detecting the voltage signal at the input terminal of the charging / discharging module, i.e. the voltage signal at the data line input terminal, the charging / discharging requirements of the charging / discharging module can be determined. Based on the charging / discharging requirements of the charging / discharging module, the input / output channels of the charging / discharging module can be turned on or off.
[0101] The presence or absence of a voltage signal can be achieved based on basic components such as voltage divider resistors, voltage comparators, and MOS (Metal-Oxide-Semiconductor) field-effect transistor switches. There is no need to integrate complex communication protocol chips or involve the deep involvement of microcontrollers (MCUs). Furthermore, the manufacturing process of soldering basic components is simple and does not require complex firmware debugging. Mass production can be achieved simply by calibrating the voltage threshold.
[0102] In an exemplary embodiment, the activation instruction in the step of "detecting the voltage signal at the data line input terminal when the activation instruction of the charging and discharging module is obtained" is either a user-triggered operation instruction or a data line input terminal voltage change instruction detected by the microcontroller unit (MCU).
[0103] A touch module can be installed on the charging / discharging module, allowing users to issue activation commands by touching the module when charging / discharging control is required. The touch module can be a button, a touchscreen, or similar device.
[0104] User-triggered operation commands are mechanical / electronic signals, enabling direct transmission of these signals without protocol handshakes or complex judgments. Furthermore, the transmission response delay of mechanical / electronic signals is ≤50ms, significantly faster than signal transmission schemes relying on communication protocols.
[0105] Triggering operation commands via the touch module reduces the lag experienced while waiting for activation. For example, in an emergency charging situation where the user needs to charge the module, charging can be initiated directly by triggering the touch module, without waiting for software initialization or protocol negotiation.
[0106] Furthermore, the user-triggered operation commands are simple to use and suitable for all age groups. Even the elderly do not need to learn complicated operations to activate the charging and discharging module.
[0107] When the microcontroller unit (MCU) detects a sudden voltage change command at the data line input terminal, it indicates that an external power source has been connected to the input terminal of the charging / discharging module via the data line. In other words, an external power source has been connected to the data line input terminal, causing a sudden voltage change at the input terminal of the charging / discharging module. At this time, the charging / discharging module can be considered to be in a charging demand.
[0108] Voltage surge detection is a microcontroller (MCU) hardware-level interrupt response, eliminating the need for software polling to detect voltage surges at the data line input. After a voltage surge, a data line input voltage surge command can be output within a ≤1ms time interval, supporting a plug-and-charge user experience.
[0109] In one exemplary embodiment, such as Figure 3As shown, after the step of "if the input power is insufficient to simultaneously support the charging of the charging / discharging module and the power supply of the output device, then the input channel of the charging / discharging module is shut down, and only the device at the output end of the data line is charged," the above-mentioned data line switching control method for the charging / discharging module further includes:
[0110] S218, after a preset delay, the input channel of the charging and discharging module is turned on.
[0111] After a preset delay, the input channel of the charging / discharging module is reconnected, allowing external power to charge the module via the data line and input channel. At this time, the external power supply simultaneously powers both the charging / discharging module and the device connected to its output. In this scenario, the process proceeds to the step "Determine the charging / discharging module's input power: If the input power is insufficient to simultaneously support the charging / discharging module's charging and the power supply to the output device, then the charging / discharging module's input channel is shut down, and only the device at the data line's output is charged." In other words, when the external power supply simultaneously powers both the charging / discharging module and the device connected to its output, the determination of the charging / discharging module's input power is triggered again to verify whether the current input power is sufficient to simultaneously support the charging / discharging module's charging and the power supply to the output device.
[0112] In an exemplary embodiment, the preset time in the step of "turning on the input channel of the charging and discharging module after a preset delay" ranges from 10 minutes to 60 minutes, wherein the preset time is adjusted by the software program of the microcontroller unit (MCU).
[0113] The preset time provides a dedicated power supply period for devices connected to the output of the charging / discharging module. A preset time of 10 to 60 minutes accommodates both devices with and without fast charging capabilities. Specifically, when most devices have fast charging capabilities, the preset time can be adjusted to approximately 10 minutes, falling within the 10-60 minute range, based on the microcontroller unit (MCU) software program. Conversely, when most devices lack fast charging capabilities, the preset time can be adjusted to approximately 60 minutes, again within the 10-60 minute range, based on the MCU software program.
[0114] In one exemplary embodiment, such as Figure 3 As shown, it also includes the logic for controlling the pull-down resistors of the channel pins, including the following steps:
[0115] In the initial state and during function switching, the S220 defaults to controlling the configuration channel control module by turning on the pull-down resistor of the configuration channel pin, enabling connected external devices to recognize the effective load and thus output voltage normally. These external devices include OTG (On-The-Go Mode) devices and fast charging devices.
[0116] S222, the detection module uses the voltage source identification unit to determine the source of the detected voltage signal based on the voltage polarity and current flow direction: if the voltage signal comes from the data line input terminal, the pull-down resistor is kept on to adapt to fast charging protocol negotiation or normal charging voltage output.
[0117] S224, if the voltage signal comes from the data line output terminal, outputs a control command to turn off the pull-down resistor of the configuration channel pin.
[0118] S226, after the pull-down resistor is turned off, the mobile device in OTG mode stops discharging externally because no effective load is detected, and the input channel of the charging and discharging module is turned on simultaneously, so that the charging and discharging module can reverse charge the mobile device.
[0119] The default control configuration channel control module activates the pull-down resistors on the configuration channel pins to ensure effective identification of connected devices. When a voltage signal is detected originating from the input of the charging / discharging module (i.e., from the data line input), it is determined that the connected device is an external power source. In this case, the pull-down resistors remain on to accommodate fast charging protocol negotiation or standard charging voltage output. The voltage signal from the data line input can be a signal output from the power adapter or a signal output after connecting to a computer.
[0120] Upon detecting that the voltage signal originates from the output of the charging / discharging module (i.e., from the data line output), it is determined that the connected device is a power-consuming device requiring charging. At this point, a control command is output to disable the pull-down resistor on the configuration channel pin, thereby preventing the power-consuming device from discharging to the charging / discharging module or an external power source connected to it. This allows the charging / discharging module or the external power source connected to it to charge the power-consuming device. The voltage signal from the data line output can be a signal output from a mobile device connected in OTG mode.
[0121] The pull-down resistor control logic for the configuration channel pins has a fast response speed, with a response time of <1ms. Furthermore, the triggering of the pull-down resistor control logic for the configuration channel pins is a hardware-level interrupt trigger. When the voltage of the CC pin changes abruptly, it can directly trigger the microcontroller (MCU) interrupt without software polling, enabling a seamless "plug and charge" experience.
[0122] Compared to pull-up resistor control logic, pull-down resistors consume only μA of current when no effective load is detected, saving 50% more power than pull-up resistor solutions.
[0123] In one exemplary embodiment, such as Figure 3 As shown, the specific process of the data line switching control method for the above-mentioned charging and discharging module is as follows:
[0124] S202, in the initial state, the voltage bus signal (Vbus signal) controlling the charging and discharging module and the data line is turned on, and the configuration channel signal (CC signal) controlling the charging and discharging module and the data line is turned off, so that the data line is in the data transmission state, supporting universal serial bus data transmission between devices connected at both ends of the data line.
[0125] S204, acquire the charging / discharging demand signal of the charging / discharging module, and determine the charging / discharging demand based on the charging / discharging demand signal:
[0126] S206, if the charging / discharging module requires charging, then the input channel of the charging / discharging module is turned on and the output channel of the charging / discharging module is turned off, so that the external power supply can charge the charging / discharging module through the data line.
[0127] S208, if the charging / discharging module requires discharging, disconnect the voltage bus signal (Vbus signal) and turn on the output channel of the charging / discharging module so that the charging / discharging module can charge the device at the output end through the data line.
[0128] S210, if the charging and discharging requirements of the charging and discharging module are obtained simultaneously: control the input channel of the charging and discharging module to be turned on, control the output channel of the charging and discharging module to be turned off, control the voltage bus signal (Vbus signal) between the charging and discharging module and the data line to be turned on, so that the external power supply charges the charging and discharging module through the data line and the input channel of the charging and discharging module, and at the same time charges the device at the output end of the data line through the voltage bus signal (Vbus signal) circuit of the data line and the charging and discharging module.
[0129] S212, Determine the input power at the charging terminal of the charging / discharging module:
[0130] S214 If the input power is insufficient to simultaneously support the charging of the charging and discharging module and the power supply of the output device, then the input channel of the charging and discharging module is shut down, and only the device at the output end of the data line is charged.
[0131] S216, if the input power is sufficient to simultaneously support the charging of the charging and discharging module and the power supply of the output device, then the input channel and output channel of the charging and discharging module are simultaneously turned on, and the output device of the charging and discharging module and the data line is charged at the same time.
[0132] S218, after a preset delay, the input channel of the charging and discharging module is turned on.
[0133] In the initial state and during function switching, the default control configuration channel control module turns on the pull-down resistor of the configuration channel pin, enabling the connected external device to recognize the effective load and thus output voltage normally.
[0134] S222, the detection module uses the voltage source identification unit to determine the source of the detected voltage signal based on the voltage polarity and current flow direction: if the voltage signal comes from the data line input terminal, the pull-down resistor is kept on to adapt to fast charging protocol negotiation or normal charging voltage output.
[0135] S224, if the voltage signal comes from the data line output terminal, outputs a control command to turn off the pull-down resistor of the configuration channel pin.
[0136] S226, after the pull-down resistor is turned off, the mobile device in OTG mode stops discharging externally because no effective load is detected, and the input channel of the charging and discharging module is turned on simultaneously, so that the charging and discharging module can reverse charge the mobile device.
[0137] Specifically, step S204 involves acquiring the charging / discharging demand signal from the charging / discharging module and determining the specific charging / discharging demand based on the signal, including the following steps:
[0138] S2042, when the activation command of the charging / discharging module is received, the voltage signal at the input terminal of the data line is detected.
[0139] S2044, if a voltage signal is present, then the charging / discharging module is determined to be in a charging demand.
[0140] S2046, if there is no voltage signal, then the charging / discharging module is determined to be in a discharging state.
[0141] Therefore, in the above-mentioned data line switching control method for the discharge module, a state judgment is first performed, including the initial state judgment (S202), the charging / discharging state judgment (S204), and the function switching process state judgment (S220). Then, different control flows are entered under different states. Specifically, in the initial state, the voltage bus signal (Vbus signal) between the charging / discharging module and the data line is turned on, and the configuration channel signal (CC signal) between the charging / discharging module and the data line is turned off, so that the data line is in the data transmission state to support universal serial bus data transmission between devices connected to both ends of the data line. In the charging / discharging state, based on the charging / discharging requirements of the charging / discharging module, corresponding charging / discharging control is performed to meet at least one of the charging and discharging requirements of the charging / discharging module and the power consumption requirements of the electrical equipment connected to the output end of the charging / discharging module. In the initial state and during the function switching process, the default control configuration channel control module is turned on. The pull-down resistors of the configured channel pins enable connected external devices to recognize the effective load and output voltage normally. Then, the voltage source identification unit determines the voltage polarity and current flow to determine the source of the detected voltage signal. When the voltage signal comes from the data line input, the pull-down resistor remains on to adapt to fast charging protocol negotiation or normal charging voltage output. When the voltage signal comes from the data line output, a control command is output to close the pull-down resistors of the configured channel pins. After the pull-down resistors are closed, the OTG mode mobile device stops discharging externally because no effective load is detected. Simultaneously, the input channel of the charging and discharging module is turned on to realize reverse charging of the mobile device by the charging and discharging module.
[0142] The charging / discharging requirements of the charging / discharging module can be determined based on the voltage signal at the data line input. That is, without an activation command from the charging / discharging module, it is in an initial state, supporting universal serial bus data transmission between devices connected to both ends of the data line. Upon receiving an activation command from the charging / discharging module, it enters a charging / discharging state to meet at least one of the charging / discharging requirements of the module itself, as well as the power requirements of the devices connected to the output of the charging / discharging module. The transition between the initial state and the charging / discharging state is a function switching process.
[0143] Then, with the charging / discharging module in a charging state and an external power device connected to its output, the input power of the charging / discharging module is assessed to determine the appropriate control flow based on the power supply capacity corresponding to the input power. Specifically, if the input power is insufficient to simultaneously support the charging / discharging module's charging and the power supply to the output device, the charging / discharging module's input channel is closed, and only the device at the data cable's output is charged. If the input power is sufficient to simultaneously support the charging / discharging module's charging and the power supply to the output device, both the charging / discharging module's input and output channels are simultaneously activated, charging both the charging / discharging module and the data cable's output device. If the charging / discharging module's input channel is closed, after a preset delay, it is activated again to reconfirm whether the current input power is sufficient to simultaneously support the charging / discharging module's charging and the output device's power supply, thus initiating a new round of assessment.
[0144] In one exemplary embodiment, such as Figure 4 As shown, a switching control circuit 40 is provided to implement the data line switching control method of the above-mentioned charging and discharging module, including: a voltage bus control module 402, a configuration channel control module 404, a detection module 406, a control module 408, and a charging and discharging control module 410.
[0145] The voltage bus control module 402 includes at least two switching elements for controlling the conduction and disconnection of the voltage bus at both ends of the data line. The voltage bus control module 402 can be configured with a dual-switch parallel branch to adapt to high-power transmission.
[0146] The configuration channel control module 404 includes a switching element for controlling the on and off of the configuration channel signal (CC signal).
[0147] The detection module 406 includes a voltage detection unit and a power detection unit, which are used to detect the voltage signal and input power at the data line input terminal and the data line output terminal, respectively.
[0148] The control module 408 uses a microcontroller unit (MCU) and is electrically connected to the voltage bus control module 402, the configuration channel control module 404, the detection module 406, and the charge / discharge control terminal of the charge / discharge module 102, respectively. It is used to receive the voltage signal / input power transmitted by the detection module 406, execute the preset software program, and output control commands.
[0149] The charge / discharge control module 410 includes a transistor switch, which is used to control the on / off state of the input and output channels of the charge / discharge module 102 according to the instructions of the control module 408.
[0150] The detection module 406 transmits the detected voltage signal / input power to the control module 408 in real time. The control module 408 generates corresponding control commands based on the signal and sends them to the voltage bus control module 402, the configuration channel control module 404, and the charge / discharge control module 410, respectively, to realize the coordinated switching between data line function and charge / discharge function.
[0151] The detection module 406 can detect and output the voltage signals at the data line input and output terminals to the control module 408 in real time. When the control module 408 receives the voltage signal at the data line input terminal, it assumes that an external power source has been connected to the input terminal of the charging / discharging module 102 via the data line. At this time, it determines that the charging / discharging module 102 requires charging and outputs a corresponding control command to turn on the input channel and turn off the output channel of the charging / discharging module 102, so that the external power source can charge the charging / discharging module 102 via the data line. When the control module 408 receives the voltage signal at the data line output terminal, it assumes that the device has been connected to the output terminal of the charging / discharging module 102 via the data line. At this time, it determines that the charging / discharging module 102 requires discharging and outputs a corresponding control command to disconnect the voltage bus signal (Vbus signal) and turn on the output channel of the charging / discharging module 102, so that the charging / discharging module 102 can charge the device at the output terminal via the data line. When the control module 408 can simultaneously receive voltage signals from both the data line input and output terminals, it assumes that an external power supply is connected to the input terminal of the charging / discharging module 102 via the data line, and that the electrical device is connected to the output terminal of the charging / discharging module 102 via the data line. At this time, it outputs corresponding control commands to control the input channel of the charging / discharging module 102 to be turned on, control the output channel of the charging / discharging module 102 to be turned off, and control the voltage signal between the charging / discharging module 102 and the data line to be turned on. This allows the external power supply to charge the charging / discharging module 102 through the data line and the input channel of the charging / discharging module 102, and simultaneously charges the device at the output terminal of the data line through the voltage bus signal (Vbus signal) circuit of the data line and the charging / discharging module 102. When the control module 408 does not receive voltage signals from the data line input and output terminals, it outputs corresponding control commands to control the charging / discharging module 102 to conduct the voltage bus signal (Vbus signal) of the data line and to control the charging / discharging module 102 to disconnect the configuration channel signal (CC signal) of the data line, so that the data line is in the data transmission state and supports universal serial bus data transmission between devices connected at both ends of the data line.
[0152] The detection module 406 can also detect and output the charging input power of the charging module 102 to the control module 408 in real time. When the input power is insufficient to simultaneously support the charging of the charging module 102 and the power supply of the output device, the control module 408 outputs a corresponding control command to shut down the input channel of the charging module 102, charging only the device at the output of the data line. When the input power is sufficient to simultaneously support the charging of the charging module 102 and the power supply of the output device, the control module 408 outputs a corresponding control command to simultaneously turn on the input and output channels of the charging module 102, charging both the charging module 102 and the device at the output of the data line, ensuring that the charging module 102 stores enough power for user use.
[0153] In an exemplary embodiment, the switching elements in the voltage bus control module 402 and the configuration channel control module 404 are FETs (Field Effect Transistors) with a voltage withstand value ≥5V; the transistor switches in the charge / discharge control module 410 are BJTs (Bipolar Junction Transistors) with a current carrying capacity ≥1A; and the resistance values of the voltage divider resistors include 10 kΩ, 15 kΩ, and 5.1 kΩ.
[0154] In an exemplary embodiment, the control module 408 further includes a wake-up unit, which is electrically connected to the voltage detection units at the data line input terminal and the data line output terminal, respectively, and is used to receive voltage change signals and wake up the control module 408 to execute control logic.
[0155] When the wake-up unit receives a voltage surge signal, it outputs a voltage surge command to the control module 408. At this time, the control module 408 determines that the charging and discharging module 102 needs charging based on the received voltage surge command and outputs a corresponding control command to turn on the input channel of the charging and discharging module 102 and turn off the output channel of the charging and discharging module 102 so that the external power supply can charge the charging and discharging module 102 through the data line.
[0156] In an exemplary embodiment, the dual-switch parallel branch of the voltage bus control module 402 includes two parallel FETs, and the dual-switch parallel branch is connected in series with a current sampling resistor. The current sampling resistor is electrically connected to the power detection unit of the detection module 406 to provide real-time feedback of the branch current, and the control module 408 dynamically adjusts the switch conduction state to stabilize power transmission.
[0157] In one exemplary embodiment, the switching control circuit 40 further includes a surge protection module, which includes an electrostatic surge protection element and a voltage divider resistor connected in series with the electrostatic surge protection element. The voltage divider resistor is used to limit the peak value of the electrostatic surge current to prevent damage to the microcontroller unit (MCU) of the control module 408.
[0158] Electrostatic discharge (ESD) surge protection components can be TVS diodes (Transient Voltage Suppressor Diodes), ESD (Electrostatic Discharge) protection devices, or MOV (Metal Oxide Varistors). These components clamp surge voltages to safe levels, ensuring the safe operation of the charging / discharging module's data lines.
[0159] The voltage divider resistor connected in series with the surge protection element limits the peak value of the surge current based on Ohm's law, so that the surge protection element only needs to handle a portion of the energy, thereby avoiding overheating damage to the surge protection element.
[0160] In an exemplary embodiment, the control module 408 is electrically connected to the switching element of the pull-down resistor. Based on the voltage signal source identification result of the detection module 406, it synchronously outputs a turn-on / turn-off command to realize the linkage control between the pull-down resistor and the charging / discharging channel.
[0161] When the control module 408 detects that the voltage signal originates from the input terminal of the charging / discharging module 102 (i.e., the data line input terminal), it determines that the connected device is an external power source. In this case, it keeps the pull-down resistor in the conducting state to adapt to fast charging protocol negotiation or normal charging voltage output. When the control module 408 detects that the voltage signal originates from the output terminal of the charging / discharging module 102 (i.e., the data line output terminal), it determines that the connected device is a device requiring charging. In this case, it outputs a control command to close the pull-down resistor of the configuration channel pin, thereby stopping the device from discharging to the charging / discharging module 102 or the external power source connected to the charging / discharging module 102, thus allowing the charging / discharging module 102 or the external power source connected to the charging / discharging module 102 to charge the device.
[0162] In one exemplary embodiment, a data cable with charging and discharging functions is provided, including: a data cable body, a charging and discharging unit, and a switching control circuit.
[0163] The data cable body uses multi-core transmission cable and has a universal serial bus interface at both ends, which includes configuration channel pins and voltage bus pins.
[0164] The charging and discharging unit is equipped with a charging input interface and a discharging output interface.
[0165] The switching control circuit is the switching control circuit described above. In the switching control circuit, the microcontroller unit (MCU) and the detection module are integrated inside the interface of the data line body. The voltage bus control module and the configuration channel control module of the switching control circuit are electrically connected to the corresponding lines of the data line body, and the charge and discharge control module is electrically connected to the charge and discharge interface of the charge and discharge unit.
[0166] This charging and discharging data cable can handle both data transmission and power transmission, enabling dynamic switching and coordinated operation of the two. When the user needs to transmit data, it can be triggered to enter the initial state to support universal serial bus data transmission between devices connected to both ends of the data cable. When the user needs to perform a charging and discharging operation, it can be triggered to enter the charging and discharging state, so that an external power source can charge the charging and discharging unit through the data cable, or so that the charging and discharging unit can charge the electrical device connected to the output end of the charging and discharging unit through the data cable.
[0167] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0168] Based on the same inventive concept, this application also provides a data line switching control device 50 for implementing the data line switching control method of the charging and discharging module described above. The solution provided by this device is similar to the implementation described in the above method. Therefore, the specific limitations of one or more embodiments of the data line switching control device 50 for charging and discharging modules provided below can be found in the limitations of the data line switching control method for charging and discharging modules described above, and will not be repeated here.
[0169] In one exemplary embodiment, such as Figure 5 As shown, a data line switching control device 50 for a charging and discharging module is provided, including: an initialization module 502, a demand judgment module 504, a charging demand control module 506, and a discharging demand control module 508.
[0170] The initial module 502 is used to control the voltage bus signal between the charging / discharging module and the data line to be turned on in the initial state, and to control the configuration channel signal between the charging / discharging module and the data line to be turned off, so that the data line is in the data transmission state and supports universal serial bus data transmission between devices connected at both ends of the data line.
[0171] The demand determination module 504 is used to acquire the charging / discharging demand signal of the charging / discharging module, and determine the charging / discharging demand based on the charging / discharging demand signal:
[0172] The charging demand control module 506 is used to turn on the input channel and turn off the output channel of the charging and discharging module if the charging and discharging module has a charging demand, so that the external power supply can charge the charging and discharging module through the data line.
[0173] The discharge demand control module 508 is used to disconnect the voltage bus signal and turn on the output channel of the charge / discharge module if the charge / discharge module is in discharge demand, so that the charge / discharge module can charge the device at the output end through the data line.
[0174] In an exemplary embodiment, the demand determination module 504 includes a charge / discharge demand control module.
[0175] The charge / discharge demand control module is used to: control the input channel of the charge / discharge module to be turned on when the charging and discharging demands of the charge / discharge module are simultaneously obtained; control the output channel of the charge / discharge module to be turned off; control the voltage bus signal between the charge / discharge module and the data line to be turned on; enable the external power supply to charge the charge / discharge module through the data line and the input channel of the charge / discharge module, and at the same time charge the device at the output end of the data line through the voltage bus signal circuit of the data line and the charge / discharge module.
[0176] In an exemplary embodiment, the data line switching control device 50 of the charge / discharge module further includes an input power determination module.
[0177] The input power judgment module is used to judge the input power of the charging end of the charging and discharging module: if the input power is insufficient to support the charging of the charging and discharging module and the power supply of the output device at the same time, the input channel of the charging and discharging module is closed, and only the device at the output end of the data line is charged.
[0178] In an exemplary embodiment, the demand determination module 504 further includes: a voltage signal detection module, a first demand determination module, and a second demand determination module.
[0179] The voltage signal detection module is used to detect the voltage signal at the data line input terminal when the activation command of the charging / discharging module is received.
[0180] The first requirement determination module is used to determine that the charging / discharging module requires charging if a voltage signal is present.
[0181] The second requirement determination module is used to determine the charging / discharging module as the discharge requirement if no voltage signal is present.
[0182] In one exemplary embodiment, the activation instruction is either a user-triggered operation instruction or a data line input voltage surge instruction detected by the microcontroller unit.
[0183] In one exemplary embodiment, the data line switching control device 50 of the charge / discharge module further includes a delay module.
[0184] The delay module is used to turn on the input channel of the charging and discharging module after a preset delay time.
[0185] In one exemplary embodiment, the preset time ranges from 10 minutes to 60 minutes, wherein the preset time is adjusted by the software program of the microcontroller unit.
[0186] In one exemplary embodiment, the system further includes pull-down resistor control logic for configuring channel pins, comprising the steps of: a default configuration module, a voltage source identification module, and a configuration shutdown module.
[0187] The default configuration module is used to turn on the pull-down resistor of the configuration channel pin during the initial state and function switching process, so that the connected external device can recognize the effective load and then output voltage normally.
[0188] The voltage source identification module is used by the detection module to determine the source of the detected voltage signal based on the voltage polarity and current flow direction. If the voltage signal comes from the data line input terminal, the pull-down resistor is kept on to adapt to fast charging protocol negotiation or normal charging voltage output.
[0189] The configuration shutdown module is used to output a control command if the voltage signal comes from the data line output terminal, to close the pull-down resistor of the configuration channel pin. After the pull-down resistor is closed, the mobile device in OTG mode stops discharging externally because no effective load is detected, and the input channel of the charging and discharging module is turned on simultaneously, so as to realize the reverse charging of the mobile device by the charging and discharging module.
[0190] Each module in the data line switching control device 50 of the aforementioned charging and discharging module can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0191] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores the data required for the data line switching control method of the charging / discharging module. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a data line switching control method for a charging / discharging module.
[0192] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0193] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods of the data line switching control method of the charging and discharging module described above.
[0194] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described data line switching control methods for the charging / discharging module.
[0195] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of any of the methods of the data line switching control method for the charging / discharging module described above.
[0196] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of any of the methods of the data line switching control method for the charging / discharging module described above.
[0197] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0198] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0199] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data line switching control method for a charging / discharging module, characterized in that, include: In the initial state, the voltage bus signal controlling the charging and discharging module and the data line is turned on, and the configuration channel signal controlling the charging and discharging module and the data line is turned off, so that the data line is in the data transmission state, supporting universal serial bus data transmission between devices connected at both ends of the data line; Obtain the charging / discharging demand signal from the charging / discharging module, and determine the charging / discharging demand based on the charging / discharging demand signal: If the charging / discharging module requires charging, then the input channel of the charging / discharging module is turned on and the output channel of the charging / discharging module is turned off, so that the external power supply can charge the charging / discharging module through the data line; If the charging / discharging module requires discharging, the voltage bus signal is disconnected, and the output channel of the charging / discharging module is turned on, so that the charging / discharging module can charge the device at the output end through the data line.
2. The method according to claim 1, characterized in that, Steps: After acquiring the charge / discharge demand signal from the charge / discharge module and determining the charge / discharge demand based on the signal, the following steps are also included: If the charging and discharging requirements of the charging and discharging modules are obtained simultaneously: The input channel of the control charging and discharging module is turned on; The output channel of the charge / discharge control module is disconnected; The voltage bus signal between the control charging / discharging module and the data line is turned on; The external power supply charges the charging module through the data line and the input channel of the charging module, and simultaneously charges the device at the output end of the data line through the voltage bus signal circuit of the data line and the charging module.
3. The method according to claim 2, characterized in that, It also includes the following steps: Determine the input power at the charging terminal of the charging / discharging module: If the input power is insufficient to simultaneously support the charging and discharging of the module and the power supply of the output device, the input channel of the charging and discharging module will be shut down, and the device at the output end of the data line will be charged only.
4. The method according to claim 1, characterized in that, In the control unit that controls the on / off state of the voltage bus signal, controls the disconnection of the configuration channel signal, determines the charging / discharging demand, and connects the input and output channels of the charging / discharging module, at least one control unit is a microcontroller unit.
5. The method according to claim 1, characterized in that, Steps: Acquire the charging / discharging demand signal from the charging / discharging module, and determine the charging / discharging demand based on the charging / discharging demand signal. This also includes the following steps: When the activation command of the charging and discharging module is received, the voltage signal at the input terminal of the data line is detected; If a voltage signal is present, it is determined that the charging / discharging module is in need of charging. If no voltage signal is present, then the charging / discharging module is determined to be in a discharging state.
6. The method according to claim 5, characterized in that, The activation command in the step of "detecting the voltage signal at the data line input terminal when the activation command of the charging and discharging module is obtained" is either an operation command triggered by the user or a sudden voltage change command at the data line input terminal detected by the microcontroller unit.
7. The method according to claim 3, characterized in that, Following the step of "if the input power is insufficient to simultaneously support the charging of the charging / discharging module and the power supply to the output device, then shut down the input channel of the charging / discharging module and only charge the device at the output end of the data line," the following is also included: After a preset delay, the input channel of the charging and discharging module is turned on.
8. The method according to claim 7, characterized in that, The preset time in the step of "delaying a preset time and then turning on the input channel of the charging and discharging module" ranges from 10 minutes to 60 minutes, and the preset time is adjusted by the software program of the microcontroller unit.
9. The method according to any one of claims 1-8, characterized in that, It also includes the logic for configuring the pull-down resistors of the channel pins, including the following steps: During the initial state and function switching process, the default control configuration channel control module turns on the pull-down resistor of the configuration channel pin, so that the connected external device can recognize the effective load and then output voltage normally. The detection module uses a voltage source identification unit to determine the source of the detected voltage signal based on the voltage polarity and current flow direction: if the voltage signal comes from the data line input terminal, the pull-down resistor is kept on to adapt to fast charging protocol negotiation or normal charging voltage output. If the voltage signal comes from the data line output, then output a control command to turn off the pull-down resistor of the configuration channel pin; When the pull-down resistor is turned off, the mobile device in OTG mode stops discharging externally because no effective load is detected, and the input channel of the charging and discharging module is turned on simultaneously, so that the charging and discharging module can reverse charge the mobile device.
10. A switching control circuit for implementing the method of any one of claims 1-9, characterized in that, include: The voltage bus control module includes at least two switching elements for controlling the conduction and disconnection of the voltage bus at both ends of the data line. The voltage bus control module can be configured with a dual-switch parallel branch to adapt to high-power transmission. The configuration channel control module includes switching elements for controlling the on and off of the configuration channel signal; The detection module includes a voltage detection unit and a power detection unit, which are used to detect the voltage signal and input power at the data line input terminal and data line output terminal, respectively. The control module, which adopts a microcontroller unit, is electrically connected to the voltage bus control module, the configuration channel control module, the detection module, and the charge / discharge control terminal of the charge / discharge module, respectively. It is used to receive the voltage signal / input power transmitted by the detection module, execute the preset software program, and output control commands. The charging and discharging control module includes a transistor switch, which is used to control the conduction and disconnection of the input and output channels of the charging and discharging module according to the instructions of the control module; The detection module transmits the detected voltage signal / input power to the control module in real time. The control module generates corresponding control commands based on the signal and sends them to the voltage bus control module, configuration channel control module, and charge / discharge control module, respectively, to achieve coordinated switching between data line function and charge / discharge function.
11. The switching control circuit according to claim 10, characterized in that, The switching control circuit also includes a surge protection module, which includes an electrostatic surge protection element and a voltage divider resistor connected in series with the electrostatic surge protection element. The voltage divider resistor is used to limit the peak value of the electrostatic surge current and prevent damage to the microcontroller unit of the control module.
12. The switching control circuit according to claim 10, characterized in that, The control module is electrically connected to the switching element of the pull-down resistor. Based on the voltage signal source identification result of the detection module, it synchronously outputs on / off commands to realize the linkage control between the pull-down resistor and the charging / discharging channel.
13. A data cable with charging and discharging functions, characterized in that, include: The data cable body uses multi-core transmission cable and has a universal serial bus interface at both ends. The interface includes configuration channel pins and voltage bus pins. The charging / discharging unit is equipped with a charging input interface and a discharging output interface; The switching control circuit is the switching control circuit according to any one of claims 10-12. In the switching control circuit, the microcontroller unit and the detection module are integrated inside the interface of the data line body. The voltage bus control module and the configuration channel control module of the switching control circuit are electrically connected to the corresponding lines of the data line body, and the charge / discharge control module is electrically connected to the charge / discharge interface of the charge / discharge unit.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.