Power supply control method and apparatus
Patent Information
- Application Number
- CN202611029474.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]然而,上述方案中,由于电子设备中的多个用电模块共用一个电源端口,导致电子设备在关闭共用的电源端口后,会导致该电源端口对应的其它正在使用的用电模块工作异常
[0012]在本申请实施例中,在电子设备中的第一用电模块在第一时刻被停用的情况下,基于该第一用电模块的第一模块标识,确定向该第一用电模块供电的第一电源端口;基于该第一电源端口,确定第一使用次数,该第一使用次数为上述第一电源端口在上述第一时刻被用电模块使用的次数;基于上述第一使用次数,确定是否关闭上述第一电源端口。本方案中,在第一用电模块被停用后,电子设备会确定出该第一用电模块对应的第一电源端口被用电模块使用的次数,之后可以根据该次数判断此时是否存在其它用电模块正在使用上述第一电源端口,并据此确定是否要关闭上述第一电源端口,避免了直接关闭第一电源端口导致的影响其它用电模块正常工作的问题,提高了电源对多个用电模块的控制方法的灵活性。
Smart Images

Figure CN122924528A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic technology, specifically relating to a power control method and device. Background Technology
[0002] With the continuous development of electronic devices, multiple power modules of the same type often exist within these devices, and these modules typically share a single power port. For example, a mobile phone contains a main camera, a wide-angle camera, and a telephoto camera, which often share a single power port. Therefore, controlling the opening and closing of the power port based on the usage of each power module becomes extremely important.
[0003] In related technologies, when an electronic device has multiple power modules enabled simultaneously, if it detects that any one of these power modules has been turned off, the electronic device will directly shut down the power port shared by all the power modules. For example, when a mobile phone is in Super Anti-Shake (SAT) shooting mode, the main camera and the wide-angle camera will be enabled simultaneously. If, after a period of time, the phone detects that the user has only used the main camera, the phone will disable the wide-angle camera and turn off its corresponding power port.
[0004] However, in the above solution, because multiple power modules in the electronic device share a single power port, shutting down the shared power port can cause other power modules using that port to malfunction. Therefore, the power supply's control method for multiple power modules in this related technology is not flexible enough. Summary of the Invention
[0005] The purpose of this application is to provide a power control method and apparatus that can improve the flexibility of the power supply's control method for multiple power-consuming modules.
[0006] In a first aspect, embodiments of this application provide a power control method, the method comprising: when a first power-consuming module in an electronic device is disabled at a first moment, determining a first power port that supplies power to the first power-consuming module based on a first module identifier of the first power-consuming module; determining a first number of uses based on the first power port, the first number of uses being the number of times the first power port is used by the power-consuming module at the first moment; and determining whether to turn off the first power port based on the first number of uses.
[0007] Secondly, embodiments of this application provide a power control device, the device comprising: a processing module; the processing module being configured to, when a first power-consuming module in an electronic device is disabled at a first moment, determine a first power port supplying power to the first power-consuming module based on a first module identifier of the first power-consuming module; and, based on the first power port, determine a first number of uses, the first number of uses being the number of times the first power port is used by the power-consuming module at the first moment; and, based on the first number of uses, determine whether to shut down the first power port.
[0008] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the power control method as described in the first aspect.
[0009] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the power control method as described in the first aspect.
[0010] 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 power control method as described in the first aspect.
[0011] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the power control method as described in the first aspect.
[0012] In this embodiment, when a first power-consuming module in an electronic device is disabled at a first moment, a first power port supplying power to the first power-consuming module is determined based on the first module identifier of the first power-consuming module; based on the first power port, a first usage count is determined, which is the number of times the first power port is used by the power-consuming module at the first moment; based on the first usage count, it is determined whether to shut down the first power port. In this solution, after the first power-consuming module is disabled, the electronic device determines the number of times the first power port corresponding to the first power-consuming module has been used by the power-consuming module. Then, based on this count, it can determine whether other power-consuming modules are currently using the first power port, and accordingly determine whether to shut down the first power port. This avoids the problem of affecting the normal operation of other power-consuming modules caused by directly shutting down the first power port, and improves the flexibility of the power supply's control method for multiple power-consuming modules. Attached Figure Description
[0013] Figure 1 This is a schematic diagram showing the connection between the power port and the camera module provided in some embodiments of this application;
[0014] Figure 2 This is one of the flowcharts of the power control method provided in some embodiments of this application;
[0015] Figure 3 This is a second flowchart of a power control method provided in some embodiments of this application;
[0016] Figure 4 This is the third flowchart of a power control method provided in some embodiments of this application;
[0017] Figure 5 This is the fourth flowchart of a power control method provided in some embodiments of this application;
[0018] Figure 6 This is the fifth flowchart of a power control method provided in some embodiments of this application;
[0019] Figure 7 This is a system structure diagram corresponding to the power control method provided in some embodiments of this application;
[0020] Figure 8 This is a schematic diagram of a power control device provided in some embodiments of this application;
[0021] Figure 9 These are schematic diagrams of the electronic devices provided in some embodiments of this application;
[0022] Figure 10 These are schematic diagrams of the hardware structure of electronic devices provided in some embodiments of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0024] 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, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. 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.
[0025] The terms "at least one," "at least one of," etc., used in the specification and claims of this application refer to any one, any two, or a combination of two or more of the included items. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more items, and its meaning is similar to that of "at least one."
[0026] The power control method and apparatus provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0027] Mobile devices typically contain multiple camera modules, such as a rear wide-angle camera module, a main camera module, a periscope camera module, and a front-facing camera module. Each camera module is composed of multiple components. For example, such as... Figure 1As shown, camera module 1 and camera module 2 each include a sensor integrated circuit (IC), an optical image stabilization (OIS) IC, an autofocus (AF) IC, and an electrically erasable programmable read-only memory (EEPROM) IC. The power ports shared by camera module 1 and camera module 2 are: Analog Circuit Drain Supply Voltage (AVDD) port, Digital Circuit Drain Supply Voltage (DVDD) port, Input Output Interface Drain Supply Voltage (IOVDD) port, Autofocus Driver Drain Supply Voltage (AFVDD) port, and Optical Image Stabilization Driver Drain Supply Voltage (OISVDD) port. The electronic devices are connected via a power management integrated circuit (Power Management Integrated Circuit). The circuit (PMIC) delivers electrical power from the battery or Universal Serial Bus Type-C (USB Type-C) interface to camera module 1 and camera module 2 through these ports.
[0028] In related technologies, when a user activates the SAT shooting mode and opens the camera preview on their phone, the phone simultaneously uses both the wide-angle camera module and the main camera module. However, if the phone detects that the user has only used the main camera module for a period of time, it automatically disables the wide-angle camera module and shuts down all power ports supplying it. Since the main camera module is in working mode at this time, its operation will malfunction once its power ports are turned off. Therefore, the power control method in these technologies is not flexible enough.
[0029] This application provides a power control method and apparatus. When a first power-consuming module in an electronic device is disabled at a first moment, a first power port supplying power to the first power-consuming module is determined based on the first module identifier of the first power-consuming module; based on the first power port, a first usage count is determined, which is the number of times the first power port is used by the power-consuming module at the first moment; based on the first usage count, it is determined whether to shut down the first power port. In this solution, after the first power-consuming module is disabled, the number of times the power port corresponding to the first power-consuming module is used by the power-consuming module is determined. Then, based on this count, it can be determined whether other power-consuming modules are currently using the power port corresponding to the first power-consuming module, thereby determining whether to shut down the power port corresponding to the first power-consuming module. This avoids the problem of affecting the normal operation of other power-consuming modules caused by directly shutting down the power port corresponding to the first power-consuming module, and improves the flexibility of the power supply control method for multiple power-consuming modules.
[0030] The embodiments of this application can be applied to scenarios where power supply needs to be controlled.
[0031] In one possible application scenario, the power control method provided in this application embodiment can be applied to a scenario where it is necessary to determine whether to turn off the power port that supplies power to the camera when the camera of the mobile phone is turned off, such as scenario 1.
[0032] Scenario 1: Taking a mobile phone where camera A and camera B are both enabled and share power port A, and camera A is disabled at the first moment, the phone determines whether to turn off power port A. When camera A is disabled at the first moment, based on the first module identifier of camera A, the power port supplying power to camera A is determined to be power port A; based on power port A, a first usage count is determined, which is the number of times power port A is used by the power-consuming module at the first moment; based on the first usage count, it is determined whether to turn off power port A.
[0033] In another possible application scenario, the power control method provided in this application embodiment can be applied to a scenario where it is necessary to determine whether to turn off the power port that supplies power to the speaker when the speaker is turned off in a mobile phone, such as scenario 2.
[0034] Scenario 2: Taking a mobile phone with speakers A, B, and C all enabled and sharing a power port B as an example, if speaker A is disabled at the first moment, the phone determines whether to turn off power port B. When speaker A is disabled at the first moment, based on the first module identifier of speaker A, the power port supplying power to speaker A is determined to be power port B. Based on this power port B, a first usage count is determined, which is the number of times power port B is used by the power-consuming module at the first moment. Based on the first usage count, it is determined whether to turn off power port B.
[0035] It should be noted that the above scenarios 1 and 2 are merely exemplary examples of some scenarios that may be applied to the embodiments of this application. In actual implementation, the embodiments of this application can also be applied to any possible scenario where power supply needs to be controlled. The embodiments of this application are not limited here.
[0036] The power control method provided in this application can be executed by a power control device, which can be an electronic device, or a functional module or functional entity within the electronic device. The following description uses an electronic device as an example to illustrate the technical solution provided in this application.
[0037] Figure 2 A flowchart of a power control method provided in an embodiment of this application is shown, such as... Figure 2 As shown, the power control method provided in this application embodiment may include the following steps 201 to 203.
[0038] Step 201: When the first power-consuming module in the electronic device is disabled at the first moment, the electronic device determines the first power port that supplies power to the first power-consuming module based on the first module identifier of the first power-consuming module.
[0039] In some embodiments of this application, "disabling the first power module" means that the first power module has exited its working state. For example, assuming the first power module is camera A, "disabling the first power module" means that camera A is no longer capturing images.
[0040] In some embodiments of this application, a power module refers to a unit that relies on the power supply in an electronic device to perform a specific function.
[0041] In some embodiments of this application, the power module may also be referred to as a power supply module.
[0042] In some embodiments of this application, the power supply module includes at least one of the following: a chip, a functional unit, or an onboard module. Of course, the power supply module may also include other types of units that rely on the power supply in the electronic device to perform specific functions; the specific type can be determined according to actual needs, and this application does not limit this.
[0043] In some embodiments of this application, the chip mentioned above refers to an integrated circuit device in an electronic device that is manufactured and packaged using semiconductor technology and can independently perform specific electrical functions.
[0044] In some embodiments of this application, the chip type of the aforementioned chip includes at least one of the following: a camera chip, an audio chip, and a display chip. Of course, the aforementioned chip may also include other types of chips, which can be determined according to actual needs, and this application does not limit this.
[0045] In some embodiments of this application, the aforementioned camera chip refers to a chip in an electronic device that is related to the camera function.
[0046] In some embodiments of this application, the aforementioned audio chip refers to a chip in an electronic device that is related to audio input or audio output functions.
[0047] In some embodiments of this application, the aforementioned display chip refers to a chip in an electronic device that is related to the image output function.
[0048] In some embodiments of this application, the aforementioned functional unit refers to a basic component in an electronic device that is composed of relevant components and modules and can independently realize a specific electrical function.
[0049] In some embodiments of this application, the types of the above-mentioned functional units include at least one of the following: a camera module, a speaker, an earpiece, and a display module. Of course, the above-mentioned functional units may also include other types of functional units, which can be determined according to actual needs, and this application does not limit them.
[0050] In some embodiments of this application, the aforementioned onboard module refers to a board-level unit in an electronic device, consisting of a chip and supporting components, capable of independently performing specific functions.
[0051] In some embodiments of this application, the type of the onboard module includes at least one of the following: a radio frequency front-end module, a clock module, and an inertial measurement unit. Of course, the onboard module may also include other types of onboard modules, which can be determined according to actual needs, and this application does not limit this.
[0052] It should be noted that the identifiers in this application are text, symbols, images, etc. used to indicate information, and may be used as carriers for displaying information in the form of identifiers or other containers, including but not limited to text identifiers, image identifiers, symbol identifiers, etc.
[0053] In some embodiments of this application, the electronic device includes at least one power source, and each power source includes at least one power port.
[0054] In some embodiments of this application, the power port can be the output port of the power supply, that is, the port used by the power supply to supply power to the power module.
[0055] In some embodiments of this application, the electronic device can retrieve a first list based on the first module identifier of the first power-consuming module to determine the first power port that supplies power to the first power-consuming module.
[0056] It should be noted that the specific implementation process of the electronic device retrieving the first list based on the first module identifier of the first power module to determine the first power port supplying power to the first power module can be found in the relevant description in the following embodiments. To avoid repetition, this application will not elaborate on it here.
[0057] In some embodiments of this application, a power module may be powered by only one power port. Alternatively, a power module may be powered by multiple power ports, and this application does not limit this to one of them.
[0058] In some embodiments of this application, a power port may supply power to only one power module. Alternatively, a power port may supply power to multiple power modules, and this application does not limit this.
[0059] Step 202: The electronic device determines the first number of uses based on the first power port mentioned above.
[0060] In some embodiments of this application, the first number of uses refers to the number of times the first power port is used by the power module at the first moment.
[0061] In some embodiments of this application, the aforementioned first usage count can be used to indicate the number of power modules supplied by the first power port at a first moment.
[0062] In some embodiments of this application, the electronic device may retrieve a second list based on the first power port to determine the first number of uses.
[0063] It should be noted that the specific implementation process of the electronic device searching the second list based on the first power port to determine the first number of uses can be found in the relevant description in the following embodiments. To avoid repetition, this application will not elaborate on it here.
[0064] Step 203: Based on the first number of uses mentioned above, the electronic device determines whether to turn off the first power port.
[0065] In some embodiments of this application, the electronic device can decrement the first number of uses by 1, and then determine the numerical relationship between the value obtained after decrementing the first number of uses by 1 and the first value, thereby determining whether to turn off the first power port based on the numerical relationship.
[0066] For example, taking scenario 1, after the phone detects that camera A is disabled, it can search the first list based on the module identifier of camera A to find the port identifier of the power port that supplies power to camera A, i.e., the port identifier of power port A. Then, based on the port identifier of power port A, it searches the second list to find the number of times power port A has been used, decrements this number by 1, and then checks whether the value after decrementing is 0. If the value after decrementing is 0, the phone turns off power port A; if the value after decrementing is greater than zero, the phone keeps power port A enabled.
[0067] It should be noted that the specific implementation process of the electronic device subtracting the first number of uses by 1, and then judging the relationship between the value obtained after subtracting the first number of uses by 1 and the first value, and thus determining whether to turn off the first power port based on the relationship, can be found in the relevant description in the following embodiments. To avoid repetition, this application will not elaborate on it here.
[0068] This application provides a power control method. In this solution, after a first power module is deactivated, the electronic device determines the number of times the first power port corresponding to the first power module has been used by the power module. Then, based on the number of times, it can be determined whether other power modules are currently using the first power port, and accordingly, it can be determined whether to shut down the first power port. This avoids the problem of affecting the normal operation of other power modules caused by directly shutting down the first power port, and improves the flexibility of the power supply's control method for multiple power modules.
[0069] In some embodiments of this application, combined with Figure 2 ,like Figure 3 As shown, step 201 can be implemented through steps 201a and 201b below.
[0070] Step 201a: The electronic device obtains the first port identifier associated with the first module identifier from the first list based on the first module identifier of the first power-consuming module.
[0071] In some embodiments of this application, the first list above includes at least one module identifier and a port identifier associated with each module identifier.
[0072] In some embodiments of this application, the first list mentioned above is used to indicate the connection relationship between the power supply port and the power consumption module. That is, the first list mentioned above is used to indicate which power consumption modules each power supply port is used to supply power to.
[0073] In some embodiments of this application, the first list above includes at least one first mapping relationship.
[0074] In some embodiments of this application, the first mapping relationship mentioned above refers to the mapping relationship between module identifier and port identifier.
[0075] In some embodiments of this application, each first mapping relationship indicates that there is a path between the corresponding power port and the power module.
[0076] For example, assuming there is a first mapping relationship between the port identifier of power port A and the module identifier of power module A, it means that there is a path between power port A and power module A.
[0077] In some embodiments of this application, the aforementioned first list is a table pre-established and stored by the electronic device. Specifically, during the startup process, the electronic device can parse the Power Configuration Topology (PCT) file in the system by calling the initialization function of each power module through the system kernel, thereby obtaining the port information of each power port recorded in the PCT, and constructing the first list based on the port information of each power port.
[0078] It should be noted that the PCT file mentioned above defines detailed information for all power ports. For example, assuming an electronic device has three power ports, identified as avdd_2_8, dvdd_1_8, and iovdd_1_2, the PCT file would define the port information for these three power ports respectively: avdd_2_8{power-name="v-cam-11";power-volt="... <2800000>}. Here, `power-name="v-cam-11"` indicates that the power supply associated with the port identifier avdd_2_8 has the power identifier v-cam-11. `power-volt=` <2800000> The power supply identified as v-cam-11 has a voltage of 1,800,000 microvolts (μV); dvdd_1_8{power-name="v-cam-12";power-volt= <1800000>}. Here, `power-name="v-cam-12"` indicates that the power supply associated with the port identified as `dvdd_1_8` has the power supply identifier `v-cam-12`. `power-volt=` <1800000> The voltage of the power supply identified as v-cam-12 is 2800000μV; iovdd_1_2{power-name="v-cam-13";power-volt= <1200000>}. Here, `power-name="v-cam-13"` indicates that the power supply associated with the port identified as `iovdd_1_2` has the power supply identifier `v-cam-13`. `power-volt=` <1200000> The voltage of the power supply marked V-CAM-13 is 1200000μV.
[0079] Furthermore, the aforementioned PCT document also describes the connection relationships between power modules and power ports. For example, suppose an electronic device contains an ultra-wide-angle camera, a wide-angle camera, and a telephoto camera, with module identifiers Sensor_uw, Sensor_w, and Sensor_t, respectively. Then the following information can be defined in the above PCT file: Sensor_uw{avdd-supply=<&avdd_2_8>;dvdd-supply=<&dvdd_1_8>;dovdd-supply=<&iovdd_1_2>};Sensor_w{avdd-supply=<&avdd_2_8> ;dvdd-supply=<&dvdd_1_8>;dovdd-supply=<&iovdd_1_2>};Sensor_t{avdd-supply=<&avdd_2_8>;dvdd-supply=<&dvdd_1_8>;dovdd-supply=<&iovdd_1_2>}. Specifically, `Sensor_uw{avdd-supply=<&avdd_2_8>;dvdd-supply=<&dvdd_1_8>;dovdd-supply=<&iovdd_1_2>}` indicates that the port identifiers for the power supply ports of the power module with module identifier `Sensor_uw` are "avdd_2_8", "dvdd_1_8", and "iovdd_1_2", respectively; `Sensor_w{avdd-supply=<&avdd_2_8>;dvdd-supply=<&dvdd_1_8>;dovdd-supply=<&iovdd_1_2>}` indicates that the port identifiers for the power supply ports of the power module with module identifier `Sensor_w` are "avdd_2_8", "dvdd_1_8", and "iovdd_1_2", respectively. The `Sensor_t{avdd-supply=<&avdd_2_8>;dvdd-supply=<&dvdd_1_8>;dovdd-supply=<&iovdd_1_2>}` indicates that the port identifiers of the power supply ports for the power module with module identifier `Sensor_t` are "avdd_2_8", "dvdd_1_8", and "iovdd_1_2", respectively.
[0080] In some embodiments of this application, the electronic device can parse the PCT file through the PMIC driver to obtain the power port information stored in the PCT file, and then construct the first list based on the obtained power port information.
[0081] It should be noted that the aforementioned PMIC refers to a dedicated integrated chip responsible for power management in electronic devices.
[0082] In some embodiments of this application, the first list above further includes at least one control interface, each control interface being used to control a power port.
[0083] In some embodiments of this application, the control interface described above is used to enable the corresponding power port.
[0084] In some embodiments of this application, the electronic device can call a control interface and send an enable command to the power port corresponding to the control interface, thereby enabling the power port corresponding to the control interface.
[0085] In some embodiments of this application, there is an association between the control interfaces and port identifiers included in the first list.
[0086] In some embodiments of this application, the electronic device can obtain at least one control interface corresponding to a power port by parsing the first list, so that when a power port needs to be enabled, its corresponding control interface can be directly called to achieve rapid enabling of the power port.
[0087] Step 201b: The electronic device determines the first power port that supplies power to the first power module based on the first port identifier.
[0088] In some embodiments of this application, the electronic device can retrieve a second list based on the first port identifier to determine the first power port that supplies power to the first power module.
[0089] It should be noted that the specific implementation process of the electronic device searching the second list based on the first port identifier to determine the first power port supplying power to the first power module can be found in the relevant description in the following embodiments. To avoid repetition, this application will not elaborate on it here.
[0090] Thus, after the first power module is deactivated, the electronic device can obtain the port identifier of the power port supplying power to the first power module from the first list based on the module identifier of the first power module. Subsequently, based on the port identifier, it can determine the number of times the first power port has been used by the power module. Then, based on the number of times, it can determine whether other power modules are currently using the first power port, thereby determining whether to shut down the first power port. This avoids the problem of directly shutting down the first power port affecting the normal operation of other power modules and improves the flexibility of the power supply's control method for multiple power modules.
[0091] In some embodiments of this application, combined with Figure 3 ,like Figure 4 As shown, step 202 above can be specifically implemented through step 202a below.
[0092] Step 202a: The electronic device obtains the first number of uses associated with the first port identifier from the second list based on the first port identifier of the first power port.
[0093] In some embodiments of this application, the second list above includes at least one port identifier and the number of times each port identifier is associated with a usage count, where a usage count is the number of times the power port corresponding to a port identifier is used by the power module at the same time.
[0094] In some embodiments of this application, the second list described above is used to indicate the number of power modules using each power port of the power supply at the same time. That is, the second list described above is used to indicate how many power modules are using each power port of the power supply at the same time.
[0095] In some embodiments of this application, the second list above includes at least one second mapping relationship.
[0096] In some embodiments of this application, the second mapping relationship refers to the mapping relationship between module identifier and usage count.
[0097] In some embodiments of this application, the aforementioned second list is a table that the electronic device pre-establishes, stores, and updates in real time. Specifically, during the startup process, the electronic device can parse the Power Configuration Topology (PCT) file in the system by calling the initialization function of each power module through the system kernel, thereby obtaining the port information of each power port and setting the usage count corresponding to each power port as an initial value. After any power module is enabled, the electronic device will search the first list based on the module identifier of the power module to determine the power port that supplies power to the power module, and then search the second list based on the identifier of the power port to determine the usage count corresponding to the power module, and decrement the usage count by 1, and then determine whether to shut down the power port based on the value obtained after decrementing 1.
[0098] Thus, after the first power module is deactivated, the electronic device can determine from the second list the number of times the first power port has been used by the power module based on the port identifier of the first power port that supplies power to the first power module. Then, it can determine whether other power modules are using the first power port based on the number of times, thereby determining whether to shut down the first power port. This avoids the problem of affecting the normal operation of other power modules caused by directly shutting down the first power port, and improves the flexibility of the power supply's control method for multiple power modules.
[0099] In some embodiments of this application, combined with Figure 2 ,like Figure 5 As shown, step 203 can be implemented through step 203a or step 203b as described below.
[0100] Step 203a: When the value after subtracting 1 from the first number of uses is the first value, the electronic device controls the first power port to perform a shutdown operation.
[0101] In some embodiments of this application, the first value can be 0. Of course, the first value can also be other values preset by the system. The specific value can be determined according to actual needs, and this application does not limit it.
[0102] It is understood that if the value of the electronic device after subtracting 1 from the first number of uses is 0, it can be determined that the first power port is currently supplying power to any power module, and at this time the first power port can be directly turned off.
[0103] In some embodiments of this application, performing a shutdown operation on the first power port means stopping the supply of power to the power-consuming module through the first power port.
[0104] In some embodiments of this application, the electronic device can call the power control interface through the system kernel layer to shut down the first power port mentioned above.
[0105] In some embodiments of this application, after the electronic device subtracts 1 from the first number of uses, it can replace and update the first number of uses in a second list with the value obtained after subtracting 1.
[0106] It is understandable that after the first power module is deactivated, the number of power modules powered by the first power port that supplies power to the first power module is reduced by 1. Therefore, it is necessary to decrement the first usage count by 1 and replace and update the first usage count in the second list.
[0107] Step 203b: If the value of the electronic device after subtracting 1 from the first number of uses is greater than the first value, the first power port shall remain in the enabled state.
[0108] In some embodiments of this application, keeping the first power port in the enabled state means not performing any action on the first power port while it is in the enabled state.
[0109] It is understood that if the value of the electronic device after subtracting 1 from the first number of uses is greater than 0, it can be determined that the first power port is still supplying power to other power modules after the first power module is deactivated. Therefore, the electronic device does not need to turn off the first power port.
[0110] In some embodiments of this application, after the electronic device subtracts 1 from the first number of uses, it can replace and update the first number of uses in a second list with the value obtained after subtracting 1.
[0111] Thus, after the first power module is deactivated, the electronic device can determine from the second list how many times the first power port has been used by the power module. Then, based on whether the value after subtracting 1 from the number is the first value, it can determine whether other power modules are currently using the first power port, thereby determining whether to shut down the first power port. This avoids the problem of affecting the normal operation of other power modules caused by directly shutting down the first power port, and improves the flexibility of the power supply's control method for multiple power modules.
[0112] In some embodiments of this application, the power control method provided in this application further includes the following steps 301 to 303.
[0113] Step 301: When the second power module in the electronic device is activated at the second moment, the electronic device determines the second power port that supplies power to the second power module based on the second module identifier of the second power module.
[0114] In some embodiments of this application, the activation of the second power module refers to the first power module switching to a working state. For example, assuming the first power module is camera A, the activation of the first power module means waking up camera A and acquiring images through camera A.
[0115] In some embodiments of this application, the electronic device can retrieve a first list based on the second module identifier of the second power module to determine the second power port that supplies power to the second power module.
[0116] It should be noted that, for the electronic device to retrieve the first list based on the second module identifier of the second power module, thereby determining the second power port that supplies power to the second power module, please refer to the relevant description in the above embodiments. To avoid repetition, this application will not repeat it here.
[0117] Step 302: The electronic device determines the second number of uses based on the second power port mentioned above.
[0118] In some embodiments of this application, the second number of uses refers to the number of times the second power port is used by the power module at the second time.
[0119] In some embodiments of this application, the electronic device can retrieve the second list based on the port identifier of the second power port to determine the second number of uses.
[0120] It should be noted that the specific implementation process of the electronic device retrieving the second list based on the port identifier of the second power port to determine the second number of uses can be found in the relevant description in the above embodiments. To avoid repetition, this application will not repeat it here.
[0121] Step 303: The electronic device determines whether to enable the second power port based on the second number of uses mentioned above.
[0122] In some embodiments of this application, the electronic device can decrement the second number of uses by 1, and then determine the numerical relationship between the value obtained after decrementing the second number of uses by 1 and the second value, thereby determining whether to turn off the second power port based on the numerical relationship.
[0123] It should be noted that the specific implementation process of the electronic device decrementing the second usage count by 1, then judging the numerical relationship between the value obtained after decrementing the second usage count by 1 and the second value, and thus determining whether to turn off the second power port based on the numerical relationship, can be found in the relevant description in the following embodiments. To avoid repetition, this application will not elaborate further here.
[0124] For example, assuming the phone detects that camera B is enabled at a second moment, the phone can search a first list based on the module identifier of camera B to find the port identifier of the power port that supplies power to camera B, i.e., the port identifier of power port C. Then, based on the port identifier of power port C, the phone searches a second list to find the number of times power port C has been used, increments this number by 1, and then checks whether the incremented value is 1. If the incremented value is 1, the phone enables power port C; if the incremented value is greater than 1, the phone keeps power port C enabled.
[0125] It should be noted that steps 301 to 303 above can be performed when the electronic device detects that a power-consuming module is enabled.
[0126] In this way, when the second power module is activated, the electronic device will determine the number of times the second power port corresponding to the second power module has been used by the power module. Then, based on the number of times, it can determine whether other power modules are using the second power port at this time, and determine whether the second power port is already in the activated state. This avoids the problem of system instability caused by repeatedly activating the second power port when it is already activated, and improves the stability of the system.
[0127] In some embodiments of this application, step 303 can be implemented by step 303a or step 303b as described below.
[0128] Step 303a: When the value of the second number of uses plus 1 is the second value, the electronic device controls the second power port to perform an enable operation.
[0129] In some embodiments of this application, the second value can be 1. Of course, the second value can also be other values preset by the system, which can be determined according to actual needs, and this application does not limit this.
[0130] It is understood that if the value of the electronic device after adding 1 to the second number of uses is 1, it can be determined that the second power port did not supply power to any power module before the second power module was activated. Therefore, the second power port must have been in a closed state before the second power module was activated. At this time, the electronic device needs to activate the second power port so that it can supply power to the second power module.
[0131] In some embodiments of this application, after the electronic device increments the second usage count by 1, the value obtained by incrementing by 1 can be used to replace or update the second usage count in a second list.
[0132] It is understandable that after the second power module is enabled, the number of power modules powered by the second power port that powers the second power module increases by 1. Therefore, it is necessary to increment the above second usage count by 1 and replace and update the above second usage count in the second list.
[0133] Step 303b: If the value of the second number of uses plus 1 is greater than the second value, the electronic device keeps the second power port in the enabled state.
[0134] In some embodiments of this application, keeping the first power port in the enabled state means not performing any action on the first power port while it is in the enabled state.
[0135] It is understood that if the value of the electronic device after adding 1 to the second number of uses is greater than 1, it can be determined that the second power port was already supplying power to other power modules before the second power module was activated. Therefore, the electronic device does not need to activate the second power port again.
[0136] In some embodiments of this application, after the electronic device increments the second usage count by 1, the value obtained by incrementing by 1 can be used to replace or update the second usage count in a second list.
[0137] Thus, when the second power module is activated, the electronic device will determine the number of times the second power port corresponding to the second power module has been used by the power module, and then check whether the result of adding 1 to that number equals a second value.
[0138] The system determines whether other power modules are currently using the second power port and whether the second power port is already enabled. This helps determine whether the second power port should be enabled, thus avoiding system instability caused by repeatedly enabling the second power port when it is already enabled and improving system stability.
[0139] This application proposes a power control method that, after an electronic device disables a power module, determines whether the power port corresponding to that power module is being used by other power modules, thereby determining whether to shut down the power port. This achieves decoupling of power modules and avoids the problem of directly shutting down the power port affecting the normal operation of other power modules. For example, as shown... Figure 6 As shown, the power control method proposed in this application may include the following steps 40 to 53:
[0140] Step 40: The phone builds a power connection list.
[0141] In some embodiments of this application, the power connection list mentioned above is the same as the first list mentioned above.
[0142] In some embodiments of this application, the mobile phone can call the initialization function in the Driver of each power module to parse out each power connection information described in the PCT file, that is, the connection information between each power port and the power module, and save it into the power_link data structure. Then, the power_link is added to the Power_Link list, that is, the first list.
[0143] Step 41: Build a power port list on the phone.
[0144] In some embodiments of this application, the power port list described above is the same as the second list described above.
[0145] In some embodiments of this application, during the startup process, the mobile phone automatically calls the initialization function in the Driver of each power module through the system kernel. The mobile phone can use the PMIC Driver's initialization function to parse out the port information of each power port defined in the PCT file and save it into a power_port data structure. Then, the PMIC Driver will add this power_port to the Power_Port list, i.e., the second list mentioned above.
[0146] In some embodiments of this application, the mobile phone can set a corresponding enable_count field for each port identifier in the second list to indicate the number of times each power port is used at the same time.
[0147] Step 42: The mobile phone detects that power module A is activated at the third moment.
[0148] In some embodiments of this application, the power module A shares power port A with power module B and power module C.
[0149] Step 43: Based on the third module identifier of power module A, the mobile phone searches the above power connection list to determine the power port A that supplies power to power module A.
[0150] Step 44: Based on power port A, the mobile phone searches the above power port list to determine the third time that power port A was used by the power module at the third time mentioned above.
[0151] Step 45: The phone adds 1 to the third number and checks whether the value after adding 1 to the third number is 1.
[0152] In some embodiments of this application, if the value after adding 1 to the third number is 1, then the process jumps to step 46 below, and after executing step 46, it jumps to step 48; if the value after adding 1 to the third number is greater than 1, then the process jumps to step 47 below and executes subsequent steps.
[0153] Step 46: Enable the power port A on the mobile phone.
[0154] In some embodiments of this application, when the value of the third number plus 1 is 1, the power port A can be enabled and the third number in the second list can be replaced with the value obtained by adding 1 to the third number.
[0155] Step 47: Keep the power port A of the mobile phone enabled.
[0156] In some embodiments of this application, if the value of the third number plus 1 is 1, the mobile phone can maintain the enabled state of the power port A and replace the third number in the second list with the value obtained by adding 1 to the third number.
[0157] Step 48: The mobile phone detected that the power module B was deactivated at the fourth moment.
[0158] Step 49: Based on the fourth module identifier of power module B, the mobile phone searches the above power connection list to determine the power port A that supplies power to power module A.
[0159] Step 50: Based on power port A, the mobile phone searches the above power port list to determine the fourth number of times power port A is used by the power module at the fourth time mentioned above.
[0160] Step 51: The phone subtracts 1 from the fourth count and determines whether the value after subtracting 1 from the fourth count is 0.
[0161] In some embodiments of this application, if the value after subtracting 1 from the fourth count is 0, then the process jumps to step 52 below, and after step 52 is completed; if the value after subtracting 1 from the fourth count is greater than 0, then the process jumps to step 53 below.
[0162] Step 52: Turn off the power port A on the mobile phone.
[0163] In some embodiments of this application, when the value of the fourth count minus 1 is 0, the mobile phone can turn off the power port A and replace the fourth count in the second list with the value obtained by subtracting 1 from the fourth count.
[0164] Step 53: Keep the power port A of the mobile phone in the enabled state.
[0165] In some embodiments of this application, if the value obtained by subtracting 1 from the fourth number is greater than 0, the mobile phone can maintain the enabled state of the power port A and replace the fourth number in the second list with the value obtained by subtracting 1 from the fourth number.
[0166] It should be noted that the specific implementation process of each step in steps 40 to 53 above can be found in the relevant descriptions in the above embodiments. To avoid repetition, this application will not repeat them here.
[0167] The power control method proposed in this application will be explained in detail below, taking the camera module as an example.
[0168] For example, such as Figure 7 As shown, the power control method proposed in this application involves two levels of electronic devices: the Kernel Space (KS) level and the Hardware (HW) level. The KS level stores PCT files. The electronic device can call the drivers of the UltraWide Camera (UWCamera), the Wide Camera (WCamera), and the Tele Camera (TCamera) to parse the PCT files, obtaining a first list of Power_Links and a second list of Power_Ports, which are then stored in the KS level. Subsequently, the PMIC Driver reads the Power_Links and Power_Ports to determine the power control strategy. The HW level includes UWCamera, WCamera, and TCanmera. These three camera modules share power output ports including AVDD, DVDD, and IOVDD.
[0169] It should be noted that each of the above method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions on this.
[0170] The power control method provided in this application can be executed by a power control device. This application uses the example of a power control device executing a power control method to illustrate the power control device provided in this application.
[0171] Figure 8 This is a schematic diagram of a power control device provided in an embodiment of this application. Figure 8 As shown, the power control device 50 includes a processing module 501.
[0172] The processing module 501 is configured to, when the first power-consuming module in the electronic device is disabled at a first moment, determine a first power port that supplies power to the first power-consuming module based on the first module identifier of the first power-consuming module; determine a first number of uses based on the first power port, the first number of uses being the number of times the first power port is used by the power-consuming module at the first moment; and determine whether to turn off the first power port based on the first number of uses.
[0173] In one possible implementation, the processing module 501 is specifically configured to: obtain a first port identifier associated with the first module identifier from a first list based on the first module identifier of the first power-consuming module, wherein the first list includes at least one module identifier and a port identifier associated with each module identifier; and determine a first power supply port that supplies power to the first power-consuming module based on the first port identifier.
[0174] In one possible implementation, the processing module 501 is specifically used to: based on the first port identifier of the first power port, obtain the first number of uses associated with the first port identifier from a second list, wherein the second list includes at least one port identifier and the number of uses associated with each port identifier, and a number of uses is the number of times the power port corresponding to a port identifier is used by the power module at the same time.
[0175] In one possible implementation, the processing module 501 is specifically configured to: control the first power port to perform a shutdown operation when the value after subtracting 1 from the first usage count is a first value; or, keep the first power port in an enabled state when the value after subtracting 1 from the first usage count is greater than the first value.
[0176] In one possible implementation, the processing module 501 is further configured to, when the second power-consuming module in the electronic device is enabled at a second time, determine a second power port supplying power to the second power-consuming module based on the second module identifier of the second power-consuming module; and, based on the second power port, determine a second number of uses, the number of times the second power port is used by the power-consuming module at the second time; and, based on the second number of uses, determine whether to enable the second power port.
[0177] In one possible implementation, the processing module 501 is specifically used to: control the second power port to perform an enable operation when the value after adding 1 to the second number of uses is a second value; or, keep the second power port in the enabled state when the value after adding 1 to the second number of uses is greater than the second value.
[0178] This application provides a power control device. After a first power module is deactivated, the power control device determines the number of times the first power port corresponding to the first power module has been used by the power module. Then, based on the number of times, it can determine whether other power modules are currently using the first power port, and determine whether to shut down the first power port. This avoids the problem of affecting the normal operation of other power modules caused by directly shutting down the first power port, and improves the flexibility of the power supply's control method for multiple power modules.
[0179] The power control device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.
[0180] The power control device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0181] The power control device provided in this application embodiment can realize the various processes implemented in the above method embodiments, and will not be described again here to avoid repetition.
[0182] Optionally, such as Figure 9 As shown, this application embodiment also provides an electronic device 600, including a processor 601 and a memory 602. The memory 602 stores a program or instructions that can run on the processor 601. When the program or instructions are executed by the processor 601, they implement the various steps of the above-described power control method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0183] 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.
[0184] Figure 10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0185] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.
[0186] Those skilled in the art will understand that the electronic device 100 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 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 10 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.
[0187] The processor 110 is configured to, when the first power-consuming module in the electronic device is disabled at a first moment, determine a first power port that supplies power to the first power-consuming module based on the first module identifier of the first power-consuming module; determine a first number of uses based on the first power port, the first number of uses being the number of times the first power port is used by the power-consuming module at the first moment; and determine whether to turn off the first power port based on the first number of uses.
[0188] Optionally, the processor 110 is specifically configured to: obtain a first port identifier associated with the first module identifier from a first list based on the first module identifier of the first power-consuming module, wherein the first list includes at least one module identifier and a port identifier associated with each module identifier; and determine a first power port for supplying power to the first power-consuming module based on the first port identifier.
[0189] Optionally, the processor 110 is specifically configured to: based on the first port identifier of the first power port, obtain a first usage count associated with the first port identifier from a second list, wherein the second list includes at least one port identifier and a usage count associated with each port identifier, and a usage count is the number of times the power port corresponding to a port identifier is used by the power module at the same time.
[0190] Optionally, the processor 110 is specifically configured to: control the first power port to perform a shutdown operation when the value after subtracting 1 from the first number of uses is a first value; or, keep the first power port in an enabled state when the value after subtracting 1 from the first number of uses is greater than the first value.
[0191] Optionally, the processor 110 is further configured to, when the second power module in the electronic device is enabled at a second time, determine a second power port supplying power to the second power module based on the second module identifier of the second power module; and, based on the second power port, determine a second number of uses, the number of times the second power port is used by the power module at the second time; and, based on the second number of uses, determine whether to enable the second power port.
[0192] Optionally, the processor 110 is specifically configured to: control the second power port to perform an enable operation when the value after adding 1 to the second number of uses is a second value; or, keep the second power port in an enabled state when the value after adding 1 to the second number of uses is greater than the second value.
[0193] This application provides an electronic device that, after a first power module is deactivated, determines the number of times the first power port corresponding to the first power module has been used by the power module. Then, based on the number of times, it can determine whether other power modules are currently using the first power port, and accordingly determine whether to shut down the first power port. This avoids the problem of affecting the normal operation of other power modules caused by directly shutting down the first power port, and improves the flexibility of the power supply's control method for multiple power modules.
[0194] This application provides an electronic device that, after a first power module is deactivated, determines the number of times the power port corresponding to the first power module has been used by the power module. Then, based on this number, it can be determined whether other power modules are currently using the power port corresponding to the first power module, thereby determining whether to shut down the power port corresponding to the first power module. This avoids the problem of affecting the normal operation of other power modules caused by directly shutting down the power port corresponding to the first power module, and improves the flexibility of the power supply's control method for multiple power modules.
[0195] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0196] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0197] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.
[0198] 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.
[0199] 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.
[0200] 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.
[0201] 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.
[0202] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the power control method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0203] 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.
[0204] 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 computer 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, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0205] 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, characterized in that, include: If the first power-consuming module in the electronic device is disabled at the first moment, the first power port that supplies power to the first power-consuming module is determined based on the first module identifier of the first power-consuming module. Based on the first power port, a first number of uses is determined, where the first number of uses is the number of times the first power port is used by the power module at the first moment. Based on the first number of uses, determine whether to turn off the first power port.
2. The method according to claim 1, characterized in that, The step of determining the first power port for supplying power to the first power module based on the first module identifier of the first power module includes: Based on the first module identifier of the first power module, obtain the first port identifier associated with the first module identifier from the first list, wherein the first list includes at least one module identifier and a port identifier associated with each module identifier; Based on the first port identifier, the first power port that supplies power to the first power module is determined.
3. The method according to claim 1 or 2, characterized in that, The determination of the first number of uses based on the first power port includes: Based on the first port identifier of the first power port, the first usage count associated with the first port identifier is obtained from the second list. The second list includes at least one port identifier and the usage count associated with each port identifier. A usage count is the number of times the power port corresponding to a port identifier is used by the power module at the same time.
4. The method according to claim 1, characterized in that, The step of determining whether to turn off the first power port based on the first number of uses includes: If the value after subtracting 1 from the first number of uses is the first value, control the first power port to perform a shutdown operation; or, If the value after subtracting 1 from the first number of uses is greater than the first value, the first power port remains in the enabled state.
5. The method according to claim 1, characterized in that, The method further includes: When the second power module in the electronic device is enabled at a second moment, the second power port that supplies power to the second power module is determined based on the second module identifier of the second power module; Based on the second power port, a second number of uses is determined, where the second number of uses is the number of times the second power port is used by the power module at the second time. Based on the second number of uses, determine whether to enable the second power port.
6. The method according to claim 5, characterized in that, The step of determining whether to enable the second power port based on the second number of uses includes: If the value after adding 1 to the second number of uses is the second value, control the second power port to perform an enable operation; or, If the value after adding 1 to the second number of uses is greater than the second value, the second power port remains in the enabled state.
7. A power control device, characterized in that, include: Processing module; The processing module is used to determine the first power port that supplies power to the first power module based on the first module identifier of the first power module when the first power module in the electronic device is disabled at the first moment. as well as, Based on the first power port, a first number of uses is determined, where the first number of uses is the number of times the first power port is used by the power module at the first moment. as well as, Based on the first number of uses, determine whether to turn off the first power port.
8. The apparatus according to claim 7, characterized in that, The processing module is specifically used for: Based on the first module identifier of the first power module, obtain the first port identifier associated with the first module identifier from the first list, wherein the first list includes at least one module identifier and a port identifier associated with each module identifier; Based on the first port identifier, the first power port that supplies power to the first power module is determined.
9. The apparatus according to claim 7 or 8, characterized in that, The processing module is specifically used for: Based on the first port identifier of the first power port, the first usage count associated with the first port identifier is obtained from the second list. The second list includes at least one port identifier and the usage count associated with each port identifier. A usage count is the number of times the power port corresponding to a port identifier is used by the power module at the same time.
10. The apparatus according to claim 7, characterized in that, The processing module is specifically used for: If the value after subtracting 1 from the first number of uses is the first value, control the first power port to perform a shutdown operation; or, If the value after subtracting 1 from the first number of uses is greater than the first value, the first power port remains in the enabled state.
11. The apparatus according to claim 7, characterized in that, The processing module is further configured to, when the second power module in the electronic device is activated at a second moment, determine the second power port that supplies power to the second power module based on the second module identifier of the second power module; as well as, Based on the second power port, a second number of uses is determined, where the second number of uses is the number of times the second power port is used by the power module at the second time. as well as, Based on the second number of uses, determine whether to enable the second power port.
12. The apparatus according to claim 11, characterized in that, The processing module is specifically used for: If the value after adding 1 to the second number of uses is the second value, control the second power port to perform an enable operation; or, If the value after adding 1 to the second number of uses is greater than the second value, the second power port remains in the enabled state.