Power supply control method, electronic equipment and readable storage medium
By acquiring and storing the power value of the power module in the electronic device and calculating the total output power value, the problem of battery damage caused by the superposition of multiple branch current warnings is solved, and the reliability of the device is improved.
Patent Information
- Application Number
- CN202511068057.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-14
AI Technical Summary
In existing technologies, when multiple branches of an electronic device trigger current warnings simultaneously, the superimposed current is too large, which can easily exceed the instantaneous power supply peak of the battery, leading to permanent battery damage and reducing the reliability of the device.
The power value is obtained by the first power module and a signal is sent to the main control module and other power modules when the threshold is exceeded. The power values of each power module are stored. The main control module calculates the total output power value and executes power control operations to avoid multiple power modules issuing current warnings at the same time.
This effectively avoids battery damage caused by multiple power modules simultaneously triggering current warnings, thus improving the reliability of electronic devices.
Smart Images

Figure CN120949914A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology, specifically relating to a power control method, electronic device, and readable storage medium. Background Technology
[0002] With the development of electronic products, power networks in electronic devices are often subdivided into multiple paths to supply power to the system for efficiency and heat dissipation. Currently, the main control module of the electronic device typically adjusts the power consumption of the branch that triggers the current warning based on the current warning triggered by each branch. However, once one branch triggers a current warning, current warnings from other branches usually follow suit. This simultaneous triggering of current warnings from multiple branches results in an excessively large cumulative current, easily exceeding the battery's instantaneous peak power supply and causing permanent battery damage. Therefore, the existing technology suffers from low reliability in electronic devices. Summary of the Invention
[0003] The purpose of this application is to provide a power control method, an electronic device, and a readable storage medium that can solve the problem of low reliability in the use of electronic devices.
[0004] In a first aspect, embodiments of this application provide a power control method applied to an electronic device, the electronic device including at least two power modules and a main control module, the method comprising:
[0005] The first power module acquires a first power value, the first power value is the output power value of the first power module, and the first power module is any one of the at least two power modules.
[0006] When the first power value is greater than the first threshold, the first power module stores the first power value and sends a first signal to the second power module and the master control module. The second power module includes any power module other than the first power module among the at least two power modules.
[0007] The first signal is used to trigger the second power module to store the second power value and to trigger the main control module to read the first power value and the second power values of all the second power modules to obtain the first total output power value, and to perform power control operation according to the first total output power value.
[0008] Wherein, the second power value is the maximum output power value detected by the second power module within a preset time period; the first total output power value is the sum of the first power value and all the second power values.
[0009] Secondly, embodiments of this application provide an electronic device, which includes at least two power modules and a main control module, wherein...
[0010] A first power module is configured to acquire a first power value, wherein the first power value is the output power value of the first power module, and the first power module is any one of the at least two power modules; when the first power value is greater than a first threshold, the first power value is stored and a first signal is sent to a second power module and the master control module, wherein the second power module includes any one of the at least two power modules other than the first power module;
[0011] The second power module is used to store a second power value based on the first signal, wherein the second power value is the maximum output power value detected by the second power module within a preset time period;
[0012] The main control module is used to read the first power value and the second power values of all the second power modules according to the first signal to obtain a first total output power value, and to perform power control operation according to the first total output power value; wherein, the first total output power value is the sum of the first power value and all the second power values.
[0013] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0014] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0015] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0016] In this embodiment, a first power value is obtained through a first power module, where the first power value is the output power value of the first power module, and the first power module is any one of the at least two power modules. When the first power value is greater than a first threshold, the first power module stores the first power value and sends a first signal to a second power module and a master control module. The second power module includes any one of the at least two power modules other than the first power module. The first signal triggers the second power module to store a second power value and triggers the master control module to read the first power value and the second power values of all the second power modules to obtain a first total output power value, and performs power control operations based on the first total output power value. The second power value is the maximum output power value detected by the second power module within a preset time period. The first total output power value is the sum of the first power value and all the second power values. Thus, when a power module issues a current warning, the power control operation is performed by combining the total output power value of multiple power modules, effectively preventing multiple power modules from simultaneously issuing current warnings, which could lead to excessive superimposed current and damage to the battery. Therefore, this embodiment improves the reliability of electronic devices. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the power control method provided in the embodiments of this application;
[0019] Figure 2 This is a power supply block diagram of an electronic device to which the power control method provided in the embodiments of this application is applied;
[0020] Figure 3 This is a power supply block diagram of one circuit in an electronic device to which the power control method provided in this application embodiment is applied;
[0021] Figure 4 This is a timing state diagram of the power control method provided in the embodiments of this application;
[0022] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0023] Figure 6 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application;
[0024] Figure 7 This is a schematic diagram of the structure of another electronic device provided in the embodiments of this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0027] For efficiency and heat dissipation considerations, the power network of electronic devices is often divided into multiple power supply branches to supply power to the system. Under heavy load scenarios, multiple power supply branches (i.e., multiple power modules) will often trigger overcurrent protection (OCP) protection successively. The essence of OCP is current limiting, and its purpose is to prevent power devices from burning out. When OCP is triggered, the following situations may occur:
[0028] Scenario 1: When the load is too high (in the worst case, a short circuit to ground), a large current will be generated. If this current exceeds the battery's maximum output, it will damage the battery. However, if the current is limited, the power supply capacity may not be able to meet the power requirements of the processing unit, causing a significant voltage drop in this power supply branch. This can lead to uncontrollable system crashes and other hardware anomalies. Often, when the power management integrated circuit (PMIC) has a built-in power register, it can be configured to enable an automatic hardware reset function when the OCP protection is reached, thus preventing the system from crashing.
[0029] Scenario 2: When multiple power supplies are triggered simultaneously, the superimposed current becomes too large and exceeds the instantaneous power supply peak of the battery, which may cause permanent damage to the battery.
[0030] Optionally, when the load is too large, a large current will be generated. If it exceeds the maximum output value of the power module, it will damage the power module. Therefore, the OCP protection mechanism is needed to protect the power module.
[0031] Currently, if a power supply branch triggers a threshold 1 current alarm, the main control module will adjust the power consumption of that branch to prevent it from triggering a threshold 2 OCP (Overcurrent Protection). However, power consumption alarms from other power supply branches often follow. Therefore, in related technologies, the main control module passively waits for each power supply branch to trigger a threshold 1 interruption alarm before adjusting the power consumption of each branch. This often lacks real-time capability and can easily lead to situations 1 and 2 mentioned above. To address this, the power control method proposed in this application is presented.
[0032] The power control method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0033] See Figure 1 , Figure 1 This is a flowchart of a power control method provided in an embodiment of this application, such as... Figure 1 As shown, it includes the following steps:
[0034] Step 101: The first power module obtains a first power value, the first power value being the output power value obtained by the first power module, and the first power module being any one of the at least two power modules;
[0035] In this embodiment, each power module can continuously detect its current output power value within a detection cycle to determine the maximum output power value within that cycle. Alternatively, the current output power value can be detected at regular intervals within a detection cycle, and the maximum value of the multiple detected power values can be determined as the maximum output power value within the current detection cycle. After a detection cycle ends, the maximum output power value detected within that cycle can be stored. The aforementioned first power value can be understood as the currently detected output power value of the first power module, or as the average, maximum, or weighted value of multiple detected output power values within a time period (hereinafter referred to as the first time period) within a detection cycle. In the embodiments of this application, the first power value is used as an example to illustrate the currently detected output power value of the first power module.
[0036] Optionally, each power module can be understood as a power supply branch of the battery in an electronic device, or a single power source. Multiple power sources can then supply power to the electronic device's system. A power module can also be called a power management unit (PMU), such as... Figure 2As shown, the battery can achieve 8 power supply branches through 8 PMUs, which will supply power to eight units of the main control module. For example, the eight units may include, but are not limited to, the following units: Accelerated Processing Unit (APU), Graphics Processing Unit (GPU), Little Cores Central Processing Unit (CPU-L), Middle Cores CPU (CPU-M), Big Cores CPU (CPU-M), Memory Management, Central Processing Core, and Direct Memory Access Grant Request unit.
[0037] Optionally, the main control module in the embodiments of this application can be understood or replaced as a system on chip (SoC).
[0038] Step 102: When the first power value is greater than the first threshold, the first power module stores the first power value and sends a first signal to the second power module and the master control module. The second power module includes any power module other than the first power module among the at least two power modules.
[0039] The first signal is used to trigger the second power module to store the second power value and to trigger the main control module to read the first power value and the second power values of all the second power modules to obtain the first total output power value, and to perform power control operation according to the first total output power value.
[0040] Wherein, the second power value is the maximum output power value detected by the second power module within a preset time period; the first total output power value is the sum of the first power value and all the second power values.
[0041] In this embodiment of the application, within a detection cycle, it can be determined in real time whether the detected first power value is greater than the first threshold. When it is determined that the detected first power value is greater than the first threshold, the storage of the first power value can be triggered and the sending of the first signal can be triggered. At the end of the detection cycle, if the currently detected first power value is still not greater than the first threshold, the storage of the maximum power value of the current detection cycle will also be triggered.
[0042] Optionally, in some embodiments, it can be determined whether the first power value is greater than the first threshold at regular intervals (such as a first time interval).
[0043] Optionally, the first power value of the first power module being greater than the first threshold can be understood as the first power module having a current warning, that is, the first threshold can be understood as the threshold 1.
[0044] Optionally, when it is determined that the detected first power value is greater than a first threshold, the current detection cycle will end and the next detection cycle will begin, i.e., the detection cycle will be updated. In one implementation, the next detection cycle can begin immediately; in another embodiment, the next detection cycle can begin after a period of time. For example, the first clock cycle or the second clock cycle after sending the first signal can be used as the start time of the next detection cycle.
[0045] Optionally, the first signal mentioned above can be understood as an interrupt signal, for example, the first signal can be understood as a rising edge interrupt signal.
[0046] Optionally, each power module may include a port that can be used to output or receive the first signal, and trigger an interrupt after receiving the first signal to perform the storage behavior of storing the second power value into the power register. That is, the power modules are linked by a bidirectional transmission design, and the ports of the power modules have input / output functions and interrupt configuration.
[0047] Optionally, when the second power module receives the first signal, the second power module can store a second power value based on the first signal, wherein the second power value is the maximum output power value detected within a preset time period.
[0048] Optionally, the aforementioned second power value can be understood as the maximum output power value detected before receiving the first signal within a preset time period. Optionally, after the second power module receives the first signal, it can store the detected maximum output power value based on the first signal. Of course, in other embodiments, the second power value can also be the maximum value, average value, or weighted value of the output power of the second power module detected multiple times within a first time period before receiving the first signal.
[0049] Optionally, the aforementioned preset time period can be understood as a detection cycle, or as a time period within a detection cycle, without further limitation.
[0050] Optionally, when the main control module receives the first signal, the main control module can read the first power value and the second power value of all the second power modules according to the first signal to obtain the first total output power value, and perform power control operation according to the first total output power value.
[0051] It should be noted that the main control module can periodically read the maximum output power value stored in each power module. When the main control module receives the first signal, it will generate an interrupt event, triggering the main control module to read the maximum output power value of each power module in advance before the end of the reading cycle. Here, a reading cycle can be understood as a detection cycle, or a reading cycle may include multiple detection cycles.
[0052] Optionally, in some embodiments, after reading the maximum output power value of each power module, the main control module can calculate the first total output power value of all power modules, and then perform power control operations based on the magnitude of the first total output power value. In this way, if the first power value of one power module exceeds a first threshold, it will trigger other power modules to update their maximum output power values, thus allowing the main control module to obtain the current total output power value. By combining the total output power values of multiple power modules for power control operations, it is possible to effectively avoid multiple power modules simultaneously issuing current warnings, which could lead to excessive cumulative current and damage to the battery.
[0053] In this embodiment, a first power value is obtained through a first power module, where the first power value is the output power value of the first power module, and the first power module is any one of the at least two power modules. When the first power value is greater than a first threshold, the first power module stores the first power value and sends a first signal to a second power module and a master control module. The second power module includes any one of the at least two power modules other than the first power module. The first signal triggers the second power module to store a second power value and triggers the master control module to read the first power value and the second power values of all the second power modules to obtain a first total output power value, and performs power control operations based on the first total output power value. The second power value is the maximum output power value detected by the second power module within a preset time period. The first total output power value is the sum of the first power value and all the second power values. Thus, when a power module issues a current warning, the power control operation is performed by combining the total output power value of multiple power modules, effectively preventing multiple power modules from simultaneously issuing current warnings, which could lead to excessive superimposed current and damage to the battery. Therefore, this embodiment improves the reliability of electronic devices.
[0054] It should be noted that, as Figure 3 As shown, each power module is equipped with a power detection unit and a power register. The power module output uses a low-loss sampling element 301. The power detection unit samples the voltage / current and records it to the power register, which can be automatically refreshed upon reset and during operation, periodically saving the maximum output power value of the power module. Specifically, the power detection unit can capture the maximum output power value through a software algorithm and then save it in the power register. The main control module can periodically read the maximum output power value stored in the power register.
[0055] The power register mentioned above can be a read-only power register, meaning the main control module can only read data from the power register and cannot write data to it.
[0056] Optionally, in some embodiments, the port of the power module for outputting the first signal or for receiving the first signal is, but is not limited to, a port of the power register.
[0057] Optionally, in some embodiments, the first signal is used to trigger the second power module to store the second power value, including:
[0058] The first signal is used to trigger the second power module to update and store the second power value in the power register of the second power module in the next clock cycle after receiving the first signal;
[0059] Wherein, the first signal is used to trigger the main control module to read the first power value and the second power values of all the second power modules, including:
[0060] The first signal is used to trigger the main control module to send a read command in the Nth clock cycle after receiving the first signal. The read command is used to read the first power value and the second power value, where N is an integer greater than 1.
[0061] In this embodiment of the application, the second power module updates and stores the second power value in the power register of the second power module in the next clock cycle after receiving the first signal; the main control module reads the first power value and the second power value corresponding to all the second power modules in the Nth clock cycle after receiving the first signal.
[0062] Optionally, N can be 2 or 3. Since the maximum output power value of each power module is stored in the first clock cycle after receiving the first signal, and the maximum output power value of each power module is read in the second or third cycle after receiving the first signal, the timeliness of reading the maximum output power value can be guaranteed.
[0063] Alternatively, in some embodiments, such as Figure 4 As shown, since the hardware interfaces for transmitting interrupt signals of each power module are connected, when the first power value is greater than the first threshold, each second power module can simultaneously receive the first signal (i.e., the rising edge trigger signal) within a certain clock cycle. In the next clock cycle after receiving the first signal, the power registers of all power modules will be refreshed once, such as when the refresh is triggered by the falling edge of the clock. After completing the data refresh of the power registers, in the second clock cycle (i.e., the third clock cycle after receiving the first signal), the main control module can send a read command to read the maximum output power value stored in each power register. In this way, when the main control module receives the first signal, each power module is ready to read, and the read address of the power register is fixed. Compared with the read operation in the prior art (sending a read request through the main control module, and then sending the address to be read after receiving the response), the embodiments of this application simplify the read process and shorten the read time.
[0064] Optionally, in some embodiments, the power control operation includes:
[0065] Determine whether the first total output power value is greater than a preset total power threshold;
[0066] If the first total output power value is greater than the preset total power threshold, the power supply mode of the at least two power modules is controlled to switch from the first mode to the second mode.
[0067] Wherein, the total output power of the at least two power modules in the first mode is greater than the total output power of the at least two power modules in the second mode.
[0068] In this embodiment, the first mode can be understood as a turbo mode, and the second mode can be understood as a balanced mode. Because of the mode switching, the continuous increase in the total output power of the power module can be avoided, thereby effectively reducing the output pressure on the power module and ensuring the reliability of its operation.
[0069] Optionally, after switching to balanced mode, it can be determined whether to restore the main control module from balanced mode to Turbo mode based on whether the maximum output power value of the power modules begins to decline and / or whether the maximum output power values of all power modules are less than or equal to a first threshold. Thus, by increasing the frequency of acquiring the maximum output power value of the power modules when the first power value is greater than or equal to the first threshold, the recovery to Turbo mode can be accelerated.
[0070] Optionally, in some embodiments, the power control operation further includes:
[0071] If the first total output power value is less than or equal to a preset total power threshold, determine whether the first total output power value is greater than the second total output power value. The second total output power value is the output power value of the at least two power modules most recently obtained before the main control module receives the first signal.
[0072] When the first total output power value is greater than the second total output power value, the power module is controlled to obtain the maximum output power value of the power module according to the first sampling frequency;
[0073] Wherein, the first sampling frequency is greater than the second sampling frequency, and the second sampling frequency is the frequency at which the power supply module samples the maximum output power value before the main control module receives the first signal.
[0074] In this embodiment, the aforementioned preset total power threshold can be understood as the total power value corresponding to the battery's maximum output capability. The fact that the first total output power value is greater than the second total output power value can be understood as whether there is an upward trend in the total output power value or the output power value of each power module.
[0075] Optionally, after the main control module obtains the maximum output power values of all power modules, it can calculate the current total output power value (i.e., the first total output power value) to determine whether the first total output power value is greater than a preset total power threshold. If the first total output power value is less than or equal to the preset total power threshold, it can be determined whether the total output power value or the output power of each power module has an upward trend. If an upward trend exists, the frequency at which the power modules obtain the maximum output power value is increased. In this way, by increasing the frequency at which the power modules obtain the maximum output power value, a rapid response can be made to power modules whose maximum output power value exceeds the first threshold, thereby preventing the total output power value of all power modules from exceeding the preset total power threshold.
[0076] For example, before the main control module receives the first signal, the power module acquires the maximum output power value every 0.5 seconds. When the main control module receives the first signal and the first total output power value is less than or equal to a preset total power threshold, the main control module can send a control signal to control the power module to acquire the maximum output power value every 0.2 seconds.
[0077] Optionally, in some embodiments, the power control operation further includes:
[0078] When the first power value is greater than or equal to the first threshold, the maximum output power value of the power module is obtained according to the first frequency.
[0079] Wherein, the first frequency is greater than the second frequency, and the second frequency is the frequency at which the main control module obtains the maximum output power value of the power module before receiving the first signal.
[0080] In this embodiment, the first frequency can be the same as the first sampling frequency, and the second frequency can be the same as the second sampling frequency. That is, after the power module samples the maximum output power value once, the main control module reads the maximum output power value obtained by the power module sampling.
[0081] In some embodiments, the first frequency may be different from the first sampling frequency, and the second frequency may be different from the second sampling frequency. For example, the power module samples the maximum output power value of the power module N times in one detection cycle, and determines the average or maximum value of the maximum output power value obtained from the N samples as the maximum output power value of the current detection cycle, where N is an integer greater than 1. At the end of the detection cycle, the main control module can read the maximum output power value stored in the power register of the power module.
[0082] Optionally, in some embodiments, when the first power value is greater than a first threshold, the first power module stores the first power value and sends a first signal to the second power module and the master control module:
[0083] If the first power value is greater than the first threshold, the first power module determines whether the first power value is greater than the second threshold.
[0084] If the first power value is greater than the second threshold, the first power module performs a hardware reset operation;
[0085] If the first power value is less than or equal to the second threshold, the first power module stores the first power value and sends a first signal to the second power module and the master control module.
[0086] In this embodiment, the hardware reset operation performed by the first power module can be understood as enabling the automatic hardware reset function, i.e., the power module's self-protection mechanism. Hardware reset prevents further current increase and damage to the power module's PMIC. It should be understood that this can often be configured when there is a power register within the PMIC. By pre-setting the hardware reset function, an automatic reset will be triggered when an OCP occurs, thus preventing the system from freezing.
[0087] It should be noted that, in the embodiments of this application, "reset" refers to powering down the power module, terminating all communication data, and pulling all signal networks low.
[0088] Optionally, in some embodiments, after the power module is reset, power can be restored after a preset time period to avoid repeated resets due to excessive load.
[0089] Optionally, such as Figure 2 As shown, each power module corresponds to a PMU. The PMIC includes 8 PMUs. When the load corresponding to a certain PMU is very large at an instant, the PMU will trigger the automatic reset function.
[0090] Optionally, the aforementioned second threshold can be understood as threshold 2. When the first power value is greater than the second threshold, OCP protection will be triggered, and the automatic hardware reset function will be enabled to prevent the system from hanging.
[0091] It should be noted that the power control method provided in this application embodiment can be executed by an electronic device or a main control module in the electronic device for executing the power control method. This application embodiment uses the execution of the power control method by an electronic device as an example to illustrate the power control method provided in this application embodiment.
[0092] See Figure 5 , Figure 5 This is a structural diagram of the electronic device provided in the embodiments of this application, such as... Figure 5 As shown, the electronic device 500 includes at least two power supply modules and a main control module, wherein,
[0093] A first power module is configured to acquire a first power value, wherein the first power value is the output power value of the first power module, and the first power module is any one of the at least two power modules; when the first power value is greater than a first threshold, the first power value is stored and a first signal is sent to a second power module and the master control module, wherein the second power module includes any one of the at least two power modules other than the first power module;
[0094] The second power module is used to store a second power value based on the first signal, wherein the second power value is the maximum output power value detected by the second power module within a preset time period;
[0095] The main control module is used to read the first power value and the second power values of all the second power modules according to the first signal to obtain a first total output power value, and to perform power control operation according to the first total output power value; wherein, the first total output power value is the sum of the first power value and all the second power values.
[0096] Optionally, the power module includes a power register, a maximum power detection unit, and a first port;
[0097] The maximum power detection unit is used to detect the maximum output power value of the power module.
[0098] The power register is used to store the maximum output power value of the power module;
[0099] The first port is used to output or receive the first signal, and triggers an interrupt after receiving the first signal to perform the storage behavior of storing the second power value into the power register;
[0100] The first ports of each power module are interconnected, and the first port of each power module is connected to the main control module.
[0101] Optionally, the second power module is specifically configured to update and store the second power value in the power register of the second power module in the next clock cycle after receiving the first signal;
[0102] The main control module is also used to read the first power value and the second power value corresponding to all the second power modules in the Nth clock cycle after receiving the first signal;
[0103] Where N is an integer greater than 1.
[0104] For example, the main control module sends a read command in the Nth clock cycle after receiving the first signal. The read command is used to read the first power value and the second power value.
[0105] Optionally, performing power control operations based on the first total output power value includes:
[0106] Determine whether the first total output power value is greater than a preset total power threshold;
[0107] If the first total output power value is greater than the preset total power threshold, the power supply mode of the at least two power modules is controlled to switch from the first mode to the second mode.
[0108] Wherein, the total output power of the at least two power modules in the first mode is greater than the total output power of the at least two power modules in the second mode.
[0109] The main control module is specifically used to: determine whether the first total output power value is greater than a second total output power value when the first total output power value is less than or equal to a preset total power threshold, wherein the second total output power value is the output power value of the at least two power modules most recently acquired before the main control module receives the first signal; and control the power modules to acquire the maximum output power value of the power modules according to a first sampling frequency when the first total output power value is greater than the second total output power value.
[0110] Wherein, the first sampling frequency is greater than the second sampling frequency, and the second sampling frequency is the frequency at which the power supply module samples the maximum output power value before the main control module receives the first signal.
[0111] Optionally, if the first power value is greater than or equal to the first threshold, the main control module is further configured to obtain the maximum output power value of the power module according to the first frequency;
[0112] Wherein, the first frequency is greater than the second frequency, and the second frequency is the frequency at which the main control module obtains the maximum output power value of the power module before receiving the first signal.
[0113] Optionally, the first power module is specifically configured to: determine whether the first power value is greater than a second threshold when the first power value is greater than a first threshold; and perform a hardware reset operation when the first power value is greater than the second threshold.
[0114] If the first power value is less than or equal to the second threshold, the first power module stores the first power value and sends a first signal to the second power module and the master control module.
[0115] The electronic device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0116] Optionally, refer to Figure 6 This application also provides an electronic device 600, including a processor 601, a memory 602, and a program or instructions stored in the memory 602 and executable on the processor 601. When the program or instructions are executed by the processor 601, they implement the various processes of the above-described power control method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0117] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0118] Figure 7A schematic diagram of the hardware structure of an electronic device for implementing the various embodiments of this application.
[0119] The electronic device 700 includes, but is not limited to, components such as: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.
[0120] Those skilled in the art will understand that the electronic device 700 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0121] The electronic device further includes at least two power modules and a main control module. The processor 710 is used to: ...
[0122] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described power control method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0123] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0124] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above power control method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0125] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0126] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0128] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A power supply control method, applied to electronic devices, characterized in that, The electronic device includes at least two power modules and a main control module, and the method includes: The first power module acquires a first power value, the first power value is the output power value of the first power module, and the first power module is any one of the at least two power modules. When the first power value is greater than the first threshold, the first power module stores the first power value and sends a first signal to the second power module and the master control module. The second power module includes any power module other than the first power module among the at least two power modules. The first signal is used to trigger the second power module to store the second power value and to trigger the main control module to read the first power value and the second power values of all the second power modules to obtain the first total output power value, and to perform power control operation according to the first total output power value. Wherein, the second power value is the maximum output power value detected by the second power module within a preset time period; the first total output power value is the sum of the first power value and all the second power values.
2. The method according to claim 1, characterized in that, The first signal is used to trigger the second power module to store the second power value, including: The first signal is used to trigger the second power module to update and store the second power value in the power register of the second power module in the next clock cycle after receiving the first signal; Wherein, the first signal is used to trigger the main control module to read the first power value and the second power values of all the second power modules, including: The first signal is used to trigger the main control module to send a read command in the Nth clock cycle after receiving the first signal. The read command is used to read the first power value and the second power value, where N is an integer greater than 1.
3. The method according to claim 1, characterized in that, The power control operation includes: Determine whether the first total output power value is greater than a preset total power threshold; If the first total output power value is greater than the preset total power threshold, the power supply mode of the at least two power modules is controlled to switch from the first mode to the second mode. Wherein, the total output power of the at least two power modules in the first mode is greater than the total output power of the at least two power modules in the second mode.
4. The method according to claim 3, characterized in that, The power control operation also includes: If the first total output power value is less than or equal to a preset total power threshold, determine whether the first total output power value is greater than the second total output power value. The second total output power value is the sum of the maximum output power values of the at least two power modules most recently obtained before the main control module receives the first signal. When the first total output power value is greater than the second total output power value, the power module is controlled to obtain the maximum output power value of the power module according to the first sampling frequency; Wherein, the first sampling frequency is greater than the second sampling frequency, and the second sampling frequency is the frequency at which the power supply module samples the maximum output power value before the main control module receives the first signal.
5. The method according to any one of claims 1 to 4, characterized in that, The power control operation also includes: When the first power value is greater than or equal to the first threshold, the maximum output power value of the power module is obtained according to the first frequency. Wherein, the first frequency is greater than the second frequency, and the second frequency is the frequency at which the main control module obtains the maximum output power value of the power module before receiving the first signal.
6. The method according to any one of claims 1 to 4, characterized in that, When the first power value is greater than the first threshold, the first power module stores the first power value and sends a first signal to the second power module and the main control module, including: If the first power value is greater than the first threshold, the first power module determines whether the first power value is greater than the second threshold. If the first power value is greater than the second threshold, the first power module performs a hardware reset operation; When the first power value is less than or equal to the second threshold, the first power module stores the first power value and sends a first signal to the second power module and the master control module.
7. An electronic device, characterized in that, The electronic device includes at least two power modules and a main control module, wherein, A first power module is configured to acquire a first power value, wherein the first power value is the output power value of the first power module, and the first power module is any one of the at least two power modules; when the first power value is greater than a first threshold, the first power value is stored and a first signal is sent to a second power module and the master control module, wherein the second power module includes any one of the at least two power modules other than the first power module; The second power module is used to store a second power value based on the first signal, wherein the second power value is the maximum output power value detected by the second power module within a preset time period; The main control module is used to read the first power value and the second power values of all the second power modules according to the first signal to obtain a first total output power value, and to perform power control operation according to the first total output power value; wherein, the first total output power value is the sum of the first power value and all the second power values.
8. The electronic device according to claim 7, characterized in that, The power module includes a power register, a maximum power detection unit, and a first port; The maximum power detection unit is used to detect the maximum output power value of the power module. The power register is used to store the maximum output power value of the power module; The first port is used to output or receive the first signal, and triggers an interrupt after receiving the first signal to perform the storage behavior of storing the second power value into the power register; The first ports of each power module are interconnected, and the first port of each power module is connected to the main control module.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the power control method as described in any one of claims 1 to 7.
10. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps of the power control method according to any one of claims 1 to 7.