Over-current protection fault processing method, electronic equipment and storage medium

By adjusting the operating mode of the target power supply in the electronic device and repeatedly loading the driver, the problem of peripherals being unable to recover due to overcurrent protection failures is solved, and the user experience and device availability is improved.

CN119248542APending Publication Date: 2025-01-03HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410163144.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-02
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The peripherals caused by overcurrent protection failure in electronic devices cannot be restored in time, which affects the user experience, and users may mistakenly believe that the device has hardware failure, resulting in return or repair.

Method used

In the event of an overcurrent protection failure, adjust the operating mode of the target power supply to increase the OCP threshold and repeatedly load the target driver if the fault is not eliminated to increase the probability and success rate of failure recovery.

Benefits of technology

It increases the probability that peripheral devices will resume normal operation due to overcurrent protection failures, reduces the possibility of users misjudging hardware failures, and improves user experience and device availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248542A_ABST
    Figure CN119248542A_ABST
Patent Text Reader

Abstract

The invention provides an overcurrent protection fault processing method, electronic equipment and a storage medium, relates to the technical field of terminals, and can improve the probability of automatic recovery of parts which cannot be used due to an OCP fault in the electronic equipment so as to improve the use experience of a user. The method comprises the following steps: adjusting the working mode of a target power supply corresponding to an OCP fault from a first working mode to a second working mode under the condition that the OCP fault exists; wherein the OCP threshold of the second working mode is greater than the OCP threshold of the first working mode; under the condition that the OCP fault is not eliminated, determining a target drive corresponding to the target power supply; loading a target drive; and after the target drive is loaded, reloading the target drive under the condition that the OCP fault is not eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The application relates to the field of terminal technology, and in particular to an overcurrent protection fault handling method, electronic device and storage medium. Background Art

[0002] In order to use electric energy more effectively, electronic devices can divide the electric energy supplied by the battery (which can be called the electric energy of the total power supply) into multiple power supplies (which can be called sub-power supplies) to supply different components in the electronic device. Generally speaking, the multiple power supplies powered by batteries in electronic devices can be divided into two categories: peripheral power supplies and system power supplies. Among them, the peripheral power supply can power electronic components such as cameras, speakers, microphones, flashlights, displays, radars, etc. in electronic devices. The system power supply can power electronic components such as processors and memories in electronic devices. When the load current exceeds the maximum value that a certain power mode can withstand (i.e., the overcurrent protection (OCP) threshold value), the power supply will have an OCP (overcurrent) fault, and the device powered by the power supply will not be able to be used normally.

[0003] When an OCP failure occurs in a power supply of an electronic device, the power chip can transmit or broadcast the fault message of the OCP failure of the power supply to the system on chip (or system on chip (SOC)), and the SOC may control the electronic device to restart, and the user will not be able to use the electronic device in time. In order to ensure the user experience of the electronic device, the power chip will not broadcast the fault message to the SOC when an OCP failure occurs in a peripheral power supply, so that the electronic device can be used by the user when the corresponding peripheral cannot work normally.

[0004] However, in this case, the peripherals corresponding to the power supply with OCP failure cannot be restarted and restored in time. When users use the peripherals, they will think that the mobile phone has a fault and then return it for exchange or repair, which has a negative impact on the user's use. Summary of the invention

[0005] The embodiments of the present application provide an overcurrent protection fault processing method, an electronic device, and a storage medium, which can increase the probability of automatic recovery of components in an electronic device that cannot be used due to an OCP fault, thereby improving the user experience.

[0006] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0007] In a first aspect, an embodiment of the present application provides an overcurrent protection fault processing method, which is applied to electronic devices. The method includes: in the case of an overcurrent protection OCP fault, adjusting the working mode of the target power supply corresponding to the OCP fault from the first working mode to the second working mode; wherein the OCP threshold of the second working mode is greater than the OCP threshold of the first working mode; in the case that the OCP fault is not eliminated, determining the target drive corresponding to the target power supply; loading the target drive; after loading the target drive, in the case that the OCP fault is not eliminated, reloading the target drive.

[0008] Based on the technical solution provided by the present application, when the electronic device determines that there is an OCP fault, it can first improve the working mode of the target power supply corresponding to the OCP fault. Specifically, improving the working mode of the target power supply can be to adjust the current first working mode of the target power supply to the second working mode with a higher OCP threshold. Afterwards, if the OCP fault no longer exists (that is, the OCP fault has been eliminated), it indicates that the target component (such as a peripheral component) powered by the target power supply can work normally, that is, the use of this solution has achieved the purpose of restoring the target component that cannot work normally due to the OCP fault to work normally, and the whole solution ends. If the OCP fault still exists (that is, the OCP fault has not been eliminated), the electronic device can try to load the target drive successfully by repeatedly loading the target drive corresponding to the target power supply. Because the target component powered by the target power supply needs to be controlled by the target drive, if the target drive can be loaded successfully (no error information appears during the loading process), it means that the target component can be controlled to work normally, which means that the OCP fault has been eliminated at this time. Therefore, based on the technical solution provided by the present application, the OCP fault can be eliminated by adjusting the working mode of the target power supply corresponding to the OCP fault, so that the target component powered by the target power supply works normally. After adjusting the working mode, if the OCP fault cannot be eliminated, the target driver corresponding to the target power supply can be repeatedly loaded to increase the success rate of the target driver being loaded successfully, thereby increasing the probability of eliminating the OCP fault, so that the target component powered by the target power supply can be restored to a normal working state with a greater probability when it cannot work normally due to the OCP fault. In this way, even if the target component in the electronic device cannot work normally due to the OCP fault when the user uses the electronic device, the probability of it restoring to a normal working state is increased, thereby improving the user experience. Furthermore, if the OCP fault is caused by a non-hardware fault, the technical solution provided by the present application can enable the target component to automatically restore to a normal working state in a timely manner, so that the user can better use the electronic device and improve the user experience.

[0009] In a possible design manner of the first aspect, when the electronic device is in the process of starting up and there is an overcurrent protection OCP fault, before adjusting the operating mode of the target power supply corresponding to the OCP fault from the first operating mode to the second operating mode, the method also includes: obtaining OCP information of at least one power supply; wherein the OCP information is used to indicate whether the power supply to which it belongs has an OCP fault; and when there is OCP information of a first power supply in the OCP information of at least one power supply, which is used to indicate that the first power supply has an OCP fault, it is determined that there is an OCP fault and the first power supply is the target power supply.

[0010] Based on the above design, when the electronic device is in the process of starting up, the electronic device can obtain OCP information to determine whether there is an OCP fault, so that the overcurrent protection fault handling method can be smoothly implemented.

[0011] In a possible design manner of the first aspect, obtaining OCP information of at least one power source includes: obtaining the OCP information of at least one power source from a register corresponding to the at least one power source in a power chip of the electronic device.

[0012] Based on the above design method, the electronic device can successfully obtain the OCP information of at least one power source.

[0013] In a possible design of the first aspect, determining a target driver corresponding to a target power source includes: determining a target component powered by the target power source according to a preset power tree; and determining a driver of the target component as the target driver.

[0014] Based on the above design method, the electronic device can accurately obtain the target drive corresponding to the target power supply.

[0015] In a possible design manner of the first aspect, after reloading the target driver, the method further includes: if the OCP fault has not been eliminated, if the number of times the target driver is loaded during this startup process is less than a first preset number, reloading the target driver; if the number of times the target driver is loaded during this startup process is not less than the first preset number, outputting a prompt message; the prompt message is used to indicate to the user that there is a hardware fault in the target component of the mobile phone.

[0016] When it is determined that the OCP fault has not been eliminated, the electronic device can reload the target driver again to further eliminate the OCP fault. However, repeated loading of the target driver consumes more processing resources. Moreover, if the OCP fault is caused by a hardware short circuit or other reasons that cannot be automatically recovered, the OCP fault cannot be eliminated no matter how many times the target driver is repeatedly loaded. Therefore, the number of repeated loading of the target driver needs to be limited to an appropriate range to save processing resources while ensuring that OCP faults caused by reasons other than hardware short circuits can be eliminated as much as possible. Based on this, using the technical solution corresponding to the above-mentioned design method, it is possible to promptly determine whether the number of records is too many after the target driver is reloaded, and then decide whether to continue reloading. In this way, the probability of the target component returning to a normal working state can be increased as much as possible while saving processing resources.

[0017] In a possible design manner of the first aspect, reloading the target driver includes: reloading the target driver after a preset time period.

[0018] In practice, after a mobile phone has loaded a target driver once, in order to ensure the stability and security of the entire electronic device system, the same driver cannot be loaded continuously. Therefore, based on the above design method, the stability and security of the entire electronic device system can be improved.

[0019] In a possible design manner of the first aspect, when the electronic device is in the process of being powered on and in use, in the case of an overcurrent protection OCP fault, before adjusting the operating mode of a target power supply corresponding to the OCP fault from a first operating mode to a second operating mode, the method further includes: a target module in the electronic device registers a target callback function in a driver of at least one component, so that the driver of at least one component reports an OCP fault message to the target module when an OCP fault occurs in the corresponding component; the OCP fault message is used to indicate that an OCP fault occurs in the corresponding component; when the target module receives the OCP fault message from the first driver, it is determined that an OCP fault exists, and the first driver is determined as the target driver.

[0020] Based on the above design, during the use of the electronic device, it is possible to promptly determine whether there is an OCP fault by registering a callback function in the driver, and then promptly execute the overcurrent protection fault handling method to improve the user experience.

[0021] In a possible design manner of the first aspect, loading the target driver includes: loading the target driver after a preset time period.

[0022] Since the electronic device has already loaded the target driver before loading the target driver for the first time during the use of the electronic device, the target driver may be loaded after a period of time in order to ensure the system stability and security of the electronic device.

[0023] In a possible design manner of the first aspect, after reloading the target driver, the method further includes: if the OCP fault is not eliminated, if the number of times the target driver is loaded during this use is less than a second preset number of times, reloading the target driver; if the number of times the target driver is loaded during this use is not less than the second preset number of times, outputting a prompt message; the prompt message is used to indicate to the user that there is a hardware fault in the target component of the mobile phone.

[0024] When it is determined that the OCP fault has not been eliminated, the electronic device can reload the target driver again to further eliminate the OCP fault. However, repeated loading of the target driver consumes more processing resources. Moreover, if the OCP fault is caused by a hardware short circuit or other reasons that cannot be automatically recovered, the OCP fault cannot be eliminated no matter how many times the target driver is repeatedly loaded. Therefore, the number of repeated loading of the target driver needs to be limited to an appropriate range to save processing resources while ensuring that OCP faults caused by reasons other than hardware short circuits can be eliminated as much as possible. Based on this, using the technical solution corresponding to the above-mentioned design method, it is possible to promptly determine whether the number of records is too many after the target driver is reloaded, and then decide whether to continue reloading. In this way, the probability of the target component returning to a normal working state can be increased as much as possible while saving processing resources.

[0025] In a possible design of the first aspect, the target power supply is an external power supply, and the external power supply is used to power external components; the external components include: an audio module, a speaker, a receiver, a microphone, a display screen, a camera, a sensor, and a communication module.

[0026] Based on the above design method, through the technical solution provided by this application, it is possible to ensure that users can use electronic devices while making it more likely that peripheral components can be restored to a normal working state from a state where they cannot work properly due to OCP failure.

[0027] In a second aspect, an embodiment of the present application further provides an overcurrent protection fault processing device, which can be applied to electronic equipment. The functions of the device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, for example, a control module, a processing module, and a loading module.

[0028] The control module is used to adjust the working mode of the target power supply corresponding to the OCP fault from the first working mode to the second working mode when there is an overcurrent protection OCP fault; wherein the OCP threshold of the second working mode is greater than the OCP threshold of the first working mode. The processing module is used to determine the target driver corresponding to the target power supply when the OCP fault is not eliminated. The loading module is used to load the target driver determined by the processing module, and the loading module is also used to reload the target driver after loading the target driver when the OCP fault is not eliminated.

[0029] In a third aspect, the present application provides an electronic device, comprising a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the overcurrent protection fault handling method provided in the first aspect and any possible design method thereof.

[0030] In a fourth aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the overcurrent protection fault handling method provided in the first aspect and any possible design method thereof.

[0031] In a fifth aspect, the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the overcurrent protection fault handling method provided in the first aspect and any possible design method thereof.

[0032] It can be understood that the beneficial effects that can be achieved by the technical solutions provided in the second to fifth aspects provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A schematic diagram of the structure of a power tree provided in an embodiment of the present application;

[0034] Figure 2 A schematic diagram of the principle of an overcurrent protection fault processing method provided in an embodiment of the present application;

[0035] Figure 3 A schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application;

[0036] Figure 4 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;

[0037] Figure 5A schematic diagram of a method for handling an overcurrent protection fault provided in an embodiment of the present application Figure 1 ;

[0038] Figure 6 A schematic diagram of a display scenario of prompt information provided in an embodiment of the present application;

[0039] Figure 7 A schematic diagram of a method for handling an overcurrent protection fault provided in an embodiment of the present application Figure 2 ;

[0040] Figure 8 A schematic diagram of a method for handling an overcurrent protection fault provided in an embodiment of the present application Figure 3 ;

[0041] Fig. 9 A schematic diagram of the structure of an overcurrent protection fault processing device provided in an embodiment of the present application;

[0042] Fig.10 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of an association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0044] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0045] The terms "first" and "second" in the following embodiments of the present application are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.

[0046] First, the nouns involved in the embodiments of the present application are explained as follows:

[0047] (1) Overcurrent protection (OCP): In electronic devices, overcurrent protection is an important safety function designed to protect circuits from damage and dangers caused by abnormally high currents. When the current value in the circuit exceeds the OCP threshold, the circuit will have an overcurrent risk (or OCP failure), which will cause safety hazards. At this time, the electronic device can perform the affected OCP protection operation to avoid overheating, short circuit or other damage to the device. The specific value of the OCP threshold can be determined according to the specifications, design requirements and safety standards of the equipment.

[0048] (2) Register: A register is a storage device inside a computer or chip that is used to temporarily store and process data. They are usually located inside the processor and have very fast read and write access speeds. Common register bit sizes include 8 bits, 16 bits, 32 bits, and 64 bits.

[0049] In an embodiment of the present application, a power chip (e.g., a power management integrated circuit (PMIC)) in an electronic device may have multiple registers. The multiple registers may be used to store OCP information of all power supplies in the electronic device. In an embodiment of the present application, the OCP information may include: a power supply identifier, an OCP fault identifier. The OCP fault identifier is used to indicate whether the power supply has an OCP fault.

[0050] (3) Booting stage: When an electronic device is turned on, it first goes through the booting stage to create an operating system (such as Android) in the electronic device. system) running environment, thereby facilitating the running of the subsequent operating system, and allowing users to use the electronic device normally.

[0051] Exemplarily, taking the operating system of the electronic device as the Android system as an example, the boot phase may include a power-on self-test (POST) phase, a unified extensible firmware interface (UEFI) phase, a Linux initialization (Init) phase, and an Android phase. In some embodiments, the POST phase and the UEFI phase may be collectively referred to as a small system boot process, the POST phase being the first phase of the small system boot process, and the UEFI phase being the second phase of the small system boot process.

[0052] Among them, the POST stage is an automatic detection process used to check and verify the integrity and functionality of the phone's hardware components. When an electronic device is turned on, a series of tests are performed during the POST stage to ensure that the hardware components are functioning properly. These tests include, but are not limited to: memory detection (checking whether the capacity and function of the random access memory (RAM) are normal), display test (checking whether the display quality and function of the display are normal), keyboard test (checking whether the keys of the keyboard are functioning properly), battery test (checking whether the battery power and charging status are normal), external interface test (checking whether the external interfaces such as the universal serial bus (USB) and headphones are functioning properly) and system clock test (checking whether the accuracy and function of the system clock are normal).

[0053] UEFI is a new boot mode that replaces the traditional BIOS (basic input output system). The UEFI stage is a firmware boot process used to initialize hardware devices, load the operating system, and ensure the secure boot of the system. In the UEFI stage, the tasks performed by the electronic device may include hardware initialization (initializing various hardware components, such as processors, memory, storage devices, etc., so that the operating system can start normally), boot device detection (detecting and selecting the boot device used to start the operating system, such as hard disks, flash drives, etc.), operating system loading (loading the core files of the operating system in the boot device, including the kernel (such as the Linux kernel) and initialization programs, etc.) and secure boot (providing a series of security features to ensure that only verified software and firmware can boot the system).

[0054] After the UEFI stage, the Linux kernel starts and initializes. In the Linux Init stage, the electronic device (specifically, the Linux kernel in the electronic device) loads and initializes the device driver, initializes the system environment, and starts the system's first process init. Usually, the init process is the first user space process of Android, responsible for starting and initializing the Android runtime environment.

[0055] Among them, in the Linux Init stage, the loaded drivers may include drivers for various peripherals of electronic devices, such as camera drivers, sensor drivers, display drivers, etc. These drivers can be specifically expressed in the form of ko (kernel object) files. In the case that an OCP failure occurs in a peripheral corresponding to a driver (or a power supply corresponding to the peripheral), the driver (or the ko) cannot be loaded successfully.

[0056] After the Linux Init phase is completed, the Android system boot process begins. This phase includes starting the Zygote process, starting system services, loading applications, etc. The Zygote process is used to create other application processes, system services provide various functions and services, and applications are user-visible application interfaces. After the Android system is started, users can use electronic devices normally.

[0057] (4) Power tree: A power tree refers to an integrated power supply system that is similar in shape and structure to a tree. The root of the power tree represents the main source of power, such as the power grid or main battery. The branches and leaves represent the various devices and equipment that distribute and convert electrical energy, such as transformers, power adapters, UPS power supplies, etc. The concept of the power tree stems from the need to integrate and optimize the power supply system. Previous power supply systems had many problems, such as chaotic lines, independent equipment, and energy waste. The design concept of the power tree is to combine various power equipment together in an integrated and modular manner to form a unified power supply system, thereby improving energy utilization efficiency, reducing energy loss, and improving power supply reliability.

[0058] Generally, after an electronic device leaves the factory, in order to facilitate the subsequent management and control of the power supply by the electronic device, a structure diagram of the power tree may be stored in a specific storage area (such as a storage area of ​​a power chip) in the electronic device. Figure 1 A possible power tree structure diagram is shown below. Figure 1As shown in the figure, in the power tree, the main power supply VPH_PWR divides multiple power supplies such as S1C and S6C, that is, multiple power supplies such as S1C, S2C, and S6C are powered by the main power supply VPH_PWR. S1C divides peripheral power supplies such as L2C and L2G, that is, peripheral power supplies such as L2C and L2G are powered by S1C. S6C divides peripheral power supplies such as L5N, that is, peripheral power supplies such as L5N are powered by S6C.

[0059] Among them, the external power supply L2C is used to power the fingerprint sensor on the display screen; the external power supply L2G is used to power the digital power supply DVDD of the main camera (main camera, specifically the main camera in the rear camera) of the electronic device; the external power supply L5N is used to power the input / output power supply IOVDD of multiple cameras of the electronic device. Specifically, L5N is used to power the input / output power supply IOVDD of the front camera (front camera), the input / output power supply of the main camera, the input / output power supply of the telephoto camera, and the input / output power supply of the wide-angle camera. In some embodiments, powering the digital power supply DVDD can be understood as powering the digital circuit part, and powering the input / output power supply IOVDD can also be understood as powering the input / output interface (I / O interface) or powering the analog circuit part.

[0060] certainly, Figure 1 The power tree shown is only an example. In practice, the structure of the power tree may include more or less content, and this application does not impose any specific limitation on this.

[0061] In order to use electric energy more efficiently, the electric energy of the battery in the electronic device can be divided into multiple power supplies. Generally speaking, the multiple power supplies powered by the battery in the electronic device can be divided into two categories: peripheral power supply and system power supply. Among them, the peripheral power supply can power the electronic components such as the camera, speaker, microphone, flash, display, radar, etc. in the electronic device. The system power supply can power the electronic components such as the processor and memory in the electronic device.

[0062] In electronic devices, each power supply can have multiple working modes. Different working modes correspond to different levels. Different working modes correspond to different power consumption and over-current protection (OCP) threshold values. When the load current of a power supply exceeds the maximum value (OCP threshold value) that the power supply can withstand in the working mode, the power supply will have an OCP (overcurrent) fault, and the device powered by the power supply will not be able to be used normally.

[0063] There are currently two processing strategies for OCP failures in power supplies of electronic devices: broadcast and non-broadcast. Broadcast means that the power chip transmits or broadcasts information about an OCP failure in the power supply to the SOC, and non-broadcast means that the power chip does not transmit or broadcast the message of an OCP failure in the power supply (i.e., an OCP failure message) to the SOC. If a power supply is configured so that when an OCP failure occurs, the power chip broadcasts the corresponding OCP failure message to the SOC, then the SOC may restart the entire device, i.e., restart the entire electronic device. If a power supply is configured so that when an OCP failure occurs, the power chip does not broadcast the corresponding OCP failure message to the SOC, then the SOC does not do anything. In order to avoid frequent restarts of electronic devices and ensure the user experience of electronic devices, the power chip currently does not broadcast a failure message to the SOC when an OCP failure occurs in a peripheral power supply, so that the electronic device can be used by the user when the corresponding peripheral fails to work properly.

[0064] However, in this case, the peripherals corresponding to the sub-power supply with OCP failure cannot be restarted and restored in time. When the user uses the peripherals, the user will think that the mobile phone has a fault and then return it for exchange or repair, which has a negative impact on the user's use.

[0065] In response to the above problems, relevant researchers have found that there are many reasons that lead to OCP problems, such as hardware short circuits, software bugs (such as power-off timing problems, the front-stage power supply is powered off before the rear-stage power supply), etc. For OCP failures of peripheral power supplies that are not caused by short circuits (that is, hardware problems such as non-hardware short circuits), by improving the working mode of the peripheral power supply to which the OCP failure belongs, that is, adjusting it to a working mode with a higher OCP threshold, and restarting the corresponding peripherals (reloading or running the files of the corresponding peripherals), the peripherals with the peripheral power supply function corresponding to the OCP failure will most likely be able to return to normal. Based on this, in response to the above problems, an embodiment of the present application provides an overcurrent protection fault handling method, which is applied to an electronic device, wherein the electronic device includes multiple power supplies. In this technical solution, refer to Figure 2As shown, when the electronic device determines that there is an OCP fault in the electronic device, the operating mode of the target power supply corresponding to the OCP fault is improved. Specifically, improving the operating mode of the target power supply may be to adjust the original first operating mode of the target power supply to the second operating mode. The OCP threshold corresponding to the second operating mode is greater than the OCP threshold of the first operating mode. Afterwards, if the OCP fault no longer exists (that is, the OCP fault has been eliminated), it indicates that the target component (such as a peripheral component) powered by the target power supply can work normally, that is, the use of this solution has achieved the purpose of restoring the target component that cannot work normally due to the OCP fault to work normally, and the entire solution ends. If the OCP fault still exists (that is, the OCP fault has not been eliminated), the electronic device can repeatedly load the target driver corresponding to the target power supply so that the target driver is loaded successfully.

[0066] Because the target component powered by the target power supply needs to be controlled by the target driver, if the target driver can be loaded successfully (no error information appears during the loading process), it means that the target component can be controlled to work normally, which means that the OCP fault has been eliminated at this time. Therefore, based on the technical solution provided by the present application, the OCP fault can be eliminated by adjusting the working mode of the target power supply corresponding to the OCP fault, so that the target component powered by the target power supply can work normally. After adjusting the working mode, if the OCP fault cannot be eliminated, the target driver corresponding to the target power supply can be repeatedly loaded to increase the success rate of the target driver being loaded successfully, thereby increasing the probability of eliminating the OCP fault, so that the target component powered by the target power supply can be restored to a normal working state with a greater probability when it cannot work normally due to the OCP fault. In this way, even if some components in the electronic device cannot work normally due to the OCP fault when the user uses the electronic device, the probability of restoring the normal working state is increased, thereby improving the user experience.

[0067] The technical solution provided by the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0068] The technical solution provided in the present application can be applied to an electronic device having multiple peripherals, each of which has a corresponding peripheral power supply. In some embodiments, the electronic device can be a mobile phone, a tablet computer, a handheld computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device, and the embodiments of the present application do not impose any special restrictions on the specific type of the electronic device.

[0069] For example, taking the electronic device as a mobile phone, Figure 3 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.

[0070] Reference Figure 3 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a display screen 193, a subscriber identification module (SIM) card interface 194, and a camera 195, etc. Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0071] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0072] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0073] A memory may also be provided in the processor 110 for storing instructions and data. In an embodiment of the present application, the memory in the processor 110 may store executable instructions, and when the executable instructions are executed by the processor, the electronic device may execute the overcurrent protection fault processing method provided in the embodiment of the present application. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. In an embodiment of the present application, the processor may be a SOC.

[0074] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0075] The charging management module 140 is used to receive charging input from a power supply device (e.g., a charger, a laptop power supply, etc.). The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device.

[0076] While charging the battery 142, the charging management module 140 can also power the electronic device through the power management module 141. The battery 142 can be composed of multiple batteries connected in series. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.

[0077] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 193, the camera 195, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as the battery voltage, current, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device, for example, the power management module 141 and the charging management module 140 can be different functional modules in the same power chip.

[0078] The indicator 192 may be an indicator light, which may be used to indicate the charging status and the change in the power level, and may also be used to indicate messages, missed calls, and notifications, etc.

[0079] The key 190 may include a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device may receive key input and generate key signal input related to user settings and function control of the electronic device.

[0080] In an embodiment of the present application, the power management module can distribute the power provided by the battery or the charging management module to multiple power supplies step by step. The multiple power supplies can be divided into a system power supply and a peripheral power supply. The system power supply can be responsible for powering the main components of the electronic device such as the processor 110, the internal memory 121, the external memory interface 120, the USB interface 130, the SIM card interface 194, the indicator 192 and the headphone interface 170D. The peripheral power supply is responsible for powering the peripheral components (or external devices / external devices) such as the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the display 193, the camera 195, the motor 191, the button 190, the sensor module 180, the antenna 1, the antenna 2, the mobile communication module 150 and the wireless communication module 160.

[0081] Each power supply at the bottom or lowest level of the multi-way power supply can be responsible for supplying power to a device (external device or main component) as a power supply or part of a power supply to the device. Figure 1 As shown, the bottom-level L2C power supply is responsible for supplying power to the fingerprint sensor; the bottom-level L2G power supply is responsible for supplying power to the digital power supply of the main camera of the electronic device; and the bottom-level L5N is responsible for supplying power to the input / output power supply of the main camera of the electronic device.

[0082] Of course, there may be different ways to divide external devices and main components in an electronic device, and this application does not impose any specific restrictions on this.

[0083] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

[0084] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and store user and application data, etc., and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.

[0085] A touch sensor is also called a "touch control device". The touch sensor can be arranged on the display screen 193. The touch sensor and the display screen 193 form a touch screen, also called a "touch control screen". The touch sensor is used to monitor touch operations acting on or near it. The touch sensor can pass the monitored touch operations to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 193. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device, which is different from the position of the display screen 193.

[0086] The ambient light sensor is used to sense the brightness of ambient light. For example, the ambient light sensor can measure the light intensity of four channels of ambient light. The ambient light sensor outputs the measured light intensity of the four channels of ambient light to the processor 110. The processor 110 can process the light intensity of the four channels of ambient light output by the ambient light sensor to obtain the light intensity of the ambient light.

[0087] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be set on the display screen 193. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. When a touch operation is applied to the display screen 193, the electronic device monitors the touch operation intensity according to the pressure sensor. The electronic device can also calculate the touch position based on the monitoring signal of the pressure sensor. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0088] In some embodiments, the electronic device may include 1 or N cameras 195, where N is a positive integer greater than 1. In the embodiment of the present application, the type of camera 195 can be distinguished according to the hardware configuration and the physical location. For example, the camera arranged on the side of the display screen 193 of the electronic device can be called a front camera, and the camera arranged on the side of the back cover of the electronic device can be called a rear camera; for another example, a camera with a short focal length and a larger viewing angle can be called a wide-angle camera; a camera with a long focal length and a small viewing angle can be called a normal camera or a telephoto camera. Among them, the length of the focal length and the size of the viewing angle are relative concepts, and there is no specific parameter limitation. Therefore, a wide-angle camera and a normal camera are also a relative concept, and can be specifically distinguished according to physical parameters such as focal length and viewing angle.

[0089] The electronic device implements the display function through a GPU, a display screen 193, and an application processor. The GPU is a microprocessor for image editing, connecting the display screen 193 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0090] The electronic device can realize the shooting function through ISP, camera 195, video codec, GPU, display screen 193 and application processor. GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or change display information. In the embodiment of the present application, the function of the GPU is used in the frame drawing process of each image frame so that the final displayed picture obtains better display effect and performance.

[0091] The ISP is used to process the data fed back by the camera 195. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 195. The camera 195 is used to capture static images or videos.

[0092] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.

[0093] The display screen 193 is used to display images, videos, etc. The display screen 193 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 193, where N is a positive integer greater than 1.

[0094] In an embodiment of the present application, the display screen 193 can be used to display pages required by the electronic device (for example, wizard pages (including highlight recommendation pages and external module access pages), etc.), and display images captured by any one or more cameras 195 in the interface.

[0095] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem and baseband processor.

[0096] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.

[0097] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0098] The mobile communication module 150 and the wireless communication module 160 may be collectively referred to as a communication module.

[0099] The modem processor (modem) may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 193. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0100] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0101] The SIM card interface 194 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device by inserting it into or removing it from the SIM card interface 194. The electronic device can support one or more SIM card interfaces. The SIM card interface 194 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 194 at the same time. The SIM card interface 194 can also be compatible with external memory cards. The electronic device interacts with the network through the SIM card to implement functions such as calls and data communications. One SIM card corresponds to one user number.

[0102] In an embodiment of the present application, the electronic device may further include a flash memory. The flash memory may be, for example, an embedded multi media card (embedded multi media card, eMMC), a universal flash storage (universal flash storage, UFS) or a non-volatile memory (non-volatile memory, NVM) and the like. The flash memory may include a boot loader (bootloader), which is responsible for executing the boot task when the electronic device receives a boot operation, so that the electronic device can be booted smoothly. Specifically, the boot loader may be responsible for the smooth progress of the POST stage and the UEFI stage in the boot stage. After completing the UEFI stage, the boot loader may hand over the control of the electronic device to the operating system (specifically, it may be the Linux kernel in the operating system) to further control the electronic device to complete the boot.

[0103] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0104] Of course, it is understandable that the above Figure 3 The figure is only an exemplary description when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet computer, a handheld computer, a PC, a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the electronic device may include Figure 3 The structure shown in the figure is less than Figure 3 More structures are shown in the figure, which are not limited here.

[0105] It is understandable that, in general, the realization of electronic device functions requires not only hardware support but also software cooperation. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.

[0106] Figure 4 A schematic diagram of a layered architecture of a software system of an electronic device provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces (such as APIs).

[0107] In some examples, reference Figure 4As shown, in the embodiment of the present application, the software system on the application processor (application processor, AP) in the system-level chip SOC of the electronic device is divided into five layers, from top to bottom, namely, the application layer, the framework layer (or called the application framework layer), the system library and the Android runtime (androidruntime), the HAL layer (hardware abstraction layer, hardware abstraction layer) and the kernel layer (or called the driver layer). Among them, the system library and the Android runtime can also be called the local framework layer or the native layer.

[0108] The application layer can include a series of applications. Figure 4 As shown, the application layer may include applications (APP) such as camera, gallery, calendar, map, WLAN, Bluetooth, news, music, video, short message, call, contact, navigation, instant messaging, etc.

[0109] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions or services. For example, the application framework layer may include an activity manager, a window manager, a content provider, an audio service, a camera service, a view system, a phone manager, a resource manager, a notification manager, a package manager, etc., and the embodiments of the present application do not impose any restrictions on this.

[0110] The activity management service is the ActivityManagerService in the electronic device. The activity management service can be used to obtain the foreground activity, that is, the activity of the foreground application. The foreground application information may be included, including but not limited to: process, application name and other information.

[0111] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0112] Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0113] The main function of the camera service is to provide a unified interface and functions for applications to access and operate camera devices (i.e., cameras). The main function of the audio service is to provide a unified interface and functions for applications to access and operate audio modules in electronic devices.

[0114] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0115] The phone manager is used to provide communication functions of the electronic device. For example, the phone manager can manage the call status of the call application (including initiation, connection, hang up, etc.).

[0116] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0117] The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages and disappear automatically after a short stay without user interaction.

[0118] The package manager is The system is used to manage application packages. It allows applications to obtain detailed information about installed applications and their services, permissions, etc. The package manager is also used to manage events such as application installation, uninstallation, and upgrades.

[0119] In the embodiment of the present application, the framework layer may also include a power management service. The power management service is the PowerManagerService in the system service of the electronic device. In the embodiment of the present application, the power management service can handle the OCP fault when an OCP fault occurs after the electronic device is fully started or powered on (i.e., the Android stage after Android is started). Specifically, it can be to execute the overcurrent protection fault handling method provided in the embodiment of the present application.

[0120] The system library can include multiple functional modules. For example: surface manager, media library, open graphics library embedded systems (OpenGL ES), SGL, etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing. SGL is a drawing engine for 2D drawing.

[0121] The Android runtime includes the core library and the ART virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the ART virtual machine. The ART virtual machine executes the Java files of the application layer and the application framework layer as binary files. The ART virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0122] The HAL layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms. The HAL layer provides a standard interface to display device hardware functions to the higher-level Java API framework (i.e., the framework layer). The HAL layer contains multiple library modules, each of which implements an interface for a specific type of hardware component, such as: audio HAL audio module, bluetooth HAL Bluetooth module, camera HAL camera module (also called camera HAL or camera hardware abstraction module), sensors HAL sensor module (or Isensor service, sensor service), Wi-Fi HAL (Wi-Fi module), etc.

[0123] The kernel layer is a layer between hardware and software. The kernel layer includes at least various types of drivers. Various types of drivers may include display drivers, camera drivers, audio drivers, sensor drivers, battery drivers, Wi-Fi drivers, etc., which are not limited in this application. In some embodiments, the kernel layer may include a Linux kernel, or the kernel layer is the Linux kernel. The Linux kernel may be responsible for the Linux Init stage in the startup stage of the electronic device, and the overcurrent protection fault handling method provided in this application may be executed in the Linux Init stage.

[0124] In some other embodiments, the kernel layer may also include a power management module. When the electronic device is powered on and enters the Android stage, the power management module may be responsible for executing the overcurrent protection fault processing method provided in the present application when an OCP fault occurs in the electronic device.

[0125] In addition, during the UEFI stage of the electronic device startup process, the boot loader in the electronic device can perform OCP fault processing, that is, it is responsible for executing part or all of the processes in the overcurrent protection fault processing method. Of course, in the embodiment of the present application, the specific execution subject of the overcurrent protection fault processing method in different scenarios can be determined according to actual conditions, and the present application does not impose specific restrictions on this. In the embodiment of the present application, the execution subject of the overcurrent protection fault processing method can obtain OCP fault-related information (such as OCP information) from the power chip when OCP fault-related information is needed.

[0126] Although the software architecture of the electronic device in the present application embodiment is described using the Android system as an example, its basic principles are also applicable to the software architecture based on Electronic devices running iOS, Windows and other operating systems.

[0127] The technical solutions provided in the embodiments of the present application can be implemented in electronic devices having the above-mentioned hardware architecture or software architecture.

[0128] In the embodiments of the present application, an OCP fault may occur in the electronic device in the booting scenario (i.e., the booting process) and the use scenario after the booting is completed, so the overcurrent protection fault processing method provided by the present application can be applied in the booting scenario and the use scenario. Based on this, the overcurrent protection fault processing method provided by the embodiments of the present application can include an overcurrent protection fault processing method in the booting scenario and an overcurrent protection fault processing method in the use scenario.

[0129] Based on the above Figure 3 The hardware architecture shown and Figure 4 The software architecture shown below is combined with Figure 5 As shown, the overcurrent protection fault handling method in the startup scenario provided by the embodiment of the present application is introduced. Figure 5 A flow chart of an overcurrent protection fault processing method in a startup scenario provided by an embodiment of the present application. Figure 5 As shown, taking the electronic device as a mobile phone, the overcurrent protection fault processing method in the startup scenario may include S501-S512:

[0130] S501. During startup, the mobile phone obtains OCP information of at least one power source.

[0131] The OCP information is used to indicate whether the power supply has an OCP fault;

[0132] In a possible implementation, the OCP information includes: a power source identifier and an OCP fault identifier. The OCP fault identifier is used to indicate whether the power source has an OCP fault.

[0133] In another possible implementation, the OCP information may include: a power source identifier and a load current value.

[0134] Specifically, the mobile phone can obtain the OCP information of at least one power supply from the register corresponding to at least one power supply in the power chip during the UEFI stage in the boot process (ie, the boot stage).

[0135] In practice, in order to achieve more flexible and efficient management, the electric energy received by the power chip is usually divided into multiple power supplies for control. Each power supply can be independently turned on, off, and voltage-regulated to meet the power requirements of different circuit modules. Specifically, after the power chip receives power from the battery or the charging device, it distributes the power to multiple different power supplies through multiple pins. In order to manage each power supply, at least one corresponding register can be configured for each pin to store various types of information about the power supply. Among them, some registers can store the OCP information of the power supply to which it belongs. In addition, the OCP information in the register can be updated in real time or periodically.

[0136] In some embodiments, at least one power source may be the lowest level power source in the mobile phone that directly powers components in the electronic device. Figure 1 As shown, at least one power supply may be the bottom-level L2C, L2G, L5N, etc. power supplies in the power tree. In this case, the mobile phone may obtain the OCP information of the bottom-level power supply according to the preset power tree during the boot process.

[0137] In other embodiments, for the system power supply in the multi-way power supply in the mobile phone, if the system power supply has OCP, the mobile phone cannot be successfully turned on or cannot be used normally. Therefore, for the system power supply, the power chip can broadcast an OCP fault message to the SOC when an OCP fault occurs in the system power supply, so that the SOC controls the mobile phone to restart. There is no need to execute the overcurrent protection fault handling method provided in the present application. Based on this, the overcurrent protection fault handling method heard in the embodiment of the present application can only be for the peripheral power supply. The peripheral power supply refers to the power supply that supplies power to the peripheral components in the mobile phone. Exemplarily, the peripheral components in the mobile phone may include: audio module, speaker, receiver, microphone, display, camera, sensor, communication module and other components.

[0138] At this time, at least one power source may be an external power source in the mobile phone that supplies power to the peripheral components. When S501 is implemented, the mobile phone may obtain the OCP information of the external power source during the boot process. Specifically, the mobile phone may obtain the OCP information of the external power source from the register corresponding to the external power source in the power chip according to the power tree.

[0139] After the mobile phone obtains the OCP information, it can determine whether there is an OCP fault according to the OCP information, that is, execute S502.

[0140] S502: The mobile phone determines whether there is an OCP fault according to OCP information of at least one power source.

[0141] In a possible implementation, when the OCP information includes a power source identifier and an OCP fault identifier, S502 may specifically be: when the OCP fault identifier in the OCP information of a certain power source (e.g., a first power source) indicates that the power source has an OCP fault, the mobile phone may determine that an OCP fault exists, and determine the first power source as the target power source with the OCP fault.

[0142] In another possible implementation, when the OCP information includes a power supply identifier and a load current value, S502 may specifically be: when the load current value in the OCP information of a certain power supply (for example, a second power supply) is greater than the OCP threshold of the first operating mode, the mobile phone may determine that an OCP fault exists, and determine the power supply as a target power supply with an OCP fault.

[0143] In the case of determining that an OCP fault exists, if the OCP fault is not caused by a hardware short circuit or other problems that require maintenance, the mobile phone can eliminate the OCP fault by increasing the OCP threshold of the power supply corresponding to the OCP fault or repeatedly loading the driver of the corresponding component. Furthermore, since the processing resources consumed by repeatedly loading the driver of the corresponding component are more than the processing resources consumed by increasing the OCP threshold of the power supply corresponding to the OCP fault, and the time required for repeatedly loading the driver of the corresponding component is also longer than the time required for increasing the OCP threshold of the power supply corresponding to the OCP fault, in the case of determining that an OCP fault exists, the OCP threshold of the power supply corresponding to the OCP fault can be increased first, and then whether the driver of the corresponding component needs to be repeatedly loaded. Based on this, after S502 is executed, in the case of determining that an OCP fault exists, S503 is executed.

[0144] When it is determined that there is no OCP fault, the mobile phone can be turned on according to the normal process, ending the process of the overcurrent protection fault handling method provided in this application.

[0145] S503: The mobile phone adjusts the working mode of the target power supply corresponding to the OCP fault from the first working mode to the second working mode.

[0146] The OCP threshold of the second working mode is greater than the OCP threshold of the first working mode. The first working mode can be any one of multiple working modes, and the second working mode can be any one of the multiple working modes whose OCP threshold is greater than the first working mode.

[0147] Exemplarily, the working modes of the power supply in the mobile phone may include multiple, such as working mode 1, working mode 2, working mode 3, working mode 4, and working mode 5. Among them, the OCP threshold of working mode 1 may be 50mA, the OCP threshold corresponding to working mode 2 is 100mA, the OCP threshold corresponding to working mode 3 is 150mA, the OCP threshold corresponding to working mode 4 is 200mA, and the OCP threshold corresponding to working mode 5 is 250mA. If the first working mode is working mode 2, the second working mode may be one of working mode 3, working mode 4, and working mode 5.

[0148] In some embodiments, the second working mode may be one of the working modes whose OCP threshold is greater than the minimum OCP threshold of the first working mode. For example, if the first working mode is the working mode 2, the second working mode is the working mode 3.

[0149] In this way, the mobile phone can serve the purpose of increasing the OCP threshold of the power supply corresponding to the OCP fault.

[0150] After the OCP threshold of the power source corresponding to the OCP fault is increased, the mobile phone can determine whether the OCP fault is eliminated, that is, execute S504.

[0151] S504: The mobile phone determines whether the OCP fault has been eliminated.

[0152] In some possible implementations, the mobile phone can determine whether the OCP fault has been eliminated by obtaining the OCP information of the target power supply. After obtaining the OCP information of the target power supply, if it is determined through the OCP information of the target power supply that the OCP fault still exists, it indicates that the OCP fault has not been eliminated; if it is determined through the OCP information of the target power supply that the OCP fault does not exist, it indicates that the OCP fault has been eliminated. The specific implementation process can refer to the relevant descriptions of S501 and S502 in the aforementioned embodiment, which will not be repeated here.

[0153] When it is determined that the OCP fault has been eliminated, it can be determined that the mobile phone no longer has an OCP fault. At this time, the mobile phone can be turned on according to the normal process, and the process of the overcurrent protection fault handling method provided in this application is terminated. Specifically, when it is determined that the OCP fault has been eliminated, the mobile phone can perform tasks in the Linux Init stage, which may include loading various drivers (specifically, it may be a ko file corresponding to the driver). After the loading is completed and the Linux Init stage is ended, the mobile phone can start the operating system (such as the Android system). At this point, the user can start using the mobile phone.

[0154] If it is determined that the OCP fault has not been eliminated, it indicates that the OCP fault has not been eliminated by increasing the OCP threshold of the target power supply, and then the step of repeatedly loading the target driver of the target device powered by the target power supply can be performed. That is, after S504 is executed, if it is determined that the OCP fault has not been eliminated, S505-S512 are executed.

[0155] S505: The mobile phone determines a target drive corresponding to the target power source.

[0156] The target driver corresponding to the target power source is the target driver of the target component powered by the target power source. In some embodiments, if the target power source is an external power source, the target component is an external component powered by the external power source, and the target driver is the driver of the external component.

[0157] In a possible implementation, the mobile phone can determine the target component powered by the target power supply from a preset power tree according to the power supply identifier of the target power supply, and then determine the target drive of the target component. The power supply identifier of the target power supply is the power supply identifier in the OCP information in which the OCP failure is determined. In some embodiments, the target component can be a peripheral component in the mobile phone.

[0158] For example, Figure 1 Taking the power tree shown in the figure as an example, if the target power supply is L5N, the target components can be determined to be multiple cameras of the mobile phone, such as the front camera, main camera, telephoto camera, and wide-angle camera. Then the mobile phone can determine that the target driver is the camera driver of the mobile phone.

[0159] In some embodiments, S501 - S505 may specifically be implemented by a bootloader in the mobile phone in the UEFI stage.

[0160] S506: The mobile phone loads at least one driver to be loaded.

[0161] Among them, the drivers to be loaded can be some necessary hardware drivers that need to be loaded during the startup phase of the mobile phone. These drivers are necessary to support the normal operation of the mobile phone's operating system. At least one of the drivers to be loaded includes a target driver. Exemplarily, these drivers may include drivers for some peripherals, such as drivers for peripheral components such as USB devices and display screens. These peripheral drivers are used to manage the communication and interaction of the corresponding peripheral components.

[0162] In some embodiments, the driver to be loaded may be in the form of a ko (or .ko) file, and the mobile phone may specifically be the ko file of the driver to be loaded. The mobile phone may load each of the at least one driver to be loaded in parallel.

[0163] Specifically, loading the driver to be loaded may be parsing the ko file, initializing the corresponding module according to the information in the ko file, and loading it into the kernel (eg, the Linux kernel).

[0164] Since the mobile phone loads at least one driver to be loaded in parallel, and due to the existence of the OCP fault, after the target driver is loaded, it is necessary to determine whether the OCP fault has been eliminated, and then decide whether to reload the target driver. After the other drivers to be loaded are loaded normally, the boot process can be considered to be over. That is to say, after S506 is executed, on the one hand, after the loading of at least one driver to be loaded except the target driver is completed, the operating system of the mobile phone is started to complete the boot of the mobile phone; on the other hand, it is necessary to determine whether the OCP fault has been eliminated. Based on this, S507 and S508 are executed after S506.

[0165] S507: After the mobile phone has completed loading the at least one driver to be loaded except the target driver, the mobile phone starts the operating system of the mobile phone, and the booting process ends.

[0166] After the mobile phone finishes the booting process, the mobile phone can be used normally by the user, but the target component corresponding to the target drive may not be used normally.

[0167] It should be noted that, in the embodiment of the present application, S505 may be executed at any feasible time after S502 is executed and it is determined that an OCP fault exists and before S507. Figure 5 The execution order of S505 shown in the figure is only an example and is not used as a specific limitation on the specific execution timing of S505 when executing the overcurrent protection fault processing method.

[0168] S508: The mobile phone determines whether the OCP fault has been eliminated.

[0169] In a possible implementation, the mobile phone may determine whether the OCP fault has been eliminated by acquiring the OCP information of the target power source. The specific implementation process may refer to the relevant description of S504 in the above embodiment.

[0170] In another possible implementation, the mobile phone can determine whether the OCP fault has been eliminated by whether the target driver is loaded successfully. Specifically, if no error message appears during the target driver loading process, it can be considered that the target driver is loaded successfully, and it is determined that the OCP fault has been eliminated. If an error message appears during the target driver loading process, it can be considered that the target driver fails to load, and it is determined that the OCP fault has not been eliminated.

[0171] When it is determined that the OCP fault has been eliminated, it can be determined that the mobile phone no longer has an OCP fault, and the target component controlled by the target drive in the mobile phone can work normally. In other words, the target component changes from a state of being unable to work normally due to the OCP fault to a state of being able to work normally. At this time, the user will not find that the target component cannot be used when using the mobile phone, and will not send the mobile phone for repair or return it, which improves the user experience. In this case, all processes of the entire overcurrent protection fault handling method are completed.

[0172] If it is determined that the OCP fault has not been eliminated, the mobile phone can reload the target driver to eliminate the OCP fault. That is, if it is determined that the OCP fault has not been eliminated after S508 is executed, S509 is executed.

[0173] S509. The mobile phone reloads the target driver.

[0174] In practice, after a mobile phone has loaded a target driver once, in order to ensure the stability and security of the entire mobile phone system, the same driver cannot be loaded continuously. Based on this, in some embodiments, if it is determined that the OCP fault has not been eliminated after S508 is executed, the mobile phone can reload the target driver after a preset time. Exemplarily, the preset time can be 5 minutes or any other possible time.

[0175] After reloading the target driver, the mobile phone can again determine whether the OCP fault has been eliminated, that is, execute S510.

[0176] S510: The mobile phone determines whether the OCP fault has been eliminated.

[0177] When it is determined that the OCP fault has been eliminated, it can be determined that the mobile phone no longer has the OCP fault, and the target component controlled by the target drive in the mobile phone can work normally. In this case, all processes of the entire overcurrent protection fault processing method are completed.

[0178] If it is determined that the OCP fault has not been eliminated, the mobile phone can reload the target driver again to further eliminate the OCP fault. However, repeated loading of the target driver consumes more processing resources. Moreover, if the OCP fault is caused by a hardware short circuit or other reasons that cannot be automatically recovered, the OCP fault cannot be eliminated no matter how many times the target driver is repeatedly loaded. Therefore, the number of repeated loadings of the target driver needs to be limited to an appropriate range to save processing resources while ensuring that OCP faults caused by reasons other than hardware short circuits can be eliminated as much as possible. Based on this, after S510, it is necessary to first determine whether the number of repeated loadings of the target driver during the startup of this mobile phone is less than the first preset number, that is, execute S511.

[0179] S511. The mobile phone determines whether the number of times the target driver is loaded during the current startup process is less than a first preset number.

[0180] Exemplarily, the first preset number may be 3 or any other possible value.

[0181] If it is determined that the number of times the target driver is loaded during this boot process is less than the first preset number, it can be considered that the current repeated loading of the target driver consumes little processing resources, and repeated loading of the target driver has the possibility of eliminating the OCP fault. Therefore, the target driver can be reloaded again at this time, that is, S509 is executed.

[0182] When it is determined that the number of repeated loadings of the target driver during this boot process is not less than the first preset number, it can be considered that the current repeated loading of the target driver consumes more processing resources, and the repeated loading of the target driver is unlikely to eliminate the OCP fault. Therefore, it can be considered that the OCP fault is caused by a hardware short circuit or other reasons that cannot be automatically restored. At this time, the user can be reminded to repair the mobile phone. That is, S512 is executed.

[0183] S512. The mobile phone outputs a prompt message.

[0184] The prompt information is used to indicate that the target component of the user's mobile phone has a hardware failure and instructs the user to repair it as soon as possible. For example, the prompt information can be composed of any one or more possible information such as text, sound, vibration, picture, animation, etc., and this application does not make specific restrictions on this. For example, if the target component is a microphone, refer to Figure 6 As shown, the prompt message may be displayed on the display screen of the mobile phone: "There is a hardware failure in the microphone, please repair it as soon as possible!"

[0185] In some embodiments, S506 - S512 may be specifically implemented by the kernel (Linux kernel) in the mobile phone in the Linux Init phase.

[0186] In the technical solution provided by the embodiment of the present application, in the boot scenario, when the mobile phone determines that there is an OCP fault, it can first improve the working mode of the target power supply corresponding to the OCP fault. Specifically, improving the working mode of the target power supply can be to adjust the current first working mode of the target power supply to the second working mode with a higher OCP threshold. Afterwards, if the OCP fault no longer exists (that is, the OCP fault has been eliminated), it indicates that the target component (such as a peripheral component) powered by the target power supply can work normally, that is, the use of this solution has achieved the purpose of restoring the target component that cannot work normally due to the OCP fault to work normally, and the whole solution ends. If the OCP fault still exists (that is, the OCP fault has not been eliminated), the mobile phone can repeatedly load the target driver corresponding to the target power supply to try to load the target driver successfully. Because the target component powered by the target power supply needs to be controlled by the target driver, if the target driver can be loaded successfully (no error information appears during the loading process), it means that the target component can be controlled to work normally, which means that the OCP fault has been eliminated at this time. Therefore, based on the technical solution provided by the present application, the OCP fault can be eliminated by adjusting the working mode of the target power supply corresponding to the OCP fault, so that the target component powered by the target power supply works normally. After adjusting the working mode, if the OCP fault cannot be eliminated, the target driver corresponding to the target power supply can be repeatedly loaded to increase the success rate of the target driver being loaded successfully, thereby increasing the probability of eliminating the OCP fault, so that the target component powered by the target power supply can be restored to a normal working state with a greater probability when it cannot work normally due to the OCP fault. In this way, even if the target component in the mobile phone cannot work normally due to the OCP fault when the user uses the mobile phone, the probability of it restoring to a normal working state is increased, thereby improving the user experience. Furthermore, if the OCP fault is caused by a non-hardware fault, the technical solution provided by the present application can enable the target component to automatically restore to a normal working state in a timely manner, so that the user can better use the mobile phone and improve the user experience.

[0187] Based on the above Figure 3 The hardware architecture shown and Figure 4 The software architecture shown below is combined with Figure 7 As shown, the overcurrent protection fault handling method in the usage scenario provided by the embodiment of the present application is introduced. Figure 7 A flow chart of an overcurrent protection fault processing method in a usage scenario provided by an embodiment of the present application. Figure 7 As shown, the electronic device is a mobile phone, and the overcurrent protection fault processing method in the usage scenario may include S701-S707:

[0188] S701: When determining that an OCP fault exists, the mobile phone adjusts the operating mode of a target power supply corresponding to the OCP fault from a first operating mode to a second operating mode.

[0189] In a possible implementation, before S701 is executed, the target module responsible for power management in the application processor AP in the mobile phone (e.g., the power management service in the framework layer or the power management module in the kernel layer) can register a callback function (i.e., a target callback function) for the OCP fault message in the driver of each component of the mobile phone, so that the target driver sends the OCP fault message to the target module when the corresponding target component has an OCP fault. The target driver can monitor whether the target component has an OCP fault according to any feasible logic or rule. The OCP fault message is used to indicate that the target component has an OCP fault. In some embodiments, the callback function can be called an OCP notification chain.

[0190] In another possible implementation, the way in which the mobile phone determines that there is an OCP fault may also be as shown in S501-S502, where the mobile phone may obtain OCP information of at least one power source to determine whether there is an OCP fault. Of course, in actual use scenarios, how the mobile phone determines that there is an OCP fault may be determined according to actual needs, and this application does not impose specific restrictions on this.

[0191] In some embodiments, the overcurrent protection fault handling method described in the embodiments of the present application may be only for the peripheral power supply. The target module may only register the callback function in the driver of all peripheral components. In this case, the target power supply is the peripheral power supply.

[0192] After the target module receives the OCP fault message from the target driver, the mobile phone can determine that an OCP fault exists.

[0193] In the case of determining that there is an OCP fault, if the OCP fault is not caused by a hardware short circuit or other problems that require maintenance, the mobile phone can eliminate the OCP fault by increasing the OCP threshold of the power supply corresponding to the OCP fault or repeatedly loading the driver of the corresponding component. Further, since the processing resources consumed by repeatedly loading the driver of the corresponding component are more than the processing resources consumed by increasing the OCP threshold of the power supply corresponding to the OCP fault, and the time required for repeatedly loading the driver of the corresponding component is also longer than the time required for increasing the OCP threshold of the power supply corresponding to the OCP fault, in the case of determining that there is an OCP fault, the OCP threshold of the power supply corresponding to the OCP fault can be increased first, and then the need to repeatedly load the driver of the corresponding component can be considered. Based on this, when the mobile phone determines that there is an OCP fault, the power supply that powers the target component controlled by the target drive corresponding to the OCP fault can be determined as the target power supply, and then its working mode can be adjusted from the first working mode to the second working mode. Specifically, the mobile phone can determine the target power supply that powers the target component through a preset power tree.

[0194] The OCP threshold of the second working mode is greater than the OCP threshold of the first working mode. The first working mode can be any one of multiple working modes, and the second working mode can be any one of the multiple working modes whose OCP threshold is greater than the first working mode.

[0195] For relevant examples of the first working mode and the second working mode, reference may be made to the relevant description after S503 in the aforementioned embodiment, which will not be repeated here.

[0196] After the OCP threshold of the power source corresponding to the OCP fault is increased, the mobile phone can determine whether the OCP fault is eliminated, that is, execute S702.

[0197] S702: The mobile phone determines whether the OCP fault has been eliminated.

[0198] In a possible implementation, the mobile phone can determine whether the OCP fault has been eliminated by whether the target module receives the OCP fault message from the target driver again. If the OCP fault message from the target driver is received again, it is determined that the OCP fault has not been eliminated. If the OCP fault message from the target driver is not received again, it is determined that the OCP fault has been eliminated.

[0199] In another possible implementation, the mobile phone can determine whether the OCP fault has been eliminated by obtaining the OCP information of the target power supply. The specific implementation can refer to the relevant description after S504 in the above embodiment, which will not be repeated here.

[0200] Of course, in actual use scenarios of mobile phones, the method of determining whether the OCP fault is eliminated may also be any other feasible method, and this application does not make any specific restrictions on this.

[0201] When it is determined that the OCP fault has been eliminated, it can be determined that the mobile phone no longer has an OCP fault. At this time, all components of the mobile phone can be used normally by the user, so the process of the overcurrent protection fault handling method provided in this application can be terminated.

[0202] If it is determined that the OCP fault has not been eliminated, it indicates that the OCP fault has not been eliminated by increasing the OCP threshold of the target power supply, and then the step of repeatedly loading the target driver of the target device powered by the target power supply can be performed. That is, after S702 is executed, if it is determined that the OCP fault has not been eliminated, S703-S707 are executed.

[0203] S703: The mobile phone determines a target drive corresponding to the target power source.

[0204] The target driver corresponding to the target power source is a target driver of a target component powered by the target power source.

[0205] In some embodiments, if the mobile phone determines that there is an OCP fault after the target module receives the OCP fault message from the target driver, the mobile phone can determine the target driver corresponding to the OCP fault when executing S701. In this case, S703 may not be executed. In this case, S704 is directly executed after S702.

[0206] In other embodiments, if the mobile phone has not determined the target driver corresponding to the target power source before S702 is executed, S703 is executed. The specific implementation method may be to determine the target component powered by the target power source according to a preset power tree, and then determine the target driver.

[0207] S704. The mobile phone reloads the target driver.

[0208] Since the target driver has been loaded once during the boot process, in order to ensure the stability and security of the entire mobile phone system, in some embodiments, when the mobile phone needs to reload the target driver, it can reload the target driver after a preset time. Exemplarily, the preset time can be 5 minutes or any other possible time.

[0209] In the usage scenario, when S704 is executed for the first time, it can also be called that the mobile phone loads the target driver.

[0210] After the mobile phone reloads the target driver, the mobile phone can again determine whether the OCP fault has been eliminated, that is, execute S705.

[0211] S705. The mobile phone determines whether the OCP fault has been eliminated.

[0212] The specific implementation of S705 may refer to the relevant description of S508 or S702 in the aforementioned embodiment, which will not be repeated here.

[0213] When it is determined that the OCP fault has been eliminated, it can be determined that the mobile phone no longer has the OCP fault, and the target component controlled by the target drive in the mobile phone can work normally. In this case, all processes of the entire overcurrent protection fault processing method are completed.

[0214] If it is determined that the OCP fault has not been eliminated, the mobile phone can reload the target driver again to further eliminate the OCP fault. However, repeated loading of the target driver consumes more processing resources. Moreover, if the OCP fault is caused by a hardware short circuit or other reasons that cannot be automatically recovered, the OCP fault cannot be eliminated no matter how many times the target driver is repeatedly loaded. Therefore, the number of repeated loadings of the target driver needs to be limited to an appropriate range to save processing resources while ensuring that OCP faults caused by reasons other than hardware short circuits can be eliminated as much as possible. Based on this, after S705, it is necessary to first determine whether the number of repeated loadings of the target driver during the startup of this mobile phone is less than the second preset number, that is, execute S706.

[0215] S706: The mobile phone determines whether the number of times the target driver is loaded during this use is less than a second preset number.

[0216] Among them, the use process does not include the boot process. Since not all processing resources can be called during the boot process of the mobile phone, all processing resources can be called during the use process after the boot is completed. Therefore, during the use process, more attempts can be made to eliminate the OCP fault by repeatedly loading the target driver. Therefore, in the embodiment of the present application, the second preset number of times can be greater than the first preset number of times. Exemplarily, the first preset number of times can be 10 or any other possible value.

[0217] If it is determined that the number of times the target driver is loaded during this boot process is less than the second preset number, it can be considered that the current repeated loading of the target driver consumes little processing resources, and repeated loading of the target driver has the possibility of eliminating the OCP fault. Therefore, the target driver can be reloaded again at this time, that is, S704 is executed.

[0218] When it is determined that the number of repeated loadings of the target driver during this boot process is not less than the second preset number, it can be considered that the current repeated loading of the target driver consumes more processing resources, and the repeated loading of the target driver is unlikely to eliminate the OCP fault. Therefore, it can be considered that the OCP fault is caused by a hardware short circuit or other reasons that cannot be automatically restored. At this time, the user can be reminded to repair the mobile phone. That is, S707 is executed.

[0219] S707. The mobile phone outputs a prompt message.

[0220] The specific implementation of S707 may refer to the relevant description of S512 in the aforementioned embodiment, which will not be repeated here.

[0221] In the technical solution provided by the embodiment of the present application, in the use scenario, when the mobile phone determines that there is an OCP fault, it can first improve the working mode of the target power supply corresponding to the OCP fault. Specifically, improving the working mode of the target power supply can be to adjust the current first working mode of the target power supply to the second working mode with a higher OCP threshold. Afterwards, if the OCP fault no longer exists (that is, the OCP fault has been eliminated), it indicates that the target component (such as a peripheral component) powered by the target power supply can work normally, that is, the use of this solution has achieved the purpose of restoring the target component that cannot work normally due to the OCP fault to work normally, and the whole solution ends. If the OCP fault still exists (that is, the OCP fault has not been eliminated), the mobile phone can try to load the target driver successfully by repeatedly loading the target driver corresponding to the target power supply. Because the target component powered by the target power supply needs to be controlled by the target driver, if the target driver can be loaded successfully (no error information appears during the loading process), it means that the target component can be controlled to work normally, which means that the OCP fault has been eliminated at this time. Therefore, based on the technical solution provided by the present application, the OCP fault can be eliminated by adjusting the working mode of the target power supply corresponding to the OCP fault, so that the target component powered by the target power supply works normally. After adjusting the working mode, if the OCP fault cannot be eliminated, the target driver corresponding to the target power supply can be repeatedly loaded to increase the success rate of the target driver being loaded successfully, thereby increasing the probability of eliminating the OCP fault, so that the target component powered by the target power supply can be restored to a normal working state with a greater probability when it cannot work normally due to the OCP fault. In this way, even if the target component in the mobile phone cannot work normally due to the OCP fault when the user uses the mobile phone, the probability of it restoring to a normal working state is increased, thereby improving the user experience. Furthermore, if the OCP fault is caused by a non-hardware fault, the technical solution provided by the present application can enable the target component to automatically restore to a normal working state in a timely manner, so that the user can better use the mobile phone and improve the user experience.

[0222] In some embodiments, since many components of the mobile phone are not fully started during the boot process, many resources cannot be used normally. Therefore, in the boot scenario, if the OCP fault cannot be eliminated after repeated loading of the target driver, it can be considered that it is caused by the limitations of the boot process (not all components are started, and not all resources are used). Based on this, in some embodiments, after S511 is executed and it is determined that the number of times the target driver is loaded during this boot process is not less than the first preset number, the prompt message may not be output first. Instead, when the mobile phone enters the use scenario, the technical solutions corresponding to S701-S707 in the above embodiments are used to determine whether some OCP faults are really caused by hardware failures. Exemplary, the following is Figure 8 Take this as an example to explain the overcurrent fault handling method in this case:

[0223] First, in the UEFI stage, the mobile phone can read the OCP information of at least one power supply from the register to determine whether there is an OCP fault. Then, if it is determined that there is an OCP fault, the working mode of the target power supply corresponding to the OCP fault is improved (i.e., the power supply mode is improved). Specifically, the working mode of the target power supply can be changed to a working mode with a higher OCP threshold.

[0224] After that, the mobile phone can determine whether the OCP fault has been eliminated, or it can be called determining whether it has been restored. If it is determined that the OCP fault has not been eliminated or restored, the affected driver (i.e., the target driver) corresponding to the target power supply can be determined through the preset power tree, and then all ko (specifically ko files) to be loaded can be loaded. If it is determined that the OCP fault has been eliminated, all ko to be loaded can be loaded. ko is a form of driver.

[0225] When each ko to be loaded is loaded, it can be determined whether it is an affected ko. If not, after all unaffected kos are loaded, the Android system of the mobile phone can be started.

[0226] If it is an affected ko, after loading the affected ko, determine whether to restore. If restored, you can also start the Android system of the phone, or if the Android system has been started, do nothing. If not restored, you can wait for 5 minutes and then flush and load the affected ko. And determine again whether to restore, if restored, start the Android system of the phone, or if the Android system has been started, do nothing. If not restored, determine whether the number of loads during this boot process is less than 3 times. If less than, re-exit the process of waiting for 5 minutes and then reloading the affected ko. If not less than, do not repeat the loading of the affected ko.

[0227] After starting the Android system and entering the Android stage, in the usage scenario, if an OCP failure occurs in the mobile phone, the working mode of the corresponding power supply can be improved.

[0228] After that, it can be determined whether it is restored. If it is restored, the entire overcurrent protection fault handling method ends. If it is not restored, the affected ko corresponding to the OCP fault can be notified through the OCP notification chain to reload after waiting for 5 minutes.

[0229] After reloading the affected ko, determine whether it has been restored. If it has been restored, end the entire process. If it has not been restored, determine whether the number of loads during this boot process is less than 10 times. If it is less than 10 times, re-exit the process of reloading the affected ko after waiting for 5 minutes. If it is not less than 10 times, do not reload the affected ko and prompt the user that the hardware is faulty, and go to a nearby store for repair.

[0230] Understandably, Figure 8 The effect that can be achieved by the overcurrent protection fault processing method shown is the same as the overcurrent protection fault processing method provided in the aforementioned embodiment, and will not be repeated here.

[0231] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

[0232] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0233] In the case of dividing each functional module into corresponding functional modules, refer to Fig. 9 As shown, the embodiment of the present application also provides an overcurrent protection fault processing device, which is applied to electronic equipment. The device may include: a control module 901, a processing module 902 and a loading module 903.

[0234] The control module 901 is used to adjust the working mode of the target power supply corresponding to the OCP fault from the first working mode to the second working mode when there is an overcurrent protection OCP fault; wherein the OCP threshold of the second working mode is greater than the OCP threshold of the first working mode. The processing module 902 is used to determine the target driver corresponding to the target power supply when the OCP fault is not eliminated. The loading module 903 is used to load the target driver determined by the processing module 902. The loading module 903 is also used to reload the target driver after loading the target driver when the OCP fault is not eliminated.

[0235] In addition, the cooperation among the control module 901, the processing module 902 and the loading module 903 can also enable the overcurrent protection fault processing device to complete all the steps of the overcurrent protection fault processing method provided in the aforementioned embodiment.

[0236] Regarding the overcurrent protection fault processing device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the frame loss fault determination method in the above embodiment, and will not be elaborated here. The relevant beneficial effects thereof can also refer to the relevant beneficial effects of the above overcurrent protection fault processing method, and will not be repeated here.

[0237] The present application also provides an electronic device, which includes: a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; wherein the memory stores a computer program code, the computer program code includes a computer instruction, and when the computer instruction is executed by the processor, the electronic device executes the overcurrent protection fault processing method provided in the above embodiment. The specific structure of the electronic device can be referred to Figure 3 The structure of the electronic device shown in .

[0238] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the overcurrent protection fault processing method provided in the above embodiment.

[0239] An embodiment of the present application also provides a computer program product, which includes executable instructions. When the computer program product is run on an electronic device, the electronic device executes the overcurrent protection fault processing method provided in the above embodiment.

[0240] The present application also provides a chip system, such as Fig.10As shown, the chip system 1000 includes at least one processor 1001, a memory and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected through a line. For example, the interface circuit 1002 can be used to receive signals from other devices (such as network side devices). For another example, the interface circuit 1002 can be used to send signals to other devices (such as network side devices).

[0241] Exemplarily, the interface circuit 1002 can read the instruction or computer program stored in the memory and send the instruction or computer program to the processor 1001. When the instruction or computer program is executed by the processor 1001, each step of the overcurrent protection fault processing method provided in the above embodiment can be implemented. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.

[0242] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0243] In the several embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0244] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0245] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0246] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0247] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for handling an overcurrent protection fault, characterized in that: Applied to electronic equipment, the method comprises: In the event of an overcurrent protection OCP fault, adjusting the operating mode of the target power supply corresponding to the OCP fault from the first operating mode to the second operating mode; wherein the OCP threshold of the second operating mode is greater than the OCP threshold of the first operating mode; In the case where the OCP fault is not eliminated, determining a target drive corresponding to the target power supply; Loading the target driver; After the target driver is loaded, if the OCP fault is not eliminated, the target driver is reloaded.

2. The method according to claim 1, characterized in that When the electronic device is in the process of starting up, and when an overcurrent protection (OCP) fault occurs, before adjusting the operating mode of the target power supply corresponding to the OCP fault from the first operating mode to the second operating mode, the method further includes: Obtaining OCP information of at least one power supply; wherein the OCP information is used to indicate whether the power supply has an OCP fault; In a case where OCP information of a first power source exists in the OCP information of the at least one power source and is used to indicate that the first power source has an OCP fault, it is determined that the OCP fault exists and the first power source is the target power source.

3. The method according to claim 2, characterized in that The obtaining of OCP information of at least one power supply includes: The OCP information of the at least one power source is obtained from a register corresponding to the at least one power source in a power source chip of the electronic device.

4. The method according to claim 2 or 3, characterized in that: The determining a target drive corresponding to the target power source includes: Determine the target component powered by the target power supply according to a preset power supply tree; The driving of the target component is determined as the target driving.

5. The method according to any one of claims 2 to 4, characterized in that: After reloading the target driver, the method further includes: In the case where the OCP fault is not eliminated, if the number of times the target driver is loaded during the current startup process is less than a first preset number, reloading the target driver; If the number of times the target driver is loaded during this boot process is not less than the first preset number, a prompt message is output; the prompt message is used to indicate to the user that there is a hardware failure of the target component in the mobile phone.

6. The method according to any one of claims 1 to 5, characterized in that: The reloading of the target driver comprises: After a preset time, the target driver is reloaded.

7. The method according to claim 1, characterized in that When the electronic device is in the process of being powered on and used, and when an overcurrent protection (OCP) fault occurs, before adjusting the operating mode of the target power supply corresponding to the OCP fault from the first operating mode to the second operating mode, the method further includes: The target module in the electronic device registers a target callback function in the driver of at least one component, so that the driver of the at least one component reports an OCP fault message to the target module when an OCP fault occurs in the corresponding component; the OCP fault message is used to indicate that an OCP fault occurs in the corresponding component; When the target module receives the OCP fault message from the first driver, it is determined that an OCP fault exists, and the first driver is determined as the target driver.

8. The method according to claim 7, characterized in that The loading of the target driver comprises: After a preset time, the target driver is loaded.

9. The method according to claim 7 or 8, characterized in that: After reloading the target driver, the method further includes: In the case where the OCP fault is not eliminated, if the number of times the target driver is loaded during this use is less than a second preset number of times, reloading the target driver; If the number of times the target driver is loaded during this use is not less than the second preset number, a prompt message is output; the prompt message is used to indicate that there is a hardware failure of the target component in the user's mobile phone.

10. The method according to any one of claims 1 to 9, characterized in that: The target power source is an external power source, and the external power source is used to supply power to external components; the external components include: an audio module, a speaker, a receiver, a microphone, a display screen, a camera, a sensor, and a communication module.

11. An electronic device, characterized in that: include: A display screen, a memory and one or more processors; the display screen and the memory are coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the overcurrent protection fault processing method as described in any one of claims 1-10.

12. A computer-readable storage medium, characterized in that: It comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the overcurrent protection fault processing method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • FPGA fault self-recovery circuit and method

    CN111104240A

  • Over-current fault processing device and method of motor and motor

    CN114243641A

  • Method for preventing over-current protection from being triggered and electronic equipment

    CN116667268A