Power-off protection method and device and electronic equipment
By monitoring abnormal power supply status in the charging control module of the electronic device and switching to the power withdrawal mode, power backup is performed using the power supply capacity of the connected device, data loss and hardware damage caused by sudden power outage of the device without built-in battery is solved, and cost-effectiveness and user experience are improved.
Patent Information
- Application Number
- CN202510397015.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-08-12
AI Technical Summary
Sudden power outage of electronic devices without built-in batteries leads to data loss and hardware damage, and the existing technology relies on uninterruptible power supply equipment to be costly and complex.
The charging control module monitors abnormal power supply status, switches to the power withdrawal mode, uses the power supply capacity of the connected target electronic equipment to supply power, and realizes dynamic power backup.
Without additional equipment, ensure that electronics maintain basic operation or safe shutdown in the event of power outage, protect data and hardware, reduce costs and improve user experience.
Smart Images

Figure CN120469559A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a power-off protection method, device, and electronic equipment. Background Art
[0002] For electronic devices without built-in batteries, if a sudden power outage occurs, they will shut down immediately, resulting in problems such as data not being backed up and hardware damage. Currently, uninterruptible power supplies are commonly used to prevent sudden power outages in electronic devices. However, uninterruptible power supplies are typically expensive and require professional setup, which reduces the user experience. Summary of the Invention
[0003] In view of this, embodiments of the present application provide a power-off protection method, device, and electronic device.
[0004] According to a first aspect of the present application, an embodiment of the present application provides a power-off protection method applied to an electronic device, comprising:
[0005] In response to the charging control module of the electronic device detecting that the power supply state of the electronic device is abnormal, the state of the charging control module is set from the power supply mode to the power supply mode;
[0006] In the power receiving mode, based on the power supply capability of the target electronic device connected to the electronic device, a power receiving request is sent to the target electronic device, so that the target electronic device supplies power to the electronic device through the charging control module based on the power receiving request;
[0007] The power supply capability of the target electronic device represents the output power of the target electronic device.
[0008] Optionally, in response to the charging control module of the electronic device detecting that the power supply state of the electronic device is abnormal, the method includes:
[0009] The charging control module detects that the power supply voltage of the electronic device is less than a first threshold value, and determines that the power supply state of the electronic device is abnormal.
[0010] Optionally, before the charging control module of the electronic device detects that the power supply state of the electronic device is abnormal, the power-off protection method further includes:
[0011] Determine if the target electronic device is connected;
[0012] Set the state of the charging control module from power supply mode to power supply mode;
[0013] In the power supply mode, a power supply capability query request is sent to the target electronic device;
[0014] receiving and storing power supply capability information returned by the target electronic device based on the power supply capability query request;
[0015] Set the state of the charging control module from power supply mode to power supply mode.
[0016] Optionally, powering the electronic device through the charging control module includes:
[0017] Power is supplied to the mainboard of the electronic device through the charging control module and the boost module;
[0018] The charging control module supplies power to the embedded controller of the electronic device.
[0019] Optionally, the power-off protection method further includes:
[0020] If the power supply capability of the target electronic device is at the first level, sending a first notification message to a basic input / output system so that the basic input / output system controls the operating system to enter a dormant state and saves the target data in the cache to a memory of the electronic device;
[0021] If the power supply capability of the target electronic device is at the second level, sending a second notification message to the basic input and output system so that the basic input and output system controls the display screen to output a power-off reminder message;
[0022] The power supply capability of the target electronic device at the first level is smaller than the power supply capability at the second level.
[0023] Optionally, after saving the target data in the cache to the memory of the electronic device, the power-off protection method further includes:
[0024] If it is detected that the voltage provided by the target electronic device is less than the second threshold, a third notification message is sent to the basic input and output system, so that the basic input and output system controls the operating system to enter a shutdown state.
[0025] Optionally, after saving the target data in the cache to the memory of the electronic device, the power-off protection method further includes:
[0026] If it is detected that the power supply status of the electronic device returns to normal, a fourth notification message is sent to the basic input and output system, so that the basic input and output system controls the operating system to enter the working state and reads the target data from the memory of the electronic device and puts it into the cache.
[0027] Optionally, the power-off protection method further includes:
[0028] The power switch is controlled to enter an off state to prevent the voltage provided by the target electronic device from being discharged outward through the power switch.
[0029] According to a second aspect of the present application, an embodiment of the present application provides a power failure protection device, including:
[0030] A monitoring module configured to, in response to a charging control module in the electronic device detecting an abnormal power supply state of the electronic device, set the state of the charging control module from a power supply mode to a power supply mode;
[0031] The sending module is used to send a power receiving request to the target electronic device based on the power supply capacity of the target electronic device connected to the electronic device in the power receiving mode, so that the target electronic device powers the electronic device through the charging control module based on the power receiving request; the power supply capacity of the target electronic device represents the output power of the target electronic device.
[0032] According to a third aspect of the present application, an embodiment of the present application provides an electronic device, including:
[0033] The charging control module is used to execute a response to the charging control module of the electronic device detecting that the power supply state of the electronic device is abnormal, and set the state of the charging control module from the power supply mode to the power collection mode; in the power collection mode, based on the power supply capacity of the target electronic device connected to the electronic device, send a power receiving request to the target electronic device, so that the target electronic device supplies power to the electronic device through the charging control module based on the power receiving request; the power supply capacity of the target electronic device represents the output power of the target electronic device.
[0034] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a flow chart of a power-off protection method according to an embodiment of the present application;
[0036] Figure 2 This is a circuit block diagram corresponding to the power-off protection method in the embodiment of the present application;
[0037] Figure 3 Schematic diagram of another power-off protection method according to an embodiment of the present application;
[0038] Figure 4 Schematic diagram of another power-off protection method according to an embodiment of the present application;
[0039] Figure 5 Schematic diagram of another power-off protection method according to an embodiment of the present application;
[0040] Figure 6 This is a structural diagram of a power-off protection device in an embodiment of the present application;
[0041] Figure 7This is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present application;
[0042] Figure 8 Schematic diagram of the hardware structure of another electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0043] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0044] For electronic devices without built-in batteries, sudden power outages can cause them to shut down, potentially leading to problems such as lost data backup and hardware damage. These sudden power outages can cause severe data loss, impacting user productivity and even permanently losing important files. Furthermore, frequent sudden power outages can cause irreversible damage to the hardware of electronic devices, shortening their lifespan.
[0045] To this end, the present invention provides a power-off protection method for electronic devices, such as Figure 1 As shown, the power-off protection methods include:
[0046] S101 , in response to a charging control module of an electronic device detecting that the power supply state of the electronic device is abnormal, the state of the charging control module is set from a power supply mode to a power supply mode.
[0047] In this embodiment, the charging control module detecting that the power supply status of the electronic device is abnormal can be specifically manifested as: the charging control module detecting that the power supply voltage of the electronic device is lower than a preset threshold or the power supply current is unstable.
[0048] In some embodiments, whether the power supply status of the electronic device is abnormal can be determined by detecting the power supply voltage or current of the charging control module itself.
[0049] In some embodiments, the charging control module may detect the power supply voltage of the electronic device in real time through a voltage comparator to determine whether the power supply status of the electronic device is abnormal.
[0050] In some embodiments, the charging module may detect the power supply current of the electronic device in real time through a current detector to determine whether the power supply status of the electronic device is abnormal.
[0051] In this embodiment, in power supply mode, the electronic device supplies power to an external device, such as a target electronic device, through the charging control module; in power extraction mode, the electronic device obtains power from the external device through the charging control module.
[0052] In this embodiment, the switching between the power supply mode and the power extraction mode can be achieved by controlling the switch circuit.
[0053] In some embodiments, the charging control module can implement a mode switching function through a USB Type-C interface controller, for example, controlling the switching circuit through the USB Type-C interface controller to supply power to an external device to implement a power supply mode; and controlling the switching circuit through the USB Type-C interface controller to obtain power from an external device to implement a power extraction mode.
[0054] In some embodiments, the charging control module can switch between the power supply mode and the power extraction mode by changing the conduction direction of the MOS tube in the charging control module.
[0055] S102, in the power-taking mode, based on the power supply capability of the target electronic device connected to the electronic device, a power receiving request is sent to the target electronic device, so that the target electronic device supplies power to the electronic device through the charging control module based on the power receiving request; the power supply capability of the target electronic device represents the output power of the target electronic device.
[0056] In this embodiment, the target electronic device may be another electronic device with power supply capability, such as a mobile power supply, a laptop computer, etc. The target electronic device may be connected to the electronic device via a USB Type C interface.
[0057] In this embodiment, the power supply capability of the target electronic device can be determined by querying the power management chip of the target device or reading a pre-stored device parameter table.
[0058] In some embodiments, the power supply capability of the target electronic device can be determined by sending a query request to the power management chip of the target device, and determining the power supply capability of the target electronic device based on a power capability data packet returned by the power management chip of the target electronic device, where the power capability data packet may include maximum output current and voltage information, or maximum output power, etc.
[0059] In some embodiments, the electronic device may pre-store device parameters of the target electronic device in a device parameter table. The device parameters of the target electronic device may include power supply capability information of the target electronic device. The power supply capability information may include maximum output current and voltage information, or maximum output power, etc. Therefore, the power supply capability of the target electronic device can be determined by searching the power supply capability information of the target electronic device in the pre-stored device parameter table to determine the power supply capability of the target electronic device.
[0060] In this embodiment, when the charging control module is in power-receiving mode, if the target electronic device is capable of supplying power, it can send a power-receiving request to the target electronic device. The power-receiving request can be transmitted using a standard power negotiation protocol such as the USB PD protocol or the QC protocol.
[0061] In some embodiments, the power request may be transmitted using differential signal transmission to improve anti-interference capability.
[0062] In this embodiment, if the target electronic device has power, the charging control module can supply power to the electronic device based on the power request, so that the electronic device can maintain basic operation or shut down safely in the event of a power outage.
[0063] The power failure protection method provided in an embodiment of the present application is applied to an electronic device. In response to a charging control module of the electronic device detecting an abnormal power supply state of the electronic device, the charging control module is set to a power supply mode from a power supply mode. In the power supply mode, based on the power supply capability of a target electronic device connected to the electronic device, a power receiving request is sent to the target electronic device, so that the target electronic device supplies power to the electronic device through the charging control module based on the power receiving request. The power supply capability of the target electronic device represents the output power of the target electronic device. In this way, when an abnormal power supply state is detected, the power supply mode is dynamically switched, the connected target electronic device is used as a temporary power source, and the power receiving strategy is intelligently adjusted based on the power supply capability of the target device, ensuring that the electronic device can maintain basic operation or safely shut down in the event of a power failure. This solves the problem of data loss and hardware damage caused by sudden power failure of devices without built-in batteries. Compared with traditional uninterruptible power supply solutions, this method does not require additional equipment and directly uses existing connected equipment to achieve power backup, reducing implementation cost and usage complexity. It has the advantages of protecting data and hardware in the event of a sudden power failure, improving user experience, reducing costs, and providing flexibility and intelligence.
[0064] In an optional embodiment, in step S101, in response to the charging control module of the electronic device detecting that the power supply state of the electronic device is abnormal, the steps include:
[0065] The charging control module detects that the power supply voltage of the electronic device is less than a first threshold value, and determines that the power supply state of the electronic device is abnormal.
[0066] In specific implementations, monitoring the electronic device's power supply voltage can be achieved using a voltage comparator, which compares the real-time collected power supply voltage with a preset first threshold. When the power supply voltage falls below the first threshold, the voltage comparator outputs an abnormality signal, confirming that the electronic device's power supply status is abnormal. The first threshold can be set based on the minimum voltage required for normal operation of the electronic device, for example, 80% of the nominal operating voltage. As a preferred embodiment, the voltage comparator can be integrated into the charging control module, thereby reducing the complexity of the peripheral circuitry.
[0067] In this embodiment, by setting a voltage threshold detection mechanism, abnormal power supply status can be accurately identified; and the protection mechanism can be triggered in time at the early stage of voltage drop, thereby buying more time for subsequent emergency power supply processing.
[0068] In an optional embodiment, in step S101, before the charging control module of the electronic device detects that the power supply state of the electronic device is abnormal, the power-off protection method further includes:
[0069] Determine that the target electronic device is connected; set the state of the charging control module from power supply mode to power sourcing mode; in the power sourcing mode, send a power supply capability query request to the target electronic device; receive and save the power supply capability information returned by the target electronic device based on the power supply capability query request; set the state of the charging control module from power sourcing mode to power supply mode.
[0070] In this embodiment, when a target electronic device is connected to the electronic device, the state of the charging control module of the electronic device is set from the power supply mode to the power sourcing mode. In the power sourcing mode, the charging control module can send a power supply capability query request to the target electronic device to obtain the power supply capability information of the target electronic device. After obtaining the power supply capability information of the target electronic device, it can be saved so that when the power supply capability of the target electronic device needs to be determined later, it can be quickly determined. The state of the charging control module can then be set from the power sourcing mode to the power supply mode to power the target electronic device.
[0071] During specific implementation, it is possible to determine whether the target electronic device is connected to the electronic device by detecting the connection status of the physical interface or the handshake signal of the communication protocol. If the target electronic device is connected to the electronic device, the charging control module is set to the power-taking mode to change the electronic device from the power supply end to the power receiving end. Then, a standard power management protocol, such as the query instruction defined in the USB PD protocol, can be used to send a power supply capability query request to the target electronic device. The target electronic device returns power supply capability information based on the power supply capability query request. The power supply capability information generally includes parameters such as the maximum output voltage, the maximum output current, and the output power. This information is stored in a non-volatile memory for subsequent calls. The state of the charging control module is then set from the power-taking mode to the power supply mode to power the target electronic device.
[0072] In this embodiment, by pre-acquiring and storing the power supply capacity information of the target electronic device, the power supply capacity of the backup power supply can be quickly evaluated in the event of a sudden power outage, thereby optimizing the power supply strategy; this can avoid the response delay caused by starting to query the power supply capacity after the power outage, and at the same time, through the mode switching mechanism, ensure that the query process will not interfere with the normal operation of the electronic device.
[0073] In an optional embodiment, in step S102, powering the electronic device through the charging control module includes:
[0074] The charging control module and the boost module are used to supply power to the mainboard of the electronic device; and the charging control module is used to supply power to the embedded controller of the electronic device.
[0075] In this embodiment, the boost module is used to boost the voltage provided by the target electronic device to a voltage value required for operation of the mainboard.
[0076] In one implementation, the boost module may be implemented using a DC-DC boost circuit.
[0077] In one implementation, when the charging control module directly supplies power to the embedded controller, the voltage must be kept stable within the operating voltage range of the embedded controller, which can be achieved, for example, by using an LDO voltage regulator circuit.
[0078] When implementing it specifically, Figure 2As shown, when the power supply state of the electronic device is normal, for example, when the external power supply 20 is turned on, the power switch 21 of the electronic device is turned on, and the external power supply 20 can be input to the mainboard 22 of the electronic device through the power switch 21, as well as to the embedded controller 23 of the electronic device, and to the charging control module 24 of the electronic device. The charging control module 24 is in charging mode, charging the outside, such as charging the target electronic device 10. When the power supply state of the electronic device is abnormal, for example, when the external power supply 20 is cut off, the power switch 21 of the electronic device is turned off, and the state of the charging control module 24 is set from the power supply mode to the power supply mode, and the target electronic device 10 supplies power to the electronic device through the charging control module 24. The voltage received by the charging control module 24 is directly sent to the embedded controller 23 to power the embedded controller 23. The voltage received by the charging control module 24 is also boosted by the boost module 25 to power the mainboard 22.
[0079] In this embodiment, through the split-path power supply design, the continuous operation of the core components can be prioritized when the main power supply is abnormal; and the introduction of the boost module solves the problem that the power supply voltage of the external device cannot meet the power supply requirements of the mainboard; and the dual-path independent power supply mechanism avoids single point failures that cause system crashes.
[0080] In an optional embodiment, if Figure 3 As shown, the power-off protection method further includes:
[0081] S103: If the power supply capability of the target electronic device is at the first level, a first notification message is sent to the basic input / output system, so that the basic input / output system controls the operating system to enter a dormant state and saves the target data in the cache to the memory of the electronic device.
[0082] S104, if the power supply capacity of the target electronic device is at the second level, send a second notification message to the basic input and output system so that the basic input and output system controls the display screen to output a power-off reminder message; the power supply capacity of the target electronic device at the first level is less than the power supply capacity at the second level.
[0083] In this embodiment, the first and second levels of power supply capability can be divided based on pre-set power thresholds. For example, the first level can be defined as output power below 10W, and the second level can be defined as output power between 10W and 20W. The power supply capability classification can also be determined by the identification field in the power supply capability information returned by the target electronic device. The target data includes, but is not limited to, volatile data such as application running status and user unsaved files.
[0084] In specific implementations, when the target electronic device's power supply capacity is detected to be at the first level, the data saving process can be triggered first, and the target data in the cache can be written to the non-volatile memory through the interrupt handler. When the power supply capacity is at the second level, a warning message can be displayed on the display screen to prompt the user to save the work content in time.
[0085] In this embodiment, by hierarchically processing different power supply capacity situations, data security is prioritized when the target electronic device is underpowered, and user warnings are provided when the target electronic device is relatively fully powered. This allows for reasonable operations to be performed based on the power supply capacity of the target electronic device in the event of a sudden power outage, thereby improving user experience.
[0086] In an optional embodiment, in step S103, after the target data in the cache is saved in the memory of the electronic device, Figure 4 As shown, the power-off protection method further includes:
[0087] S105 : If it is detected that the voltage provided by the target electronic device is less than the second threshold, a third notification message is sent to the basic input and output system, so that the basic input and output system controls the operating system to enter a shutdown state.
[0088] In this embodiment, the second threshold value is a pre-set voltage threshold used to determine whether the power supply capacity of the target electronic device is insufficient to maintain basic operation of the electronic device. The shutdown state refers to a state in which the operating system completely stops running, at which point all non-essential hardware modules of the electronic device are powered off.
[0089] In a specific implementation, the second threshold value may be set to a minimum voltage value required to maintain a safe shutdown of the operating system.
[0090] In some implementations, the charging voltage of the charging control module itself may be detected in real time to detect the voltage provided by the target electronic device.
[0091] In some embodiments, the input voltage of the target electronic device may be monitored in real time by a built-in voltage sensor of the electronic device, so as to detect the voltage provided by the target electronic device.
[0092] In this embodiment, when the voltage provided by the target electronic device falls below the second threshold, indicating that the power supply capacity of the target electronic device is seriously insufficient, a third notification message may be sent to the basic input / output system. The third notification message may be a command signal in a specific format, used to trigger the basic input / output system to execute a shutdown process.
[0093] In this embodiment, when the power supply capacity of the target electronic device is insufficient, the cached data is saved to the memory first, and then the power supply situation is judged through the voltage detection mechanism. When the power supply further deteriorates to the point where it cannot maintain system operation, the shutdown process is triggered in time to avoid data loss or hardware damage.
[0094] In an optional embodiment, in step S103, after the target data in the cache is saved in the memory of the electronic device, Figure 5 As shown, the power-off protection method further includes:
[0095] S106: If it is detected that the power supply status of the electronic device returns to normal, a fourth notification message is sent to the basic input and output system, so that the basic input and output system controls the operating system to enter the working state, and reads the target data from the memory of the electronic device and puts it into the cache.
[0096] In specific implementations, the charging control module can determine whether the power supply status has returned to normal by monitoring the external power supply voltage in real time to see if it has returned to a normal operating threshold. If the power supply status of the electronic device is detected to have returned to normal, the basic input / output system, upon receiving the fourth notification information, executes the operating system wake-up process, including reinitializing the hardware and loading the operating system kernel. The target data is then read from the memory. Direct memory access can be used to improve data transmission efficiency when reading the target data from the memory.
[0097] In this embodiment, by automatically waking up the system and restoring cached data after power is restored, the system status can be completely restored without manual intervention, which can effectively solve the problems of data loss and low system restart efficiency after power outages, reduce the data reconstruction time caused by power outages, and improve the reliability of electronic equipment under abnormal power supply conditions.
[0098] In an optional embodiment, the power-off protection method further includes:
[0099] The power switch is controlled to enter an off state to prevent the voltage provided by the target electronic device from being discharged outward through the power switch.
[0100] In this embodiment, if Figure 2 As shown, the power switch is used to control the connection status between the electronic device and the external power source. In a power-off protection scenario, when the electronic device is receiving power from the target electronic device via the charging control module, if the power switch remains on, the received power may be reversely lost through the power switch to the external circuit, thereby reducing power supply efficiency and even posing a safety hazard. Therefore, after sending a power request to the target electronic device so that the target electronic device supplies power to the electronic device via the charging control module based on the power request, the power switch can be controlled to enter the off state.
[0101] In this embodiment, when dealing with sudden power outages, the reverse discharge path of the power switch is actively cut off, thereby avoiding the loss of backup power during transmission. This ensures that the power provided by the target electronic device can be fully used to maintain the operation of key components of the electronic device, effectively extending the duration of power supply to the target electronic device and creating a more sufficient time window for data preservation and system safety shutdown.
[0102] The present application also provides a power-off protection device, such as Figure 6 Shown, including:
[0103] The monitoring module 61 is configured to, in response to the charging control module in the electronic device detecting an abnormal power supply state of the electronic device, set the state of the charging control module from a power supply mode to a power supply mode;
[0104] The sending module 62 is used to send a power receiving request to the target electronic device based on the power supply capacity of the target electronic device connected to the electronic device in the power receiving mode, so that the target electronic device powers the electronic device through the charging control module based on the power receiving request; the power supply capacity of the target electronic device represents the output power of the target electronic device.
[0105] The power failure protection device provided in an embodiment of the present application is applied to an electronic device. In response to a charging control module of the electronic device detecting an abnormal power supply state of the electronic device, the device switches the state of the charging control module from a power supply mode to a power sourcing mode. In the power sourcing mode, the device sends a power receiving request to the target electronic device based on the power supply capability of the target electronic device connected to the electronic device, so that the target electronic device supplies power to the electronic device through the charging control module based on the power receiving request. The power supply capability of the target electronic device represents the output power of the target electronic device. Thus, when an abnormal power supply state is detected, the device dynamically switches the power supply mode, utilizes the connected target electronic device as a temporary power source, and intelligently adjusts the power receiving strategy based on the power supply capability of the target device, ensuring that the electronic device can maintain basic operation or safely shut down in the event of a power failure. This solves the problem of data loss and hardware damage caused by sudden power failure in devices without built-in batteries. Compared with traditional uninterruptible power supply solutions, this method does not require additional equipment and directly uses existing connected equipment to achieve power backup, reducing implementation cost and usage complexity. It has the advantages of protecting data and hardware in the event of a sudden power failure, improving user experience, reducing costs, and providing flexibility and intelligence.
[0106] The present application also provides an electronic device, such as Figure 7 Shown, including:
[0107] The charging control module 71 is used to execute a response to the charging control module 71 of the electronic device detecting that the power supply status of the electronic device is abnormal, and set the status of the charging control module 71 from the power supply mode to the power supply mode; in the power supply mode, based on the power supply capacity of the target electronic device connected to the electronic device, a power receiving request is sent to the target electronic device, so that the target electronic device powers the electronic device through the charging control module 71 based on the power receiving request; the power supply capacity of the target electronic device represents the output power of the target electronic device.
[0108] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0109] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0110] Multiple components in the electronic device 800 are connected to the I / O interface 805, including an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0111] The computing unit 801 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the power failure protection method. For example, in some embodiments, the power failure protection method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the power failure protection method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the power failure protection method by any other suitable means (e.g., by means of firmware).
[0112] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0113] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow charts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0114] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0115] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0116] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0117] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0118] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this application can be achieved. This is not a limitation herein.
[0119] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the description of this application, "plurality" means two or more, unless otherwise specifically defined.
[0120] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A power-off protection method, applied to electronic equipment, comprising: In response to the charging control module of the electronic device detecting that the power supply state of the electronic device is abnormal, setting the state of the charging control module from the power supply mode to the power supply mode; In the power receiving mode, based on the power supply capability of the target electronic device connected to the electronic device, a power receiving request is sent to the target electronic device, so that the target electronic device supplies power to the electronic device through the charging control module based on the power receiving request; The power supply capability of the target electronic device represents the output power of the target electronic device.
2. The power-off protection method according to claim 1, wherein, in response to the charging control module of the electronic device detecting that the power supply state of the electronic device is abnormal, the method comprises: The charging control module detects that the power supply voltage of the electronic device is less than a first threshold value, and determines that the power supply state of the electronic device is abnormal.
3. The power-off protection method according to claim 1 , further comprising: Determining that the target electronic device is connected; Setting the state of the charging control module from the power supply mode to the power supply mode; In the power supply mode, sending a power supply capability query request to the target electronic device; receiving power supply capability information returned by the target electronic device based on the power supply capability query request, and saving the information; The state of the charging control module is set from the power supply mode to the power supply mode.
4. The power-off protection method according to claim 1, wherein the powering of the electronic device by the charging control module comprises: Supplying power to the mainboard of the electronic device through the charging control module and the boost module; The charging control module supplies power to the embedded controller of the electronic device.
5. The power-off protection method according to claim 1, further comprising: If the power supply capability of the target electronic device is at the first level, sending a first notification message to a basic input / output system so that the basic input / output system controls the operating system to enter a dormant state and saves the target data in the cache to a memory of the electronic device; If the power supply capability of the target electronic device is at the second level, sending a second notification message to a basic input / output system so that the basic input / output system controls a display screen to output a power-off reminder message; The power supply capability of the target electronic device at the first level is smaller than the power supply capability at the second level.
6. The power-off protection method according to claim 5, further comprising: after saving the target data in the cache to the memory of the electronic device; If it is detected that the voltage provided by the target electronic device is less than a second threshold, a third notification message is sent to the basic input and output system, so that the basic input and output system controls the operating system to enter a shutdown state.
7. The power-off protection method according to claim 5, further comprising: after saving the target data in the cache to the memory of the electronic device; If it is detected that the power supply status of the electronic device returns to normal, a fourth notification message is sent to the basic input and output system, so that the basic input and output system controls the operating system to enter the working state, and reads the target data from the memory of the electronic device and puts it into the cache.
8. The power-off protection method according to claim 1, further comprising: The power switch is controlled to enter an off state to prevent the voltage provided by the target electronic device to the electronic device from being discharged outward through the power switch.
9. A power-off protection device, comprising: a monitoring module configured to, in response to a charging control module in the electronic device detecting an abnormal power supply state of the electronic device, set the state of the charging control module from a power supply mode to a power supply mode; A sending module is used to send a power receiving request to the target electronic device in the power supply mode based on the power supply capacity of the target electronic device connected to the electronic device, so that the target electronic device powers the electronic device through the charging control module based on the power receiving request; the power supply capacity of the target electronic device represents the output power of the target electronic device.
10. An electronic device comprising: A charging control module, the charging control module is used to execute, in response to the charging control module of the electronic device detecting that the power supply state of the electronic device is abnormal, setting the state of the charging control module from the power supply mode to the power collection mode; in the power collection mode, based on the power supply capacity of the target electronic device connected to the electronic device, sending a power receiving request to the target electronic device, so that the target electronic device supplies power to the electronic device through the charging control module based on the power receiving request; the power supply capacity of the target electronic device represents the output power of the target electronic device.