A control method and a first electronic device

By introducing a hardware-level control mechanism into portable electronic devices and using input/output pins to control the power supply interface, the problem of battery overcharging during unattended charging of portable electronic devices is solved, thus achieving safety and reliability in the charging process.

CN122246924APending Publication Date: 2026-06-19LENOVO (BEIJING) LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LENOVO (BEIJING) LTD
Filing Date
2026-03-24
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

When portable electronic devices are charged via USB without human intervention, the batteries are prone to overcharging, and current technology cannot effectively guarantee the safety of the charging process.

Method used

By introducing a hardware-level control mechanism into portable electronic devices, the power supply interface can be controlled by using input/output pins (such as GPIO). Control signals are sent to the controller according to the preset charging time to switch the level state to disconnect the power supply interface and ensure that charging ends at the appropriate time.

🎯Benefits of technology

It effectively eliminates the risk of battery overcharging caused by prolonged charging, improves the safety of the charging process, especially for low-end devices, and avoids battery performance degradation and extreme safety accidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122246924A_ABST
    Figure CN122246924A_ABST
Patent Text Reader

Abstract

This application discloses a control method and a first electronic device. The control method includes: obtaining a preset charging duration in response to a first trigger event; the first trigger event is used to trigger a second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system; based on the preset charging duration, sending a first control signal to the controller of the first electronic device, so that the controller, in response to the first control signal, switches the input / output pins of the power supply interface from a first level state to a second level state, wherein in the second level state, the input / output pins are used to disconnect the power supply of the power supply interface; the power supply interface is used to supply power to the second electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more particularly to a control method and a first electronic device. Background Technology

[0002] Currently, most portable electronic devices use USB interfaces as charging ports. To control production costs, manufacturers only provide USB charging cables and do not offer dedicated charging heads. In actual use, users often choose to charge their devices via the USB ports of computers and other electronic devices. However, when charging continuously via the USB port of an electronic device without supervision, the battery is prone to overcharging, and the safety of the charging process cannot be guaranteed. Summary of the Invention

[0003] The technical solution provided in this application is as follows:

[0004] The first aspect of this application provides a control method, comprising:

[0005] In response to a first triggering event, a preset charging duration is obtained; the first triggering event is used to trigger a second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system;

[0006] Based on the preset charging time, a first control signal is sent to the controller of the first electronic device, so that the controller responds to the first control signal and switches the input / output pins of the power supply interface from a first level state to a second level state. In the second level state, the input / output pins are used to disconnect the power supply of the power supply interface; the power supply interface is used to supply power to the second electronic device.

[0007] In one possible implementation, the response to the first triggering event includes:

[0008] In response to the power supply interface of the first electronic device establishing an electrical connection with the second electronic device.

[0009] In one possible implementation, the response to the first triggering event includes:

[0010] Received a user command triggered by a function key combination.

[0011] In one possible implementation, in response to the first electronic device including multiple power supply interfaces, obtaining the preset charging duration includes:

[0012] Select the preset charging duration corresponding to the power supply interface that establishes an electrical connection with the second electronic device from a plurality of preset charging durations; the plurality of preset charging durations correspond to the plurality of power supply interfaces of the first electronic device.

[0013] In one possible implementation, the preset charging duration is determined in any of the following ways:

[0014] Receive the user's input of a set duration and use the set duration as the preset charging duration;

[0015] In response to the second electronic device connecting to the power supply interface of the first electronic device, the charging power of the second electronic device is obtained, and a preset charging time is configured based on the charging power; the preset charging time is used to ensure that the second electronic device is charged safely.

[0016] In one possible implementation, the control method further includes:

[0017] When the first system is running, in response to a change in the number of second electronic devices connected to the power supply interface of the first electronic device, the preset charging time of the power supply interface is adjusted based on the output power of the power supply interface and the changed number of second electronic devices connected to the power supply interface; wherein, the adjusted preset charging time is used to ensure that each second electronic device connected to the power supply interface can complete safe charging.

[0018] In one possible implementation, the control method further includes:

[0019] When the first system is running, in response to a second triggering event, parameters for configuring the power supply interface of the first electronic device are obtained from the second system;

[0020] Based on the parameters used to configure the power supply interface of the first electronic device, an interactive interface displayed in the first system is generated.

[0021] In response to a modification operation on the preset charging time of the power supply interface in the interactive interface, the preset charging time is adjusted.

[0022] In one possible implementation, the step of sending a first control signal to the first electronic device based on the preset charging duration includes:

[0023] Get the current system time;

[0024] Based on the current system time and the preset charging duration, the charging cutoff time is determined;

[0025] When the charging cutoff time is reached, a first control signal is sent to the controller of the first electronic device.

[0026] In one possible implementation, the control method further includes:

[0027] In response to a third triggering event, a second control signal is sent to the controller of the first electronic device, such that the controller switches the input / output pin from the second level state to the first level state in response to the second control signal.

[0028] In another aspect, this application provides a first electronic device, comprising:

[0029] At least one power supply interface; the power supply interface is used to supply power to a second electronic device;

[0030] The controller includes at least one input / output pin; the input / output pin is connected to the power supply interface;

[0031] Processor, used for:

[0032] In response to a first triggering event, a preset charging duration is obtained; the first triggering event is used to trigger a second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system;

[0033] Based on the preset charging time, a first control signal is sent to the controller, so that the controller responds to the first control signal by switching the input / output pin from a first level state to a second level state. In the second level state, the input / output pin is used to disconnect the power supply of the power supply interface. Attached Figure Description

[0034] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0035] Figure 1 A flowchart illustrating a control method provided in Embodiment 1 of this application;

[0036] Figure 2 This is a flowchart illustrating a control method provided in Embodiment 6 of this application;

[0037] Figure 3 A flowchart illustrating a control method provided in Embodiment 7 of this application;

[0038] Figure 4 A schematic diagram of the interactive interface of a first system provided in this application;

[0039] Figure 5 A flowchart illustrating a control method provided in Embodiment 9 of this application;

[0040] Figure 6 A schematic diagram illustrating the application of a control method provided in this application. Detailed Implementation

[0041] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0042] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0043] The terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units, but may include other units not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0044] Reference Figure 1 This is a flowchart illustrating a control method provided in Embodiment 1 of this application, as shown below. Figure 1 As shown, the method may include, but is not limited to, the following steps:

[0045] Step S101: In response to the first trigger event, obtain the preset charging time; the first trigger event is used to trigger the second system of the first electronic device to control the charging time of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system.

[0046] In this embodiment, the second electronic device can establish a physical connection with the power supply interface of the first electronic device through its own charging interface and a matching charging cable.

[0047] The power supply interface is the physical hardware terminal of the first electronic device. It integrates functional pins such as power supply pins and ground pins. These pins are the basic hardware for the power supply interface to realize power transmission and are an inherent component of the power supply interface. They are directly used to establish an electrical connection with the charging connection cable to complete the transmission of power to the second electronic device.

[0048] Between the power supply circuit of the first electronic device and the hardware link of the power supply interface, input and output pins of the power supply interface (such as GPIO (general purpose input / output pins), programmable input / output pins, etc.) can be set. These input and output pins of the power supply interface are not integrated pins of the power supply interface itself, but are independently set hardware control pins. They are the core hardware nodes that control the power supply interface to turn on and off, and realize the conduction and disconnection control of the overall power supply path of the power supply interface.

[0049] When the input and output pins of the power supply interface are in the on state, the power supply circuit of the first electronic device forms a closed circuit, and electrical energy can be stably delivered to the second electronic device through the power supply pins, ground pins and other functional pins of the power supply interface itself, so as to realize the charging operation of the second electronic device.

[0050] When the input / output pins of the power supply interface are in the off state, the power supply circuit of the first electronic device is cut off. Even if the power supply interface maintains a physical and electrical connection with the second electronic device, electrical energy cannot be delivered to the functional pins of the power supply interface, and the power output of the power supply interface will then terminate, and the first electronic device will stop supplying power to the second electronic device.

[0051] In this application, there are no restrictions on the conduction configuration of the input and output pins of the power supply interface. For example, if the power supply interface is not connected to any second electronic device, the input and output pins are already in a conducting state. When the second electronic device establishes a physical connection with the power supply interface through a charging cable, charging can be directly initiated. Alternatively, before the second electronic device is connected to the power supply interface, the input and output pins are in a disconnected state. When the first electronic device senses that the second electronic device is connected to the power supply interface, the controller can control the pins to switch to a conducting state, thereby initiating charging.

[0052] In this embodiment, the specific hardware form of the power supply interface is not limited and can be flexibly configured according to the hardware architecture of the first electronic device and the charging requirements of the second electronic device. For example, the implementation methods include, but are not limited to:

[0053] The power supply interface can be a USB Port, specifically including common USB physical interface types such as USB-A, USB-C, and Micro-USB. This type of interface is a common power supply interface for portable electronic devices and can meet the charging needs of most small portable electronic devices.

[0054] Alternatively, the power supply interface can be a Thunderbolt interface or a docking station integrated power supply interface. The Thunderbolt interface is a hardware interface that integrates high-speed data transmission and power output functions, while the docking station integrated power supply interface is a hardware interface on the docking station accessory that has power output capabilities. This type of interface can be adapted to a second electronic device that supports fast charging protocols, and is also suitable for a first electronic device such as a thin and light laptop, all-in-one computer, or desktop computer equipped with a Thunderbolt interface or a docking station interface. Moreover, its power supply on / off control logic is completely consistent with that of a USB Port.

[0055] The first system may include, but is not limited to, the operating system of the first electronic device (such as Windows, Mac OS, Linux, etc.), which is an upper-level software system running on the first electronic device, responsible for responding to the user's regular operations, and its operation depends on the booting of the second system and the hardware resources of the first electronic device.

[0056] The second system may include, but is not limited to, the BIOS (Basic Input / Output System) of the first electronic device. It is the boot system of the first system, responsible for power-on hardware self-test and hardware resource allocation, and has native capabilities such as low-level hardware control, hardware signal detection, and hardware clock reading.

[0057] The preset charging time can be flexibly configured according to actual usage needs, and this application does not limit its specific value. This preset charging time serves as a power supply time control threshold for the power supply interface, primarily used to impose hard constraints on the power supply process of the power supply interface from a time perspective. By limiting the maximum power supply time, it avoids continuous power supply behavior in various scenarios, eliminates the risk of battery overcharging, and ensures the safety of the second electronic device throughout the entire charging process via the power supply interface. The preset charging time can be obtained by the second system (BIOS) after responding to the first trigger event, serving as the core time basis for subsequent control of the power supply interface's power on / off state.

[0058] The second system, as the boot system of the first system, runs on the underlying hardware of the motherboard of the first electronic device and does not depend on the software environment of the first system. Even if the first system is in a hibernation, low power consumption, lag or even abnormal program state, the second system can still stably complete the trigger event detection, charging time retrieval and subsequent timing control, ensuring that the charging time control logic is not interrupted and adapting to various charging scenarios.

[0059] Step S102: Based on the preset charging time, send a first control signal to the controller of the first electronic device, so that the controller responds to the first control signal and switches the input / output pins of the power supply interface from a first level state to a second level state. In the second level state, the input / output pins are used to disconnect the power supply of the power supply interface; the power supply interface is used to supply power to the second electronic device.

[0060] In this embodiment, the second system can transmit a first control signal carrying instruction data to the controller and write the instruction data therein into a designated register of the controller.

[0061] In this embodiment, the instruction data can be configured to a hardware encoding format natively adapted to the controller. When this configuration is adopted, the instruction data does not need to be parsed, translated or formatted by any software layer. The controller can directly read the instruction data from the designated register and directly execute the corresponding hardware action according to the hardware encoding of the instruction data. That is, it performs a level state switching operation on the input and output pins of the power supply interface, switching them from the first level state of being powered on to the second level state of being powered off.

[0062] This application does not impose a unique limitation on the encoding format of instruction data. Instruction recognition can be achieved by adding a parsing step for non-natively adapted encoding formats, and all such instances fall within the protection scope of this application.

[0063] In this embodiment, the specific hardware form of the controller is not limited. The controller can be the EC (embedded controller) or PCH (platform controller hub) of the first electronic device. Both are dedicated hardware control chips on the motherboard and are directly electrically connected to the input and output pins (e.g., GPIO) of the power supply interface. They can receive the first control signal issued by the second system (BIOS) and perform level state switching operation of the input and output pins of the power supply interface according to the first control signal to realize hardware control of the power supply interface power on and off.

[0064] In this embodiment, when the first trigger event occurs, the first system can quickly respond and obtain the preset charging duration, and send a first control signal to the controller based on the preset charging duration. After receiving the first control signal, the controller will immediately perform the corresponding operation, switch the input / output pins to the second level state, disconnect the power supply path of the power supply interface, and even if the power supply interface and the second electronic device still maintain physical and electrical connection, power cannot continue to be delivered to the device, and the charging process will stop immediately.

[0065] This hardware-level approach precisely constrains the power supply process of the power interface from a time perspective. Regardless of the scenario, charging will automatically terminate once the preset charging time is reached, effectively preventing continuous power supply. This control method no longer relies on the charging protection mechanism of the second electronic device itself, but instead uses the hardware control of the first electronic device to force charging to stop at an appropriate time, fundamentally avoiding the risk of battery overcharging due to prolonged charging and improving the safety of the charging process.

[0066] This control method is particularly significant for low-end portable electronic devices (i.e., an implementation of a second electronic device) that lack dedicated charging adapters and vary in quality. These low-end devices, due to cost considerations, often have numerous deficiencies in their battery management systems and charging protection circuits. Unlike high-end devices, they lack precise charging control algorithms and robust protection mechanisms, making it difficult to dynamically adjust charging parameters based on the battery's real-time status. When charging for extended periods through the power interface of the first electronic device, the battery remains in a charging state, with excessive current and voltage continuously flowing into the battery. This leads to a series of severe chemical reactions and physical changes within the battery, such as a rapid increase in battery temperature, irreversible decomposition of the electrolyte, and damage to the electrode material structure. These adverse reactions significantly shorten battery life and reduce battery performance and stability. More seriously, they may cause extreme dangers such as battery swelling, leakage, or even fire. The hardware control method adopted in this embodiment effectively avoids these problems, providing reliable protection for the charging safety of low-end portable electronic devices.

[0067] Furthermore, the second system, serving as the boot system for the first system, operates on the underlying hardware of the motherboard of the first electronic device and does not depend on the software runtime environment of the first system. Even if the first system is in a hibernation, low-power, lagging, or even abnormal program state, the second system can still run stably, ensuring that the charging time control logic is not interrupted. This fundamentally guarantees the stability and reliability of the charging control process and avoids the risk of battery overcharging caused by charging control failure due to operating system problems.

[0068] Furthermore, the controller's input and output pins are directly electrically connected to the power supply interface, allowing it to directly respond to BIOS control signals and perform level switching operations. This hardware-level control method eliminates the need for software-level parsing, translation, or format conversion, avoiding potential delays and fault risks at the software level. It ensures accurate triggering of power-off actions and further guarantees charging safety from the control link level.

[0069] As another optional embodiment of this application, a control method provided in Embodiment 2 of this application is mainly an implementation method for responding to the first triggering event, which may include, but is not limited to, the following steps:

[0070] Step S11: In response to the power supply interface of the first electronic device, an electrical connection is established with the second electronic device.

[0071] In this embodiment, the power supply interface of the first electronic device may include various functional pins, such as power supply pins and ground pins. When not connected, these pins are in a specific initial state; for example, the power supply pins have no current output, and the relevant pin levels are at their default values.

[0072] When the second electronic device establishes an electrical connection with the power supply interface of the first electronic device via the charging cable, the charging cable creates a stable conductive path between the functional pins of the power supply interface of the first electronic device and the corresponding pins of the charging interface of the second electronic device. At this time, the power supply pins begin to have current ready to output (although charging has not yet actually started, the conditions for power transmission are met), and the voltage levels of some pins will change. For example, a detection pin that was originally at a low level will become a high level after connection.

[0073] These changes in pin states are detected by the relevant hardware detection circuitry within the first electronic device. Once a change in pin state is detected, the hardware detection circuitry generates a corresponding electrical signal and transmits this signal to either the first system or the second system. If it is transmitted to the first system, it can then transmit the signal to the second system.

[0074] When the second system receives the electrical signal, it can obtain the preset charging time.

[0075] In this embodiment, by establishing an electrical connection between the power supply interface of the first electronic device and the second electronic device, a preset charging time is obtained. Based on the preset charging time, a first control signal is sent to the controller of the first electronic device. This allows the second system to quickly start timing and controlling the charging time the instant the second electronic device connects to the power supply interface and begins charging. This rigid time constraint established from the beginning of charging effectively avoids overcharging caused by the user forgetting to manually trigger the timing function. Overcharging not only damages the battery life of electronic devices but may also cause safety hazards. This triggering method reduces the risk of overcharging from the source, providing strong protection for charging safety.

[0076] As another optional embodiment of this application, a control method provided in embodiment 3 of this application is mainly an implementation method for responding to the first triggering event, which may include, but is not limited to, the following steps:

[0077] Step S12: Receive user command triggered by function combination key.

[0078] In this embodiment, the function combination keys can be flexibly set according to the design of the first electronic device and the user's usage habits. For example, common combinations can be "Fn + a specific function key" (e.g., a key among F1-F12), "Fn + a specific letter key" (e.g., Fn+E), or "Ctrl + Alt + a specific letter key", etc.

[0079] By using a combination of function keys, users can proactively control the charging time of a second electronic device when needed. For example, if a user knows that the second electronic device only needs to be charged for a certain period of time, or is concerned that the automatic triggering mechanism may not work properly in certain special circumstances (such as an unstable power supply connection but the user still wants to charge for a limited time), they can press the function combination key to start the charging time control process, ensuring that the charging process is completed within the preset time and avoiding the risk of overcharging.

[0080] In this embodiment, the first electronic device is equipped with a dedicated hardware detection circuit for real-time monitoring of keyboard input signals. When a user presses a function combination key, the keyboard circuit generates corresponding electrical signal changes, which are quickly captured by the hardware detection circuit. The hardware detection circuit analyzes and identifies these electrical signals to determine whether a preset function combination key has been pressed.

[0081] Once the hardware detection circuit confirms that the function combination key has been pressed, it generates a specific trigger signal and transmits it to the first system. Upon receiving this signal, the first system further transmits it to the second system (BIOS). The second system, as the core boot system of the entire control process, immediately initiates subsequent operations upon receiving the trigger signal.

[0082] In this embodiment, the first trigger event is set to receiving a user command triggered via a function key combination. This design grants the user absolute control over charging time management. In real-world usage scenarios, the charging needs of the second electronic device vary widely. Users can manually initiate the charging time management process at the appropriate time based on specific circumstances. For example, when the power supply interface connection is unstable, the automatic triggering mechanism may not accurately detect the start of charging, while manual triggering by the user ensures accurate timing. If the user clearly knows the required charging time for the second electronic device, there is no need to rely on automatic timing; manual operation better meets personalized needs. In scenarios where automatic timing is not required, manual triggering provides a flexible option. This design enhances the flexibility and adaptability of the solution in different scenarios, making charging management more aligned with the user's actual needs.

[0083] Furthermore, the function combination key triggering method relies on a dedicated hardware detection circuit within the first electronic device to capture, analyze, and transmit signals. When the user presses a function combination key, the keyboard circuit generates specific electrical signal changes. The hardware detection circuit can quickly capture these changes and accurately analyze them to determine whether a preset function combination key has been triggered. Once confirmed, a trigger signal is immediately generated and quickly and accurately transmitted to the second system (BIOS). The entire process eliminates the need for redundant software parsing, avoiding potential delays caused by software parsing and ensuring that the charging timer starts quickly, providing a strong guarantee for users to manage charging time in a timely manner.

[0084] This triggering method serves as an effective supplement to automatic triggering, forming a dual triggering mechanism together with the automatic triggering method based on the electrical connection to the power supply interface. In practical applications, a single automatic triggering mechanism may fail in certain special scenarios, such as abnormal power supply interface connection or system software failure, causing the charging timer to fail to start normally and thus leading to the risk of overcharging. The dual triggering mechanism works in tandem; when automatic triggering malfunctions, users can manually trigger the charging timer control via a combination of keys, further ensuring the effective activation of the charging timer control and avoiding the overcharging risk caused by the failure of a single automatic triggering mechanism in special scenarios.

[0085] As another optional embodiment of this application, a control method provided in Embodiment 4 of this application, the first electronic device in this embodiment may include multiple power supply interfaces. This embodiment is mainly an implementation method for obtaining the preset charging time in Embodiment 2, and may include, but is not limited to, the following steps:

[0086] Step S31: Select the preset charging time corresponding to the power supply interface that establishes an electrical connection with the second electronic device from a plurality of preset charging times; the plurality of preset charging times correspond to the plurality of power supply interfaces of the first electronic device.

[0087] Users need to charge various types of secondary electronic devices, with significant differences in battery capacity and charging requirements. For example, a Bluetooth headset or mini fan with a single lithium battery can be fully charged in 1-2 hours, while a handheld fan with 3-4 lithium batteries or a small power bank requires 3-5 hours, and a high-capacity power bank may take even longer. If all power outlets share a single preset charging time, it could lead to overcharging of small-capacity devices or premature power loss for large-capacity devices. By configuring different preset charging times for each outlet, users can simply select the appropriate outlet based on the type of device being charged, eliminating the need to manually adjust the preset time each time. This significantly lowers the operational barrier for users and aligns with their everyday habit of freely choosing charging outlets.

[0088] Even if users choose any power interface according to their needs and device placement, such as plugging a Bluetooth headset that only needs 1 hour to fully charge into the interface with a preset 5-hour charge time, the final result is only a limited 5-hour charge under the forced control of the hardware, not uncontrolled continuous charging. Moreover, the preset 5-hour duration is a reasonable threshold tested by battery safety and will not cause extreme safety accidents such as battery swelling, leakage, or fire. If a high-capacity device is plugged into the short-duration interface, the device will only be cut off before it is fully charged, which may affect the user experience, but there is no safety hazard.

[0089] To address the issue of users being unaware of the corresponding power supply interfaces, when a second electronic device is connected to the interface, the operating system (i.e., an implementation of the first system) can display the preset duration and compatible devices of the current interface through a notification bar / pop-up window based on the interface configuration information synchronized by the BIOS (i.e., an implementation of the second system). At the same time, it can simply prompt "If you need to charge XX device, it is recommended to switch to XX interface". The technology is simple to implement and does not occupy additional hardware resources.

[0090] In this embodiment, each power supply interface of the first electronic device is equipped with an independent power supply circuit, and the input / output pins (GPIO) of each power supply interface are independent hardware control pins, which are directly electrically connected to the controller (EC / PCH). The power on / off and duration control of a single power supply interface will not affect the normal use of other interfaces.

[0091] In practical use, users often need to charge multiple different types of low-end devices simultaneously. If all interfaces share the same preset charging time, it cannot meet the differentiated charging needs of multiple devices. However, by configuring a preset charging time for each power interface, users can plug devices with different charging time requirements into the corresponding interfaces. The first electronic device will independently retrieve its own preset charging time, independently execute timing control, and independently complete the power-off operation for each connected interface. The charging process of each device does not interfere with each other, which makes full use of the hardware resources of multiple power interfaces and avoids the overcharging or undercharging problems caused by the uniform charging time when multiple devices are charged at the same time.

[0092] As another optional embodiment of this application, this embodiment provides a control method for embodiment 5 of this application. This embodiment is mainly an implementation of the preset charging time in embodiment 1. The preset charging time can be determined, but is not limited to, any of the following methods:

[0093] Step S41: Receive the user's input setting duration and use the setting duration as the preset charging duration.

[0094] Users can access the preset charging time input interface through any of the following methods: the BIOS settings interface of the first electronic device, the visual program accompanying the first system (operating system), or the dedicated quick settings panel. This input interface supports numerical input of the duration (such as in hours or minutes), and the operation logic is simple and easy to understand, adapting to the usage habits of ordinary users.

[0095] Once the user completes the duration input and confirms it, the input duration will be transmitted to the second system (BIOS) in the form of an electrical signal or a data signal. The second system will parse and store the signal and use it as the preset charging duration for the current power supply interface. If the first electronic device is designed with multiple power supply interfaces, it can support inputting the set duration for each interface individually, realizing personalized configuration of multiple interfaces.

[0096] The user-inputted duration takes effect immediately upon confirmation. When the second system responds to the first triggering event (such as device access or function key combination triggering), it can directly retrieve the user-inputted duration as the timing basis.

[0097] The preset charging time can be modified by the user at any time. If the user changes to a second electronic device with different charging needs in the future, the user can re-enter the appropriate time without complicated hardware operations, which greatly improves the flexibility of use.

[0098] In this embodiment, by receiving the user's input of a set duration, the set duration is used as the preset charging duration, which can meet the user's independent usage needs. For example, if the user knows that a certain second electronic device only needs to be charged for 1.5 hours, or that the device only needs to be charged for 2 hours due to a travel plan, the user can manually set the corresponding duration to achieve on-demand charging and precise power-off.

[0099] This method can also be used as a supplement to fixed timing for multiple interfaces. If the user is unaware of the compatibility between the interface and the device, they can directly input the adaptation duration for the currently used interface to solve the problem of interface and duration mismatch.

[0100] Step S42: In response to the second electronic device connecting to the power supply interface of the first electronic device, obtain the charging power of the second electronic device, and configure a preset charging time based on the charging power; the preset charging time is used to ensure that the second electronic device is charged safely.

[0101] In this embodiment, the hardware detection circuit or controller (EC / PCH) of the first electronic device can perform real-time data acquisition at the hardware level through the power supply pins and detection pins of the power supply interface to directly detect the actual power consumption of the second electronic device. This process is delay-free, the detection results are accurate, and it does not rely on any data feedback from the second electronic device.

[0102] In this embodiment, the first electronic device can also communicate with the second electronic device, and the second electronic device can actively feed back its own charging power, battery capacity and other charging-related parameters to the first electronic device, so as to obtain more accurate power data that is closer to the actual situation of the device and avoid minor errors in hardware detection.

[0103] The preset charging duration configured based on the charging power may include, but is not limited to, any one of the following:

[0104] Step S421: Find the charging time corresponding to the charging power in the mapping table and use it as the preset charging time.

[0105] The mapping table can be developed based on actual measurements of mainstream charging power, battery capacity, and safe charging thresholds for low-end portable devices.

[0106] The mapping table can be divided into fixed levels according to the common charging power of the second electronic device. Each power level corresponds to a fixed safe charging time that has been tested for safety. This time is the maximum safe threshold at which the device can be fully charged without overcharging.

[0107] Step S422: Determine and configure the preset charging time based on the safety redundancy coefficient and charging power.

[0108] In this embodiment, the preset charging time can be determined by the following relationship:

[0109] T = C / P × K

[0110] T represents the preset charging time; C represents the reference battery capacity, which can be the average battery capacity of the second electronic device under different power ranges; P represents the charging power; K represents the safety redundancy coefficient, which is used to offset problems such as low charging efficiency and line loss, and will not cause overcharging.

[0111] Once the second system obtains the charging power, it can directly substitute it into the formula for calculation. The result is the preset charging time for this charge. The calculation process is completed at the hardware level and takes little time.

[0112] In this embodiment, the charging power directly reflects the charging specifications and battery capacity-related characteristics of the device. Based on this configuration, the duration does not require users to judge and set it based on experience. It is fully compatible with second electronic devices of different power levels, improving the accuracy of the duration configuration. It achieves a precise match between the charging duration and the actual charging needs of the device, solving the problem that small-capacity devices are overcharged and large-capacity devices are not fully charged when using a single fixed duration to adapt to devices of different power levels. It allows the preset duration to fit the actual charging characteristics of the device, ensuring that the device is charged to a safe level while strictly avoiding the risk of overcharging.

[0113] As another optional embodiment of this application, refer to Figure 2This is a flowchart illustrating a control method provided in Embodiment 6 of this application, as shown below. Figure 2 As shown, the method may include, but is not limited to, the following steps:

[0114] Step S201: In response to the first trigger event, obtain the preset charging duration; the first trigger event is used to trigger the second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system.

[0115] Step S202: Based on the preset charging time, a first control signal is sent to the controller of the first electronic device, so that the controller responds to the first control signal and switches the input / output pins of the power supply interface from a first level state to a second level state. In the second level state, the input / output pins are used to disconnect the power supply of the power supply interface; the power supply interface is used to supply power to the second electronic device.

[0116] For a detailed description of steps S201-S202, please refer to the relevant description of steps S101-S102 in Example 1, which will not be repeated here.

[0117] Step S203: When the first system is running, in response to a change in the number of second electronic devices connected to the power supply interface of the first electronic device, the preset charging time of the power supply interface is adjusted based on the output power of the power supply interface and the changed number of second electronic devices connected to the power supply interface; wherein, the adjusted preset charging time is used to ensure that each second electronic device connected to the power supply interface can complete safe charging.

[0118] In this embodiment, a physical connection can be established with a single power supply interface of the first electronic device through peripheral accessories such as a docking station or USB splitter, thereby expanding the power supply interface and enabling multiple second electronic devices to be connected simultaneously.

[0119] The output power of the power supply interface is an inherent electrical attribute of the power supply interface of the first electronic device, which is determined during the hardware design stage. It represents the maximum rated power that the interface can output (e.g., the fixed total output power of a conventional USB-A interface is 5V / 1A=5W, while that of a fast-charging USB-C interface can be 10W / 18W, etc.). This value is fixed in advance during device production and stored in a designated storage area of ​​the BIOS. It is a hardware baseline value that cannot be changed in real time.

[0120] The expansion dock and USB splitter only expand the power and interface allocation, without changing the total power supply capacity of the original power supply interface. All connected second electronic devices share the output power of the power supply interface.

[0121] In this embodiment, the first electronic device can monitor the current change and pin level change of the power supply interface through hardware detection circuit, accurately identify the access and removal actions of the device, and count the number of second electronic devices currently actually connected to the power supply interface.

[0122] When the number of second electronic devices increases, the actual power received by each second electronic device decreases and the charging speed slows down. Correspondingly, the preset charging time of the power supply interface is increased to ensure that all devices can be safely charged during the power supply period of the interface, and to avoid devices not being fully charged due to power being evenly distributed or insufficient charging time.

[0123] In this embodiment, the overall preset charging time of the power supply interface can be increased synchronously by multiples of the number of interfaces to ensure that the total charging energy obtained by a single device is sufficient to complete safe charging.

[0124] For example, when there is one second electronic device, the preset charging time of the power supply interface is 3 hours. When the number of second electronic devices increases to 2, the total power is distributed and the charging speed of a single second electronic device slows down, so the preset charging time can be increased to 6 hours. If it increases to 3, the preset charging time can be increased to 9 hours, and so on.

[0125] When the number of second electronic devices decreases, the actual power received by each second electronic device increases, and the charging speed becomes faster. Correspondingly, the preset charging time of the power supply interface is reduced, which can ensure that the device will not be overcharged due to the increase in charging power and the excessive power supply time, thus ensuring charging safety from the source.

[0126] With the number of second electronic devices reduced, the remaining second electronic devices can share more of the total power. The actual charging power obtained by a single second electronic device will increase proportionally with the number, and the charging speed will also increase proportionally. Therefore, the overall preset charging time of the power supply interface can be reduced in tandem with the reduction in the number, so as to avoid overcharging of a single device due to faster charging speed and longer power supply time.

[0127] For example, when three second electronic devices are connected, the preset charging time is 9 hours. When the number of second electronic devices is reduced to two, each second electronic device can share more power, the charging speed increases by 1.5 times, and the preset charging time can be reduced to 6 hours accordingly. If it is reduced to one, the charging speed returns to full power, and the preset charging time can be reduced to the initial 3 hours accordingly, and so on.

[0128] After the second system completes the adjustment of the preset charging time, it can re-execute timing control based on the new preset charging time:

[0129] If the original timing has been running for some time, the timing will continue from the current point in time until the new end of the duration after the adjustment.

[0130] In this embodiment, the preset charging time is dynamically adjusted according to the output power of the power supply interface and the number of connected second electronic devices. On the one hand, when the number of connected devices increases, it can adapt to the actual scenario where multiple devices share the power of the same power supply interface, and extend the charging time accordingly to ensure that each device can obtain sufficient and safe charging power, avoiding the problem of insufficient charging due to power being shared by multiple devices and insufficient charging time. On the other hand, when the number of connected devices decreases, the charging time can be shortened accordingly to avoid the risk of battery overcharging caused by a single device obtaining relatively increased power and excessive charging time. At the same time, by combining the output power of the power supply interface itself for adaptation and adjustment, the preset charging time can be matched with the power supply capacity of the interface hardware and the actual number of connected devices, which not only ensures the charging effectiveness in the scenario of multiple devices sharing charging, but also further enhances the safety of the charging process from the perspective of time management.

[0131] As another optional embodiment of this application, refer to Figure 3 This is a flowchart illustrating a control method provided in Embodiment 7 of this application, as shown below. Figure 3 As shown, the method may include, but is not limited to, the following steps:

[0132] Step S301: In response to the first trigger event, obtain the preset charging time; the first trigger event is used to trigger the second system of the first electronic device to control the charging time of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system.

[0133] Step S302: Based on the preset charging time, send a first control signal to the controller of the first electronic device, so that the controller responds to the first control signal and switches the input / output pins of the power supply interface from a first level state to a second level state. In the second level state, the input / output pins are used to disconnect the power supply of the power supply interface; the power supply interface is used to supply power to the second electronic device.

[0134] For a detailed description of steps S301-S302, please refer to the relevant description of steps S101-S102 in Example 1, which will not be repeated here.

[0135] Step S303: When the first system is running, in response to the second trigger event, obtain parameters for configuring the power supply interface of the first electronic device from the second system.

[0136] The second trigger event can be used to trigger the operating system (i.e., one implementation of the first system) to obtain configuration parameters from the BIOS (i.e., one implementation of the second system).

[0137] The second trigger event has no fixed form and can be flexibly set according to the product design. For example, opening the USB charging configuration application or mini-program in the operating system, clicking the desktop shortcut, or pressing a specified function key combination are all operations that users can actively trigger in the operating system.

[0138] The operating system can establish a data interaction link with the BIOS through a preset hardware communication protocol (such as the ACPI protocol) to obtain full configuration parameters of the power supply interface from the designated storage area of ​​the BIOS. These parameters may include, but are not limited to: the overall enabled / disabled status of the front / rear USB ports (i.e., an implementation of a power supply interface), the enabled / disabled status of a single USB port (Port1 / Port2, etc.), the current preset charging time of each single USB port, and the interface hardware attributes (such as whether fast charging is supported).

[0139] Step S304: Based on the parameters used to configure the power supply interface of the first electronic device, generate an interactive interface displayed in the first system.

[0140] In this embodiment, the configuration logic and interface layout of the USB Setup module in the BIOS can be referenced, but are not limited to. For example, core configuration items such as "Front USB Ports", "Rear USB Ports", and "USB Port1 Charge Time" can be retained, and only the visualization effect and operation method of the interface can be optimized so that users can use it without relearning.

[0141] In this embodiment, the interface elements of the interactive interface in the first system can correspond one-to-one with the BIOS configuration items, including the interface group master switch (enable / disable the entire front / rear interface, selectable Enabled / Disabled), individual interface switches (such as the independent enable / disable of USB Port1 / Port2), charging time configuration items (such as drop-down menus / input boxes, supporting users to select / input specific durations, such as 1 Hour / 2 Hour), and save / reset buttons (used to confirm configuration / restore default parameters).

[0142] For example, if "Front USB Ports" is enabled in the parameters obtained from the BIOS, this option will also be enabled in the operating system interface, and the configuration items of individual interfaces such as USB Port1 and USB Port2 will be displayed below. Users can enable USB Port1 separately and select 1 Hour as the preset charging time through the "USB Port1 Charge Time" drop-down menu. The configuration logic is consistent with the BIOS.

[0143] Step S305: In response to the modification operation of the preset charging time of the power supply interface in the interactive interface, adjust the preset charging time.

[0144] In the interactive interface, users can perform modification operations such as turning a power supply interface group / individual power supply interface on / off, modifying the preset charging time of a power supply interface through the drop-down menu / input box, and restoring the default configuration.

[0145] After the user completes the operation and clicks save, the operating system can synchronize the new configuration parameters to the designated storage area of ​​the BIOS in real time through the hardware communication protocol, overwriting the original parameters. The new parameters immediately become the core basis for the BIOS to manage the power supply interface.

[0146] Once the configuration results are synchronized, they will take effect immediately for subsequent charging time control. If a power supply interface is currently in the charging timer state, the modified preset charging time can be selected to take effect immediately (re-timing) or take effect on the next trigger, depending on the design requirements, taking into account both flexibility and control stability.

[0147] Configuration parameters that users modify in the operating system can also be read and modified in the BIOS. The two complement each other. If a user modifies parameters in the BIOS, when the operating system's interactive interface is opened again, the latest parameters in the BIOS will be automatically obtained and the interface display will be updated to ensure that there are no conflicts between the upper and lower level configurations.

[0148] In this embodiment, the power supply interface configuration parameters are obtained from the second system in response to the second trigger event during the operation of the first system, and a corresponding interactive interface is generated based on the parameters. At the same time, users can modify the preset charging time of the power supply interface in the interface. On the one hand, the charging time configuration operation, which could only be completed at the BIOS level, is migrated to the more easily operated operating system level. An interactive interface consistent with the BIOS configuration logic is generated, which reduces the operation threshold for users to personalize the preset charging time of different power supply interfaces, allowing ordinary users to flexibly modify parameters without mastering the BIOS low-level operation knowledge.

[0149] On the other hand, by directly obtaining configuration parameters from the BIOS, the consistency between the configuration parameters on the operating system side and the BIOS side is ensured. The modified parameters can be synchronized to the BIOS as the basis for hardware management. This not only retains the high stability of the BIOS's low-level hardware-level control over the power supply of the USB interface, but also realizes the visualization and convenience of the charging time configuration. At the same time, it supports the modification of the preset time of multiple power supply interfaces, adapting to the differentiated charging needs of different types of secondary electronic devices. This further improves the usability and flexibility of the entire USB interface timed power-off solution, allowing users to efficiently complete the configuration adjustment of the charging time in their daily operating system environment.

[0150] In this embodiment, combined with Figure 4 This section explains how to modify the preset charging time through the interactive interface of the first system. For example, as... Figure 4 As shown, the interactive interface of the first system may include a title area (Start Menu), a core configuration area (USB Setup), etc. The core configuration area can set configuration items such as Front USB Ports and Rear USB Ports according to the physical layout of the hardware interfaces. The configuration logic and functions of Front USB Ports and Rear USB Ports are completely consistent, and they are managed independently without affecting each other. Users can personalize the configuration of the front and rear USB interfaces separately.

[0151] Users can select Disabled or Enabled via the Front USB Ports master switch. If Disabled is selected, all configuration items for individual interfaces under Front USB Ports will be automatically grayed out and cannot be operated. All USB ports on the front panel will be completely shut down, unable to provide power or transmit data. If Enabled is selected, all configuration items for individual interfaces under Front USB Ports will be unlocked, allowing users to fine-tune the configuration of each individual interface, which forms the basic conditions for enabling the front USB ports.

[0152] After the master switch is turned on, all the independent USB physical interfaces on the front panel, such as USB Port1, USB Port2, USB Port3, etc., will be displayed below in sequence. Each interface is an independent configuration unit, which includes two core function items: a single port function switch (e.g., USB Port 1 and USB Port 2 can be selected as Disabled or Enabled) and a charging time configuration (e.g., USB Port 1 Charge Time and USB Port 2 Charge Time). The configurations of each interface do not interfere with each other.

[0153] Single-port function switch: When this switch is set to Enabled, the corresponding single USB port can enable the power supply and timed power-off functions, and the charging time can be configured; if it is set to Disabled, the single port will be turned off, without affecting the normal use of other ports in the same module.

[0154] The charging time configuration option can be selected via a drop-down menu or entered manually, balancing convenience and personalization.

[0155] Drop-down menu: Built-in common charging time options such as 1 Hour, 2 Hour, 3 Hour, 4 Hour, 5 Hour, which users can select directly to meet the charging needs of common second-hand devices such as Bluetooth headsets, mini fans, and small power banks;

[0156] Manual input: Allows users to manually input specific duration values ​​(such as 0.5 Hour, 6 Hour) according to the actual needs of the device, breaking through the limitations of fixed options and meeting the personalized charging time requirements of special devices such as large-capacity power banks.

[0157] It should be noted that, in order to introduce the core design of the power supply interface timing control, this embodiment only explains in detail the parameters and configuration logic related to this core function in the interactive interface. The other basic configuration parameters involving the USB interface in the interface all follow the general design specifications and configuration logic of the BIOS underlying USB Setup module, and will not be described in detail here.

[0158] As another optional embodiment of this application, a control method is provided in Embodiment 8 of this application. This embodiment is mainly an implementation of the controller in Embodiment 1 that sends a first control signal to the first electronic device based on the preset charging time. Specifically, it may include, but is not limited to, the following steps:

[0159] Step S51: Obtain the current system time.

[0160] In this embodiment, the current system time may include, but is not limited to, the hardware clock time (such as CPU RTC time) that is synchronized in real time with the BIOS in the first electronic device. This time can be independently powered by the hardware clock module and is not affected by factors such as device hibernation, shutdown (for a short time), or operating system lag, thus ensuring the accuracy and real-time performance of the time acquisition.

[0161] The BIOS can directly read the current time of the hardware clock through its own low-level hardware access capabilities, and use it as the time base for calculating charging time, without having to go through the parsing and forwarding of the operating system, thus avoiding time errors at the software level.

[0162] Step S52: Determine the charging cutoff time based on the current system time and the preset charging duration.

[0163] The BIOS can use the current system time as the charging start time and add it to the preset charging duration corresponding to the power supply interface to calculate a unique charging end time. For example, if the current system time is 10:00 and the preset charging duration for this interface is 3 hours, then the charging end time is directly determined to be 13:00.

[0164] The calculation process can be completed by the BIOS's underlying logic without complex operations, ensuring calculation efficiency and result accuracy. Furthermore, the charging cutoff time can be temporarily stored by the BIOS and used as the core timing basis for subsequent power-off control.

[0165] Step S53: When the charging cutoff time is reached, send a first control signal to the controller of the first electronic device.

[0166] After determining the charging cutoff time, the BIOS monitors the hardware clock time in real time. When it detects that the hardware clock time is exactly matched with the preset charging cutoff time, it immediately sends a first control signal carrying a power-off command to the controller (EC / PCH). After receiving the command, the controller directly switches the level state of the power supply interface input / output pins (GPIO) to disconnect the power supply interface.

[0167] The entire process involves hardware-level timing determination and instruction triggering without any intermediate steps, enabling precise synchronization between power-off action and charging cut-off time, thus avoiding premature or delayed power-off issues caused by accumulated time errors.

[0168] In this embodiment, the charging cutoff time is determined by acquiring the current system time and combining it with a preset charging duration. The first control signal is sent to the controller only when the cutoff time is reached. The core relies on hardware-level clock timing and time determination to accurately trigger the power-off command. This takes advantage of the characteristics of the CPU RTC time being synchronized with the system time and independently powered, and not being affected by the operating system's hibernation / lag / program abnormality, which ensures the accuracy and stability of time acquisition and cutoff time determination. Furthermore, by using a fixed cutoff time control method instead of simple duration accumulation, hardware accumulation errors during the timing process are avoided, allowing the power-off action to be precisely matched with the charging duration control time node.

[0169] Meanwhile, the control logic is completed independently by the BIOS layer. The command is sent without being parsed and translated by the software layer, which can ensure that the first control signal is sent in time when the charging cutoff time is reached and the controller quickly executes the power-off operation. This further improves the accuracy and reliability of the power supply interface timed power-off. From the perspective of timing control, it completely eliminates the risk of overcharging caused by timing deviation and command delay, and provides accurate time dimension guarantee for the charging safety of the second electronic device.

[0170] As another optional embodiment of this application, refer to Figure 5 This is a flowchart illustrating a control method provided in Embodiment 9 of this application, as shown below. Figure 5 As shown, the method may include, but is not limited to, the following steps:

[0171] Step S401: In response to the first trigger event, obtain the preset charging duration; the first trigger event is used to trigger the second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system.

[0172] Step S402: Based on the preset charging time, send a first control signal to the controller of the first electronic device, so that the controller responds to the first control signal and switches the input / output pins of the power supply interface from a first level state to a second level state. In the second level state, the input / output pins are used to disconnect the power supply of the power supply interface; the power supply interface is used to supply power to the second electronic device.

[0173] For a detailed description of steps S401-S402, please refer to the relevant description of steps S101-S102 in Example 1, which will not be repeated here.

[0174] Step S403: In response to the third trigger event, a second control signal is sent to the controller of the first electronic device, so that the controller switches the input / output pin from the second level state to the first level state in response to the second control signal.

[0175] The third trigger event is a hardware signal event that can trigger the BIOS to send a power-on command. It corresponds to the first trigger event and is a hardware-level event that the BIOS can directly detect. It has no fixed form and can be flexibly set according to the product design.

[0176] For example, a third triggering event can include, but is not limited to:

[0177] A new second electronic device is detected connecting to the power supply interface: When the power supply interface is in a power-off state, if a new second electronic device establishes an electrical connection with the interface through a charging cable, the pin level and current of the power supply interface will change in hardware. This change will be captured by the hardware detection circuit of the first electronic device and transmitted to the BIOS. The BIOS will then determine that a third trigger event has occurred.

[0178] Alternatively, a user command triggered by a function combination key can be received: the user presses a preset function combination key (such as Fn+E), the hardware detection circuit captures the key signal and transmits it to the BIOS, the BIOS determines that a third trigger event has occurred. This method is suitable for scenarios where the original second electronic device has not been unplugged and needs to continue charging, and the user actively triggers the power restoration.

[0179] The second control signal is a power-on command sent by the BIOS to the controller. Its transmission method and encoding format are completely consistent with the first control signal. Both are written by the BIOS into the controller's designated register, and the controller reads and executes them directly without the need for software parsing. The controller's action of executing the second control signal is simply the inversion of the GPIO pin level. The operation is simple and forms a symmetrical hardware control logic with the power-off action, ensuring the accuracy and speed of the power-on action.

[0180] After the power supply interface is restored, the BIOS control logic will return to its initial state, continue to respond to the first trigger event, reacquire the preset charging time and start timing control.

[0181] In this embodiment, by responding to a third triggering event and sending a second control signal, the controller switches the power supply interface input and output pins from the second level state of power failure back to the first level state of power supply. This realizes the flexible power restoration function after the power supply interface is powered off, breaking the limitation that the interface cannot be reused after a single power failure. It enables the power supply interface to complete the cycle management of power failure and power restoration, improving the efficiency of interface use and the flexibility of the actual application of the solution.

[0182] Meanwhile, the power restoration action is led by the second system (BIOS) and executed at the hardware level of the controller, without the need for software layer parsing and translation. Furthermore, the third triggering event is a hardware-level signal that the BIOS can directly detect, ensuring the timeliness and accuracy of the power restoration action. It does not depend on the operating status of the first system (operating system), and can stably restore power even if the system is in hibernation or lag.

[0183] In addition, the power restoration logic can be adapted to various scenarios such as automatic triggering upon device access and manual triggering via function combination keys. It not only meets the needs of automated power restoration when no one is operating, but also supports users to actively trigger power restoration according to their needs. It takes into account both the convenience and controllability of use, and forms a complete closed loop for the timed power outage management of the power supply interface, further improving the charging safety management system and adapting to more actual charging usage scenarios.

[0184] In this embodiment, the actual application process of the above control method is illustrated by way of example with reference to Figure 6: Figure 6 As shown, the power supply circuit of the USB port is connected to the EC's GPIO, and the GPIO pin is used as a hardware switch to control the power supply of the USB port.

[0185] When the second electronic device is connected to the USB interface, the user presses the preset Fn+E function key combination in the first system (operating system). After the BIOS receives the hardware signal triggered by the key, it immediately reads the current CPU RTC time, retrieves the charging duration pre-configured in the BIOS for the USB interface, and automatically determines the charging completion time through timing superposition calculation and stores it.

[0186] The BIOS continuously monitors the CPU RTC time. When it detects that the CPU RTC time has reached the charging completion time, it immediately sends the first control signal to the EC. After receiving the instruction, the EC directly switches the corresponding GPIO to the power-off level state (i.e., disconnects the GPIO), cuts off the power supply circuit of the USB interface, and realizes the automatic power-off of the USB interface.

[0187] When the BIOS detects a second electronic device connected to the USB port again, or when the user presses the Fn+E function key combination again, it immediately sends a second control signal to the EC. The EC will switch the corresponding GPIO back to the power supply level state (i.e., turn on the GPIO), reconnect the power supply circuit of the USB port, and restore the power supply capability of the USB port.

[0188] The control device provided in this application will be described below. The control device described below can be referred to in correspondence with the control method described above.

[0189] The control device includes:

[0190] The first obtaining module is used to obtain a preset charging duration in response to a first triggering event; the first triggering event is used to trigger a second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system.

[0191] The first transmitting module is configured to send a first control signal to the controller of the first electronic device based on the preset charging time, so that the controller responds to the first control signal and switches the input / output pins of the power supply interface from a first level state to a second level state. In the second level state, the input / output pins are used to disconnect the power supply of the power supply interface; the power supply interface is used to supply power to the second electronic device.

[0192] The first acquisition module responding to the first triggering event may include:

[0193] In response to the power supply interface of the first electronic device establishing an electrical connection with the second electronic device.

[0194] The first acquisition module responding to the first triggering event may include:

[0195] Received a user command triggered by a function key combination.

[0196] In response to the first electronic device including multiple power supply interfaces, the first obtaining module obtains a preset charging time, which may include:

[0197] Select the preset charging duration corresponding to the power supply interface that establishes an electrical connection with the second electronic device from a plurality of preset charging durations; the plurality of preset charging durations correspond to the plurality of power supply interfaces of the first electronic device.

[0198] In this embodiment, the control device may further include:

[0199] The first determining module is used for:

[0200] Receive the user's input of a set duration and use the set duration as the preset charging duration;

[0201] And / or,

[0202] In response to the second electronic device connecting to the power supply interface of the first electronic device, the charging power of the second electronic device is obtained, and a preset charging time is configured based on the charging power; the preset charging time is used to ensure that the second electronic device is charged safely.

[0203] The control device may also include:

[0204] The first adjustment module is used to adjust the preset charging time of the power supply interface in response to a change in the number of second electronic devices connected to the power supply interface of the first electronic device during the operation of the first system, based on the output power of the power supply interface and the changed number of second electronic devices connected to the power supply interface; wherein the adjusted preset charging time is used to ensure that each second electronic device connected to the power supply interface can complete safe charging.

[0205] The control device may also include:

[0206] The second acquisition module is used for:

[0207] When the first system is running, in response to a second triggering event, parameters for configuring the power supply interface of the first electronic device are obtained from the second system;

[0208] A generation module is used to generate an interactive interface displayed in the first system based on the parameters used to configure the power supply interface of the first electronic device.

[0209] The second adjustment module is used to adjust the preset charging time in response to a modification operation on the preset charging time of the power supply interface in the interactive interface.

[0210] The first sending module can be specifically used for:

[0211] Get the current system time;

[0212] Based on the current system time and the preset charging duration, the charging cutoff time is determined;

[0213] When the charging cutoff time is reached, a first control signal is sent to the controller of the first electronic device.

[0214] The control device may also include:

[0215] The third transmitting module is used to send a second control signal to the controller of the first electronic device in response to a third triggering event, so that the controller switches the input / output pin from the second level state to the first level state in response to the second control signal.

[0216] In another embodiment of this application, a first electronic device is provided, which may include:

[0217] At least one power supply interface; the power supply interface is used to supply power to a second electronic device;

[0218] The controller includes at least one input / output pin; the input / output pin is connected to the power supply interface;

[0219] Processor, used for:

[0220] In response to a first triggering event, a preset charging duration is obtained; the first triggering event is used to trigger a second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running; the second system is used to guide the first system;

[0221] Based on the preset charging time, a first control signal is sent to the controller, so that the controller responds to the first control signal by switching the input / output pin from a first level state to a second level state. In the second level state, the input / output pin is used to disconnect the power supply of the power supply interface.

[0222] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0223] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0224] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0225] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A control method, comprising: In response to the first trigger event, the preset charging time is obtained; The first triggering event is used to trigger the second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running; The second system is used to boot the first system; Based on the preset charging time, a first control signal is sent to the controller of the first electronic device, so that the controller responds to the first control signal and switches the input / output pins of the power supply interface from a first level state to a second level state. In the second level state, the input / output pins are used to disconnect the power supply of the power supply interface; the power supply interface is used to supply power to the second electronic device.

2. The control method according to claim 1, wherein the response to the first triggering event includes: In response to the power supply interface of the first electronic device establishing an electrical connection with the second electronic device.

3. The control method according to claim 1, wherein the response to the first triggering event includes: Received a user command triggered by a function key combination.

4. The control method according to claim 2, in response to the first electronic device including a plurality of power supply interfaces, obtaining the preset charging time includes: Select the preset charging duration corresponding to the power supply interface that establishes an electrical connection with the second electronic device from a plurality of preset charging durations; The multiple preset charging times correspond to the multiple power supply interfaces of the first electronic device.

5. The control method according to claim 1, wherein the preset charging time is determined by any one of the following methods: Receive the user's input of a set duration and use the set duration as the preset charging duration; In response to the second electronic device connecting to the power supply interface of the first electronic device, the charging power of the second electronic device is obtained, and a preset charging time is configured based on the charging power; The preset charging time is used to ensure that the second electronic device is charged safely.

6. The control method according to claim 1, further comprising: When the first system is running, in response to a change in the number of second electronic devices connected to the power supply interface of the first electronic device, the preset charging time of the power supply interface is adjusted based on the output power of the power supply interface and the changed number of second electronic devices connected to the power supply interface; wherein, the adjusted preset charging time is used to ensure that each second electronic device connected to the power supply interface can complete safe charging.

7. The control method according to claim 1, further comprising: When the first system is running, in response to a second triggering event, parameters for configuring the power supply interface of the first electronic device are obtained from the second system; Based on the parameters used to configure the power supply interface of the first electronic device, an interactive interface displayed in the first system is generated. In response to a modification operation on the preset charging time of the power supply interface in the interactive interface, the preset charging time is adjusted.

8. The control method according to claim 1, wherein the step of sending a first control signal to the first electronic device based on the preset charging time comprises: Get the current system time; Based on the current system time and the preset charging duration, the charging cutoff time is determined; When the charging cutoff time is reached, a first control signal is sent to the controller of the first electronic device.

9. The control method according to claim 1, further comprising: In response to a third triggering event, a second control signal is sent to the controller of the first electronic device, such that the controller switches the input / output pin from the second level state to the first level state in response to the second control signal.

10. A first electronic device, comprising: At least one power supply interface; The power supply interface is used to supply power to the second electronic device; The controller includes at least one input / output pin; The input / output pins are connected to the power supply interface; Processor, used for: In response to a first triggering event, a preset charging duration is obtained; the first triggering event is used to trigger a second system of the first electronic device to control the charging duration of the second electronic device when the first system of the first electronic device is running. The second system is used to boot the first system; Based on the preset charging time, a first control signal is sent to the controller, so that the controller responds to the first control signal by switching the input / output pin from a first level state to a second level state. In the second level state, the input / output pin is used to disconnect the power supply of the power supply interface.