Power management method and device
By switching the PCIe link mode in electronic devices according to IO load and application status, the high power consumption problem caused by dual-channel data transmission is solved, achieving a balance between system power consumption and performance and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2026-03-06
AI Technical Summary
Dual-channel data transmission in electronic devices leads to excessive system power consumption, affecting device heat generation and performance.
By acquiring the system's I/O load and the application's running status, the operating mode of the PCIe link can be switched to adjust the link speed, thereby optimizing system power consumption.
Achieving a balance between data transmission performance and system power consumption, avoiding excessive system power consumption, and improving user experience.
Smart Images

Figure CN114528187B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of terminal technology, specifically relating to a power consumption management method and device. Background Technology
[0002] In related technologies, to improve the data transmission performance of storage modules in electronic devices, dual-channel data transmission can be used to double the data transmission performance. For example, dual-channel data transmission can be performed using non-volatile memory (NVM Express, NVMe) and universal flash storage (UFS).
[0003] However, dual-channel data transmission is typically based on the high-speed Serial Computer Extended Bus (PCIe) standard. While improving data transmission performance, this also increases system power consumption, leading to significant heat generation in the devices. Therefore, an effective solution is urgently needed to address the high power consumption issue in dual-channel data transmission. Summary of the Invention
[0004] The purpose of this application is to provide a power management method and apparatus that can solve the problem of high system power consumption when the storage module in an electronic device uses dual channels for data transmission.
[0005] In a first aspect, embodiments of this application provide a power consumption management method, the method comprising:
[0006] Obtain the system's I / O load;
[0007] Switch the operating mode of the PCIe link according to the IO load; and / or,
[0008] Switch the working mode of the PCIe link according to the running status of the application;
[0009] Different operating modes correspond to different link rates, and different link rates correspond to different system power consumption.
[0010] Secondly, embodiments of this application provide a power management device, the device comprising:
[0011] The acquisition module is used to acquire the system's I / O load;
[0012] The link switching module is used to switch the operating mode of the PCIe link according to the IO load; and / or, to switch the operating mode of the PCIe link according to the running status of the application.
[0013] Different operating modes correspond to different link rates, and different link rates correspond to different system power consumption.
[0014] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0015] 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.
[0016] 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.
[0017] 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 method described in the first aspect.
[0018] In this embodiment, multiple operating modes can be set for the dual-channel PCIe links. Different operating modes correspond to different link speeds, and different link speeds correspond to different system power consumption. During device operation, the system's I / O load can be acquired, and the operating mode of the PCIe links can be switched based on the I / O load and / or the application's running status, thereby adjusting the system power consumption. Thus, because the PCIe operating mode can be switched according to the system's I / O load and / or the application's running status, thereby adjusting system power consumption, a better balance can be achieved between the data transfer performance of the storage module and system power consumption, avoiding excessive system power consumption and improving the user experience. Attached Figure Description
[0019] Figure 1 This is a schematic flowchart of a power management method according to an embodiment of this application;
[0020] Figure 2 This is a schematic flowchart of a power management method according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of an application list setting method according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of an application list setting method according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of the prompt information according to an embodiment of this application;
[0024] Figure 6 This is a schematic flowchart of a power management method according to an embodiment of this application;
[0025] Figure 7 This is a schematic structural diagram of a power management device according to an embodiment of this application;
[0026] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;
[0027] Figure 9 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0028] 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.
[0029] 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.
[0030] The power management method, apparatus, and electronic device provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0031] Figure 1 This is a schematic flowchart illustrating a power management method according to an embodiment of this application. The method can be executed by an electronic device including a storage module. When the electronic device is a computer device, the storage module can be a disk; when the electronic device is a terminal device (such as a smartphone), the storage module can be the storage memory in the smart terminal device. The power management method of this application includes the following steps.
[0032] S12: Get the system's I / O load.
[0033] When an electronic device is running, the system's I / O load can be monitored and acquired. This system can be the electronic device's I / O system.
[0034] In this embodiment, the system's IO load can be acquired according to a set period. This set period can be 60ms, or other durations, and can be set according to the actual scenario; no specific limitation is made here.
[0035] Optionally, as an embodiment, when obtaining the system's IO load, specifically, firstly, the duration of the system being busy within a set period can be obtained. Then, the ratio between the duration of the system being busy and the total duration of the set period is determined as the system's IO load. For example, if the set period is 60ms, and the system is busy for 30ms within those 60ms, then the IO load is 50%. Whether the system is busy can be determined by checking if there are any unfinished requests in the work queue. If no requests are waiting to be processed, the system is in an idle state; otherwise, the system is in a busy state.
[0036] S14: Switch the operating mode of the PCIe link according to the IO load, and / or switch the operating mode of the PCIe link according to the running status of the application; where different operating modes correspond to different link speeds, and different link speeds correspond to different system power consumption.
[0037] A PCIe link is a data transmission link in an electronic device based on the PCIe bus. In this embodiment, the PCIe link can have multiple operating modes, the number of which can be two, three, or four, etc., depending on the actual scenario; no specific limitation is made here. Each operating mode can correspond to a different link speed, and different link speeds correspond to different system power consumption. Specifically, the higher the PCIe link speed, the higher the data transmission rate, and the higher the system power consumption.
[0038] In S14, after acquiring the system's I / O load, the PCIe link's operating mode can be switched based on the I / O load and / or the application's running status. For example, when the I / O load is high and / or the number of running applications is large, the PCIe operating mode can be switched to a higher link speed mode to accelerate data transfer and meet data transfer requirements. When the I / O load is low and / or the number of running applications is small, the PCIe operating mode can be switched to a lower link speed mode to reduce system power consumption when a higher link speed is not required.
[0039] In this way, since the PCIe operating mode can be switched according to the system's I / O load and / or the running status of the application, the system power consumption can be adjusted. Therefore, the data transfer performance of the storage module and the system power consumption can be balanced, achieving a good balance between the two, avoiding excessive system power consumption, and thus improving the user experience.
[0040] Optionally, as an example, when switching the operating mode of the PCIe link according to the IO load, an adjustment threshold for the IO load can be preset for different operating modes of the PCIe link. In this way, when switching the operating mode of the PCIe link, the mode can be switched according to the IO load and the preset adjustment threshold, thereby achieving accurate switching of the operating mode and better balancing the data transmission performance of the storage module and the system power consumption.
[0041] Specifically, in the current operating mode, it can be determined whether the IO load is greater than or equal to a first threshold. If the IO load is greater than or equal to the first threshold, the operating mode of the PCIe link can be switched from the current operating mode to the first mode, where the link speed is higher than that of the current operating mode. Thus, under high IO load conditions, switching to the higher-speed operating mode can accelerate data transmission and meet data transmission requirements. If the current operating mode is already in the first mode, it can be maintained without switching.
[0042] In the current operating mode, it can also be determined whether the I / O load is less than or equal to a second threshold. If the I / O load is less than or equal to the second threshold, the operating mode of the PCIe link can be switched from the current operating mode to the second mode. The link speed in the second mode is lower than the link speed in the current operating mode. Thus, when the I / O load is low, since the operating mode can be switched to a lower link speed mode, system power consumption can be reduced when a higher link speed is not required. If the current operating mode is already in the second mode, it can be maintained without switching.
[0043] It should be noted that, in one possible implementation, the first threshold can be equal to the second threshold. In this case, when switching modes based on the first and second thresholds, if the IO load is greater than or equal to the first threshold (i.e., the second threshold), the current operating mode can be switched to the first mode; if the IO load is less than or equal to the first threshold (i.e., the second threshold), the current operating mode can be switched to the second mode. In another possible implementation, the first threshold can also be greater than the second threshold. In this case, when switching modes based on the first and second thresholds, if the IO load is greater than or equal to the first threshold, the current operating mode can be switched to the first mode; if the IO load is less than or equal to the second threshold, the current operating mode can be switched to the second mode; and if the IO load is between the second and first thresholds, the current operating mode can remain unchanged.
[0044] For example, a PCIe link may have three operating modes: high-speed, medium-speed, and low-speed. The current operating mode is medium-speed. In one implementation, if the first threshold equals the second threshold, then during mode switching, if the I / O load is greater than or equal to the first threshold, the mode can be switched from medium-speed to high-speed; if the I / O load is less than the first threshold, the mode can be switched from medium-speed to low-speed. In another implementation, if the first threshold is greater than the second threshold, then during mode switching, if the I / O load is greater than or equal to the first threshold, the mode can be switched from medium-speed to high-speed; if the I / O load is less than or equal to the second threshold, the mode can be switched from medium-speed to low-speed; and if the I / O load is greater than the second threshold but less than the first threshold, the current medium-speed mode can be maintained.
[0045] It should also be noted that, for a certain working mode, the threshold for switching from other working modes to this working mode can be the same as or different from the threshold for switching from this working mode to other working modes.
[0046] Taking high-speed and medium-speed modes as examples, in one implementation, a threshold A can be set for the IO load when switching between high-speed and medium-speed modes. Thus, when the current operating mode is medium-speed, switching from medium-speed to high-speed mode occurs when the IO load is greater than or equal to threshold A. After switching to high-speed mode, switching back to medium-speed mode occurs when the IO load is less than threshold A. In another implementation, thresholds A and B can be set for the IO load when switching between high-speed and medium-speed modes, with A being less than B. In this case, when the current operating mode is medium-speed, no mode switch occurs when the IO load is greater than or equal to threshold A; instead, switching from medium-speed to high-speed mode only occurs when the IO load is greater than or equal to threshold B. Similarly, after switching to high-speed mode, no mode switch occurs when the IO load is less than or equal to threshold B; instead, switching back to medium-speed mode only occurs when the IO load is less than or equal to threshold A. This avoids the problem of frequent mode switching caused by IO load fluctuations.
[0047] In one possible implementation, where the PCIe link operates in both high-speed and low-speed modes, and the threshold for I / O load when switching from high-speed to low-speed mode differs from the threshold for I / O load when switching from low-speed to high-speed mode, the specific implementation for switching the PCIe link's operating mode based on I / O load can be as follows: Figure 2 As shown. Figure 2 The illustrated embodiment includes the following steps:
[0048] Step 101: After the system boots up, initialize the upper and lower limits of the IO load threshold, as well as the monitoring period.
[0049] The upper limit of the IO load threshold here is the threshold corresponding to the IO load when switching from low-speed mode to high-speed mode, and the lower limit is the threshold corresponding to the IO load when switching from low-speed mode to high-speed mode. The monitoring period is the set period for obtaining the IO load.
[0050] Step 102: Reset the monitoring timer.
[0051] Step 103: Start a new cycle and check the IO load.
[0052] Step 104: Determine if the cycle has ended. If yes, proceed to step 105; otherwise, return to step 103 and continue timing.
[0053] Step 105: Calculate the proportion of time the system is busy within the cycle to obtain the IO load.
[0054] Step 106: Determine whether the IO load of this cycle is greater than the upper limit. If yes, proceed to step 107; otherwise, proceed to step 109.
[0055] Step 107: If the IO load is greater than the upper limit, determine whether the current PCIe link is GEN1 (corresponding to low speed mode). If yes, proceed to step 108; otherwise, proceed to step 112.
[0056] Step 108: If the current link is GEN1, switch the link to GEN2 (corresponding to high-speed mode).
[0057] Step 109: Determine if the IO load is less than the lower limit. If yes, proceed to step 110; otherwise, proceed to step 112.
[0058] Step 110: If the IO load is less than the lower limit, determine whether the current link is GEN2. If yes, proceed to step 111; otherwise, proceed to step 112.
[0059] Step 111: If the current link is GEN2, switch the link to GEN1.
[0060] Step 112: If the link switching conditions are not met, continue to maintain the current link and enter the next monitoring cycle.
[0061] Figure 2 The illustrated embodiment enables autonomous switching of the PCIe link's operating mode; the entire switching process is completed by software without manual user intervention, making it intelligent, efficient, convenient, and fast. Furthermore, because it can flexibly switch between high-speed and low-speed modes based on I / O load, it achieves a good balance between system performance and power consumption, thus enhancing the user experience.
[0062] Optionally, as an embodiment, in the above S14, when switching the working mode of the PCIe link, the working mode of the PCIe link can also be switched only according to the running status of the applications installed in the electronic device.
[0063] Specifically, a preset application list can be established, which records at least one application installed on the electronic device, and this at least one application corresponds to the target operating mode of the PCIe link. The target operating mode can be any of the multiple operating modes of the PCIe link, such as the operating mode with the highest link speed or the operating mode with the lowest link speed. This embodiment will use the operating mode with the highest link speed as an example for explanation. At least one application corresponding to the target operating mode can mean that at least one application corresponds to a certain identical operating mode, and this identical operating mode is the target operating mode. When one or more of the at least one application is running, the operating mode of the PCIe link needs to be switched to the target operating mode.
[0064] When switching the PCIe link's operating mode based on the application's running status, the running status of applications installed on the electronic device can be monitored. When the running status of any application changes, such as changing from running to closed, or from closed to running, it can be determined whether the number of applications running in the preset application list is greater than zero. If the number of applications running in the preset application list is greater than zero, the current operating mode can be switched to the target operating mode. Optionally, if the current operating mode is already the target operating mode, the current operating mode can be maintained without switching.
[0065] In this way, since the PCIe link's working mode can be switched according to the running status of applications in the electronic device, specifically, when the number of applications running in the preset application list is greater than zero, the PCIe link's working mode can be switched to the target working mode. Therefore, it can meet the user's personalized usage needs for specific applications and improve the user experience.
[0066] At least one application in the above preset application list can be set by the user, or it can be set by the system default, or it can be set by the system based on the user's historical usage data of each installed application. No specific limitation is made here.
[0067] Alternatively, as an example, when a user sets at least one application from a preset application list, the user can set it in at least two ways.
[0068] The first method: Set it through the application icon.
[0069] Specifically, users can perform preset actions on application icons on the system desktop. After receiving the user's preset actions, the system can pop up a settings menu, which can include corresponding settings options, and users can make settings through the corresponding options.
[0070] like Figure 3 As shown, after a user long-presses the WeChat icon, a settings menu pops up. The settings menu includes five options: "App Clone," "Uninstall App," "Add to High-Speed List," "Edit Desktop," and "My QR Code." Users can click the "Add to High-Speed List" option to add WeChat to the preset app list. Optionally, after adding WeChat to the preset app list, when the user long-presses the WeChat icon again, the pop-up menu may include an "Exit High-Speed List" option. Figure 3 (Not shown), users can remove WeChat from the preset application list by clicking the "Exit High-Speed List" option.
[0071] The second method: Configure it through the system settings.
[0072] Specifically, an application list management option can be added to the application and permissions section of the system settings. Users can view the applications in the application list through the path "System Settings -> Applications and Permissions -> Application List Management" and can also configure the applications in the application list.
[0073] like Figure 4 As shown, after entering the Applications & Permissions section of system settings, a list of high-speed applications (i.e., the preset application list mentioned above) is displayed at the bottom of the Applications & Permissions page. Users can click on this list to view the applications included. Additionally, each application has a minus sign ("-") next to it; clicking this sign removes the application from the list. Below the list is a plus sign ("+"); clicking this sign adds a new application to the list.
[0074] Optionally, as an embodiment, multiple preset application lists can be set in the same way, and different preset application lists can correspond to different operating modes of the PCIe link. Specifically, each preset application list can include at least one application, which can correspond to one of the operating modes of the PCIe link. For example, the operating modes of the PCIe link include high-speed mode, medium-speed mode, and low-speed mode. Application list 1 and application list 2 can be set, with application list 1 corresponding to high-speed mode and application list 2 corresponding to medium-speed mode. Application list 1 has a higher priority than application list 2. When both application list 1 and application list 2 contain running applications, the operating mode can be switched to high-speed mode because application list 1 has a higher priority than application list 2. When there are no running applications in application list 1 but there are running applications in application list 2, the operating mode can be switched to medium-speed mode.
[0075] Optionally, as an embodiment, in S14 above, the operating mode of the PCIe link can also be switched simultaneously based on the IO load and the running status of the application. Specifically, the running status of the applications installed in the electronic device can be monitored. If the number of applications running in the preset application list is greater than zero, the current operating mode can be switched to the target operating mode. If the number of applications running in the preset application list is equal to zero, the operating mode of the PCIe link can be switched based on the IO load. The preset application list can be the same as the preset application list in the embodiment above where the operating mode of the PCIe link is switched only based on the running status of the application, and will not be described in detail here. The specific implementation of switching the current operating mode to the target operating mode based on the running status of the application can be found in the specific implementation of the corresponding steps above, and will not be repeated here. The specific implementation of the PCIe link operating mode based on IO load can also be found in the specific implementation of the corresponding steps above, and will not be repeated here either.
[0076] In this way, when switching the PCIe link's operating mode, the switching can be prioritized based on the application's running status. Therefore, it can meet users' personalized usage needs for specific applications and improve user experience. Even when the number of applications running in the preset application list is zero, the PCIe link's operating mode can still be switched based on I / O load. This allows for a balance between data transfer performance and system power consumption in scenarios where users do not have personalized usage requirements, preventing excessive system power consumption and thus improving the user experience.
[0077] Optionally, as an embodiment, in the above-mentioned case of switching the PCIe link working mode according to the application's running state, or switching the PCIe link working mode according to IO load and application's running state, after switching the current working mode of the PCIe link to the target working mode with a higher link speed, considering that the actual IO load of the system may not require such a high link speed, or that the user may mistakenly add an application to the preset application list, causing the application to switch its working mode to the target working mode when it runs, thus leading to high system power consumption, a warning mechanism can be set to avoid the system power consumption being in a meaningless high power consumption state.
[0078] Specifically, after switching the current operating mode of the PCIe link to the target operating mode, it can be determined whether the IO load is less than a third threshold within a preset time period. Both the preset time period and the third threshold can be set according to the actual scenario, and are not specifically limited here. If the IO load is less than the third threshold within the preset time period, it indicates that the current IO load is low, and such a high link speed may not be necessary. At this time, a prompt message can be displayed to ask the user whether to switch to the target operating mode. If the user confirms the switch, they can enter confirmation information. Upon receiving the user's confirmation, the target operating mode can be switched to the third mode. The third mode can be any operating mode with a lower link speed than the target operating mode. If the user confirms not to switch, the prompt message can be ignored, thus maintaining the target operating mode if no user confirmation is received.
[0079] like Figure 5 As shown, after switching the operating mode to high-speed mode based on the application's running status, and if the IO load is less than the third threshold within a preset time, the system can display a power consumption warning (i.e., a prompt message) on the desktop. This power consumption warning includes detailed prompt information, as well as ignore and details options. If the user confirms to maintain the current high-speed mode, they can click the ignore option. After receiving the ignore information, the system can maintain the current high-speed mode. If the user wants to view the details, they can click the details option, and the system will display the detailed information. If the user confirms to switch modes based on the details information, they can click the "Switch to low-speed mode" option in the details. After receiving the user's confirmation, the system will switch the current high-speed mode to low-speed mode. If the user confirms to maintain the high-speed mode based on the details information, they can click the ignore option. After receiving the ignore information, the system can maintain the current high-speed mode.
[0080] Optionally, as an example, the third threshold can be determined based on the adjustment threshold corresponding to the target working mode. For example, if the threshold corresponding to IO load is A when switching from other working modes to the target working mode, and the threshold corresponding to IO load is B when switching from the target working mode to other working modes, then the third threshold can be set to a value between A and B. This avoids the problem of accidentally switching the target working mode to other working modes under IO load fluctuations, which could lead to the inability to meet the user's personalized usage needs for the specified application.
[0081] Taking the PCIe link's working modes as high-speed mode and low-speed mode, with high-speed mode as the target working mode, when switching from low-speed mode to high-speed mode based on IO load, the threshold corresponding to IO load is 70%, and when switching from high-speed mode to low-speed mode based on IO load, the threshold corresponding to IO load is 30%. Therefore, the third threshold can be set to 50%.
[0082] In one possible implementation, where the PCIe link operates in both high-speed and low-speed modes, the target operating mode is high-speed mode, and the threshold corresponding to the IO load when switching from high-speed mode to low-speed mode is different from the threshold corresponding to the IO load when switching from low-speed mode to high-speed mode, and the warning threshold (i.e., the third threshold) is between these two thresholds, the logic for issuing a warning for the target operating mode (i.e., high-speed mode) can be as follows: Figure 6 As shown. Figure 6 The illustrated embodiment includes the following steps:
[0083] Step 201: The user adds a specific application to the application list.
[0084] Step 202: If the application list is not empty, activate the early warning mechanism.
[0085] Step 203: Determine if any of the applications in the list are running. If at least one application is running, proceed to step 204; otherwise, proceed to step 212.
[0086] Step 204: Determine whether the current system has activated the early warning mechanism. If activated, proceed to step 205; otherwise, proceed to step 212.
[0087] Step 205: Determine whether the current link is already in high-speed mode. If yes, proceed to step 207; otherwise, proceed to step 206.
[0088] Step 206: Switch the link to high-speed mode.
[0089] Step 207: Determine whether the price has been below the warning threshold for an extended period based on the warning mechanism. If so, proceed to step 208; otherwise, return to step 202.
[0090] Step 208: Issue a warning to the user.
[0091] Step 209: Determine whether the user chooses to switch to low speed mode. If yes, proceed to step 211; otherwise, proceed to step 210.
[0092] Step 210: If the user chooses to "ignore" the warning prompt, maintain the current high-speed mode and turn off the warning mechanism to avoid repeated reminders.
[0093] Step 211: If the user selects to switch to low speed mode, switch the high speed mode to low speed mode.
[0094] Step 212: After switching to low-speed mode, switch links according to IO load.
[0095] Step 213: Loop through the application list to check if any new applications are launched. If not, continue to maintain the current rate switching mode; otherwise, return to step 202 and start a new round of warning mechanisms.
[0096] Figure 6 The illustrated embodiment allows users to specify which applications should run in high-speed mode via an application list, satisfying user customization needs and improving user experience. Since the IO load threshold is fixed, the system may not switch to the highest speed when lag occurs. Therefore, based on the application list, users can add applications prone to lag to the list, thus compensating for the shortcomings of the default IO load threshold to some extent, further improving system performance and user experience. Providing an early warning mechanism can prevent users from adding lightly loaded applications to the application list, causing the system to run in high-speed mode for extended periods and resulting in unnecessary power consumption, thereby improving system battery life.
[0097] In this embodiment, multiple operating modes can be set for the dual-channel PCIe links. Different operating modes correspond to different link speeds, and different link speeds correspond to different system power consumption. During device operation, the system's I / O load can be acquired, and the operating mode of the PCIe links can be switched based on the I / O load and / or the application's running status, thereby adjusting the system power consumption. Thus, because the PCIe operating mode can be switched according to the system's I / O load and / or the application's running status, thereby adjusting system power consumption, a better balance can be achieved between the data transfer performance of the storage module and system power consumption, avoiding excessive system power consumption and improving the user experience.
[0098] The power management method provided in this application can be executed by a power management device. This application uses the example of a power management device executing the power management method to illustrate the power management device provided in this application.
[0099] Figure 7 This is a schematic structural diagram of a power management device according to an embodiment of this application. This device may correspond to a terminal or electronic device in other embodiments. Figure 7 As shown, the device 700 includes the following modules.
[0100] Module 701 is used to obtain the system's I / O load;
[0101] The link switching module 702 is used to switch the working mode of the PCIe link according to the IO load; and / or, to switch the working mode of the PCIe link according to the running status of the application.
[0102] Different operating modes correspond to different link rates, and different link rates correspond to different system power consumption.
[0103] Optionally, as an embodiment, the link switching module 702 is further configured to:
[0104] If the IO load is greater than or equal to a first threshold, the current operating mode is switched to the first mode; the link rate of the first mode is greater than the link rate of the current operating mode.
[0105] If the IO load is less than or equal to the second threshold, the current operating mode is switched to the second mode; the link rate of the second mode is less than the link rate of the current operating mode.
[0106] Wherein, the first threshold is greater than or equal to the second threshold.
[0107] Optionally, as an embodiment, the link switching module 702 is further configured to:
[0108] If the running status of an application changes and the number of applications running in the preset application list is greater than zero, the current working mode will be switched to the target working mode.
[0109] The preset application list includes at least one application, which corresponds to the target working mode of the PCIe link.
[0110] Optionally, as an embodiment, the link switching module 702 is further configured to:
[0111] If the number of applications running in the preset application list is greater than zero, the current working mode will be switched to the target working mode.
[0112] When the number of applications running in the preset application list is zero, the operating mode of the PCIe link is switched according to the IO load.
[0113] Optionally, as an embodiment, the link switching module 702 is further configured to:
[0114] If the IO load is less than a third threshold within a preset time period, a prompt message is displayed to prompt the user whether to switch the target working mode.
[0115] Upon receiving confirmation of the switchover, the target operating mode is switched to the third mode, wherein the link rate of the third mode is lower than the link rate of the target operating mode.
[0116] If the confirmation switching information is not received, the target working mode remains unchanged.
[0117] Optionally, as an embodiment, the acquisition module 701 is further configured to:
[0118] Obtain the duration of the system being in a busy state within a set period;
[0119] The ratio between the duration of the system being busy and the total duration of the set period is determined as the IO load.
[0120] The apparatus 700 according to an embodiment of this application can be referred to the corresponding embodiment of this application. Figure 1 The method flow shown is as follows, and the various units / modules in the device 700 and the other operations and / or functions described above are respectively designed to implement... Figure 1 The corresponding processes in the methods shown are identical or equivalent in achieving the same technical effects, and for the sake of brevity, they will not be elaborated upon here.
[0121] The power management 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 device.
[0122] The power management 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.
[0123] The power management device provided in this application embodiment can achieve... Figures 1 to 6 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0124] Optionally, such as Figure 8 As shown, this application embodiment also provides an electronic device 800, including a processor 801 and a memory 802. The memory 802 stores a program or instructions that can run on the processor 801. When the program or instructions are executed by the processor 801, they implement the various steps of the above-described power management method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0125] 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.
[0126] Figure 9 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0127] The electronic device 900 includes, but is not limited to, components such as: radio frequency unit 901, network module 902, audio output unit 903, input unit 904, sensor 905, display unit 906, user input unit 907, interface unit 908, memory 909, and processor 910.
[0128] Those skilled in the art will understand that the electronic device 900 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 910 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 9 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.
[0129] The processor 910 is used to acquire the system's I / O load; switch the operating mode of the PCIe link according to the I / O load; and / or switch the operating mode of the PCIe link according to the running status of the application; wherein different operating modes correspond to different link speeds, and different link speeds correspond to different system power consumption.
[0130] In this embodiment, multiple operating modes can be set for the dual-channel PCIe links. Different operating modes correspond to different link speeds, and different link speeds correspond to different system power consumption. During device operation, the system's I / O load can be acquired, and the operating mode of the PCIe links can be switched based on the I / O load and / or the application's running status, thereby adjusting the system power consumption. Thus, because the PCIe operating mode can be switched according to the system's I / O load and / or the application's running status, thereby adjusting system power consumption, a better balance can be achieved between the data transfer performance of the storage module and system power consumption, avoiding excessive system power consumption and improving the user experience.
[0131] Optionally, the processor 910 is further configured to switch the current operating mode to a first mode when the IO load is greater than or equal to a first threshold; the link rate of the first mode is greater than the link rate of the current operating mode.
[0132] If the IO load is less than or equal to the second threshold, the current operating mode is switched to the second mode; the link rate of the second mode is less than the link rate of the current operating mode.
[0133] Wherein, the first threshold is greater than or equal to the second threshold.
[0134] Optionally, the processor 910 is also configured to switch the current working mode to the target working mode when the running state of an application changes and the number of applications running in the preset application list is greater than zero.
[0135] The preset application list includes at least one application, which corresponds to the target working mode of the PCIe link.
[0136] Optionally, the processor 910 is further configured to switch the current working mode to the target working mode when the number of applications running in the preset application list is greater than zero.
[0137] When the number of applications running in the preset application list is zero, the operating mode of the PCIe link is switched according to the IO load.
[0138] Optionally, the processor 910 is further configured to display a prompt message when the IO load is less than a third threshold within a preset time period, the prompt message being used to prompt the user whether to switch the target working mode;
[0139] Upon receiving confirmation of the switchover, the target operating mode is switched to the third mode, wherein the link rate of the third mode is lower than the link rate of the target operating mode.
[0140] If the confirmation switching information is not received, the target working mode remains unchanged.
[0141] Optionally, the processor 910 is also configured to obtain the duration of the system being in a busy state within a set period;
[0142] The ratio between the duration of the system being busy and the total duration of the set period is determined as the IO load.
[0143] It should be understood that, in this embodiment, the input unit 904 may include a graphics processing unit (GPU) 9041 and a microphone 9042. The GPU 9041 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 906 may include a display panel 9061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 907 includes at least one of a touch panel 9071 and other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include a touch detection device and a touch controller. Other input devices 9072 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.
[0144] The memory 909 can be used to store software programs and various data. The memory 909 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 909 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 909 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0145] Processor 910 may include one or more processing units; optionally, processor 910 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 910.
[0146] 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 management method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0147] 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.
[0148] 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 management method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0149] 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.
[0150] 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 management method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0151] 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.
[0152] 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.
[0153] 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 consumption management method, characterized by, The method comprises: acquiring an IO load of a system; switching a working mode of a PCIE link according to the IO load; and / or switching the working mode of the PCIE link according to a running state of an application program; wherein different working modes correspond to different link rates, and different link rates correspond to different system power consumptions; the switching of the working mode of the PCIE link according to the IO load and the switching of the working mode of the PCIE link according to the running state of the application program comprises: in a case where a number of application programs running in a preset application list is greater than zero, switching a current working mode to a target working mode; in a case where the number of application programs running in the preset application list is equal to zero, switching the working mode of the PCIE link according to the IO load; wherein the preset application list comprises at least one application program, and the at least one application program corresponds to the target working mode of the PCIE link.
2. The method of claim 1, wherein, the switching of the working mode of the PCIE link according to the IO load comprises: in a case where the IO load is greater than or equal to a first threshold value, switching a current working mode to a first mode; the link rate of the first mode is greater than the link rate of the current working mode; in a case where the IO load is less than or equal to a second threshold value, switching the current working mode to a second mode; the link rate of the second mode is less than the link rate of the current working mode; wherein the first threshold value is greater than or equal to the second threshold value.
3. The method of claim 1, wherein, the switching of the working mode of the PCIE link according to the running state of the application program comprises: in a case where the running state of the application program changes and a number of application programs running in a preset application list is greater than zero, switching a current working mode to a target working mode.
4. The method of claim 3, wherein, after the current working mode is switched to the target working mode, the method further comprises: in a case where the IO load is less than a third threshold value within a preset time length, displaying prompt information, the prompt information being used to prompt a user whether to switch the target working mode; in a case where confirmation switching information is received, switching the target working mode to a third mode, the link rate of the third mode being less than the link rate of the target working mode; in a case where the confirmation switching information is not received, keeping the target working mode unchanged.
5. The method of claim 1, wherein, the acquisition of the IO load of the system comprises: acquiring a time length during which the system is in a busy state within a set period; determining a proportion between the time length during which the system is in the busy state and a total time length of the set period as the IO load.
6. A power consumption management apparatus characterized by comprising: The method comprises: an acquisition module, configured to acquire an IO load of a system; a link switching module, configured to switch a working mode of a PCIE link according to the IO load; and / or to switch the working mode of the PCIE link according to a running state of an application program; wherein different working modes correspond to different link rates, and different link rates correspond to different system power consumptions; the link switching module is further configured to: In a case where the number of application programs running in the preset application list is greater than zero, the current working mode is switched to the target working mode; In a case where the number of application programs running in the preset application list is equal to zero, the working mode of the PCIE link is switched according to the IO load; The preset application list includes at least one application program, and the at least one application program corresponds to the target working mode of the PCIE link.
7. The apparatus of claim 6, wherein, The link switching module is further configured to: In a case where the IO load is greater than or equal to a first threshold, the current working mode is switched to a first mode; the link rate of the first mode is greater than the link rate of the current working mode; In a case where the IO load is less than or equal to a second threshold, the current working mode is switched to a second mode; the link rate of the second mode is less than the link rate of the current working mode; The first threshold is greater than or equal to the second threshold.
8. The apparatus of claim 6, wherein, The link switching module is further configured to: In a case where the running state of the application program changes and the number of application programs running in the preset application list is greater than zero, the current working mode is switched to the target working mode.
9. The apparatus of claim 8, wherein, The link switching module is further configured to: In a case where the IO load is less than a third threshold within a preset time length, a prompt information is displayed, and the prompt information is used to prompt a user whether to switch the target working mode; In a case where the confirmation switching information is received, the target working mode is switched to a third mode, and the link rate of the third mode is less than the link rate of the target working mode; In a case where the confirmation switching information is not received, the target working mode is kept unchanged.
10. The apparatus of claim 6, wherein, The acquisition module is further configured to: Acquire the time length during which the system is in a busy state within a set period; Determine the proportion between the time length during which the system is in the busy state and the total time length of the set period as the IO load.
Citation Information
Patent Citations
Power consumption control method and apparatus for terminal device
CN105867580A
PCI Express link rate management system and PCI Express link rate management method
CN110430601A