Movatterモバイル変換


[0]ホーム

URL:


CN117130462B - Device control method and electronic device - Google Patents

Device control method and electronic device
Download PDF

Info

Publication number
CN117130462B
CN117130462BCN202310304793.5ACN202310304793ACN117130462BCN 117130462 BCN117130462 BCN 117130462BCN 202310304793 ACN202310304793 ACN 202310304793ACN 117130462 BCN117130462 BCN 117130462B
Authority
CN
China
Prior art keywords
performance parameter
mode
performance
electronic device
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310304793.5A
Other languages
Chinese (zh)
Other versions
CN117130462A (en
Inventor
王浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co LtdfiledCriticalHonor Device Co Ltd
Priority to CN202310304793.5ApriorityCriticalpatent/CN117130462B/en
Priority to CN202410925739.7Aprioritypatent/CN118963530A/en
Publication of CN117130462ApublicationCriticalpatent/CN117130462A/en
Application grantedgrantedCritical
Publication of CN117130462BpublicationCriticalpatent/CN117130462B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The application provides a device control method and electronic equipment, and relates to the technical field of computers. The scheme improves the compatibility between the performance and the energy consumption of the electronic equipment. The specific scheme is as follows: operating according to a first performance parameter corresponding to the first mode, wherein the parameter type of the first performance parameter comprises one or more of central processor power, overall power consumption of a graphics system, the number of enabled central processor cores, a main frequency of the central processor and a main frequency of the graphics processor; under the first condition, the operation is sequentially and alternately performed according to a second performance parameter corresponding to a second mode and the first performance parameter; the second performance parameter is the same as the first performance parameter in type, and the value of the second performance parameter is larger than that of the first performance parameter; wherein the first condition comprises one or more of the following: enabling a first application; an indication by the user to enable the second mode is detected.

Description

Translated fromChinese
一种设备控制方法及电子设备Device control method and electronic device

技术领域Technical Field

本申请涉及计算机技术领域,尤其涉及一种设备控制方法及电子设备。The present application relates to the field of computer technology, and in particular to a device control method and an electronic device.

背景技术Background technique

电子设备发展至今,性能和能耗已依然是设备迭代改进的方向,也是用户较为关注的重要指标。With the development of electronic devices, performance and energy consumption have remained the direction of device iteration and improvement, and are also important indicators that users pay more attention to.

通常电子设备启用高性能模式时,例如,启用中央处理器(central processingunit,CPU)内核数量多、CPU主频率较高、CPU功率高、图像处理器(graphics processingunit,GPU)的主频率较高、GPU功率高的情况下,电子设备实时的功耗也会较高。可以理解地,功耗越高,整机能耗也就越高。也就是说,目前,电子设备的性能和能耗很难同时达到最优。这样,在设备电量有限的情况下,电子设备要么不能启用高性能模式,要么启用高性能模式之后设备续航明显缩短。Usually, when an electronic device enables high-performance mode, for example, when a large number of central processing unit (CPU) cores, a high CPU main frequency, a high CPU power, a high graphics processing unit (GPU) main frequency, and a high GPU power are enabled, the real-time power consumption of the electronic device will also be higher. Understandably, the higher the power consumption, the higher the energy consumption of the entire device. In other words, at present, it is difficult for electronic devices to achieve optimal performance and energy consumption at the same time. In this way, when the device has limited power, the electronic device either cannot enable high-performance mode, or the device's battery life is significantly shortened after enabling high-performance mode.

发明内容Summary of the invention

本申请提供一种设备控制方法及电子设备,在设备电量有限的情况下,用于兼顾高性能和续航。The present application provides a device control method and an electronic device, which are used to balance high performance and battery life when the power of the device is limited.

为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

第一方面,本申请实施例提供的一种设备控制方法,应用于电子设备,所述方法包括:按照第一模式对应的第一性能参数运行,第一性能参数的参数类型包括中央处理器功率、图形系统整体功耗、启用的中央处理器内核数量、中央处理器主频率和图形处理器主频率中的一项或多项;在第一条件下,依次交替按照第二模式对应的第二性能参数和所述第一性能参数运行;所述第二性能参数和所述第一性能参数的参数类型相同,所述第二性能参数的取值大于所述第一性能参数的取值;其中,所述第一条件包括以下一项或多项条件:启用第一应用;检测到用户指示启用第二模式的操作。In a first aspect, an embodiment of the present application provides a device control method, which is applied to an electronic device, and the method includes: operating according to a first performance parameter corresponding to a first mode, the parameter type of the first performance parameter including one or more of the central processing unit power, the overall power consumption of the graphics system, the number of enabled central processing unit cores, the central processing unit main frequency and the graphics processing unit main frequency; under a first condition, operating alternately according to a second performance parameter corresponding to a second mode and the first performance parameter; the second performance parameter and the first performance parameter have the same parameter type, and the value of the second performance parameter is greater than the value of the first performance parameter; wherein the first condition includes one or more of the following conditions: enabling a first application; detecting a user instruction to enable the second mode.

示例性地,上述第一应用可以是对设备性能表现要求较高的程序数据。例如,游戏应用、大型仿真应用、设计类应用、开发类应用等。上述第一应用可以是对设备性能表现要求较高,可以体现在第一应用在运行期间,所需占用的系统资源满足预设条件,所述系统资源包括中央处理器资源和图形处理器资源,所述预设条件包括所需启用的中央处理器内核数量大于预设数量、所需启用的中央处理器主频率大于第一频率和所需启用的图形处理器主频率大于第二频率中的一项或多项。Exemplarily, the first application may be program data that has high requirements for device performance. For example, game applications, large-scale simulation applications, design applications, development applications, etc. The first application may have high requirements for device performance, which can be reflected in that during the operation of the first application, the system resources required to be occupied meet preset conditions, the system resources include central processing unit resources and graphics processing unit resources, and the preset conditions include one or more of the number of central processing unit cores required to be enabled being greater than a preset number, the main frequency of the central processing unit required to be enabled being greater than a first frequency, and the main frequency of the graphics processing unit required to be enabled being greater than a second frequency.

又示例性地,上述第一应用还可以是在某些特定运行阶段对于设备性能表现要求较高的程序数据。比如,需要解析或打开较大体积的文件的办公类应用等。As another example, the first application may also be program data that has high requirements for device performance in certain specific operation stages, such as office applications that need to parse or open files of larger volumes.

另外,以第一性能参数是CPU功率为例,在按照第一性能参数运行时,采用CPU功率不超过第一性能参数作为约束条件,调用电子设备的各类系统资源,释放出电子设备运行所需的性能。也就是,按照第一性能参数运行期间,电子设备的最大CPU功率等于第一性能参数。In addition, taking the CPU power as the first performance parameter as an example, when operating according to the first performance parameter, the CPU power does not exceed the first performance parameter as a constraint condition, calling various system resources of the electronic device to release the performance required for the operation of the electronic device. That is, during the operation according to the first performance parameter, the maximum CPU power of the electronic device is equal to the first performance parameter.

以第二性能参数是CPU功率为例,在按照第二性能参数运行时,采用CPU功率不超过第二性能参数作为约束条件,调用电子设备的各类系统资源,释放出电子设备运行所需的性能。也就是,按照第二性能参数运行期间,电子设备的最大CPU功率等于第二性能参数。Taking the CPU power as an example, when the second performance parameter is operated according to the second performance parameter, the CPU power does not exceed the second performance parameter as a constraint condition, and various system resources of the electronic device are called to release the performance required for the operation of the electronic device. That is, during the operation according to the second performance parameter, the maximum CPU power of the electronic device is equal to the second performance parameter.

电子设备按照第二性能参数运行,可称为启用第二模式。电子设备按照第一性能参数运行可称为启用第一模式。电子设备启用第二模式时表现出的设备性能,相比于启用第一模式表现出的设备性能更高。同时,启用第一模式时产生的能耗,相比于启用第二模式的能耗更低。The operation of the electronic device according to the second performance parameter may be referred to as enabling the second mode. The operation of the electronic device according to the first performance parameter may be referred to as enabling the first mode. The device performance exhibited by the electronic device when the second mode is enabled is higher than the device performance exhibited when the first mode is enabled. At the same time, the energy consumption generated when the first mode is enabled is lower than the energy consumption when the second mode is enabled.

在上述实施例中,根据第一应用确定需要启用第二模式,或者,根据用户主动指示确定需要启用第二模式,电子设备都可以依次交替启用第二模式和一模式。这样,相较于只启用第一模式,交替启用第二模式和第一模式期间,能表现出更高的性能,满足当前用户对设备的性能需求。相较于只启用第二模式,交替启用第二模式和第一模式期间,产生的能耗更低。在一些实施例中,在依次交替按照第二模式对应的第一性能参数和所述第一性能参数运行之前,所述方法还包括:确定所述电子设备未连接外置电源。In the above embodiment, according to the first application, it is determined that the second mode needs to be enabled, or according to the user's active indication, it is determined that the second mode needs to be enabled, and the electronic device can alternately enable the second mode and the first mode in sequence. In this way, compared with enabling only the first mode, during the period of alternatingly enabling the second mode and the first mode, higher performance can be exhibited to meet the current user's performance requirements for the device. Compared with enabling only the second mode, during the period of alternatingly enabling the second mode and the first mode, lower energy consumption is generated. In some embodiments, before operating alternately according to the first performance parameter corresponding to the second mode and the first performance parameter in sequence, the method also includes: determining that the electronic device is not connected to an external power supply.

在上述实施例中,在未接外置电源的情况下,电子设备的电量有限。在电量有限的场景下,电子设备通过交替启用第一模式和第二模式,在满足性能需求的同时,还可以增加设备续航。In the above embodiment, when the external power supply is not connected, the power of the electronic device is limited. In the scenario of limited power, the electronic device can increase the battery life of the device while meeting the performance requirements by alternately enabling the first mode and the second mode.

在一些实施例中,在结束交替按照所述第二性能参数和所述第一性能参数运行之后,在所述电子设备再次按照所述第一性能参数运行的情况下,所述方法还包括:在所述第一条件下,确定所述电子设备连接所述外置电源;按照所述第二模式对应的第二性能参数运行。In some embodiments, after completing alternating operation according to the second performance parameters and the first performance parameters, when the electronic device operates according to the first performance parameters again, the method further includes: under the first condition, determining that the electronic device is connected to the external power supply; and operating according to the second performance parameters corresponding to the second mode.

其中,电子设备可以在以下至少一种场景中,结束交替启用第一模式和第二模式:The electronic device may end the alternate activation of the first mode and the second mode in at least one of the following scenarios:

(1)心跳控制策略的止时间点,触发结束。比如,第一模式和第二模式之间的交替次数已达到心跳控制策略中指示的次数。再比如,心跳控制策略的启用时间已达到预配置的最长时间。再比如,所运行的特定程序停止运行的时间点。再比如,特定的使用场景已不存在的时间点。(1) The end time of the heartbeat control policy, the trigger ends. For example, the number of alternations between the first mode and the second mode has reached the number indicated in the heartbeat control policy. Another example is that the activation time of the heartbeat control policy has reached the pre-configured maximum time. Another example is the time point when the running specific program stops running. Another example is the time point when a specific usage scenario no longer exists.

(2)连接上外置电源。(2) Connect an external power supply.

(3)接收到用户指示关闭交替启用第一模式和第二模式的操作。(3) A user instruction is received to turn off the operation of alternately enabling the first mode and the second mode.

在上述实施例中,在停止交替启用第一模式和第二模式,且电子设备决定继续采用第一模式运行之后,同样是在第一条件下,如果检测到电子设备连接上外置电源,那么直接启用第二模式,优先满足性能需求。In the above embodiment, after the alternating activation of the first mode and the second mode is stopped and the electronic device decides to continue to operate in the first mode, also under the first condition, if it is detected that the electronic device is connected to an external power supply, the second mode is directly enabled to give priority to meeting performance requirements.

在一些实施例中,所述第一条件为启用所述第一应用的情况下,在所述依次交替按照第二模式对应的第一性能参数和所述第一性能参数运行之前,所述方法还包括:检测到第一事件;其中,在所述第一应用为文档编辑应用的情况下,所述第一事件为打开第一类文件,所述第一类文件是体积大于预设值的文件;在所述第一应用为仿真应用的情况下,所述第一事件为接收到启动仿真的操作。In some embodiments, when the first condition is enabling the first application, before the first performance parameters and the first performance parameters corresponding to the second mode are run alternately in sequence, the method further includes: detecting a first event; wherein, when the first application is a document editing application, the first event is opening a first type of file, and the first type of file is a file whose volume is greater than a preset value; when the first application is a simulation application, the first event is receiving an operation to start the simulation.

在一些实施例中,在启用不同的所述第一应用时,交替按照所述第二性能参数和所述第一性能参数运行的方式,包括以下至少一项不同:按照所述第一性能参数运行的时间长度不同;按照所述第二性能参数运行的时间长度不同;对应的交替次数不同。In some embodiments, when different first applications are enabled, the manner of alternating between running according to the second performance parameters and the first performance parameters includes at least one of the following differences: different lengths of time for running according to the first performance parameters; different lengths of time for running according to the second performance parameters; and different corresponding numbers of alternations.

在上述实施例中,面对不同的第一应用,交替切换第二模式和第一模式的方式也会存在差异,这样,可以提升性能表现与第一应用之间的适配性。In the above embodiment, in response to different first applications, the manner of alternately switching between the second mode and the first mode may also be different, so that the performance and the adaptability to the first application can be improved.

在一些实施例中,在所述电子设备的剩余电量不同时,交替按照所述第二性能参数和所述第一性能参数运行的方式,包括以下至少一项不同:按照所述第一性能参数运行的时间长度不同;按照所述第二性能参数运行的时间长度不同。In some embodiments, when the remaining power of the electronic device is different, the manner of alternating operation according to the second performance parameter and the first performance parameter includes at least one of the following differences: a different length of time of operation according to the first performance parameter; a different length of time of operation according to the second performance parameter.

在上述实施例中,电子设备在不同剩余电量下,交替切换第二模式和第一模式的方式也会存在差异,这样,能够最大化利用剩余电量,协调设备续航和表现出的性能。In the above embodiment, the electronic device may alternately switch between the second mode and the first mode in different ways under different remaining power levels, so that the remaining power can be maximized and the battery life and performance of the device can be coordinated.

在一些实施例中,在交替按照所述第二性能参数和所述第一性能参数运行的期间,所述方法还包括:在按照所述第二性能参数运行的情况下,将所述电子设备的散热风扇的转速由第一转速提升到第二转速;在按照所述第一性能参数运行的情况下,将所述散热风扇的转速恢复到所述第一转速。In some embodiments, while alternating between operating according to the second performance parameter and the first performance parameter, the method further includes: when operating according to the second performance parameter, increasing the speed of the cooling fan of the electronic device from a first speed to a second speed; and when operating according to the first performance parameter, restoring the speed of the cooling fan to the first speed.

在一些实施例中,在依次交替按照第二模式对应的第二性能参数和所述第一性能参数运行之后,所述方法还包括:检测到与所述外置电源连接;按照所述第二模式对应的第二性能参数运行;在第二条件下,在第一时段内按照第三性能参数运行,所述第三性能参数和所述第一性能参数的参数类型相同,所述第三性能参数的取值大于所述第一性能参数的取值,且小于所述第二性能参数的取值;所述第二条件包括检测到所述电子设备与所述外置电源断开连接,且所述第一应用正在运行;在所述第一时段之后的第二时段内,按照所述第四性能参数运行,所述第四性能参数和所述第一性能参数的参数类型相同,所述第四性能参数的取值大于所述第一性能参数的取值,且小于所述第三性能参数的取值;在检测到所述电子设备再次与所述外置电源连接的情况下,继续按照所述第二模式对应的第二性能参数运行。In some embodiments, after operating alternately according to the second performance parameters corresponding to the second mode and the first performance parameters, the method also includes: detecting connection with the external power supply; operating according to the second performance parameters corresponding to the second mode; under a second condition, operating according to third performance parameters within a first time period, the third performance parameter and the first performance parameter have the same parameter type, the value of the third performance parameter is greater than the value of the first performance parameter, and less than the value of the second performance parameter; the second condition includes detecting that the electronic device is disconnected from the external power supply and the first application is running; within a second time period after the first time period, operating according to the fourth performance parameter, the fourth performance parameter and the first performance parameter have the same parameter type, the value of the fourth performance parameter is greater than the value of the first performance parameter, and less than the value of the third performance parameter; when it is detected that the electronic device is connected to the external power supply again, continue to operate according to the second performance parameters corresponding to the second mode.

在上述实施例中,以第三性能参数是CPU功率为例,在按照第三性能参数运行时,采用CPU功率不超过第三性能参数作为约束条件,调用电子设备的各类系统资源,释放出电子设备运行所需的性能。也就是,按照第三性能参数运行期间,电子设备的最大CPU功率等于第三性能参数。In the above embodiment, taking the third performance parameter as CPU power as an example, when operating according to the third performance parameter, the CPU power does not exceed the third performance parameter as a constraint condition, calling various system resources of the electronic device, and releasing the performance required for the operation of the electronic device. That is, during the operation according to the third performance parameter, the maximum CPU power of the electronic device is equal to the third performance parameter.

以第四性能参数是CPU功率为例,在按照第四性能参数运行时,采用CPU功率不超过第四性能参数作为约束条件,调用电子设备的各类系统资源,释放出电子设备运行所需的性能。也就是,按照第四性能参数运行期间,电子设备的最大CPU功率等于第四性能参数。Taking the fourth performance parameter as CPU power as an example, when operating according to the fourth performance parameter, the CPU power does not exceed the fourth performance parameter as a constraint condition, calling various system resources of the electronic device to release the performance required for the operation of the electronic device. That is, during the operation according to the fourth performance parameter, the maximum CPU power of the electronic device is equal to the fourth performance parameter.

在一些实施例中,在所述电子设备的剩余电量不同的情况下,对应的所述第一时段的时间长度不同,对应的所述第二时段的时间长度也不同。In some embodiments, when the remaining power of the electronic device is different, the corresponding time length of the first time period is different, and the corresponding time length of the second time period is also different.

第二方面,本申请实施例提供的一种设备控制方法,应用于电子设备,所述方法包括:在所述电子设备与所述外置电源连接之后,按照所述第二模式对应的第二性能参数运行;第二性能参数的参数类型包括中央处理器功率、图形系统整体功耗、启用的中央处理器内核数量、中央处理器主频率和图形处理器主频率中的一项或多项;在第二条件下,在第一时段内按照第三性能参数运行,所述第三性能参数和所述第二性能参数的参数类型相同,所述第三性能参数的取值小于所述第二性能参数的取值,且大于第一模式对应的第一性能参数的取值,所述第一性能参数与所述第二性能参数的参数类型相同;所述第二条件包括检测到所述电子设备与所述外置电源断开连接,且所述电子设备包含正在运行的应用程序;在所述第一时段之后,按照所述第一模式对应的第一性能参数运行。In a second aspect, an embodiment of the present application provides a device control method, which is applied to an electronic device, and the method includes: after the electronic device is connected to the external power supply, operating according to the second performance parameter corresponding to the second mode; the parameter type of the second performance parameter includes one or more of the central processing unit power, the overall power consumption of the graphics system, the number of enabled central processing unit cores, the central processing unit main frequency and the graphics processor main frequency; under a second condition, operating according to a third performance parameter within a first time period, the parameter type of the third performance parameter and the second performance parameter are the same, the value of the third performance parameter is less than the value of the second performance parameter, and is greater than the value of the first performance parameter corresponding to the first mode, and the parameter type of the first performance parameter and the second performance parameter are the same; the second condition includes detecting that the electronic device is disconnected from the external power supply and that the electronic device contains a running application; after the first time period, operating according to the first performance parameter corresponding to the first mode.

在上述实施例中,电子设备从按照第二性能参数运行至按照第一性能参数运行之间,可以利用第三性能参数进行过渡,避免设备性能下降过快,影响用户的使用体验。In the above embodiment, the electronic device can use the third performance parameter to transition from operating according to the second performance parameter to operating according to the first performance parameter, so as to avoid the device performance from degrading too quickly and affecting the user's experience.

在一些实施例中,电子设备可以是响应于事件“连接上所述外置电源连接”,按照所述第二模式对应的第二性能参数运行。In some embodiments, the electronic device may operate according to the second performance parameters corresponding to the second mode in response to the event “connecting the external power supply”.

在另一些实施例中,也可以是在电子设备与所述外置电源连接之后,响应于用户指示启动第二模式的操作,按照所述第二模式对应的第二性能参数运行。In other embodiments, after the electronic device is connected to the external power supply, the second mode of operation may be initiated in response to a user instruction, and the device may operate according to the second performance parameters corresponding to the second mode.

在一些实施例中,在所述第二条件中,所述正在运行的应用程序是第一应用,其中,所述第一应用在运行期间,所需的系统资源量满足预设条件,所述系统资源包括中央处理器资源和图形处理器资源,所述预设条件包括所需启用的中央处理器内核数量大于预设数量、所需启用的中央处理器主频率大于第一频率和所需启用的图形处理器主频率大于第二频率中的一项或多项。In some embodiments, in the second condition, the running application is a first application, wherein during the operation of the first application, the amount of system resources required meets a preset condition, the system resources include central processing unit resources and graphics processing unit resources, and the preset condition includes one or more of the number of central processing unit cores required to be enabled being greater than a preset number, the main frequency of the central processing unit required to be enabled being greater than a first frequency, and the main frequency of the graphics processing unit required to be enabled being greater than a second frequency.

在一些实施例中,在按照所述第一模式对应的第一性能参数运行之前,所述方法还包括:在所述第一时段之后的第二时段内,按照所述第四性能参数运行,所述第四性能参数和所述第一性能参数的参数类型相同,所述第四性能参数的取值大于所述第一性能参数的取值,且小于所述第三性能参数的取值。In some embodiments, before operating according to the first performance parameter corresponding to the first mode, the method also includes: in a second time period after the first time period, operating according to the fourth performance parameter, the fourth performance parameter and the first performance parameter have the same parameter type, and the value of the fourth performance parameter is greater than the value of the first performance parameter and less than the value of the third performance parameter.

在一些实施例中,在所述电子设备的剩余电量不同的情况下,对应的所述第一时段的时间长度不同,对应的所述第二时段的时间长度也不同。In some embodiments, when the remaining power of the electronic device is different, the corresponding time length of the first time period is different, and the corresponding time length of the second time period is also different.

第三方面,本申请实施例提供的一种电子设备,电子设备包括一个或多个处理器和存储器;所述存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,所述一个或多个处理器,用于:按照第一模式对应的第一性能参数运行,第一性能参数的参数类型包括中央处理器功率、图形系统整体功耗、启用的中央处理器内核数量、中央处理器主频率和图形处理器主频率中的一项或多项;在第一条件下,依次交替按照第二模式对应的第二性能参数和所述第一性能参数运行;所述第二性能参数和所述第一性能参数的参数类型相同,所述第二性能参数的取值大于所述第一性能参数的取值;其中,所述第一条件包括以下一项或多项条件:启用第一应用,其中,所述第一应用在运行期间,所需占用的系统资源满足预设条件,所述系统资源包括中央处理器资源和图形处理器资源,所述预设条件包括所需启用的中央处理器内核数量大于预设数量、所需启用的中央处理器主频率大于第一频率和所需启用的图形处理器主频率大于第二频率中的一项或多项;检测到用户指示启用第二模式的操作。In a third aspect, an electronic device provided by an embodiment of the present application includes one or more processors and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when one or more processors execute the computer instructions, the one or more processors are used to: operate according to a first performance parameter corresponding to a first mode, the parameter type of the first performance parameter includes one or more of the central processing unit power, the overall power consumption of the graphics system, the number of enabled central processing unit cores, the main frequency of the central processing unit and the main frequency of the graphics processing unit; under a first condition, operate alternately according to a second performance parameter corresponding to a second mode and the first performance parameter; the second performance parameter and the first performance parameter have the same parameter type, and the value of the second performance parameter is greater than the value of the first performance parameter; wherein the first condition includes one or more of the following conditions: enabling a first application, wherein during the operation of the first application, the system resources required to be occupied meet a preset condition, the system resources include central processing unit resources and graphics processing unit resources, and the preset condition includes one or more of the number of central processing unit cores required to be enabled being greater than a preset number, the main frequency of the central processing unit required to be enabled being greater than a first frequency, and the main frequency of the graphics processing unit required to be enabled being greater than a second frequency; detecting an operation in which a user indicates to enable the second mode.

在一些实施例中,在依次交替按照第二模式对应的第一性能参数和所述第一性能参数运行之前,所述一个或多个处理器,还用于确定所述电子设备未连接外置电源。In some embodiments, before operating alternately according to the first performance parameter corresponding to the second mode and the first performance parameter, the one or more processors are further used to determine that the electronic device is not connected to an external power supply.

在一些实施例中,在结束交替按照所述第二性能参数和所述第一性能参数运行之后,在所述电子设备再次按照所述第一性能参数运行的情况下,所述一个或多个处理器,还用于:在所述第一条件下,确定所述电子设备连接所述外置电源;按照所述第二模式对应的第二性能参数运行。In some embodiments, after completing alternating operation according to the second performance parameters and the first performance parameters, when the electronic device operates according to the first performance parameters again, the one or more processors are further used to: under the first condition, determine that the electronic device is connected to the external power supply; and operate according to the second performance parameters corresponding to the second mode.

在一些实施例中,所述第一条件为启用所述第一应用的情况下,在所述依次交替按照第二模式对应的第一性能参数和所述第一性能参数运行之前,所述一个或多个处理器,还用于:检测到第一事件;其中,在所述第一应用为文档编辑应用的情况下,所述第一事件为打开第一类文件,所述第一类文件是体积大于预设值的文件;在所述第一应用为仿真应用的情况下,所述第一事件为接收到启动仿真的操作。In some embodiments, when the first condition is enabling the first application, before the first performance parameters and the first performance parameters corresponding to the second mode are run alternately in sequence, the one or more processors are also used to: detect a first event; wherein, when the first application is a document editing application, the first event is opening a first type of file, and the first type of file is a file with a volume greater than a preset value; when the first application is a simulation application, the first event is receiving an operation to start the simulation.

在一些实施例中,在启用不同的所述第一应用时,交替按照所述第二性能参数和所述第一性能参数运行的方式,包括以下至少一项不同:按照所述第一性能参数运行的时间长度不同;按照所述第二性能参数运行的时间长度不同;对应的交替次数不同。In some embodiments, when different first applications are enabled, the manner of alternating between running according to the second performance parameters and the first performance parameters includes at least one of the following differences: different lengths of time for running according to the first performance parameters; different lengths of time for running according to the second performance parameters; and different corresponding numbers of alternations.

在一些实施例中,在所述电子设备的剩余电量不同时,交替按照所述第二性能参数和所述第一性能参数运行的方式,包括以下至少一项不同:按照所述第一性能参数运行的时间长度不同;按照所述第二性能参数运行的时间长度不同。In some embodiments, when the remaining power of the electronic device is different, the manner of alternating operation according to the second performance parameter and the first performance parameter includes at least one of the following differences: a different length of time of operation according to the first performance parameter; a different length of time of operation according to the second performance parameter.

在一些实施例中,在交替按照所述第二性能参数和所述第一性能参数运行的期间,所述一个或多个处理器,还用于:在按照所述第二性能参数运行的情况下,将所述电子设备的散热风扇的转速由第一转速提升到第二转速;在按照所述第一性能参数运行的情况下,将所述散热风扇的转速恢复到所述第一转速。In some embodiments, while alternating between operating according to the second performance parameter and the first performance parameter, the one or more processors are further used to: when operating according to the second performance parameter, increase the speed of the cooling fan of the electronic device from a first speed to a second speed; and when operating according to the first performance parameter, restore the speed of the cooling fan to the first speed.

在一些实施例中,在依次交替按照第二模式对应的第二性能参数和所述第一性能参数运行之后,所述一个或多个处理器,还用于:检测到与所述外置电源连接;按照所述第二模式对应的第二性能参数运行;在第二条件下,在第一时段内按照第三性能参数运行,所述第三性能参数和所述第一性能参数的参数类型相同,所述第三性能参数的取值大于所述第一性能参数的取值,且小于所述第二性能参数的取值;所述第二条件包括检测到所述电子设备与所述外置电源断开连接,且所述第一应用正在运行;在所述第一时段之后的第二时段内,按照所述第四性能参数运行,所述第四性能参数和所述第一性能参数的参数类型相同,所述第四性能参数的取值大于所述第一性能参数的取值,且小于所述第三性能参数的取值;在检测到所述电子设备再次与所述外置电源连接的情况下,继续按照所述第二模式对应的第二性能参数运行。In some embodiments, after operating alternately according to the second performance parameters corresponding to the second mode and the first performance parameters, the one or more processors are also used to: detect connection with the external power supply; operate according to the second performance parameters corresponding to the second mode; under a second condition, operate according to a third performance parameter in a first time period, the third performance parameter and the first performance parameter have the same parameter type, the value of the third performance parameter is greater than the value of the first performance parameter, and less than the value of the second performance parameter; the second condition includes detecting that the electronic device is disconnected from the external power supply and the first application is running; in a second time period after the first time period, operate according to the fourth performance parameter, the fourth performance parameter and the first performance parameter have the same parameter type, the value of the fourth performance parameter is greater than the value of the first performance parameter, and less than the value of the third performance parameter; when it is detected that the electronic device is connected to the external power supply again, continue to operate according to the second performance parameter corresponding to the second mode.

在一些实施例中,在所述电子设备的剩余电量不同的情况下,对应的所述第一时段的时间长度不同,对应的所述第二时段的时间长度也不同。In some embodiments, when the remaining power of the electronic device is different, the corresponding time length of the first time period is different, and the corresponding time length of the second time period is also different.

第四方面,本申请实施例提供的一种电子设备,电子设备包括一个或多个处理器和存储器;所述存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,所述一个或多个处理器,用于:在与所述外置电源连接之后,按照所述第二模式对应的第二性能参数运行;第二性能参数的参数类型包括中央处理器功率、图形系统整体功耗、启用的中央处理器内核数量、中央处理器主频率和图形处理器主频率中的一项或多项;在第二条件下,在第一时段内按照第三性能参数运行,所述第三性能参数和所述第二性能参数的参数类型相同,所述第三性能参数的取值小于所述第二性能参数的取值,且大于第一模式对应的第一性能参数的取值,所述第一性能参数与所述第二性能参数的参数类型相同;所述第二条件包括检测到所述电子设备与所述外置电源断开连接,且所述电子设备包含正在运行的应用程序;在所述第一时段之后,按照所述第一模式对应的第一性能参数运行。In a fourth aspect, an embodiment of the present application provides an electronic device, the electronic device comprising one or more processors and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the one or more processors are used to: after being connected to the external power supply, operate according to the second performance parameter corresponding to the second mode; the parameter type of the second performance parameter includes one or more of the central processing unit power, the overall power consumption of the graphics system, the number of enabled central processing unit cores, the central processing unit main frequency and the graphics processor main frequency; under a second condition, operate according to a third performance parameter within a first time period, the parameter type of the third performance parameter and the second performance parameter are the same, the value of the third performance parameter is less than the value of the second performance parameter, and is greater than the value of the first performance parameter corresponding to the first mode, and the parameter type of the first performance parameter and the second performance parameter are the same; the second condition includes detecting that the electronic device is disconnected from the external power supply and the electronic device contains a running application; after the first time period, operate according to the first performance parameter corresponding to the first mode.

在一些实施例中,在所述第二条件中,所述正在运行的应用程序是第一应用,其中,所述第一应用在运行期间,所需的系统资源量满足预设条件,所述系统资源包括中央处理器资源和图形处理器资源,所述预设条件包括所需启用的中央处理器内核数量大于预设数量、所需启用的中央处理器主频率大于第一频率和所需启用的图形处理器主频率大于第二频率中的一项或多项。在一些实施例中,在按照所述第一模式对应的第一性能参数运行之前,所述一个或多个处理器,还用于:在所述第一时段之后的第二时段内,按照所述第四性能参数运行,所述第四性能参数和所述第一性能参数的参数类型相同,所述第四性能参数的取值大于所述第一性能参数的取值,且小于所述第三性能参数的取值。In some embodiments, in the second condition, the running application is a first application, wherein the amount of system resources required by the first application during operation meets a preset condition, the system resources include CPU resources and GPU resources, and the preset condition includes one or more of the number of CPU cores required to be enabled being greater than a preset number, the CPU main frequency required to be enabled being greater than a first frequency, and the GPU main frequency required to be enabled being greater than a second frequency. In some embodiments, before operating according to the first performance parameter corresponding to the first mode, the one or more processors are further configured to: operate according to the fourth performance parameter in a second time period after the first time period, the fourth performance parameter and the first performance parameter are of the same parameter type, the value of the fourth performance parameter is greater than the value of the first performance parameter, and less than the value of the third performance parameter.

在一些实施例中,在依次交替按照第二模式对应的第二性能参数和所述第一性能参数运行之后,所述一个或多个处理器,还用于:检测到与所述外置电源连接;按照所述第二模式对应的第二性能参数运行;在第二条件下,在第一时段内按照第三性能参数运行,所述第三性能参数和所述第一性能参数的参数类型相同,所述第三性能参数的取值大于所述第一性能参数的取值,且小于所述第二性能参数的取值;所述第二条件包括检测到所述电子设备与所述外置电源断开连接,且所述第一应用正在运行;在所述第一时段之后的第二时段内,按照所述第四性能参数运行,所述第四性能参数和所述第一性能参数的参数类型相同,所述第四性能参数的取值大于所述第一性能参数的取值,且小于所述第三性能参数的取值;在检测到所述电子设备再次与所述外置电源连接的情况下,继续按照所述第二模式对应的第二性能参数运行。In some embodiments, after operating alternately according to the second performance parameters corresponding to the second mode and the first performance parameters, the one or more processors are also used to: detect connection with the external power supply; operate according to the second performance parameters corresponding to the second mode; under a second condition, operate according to a third performance parameter in a first time period, the third performance parameter and the first performance parameter have the same parameter type, the value of the third performance parameter is greater than the value of the first performance parameter, and less than the value of the second performance parameter; the second condition includes detecting that the electronic device is disconnected from the external power supply and the first application is running; in a second time period after the first time period, operate according to the fourth performance parameter, the fourth performance parameter and the first performance parameter have the same parameter type, the value of the fourth performance parameter is greater than the value of the first performance parameter, and less than the value of the third performance parameter; when it is detected that the electronic device is connected to the external power supply again, continue to operate according to the second performance parameter corresponding to the second mode.

在一些实施例中,在所述电子设备的剩余电量不同的情况下,对应的所述第一时段的时间长度不同,对应的所述第二时段的时间长度也不同。In some embodiments, when the remaining power of the electronic device is different, the corresponding time length of the first time period is different, and the corresponding time length of the second time period is also different.

第五方面,本申请实施例提供的一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述第一方面及其可能的实施例中的方法。In a fifth aspect, an embodiment of the present application provides a computer storage medium, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method in the above-mentioned first aspect and its possible embodiments.

第六方面,本申请提供一种计算机程序产品,当计算机程序产品在上述电子设备上运行时,使得电子设备执行上述第一方面及其可能的实施例中的方法。In a sixth aspect, the present application provides a computer program product. When the computer program product runs on the above-mentioned electronic device, it enables the electronic device to execute the method in the above-mentioned first aspect and possible embodiments thereof.

可以理解地,上述各个方面所提供的电子设备、计算机存储介质以及计算机程序产品均应用于上文所提供的对应方法,因此,其所能达到的有益效果可参考上文所提供的对应方法中的有益效果,此处不再赘述。It can be understood that the electronic devices, computer storage media and computer program products provided in the above-mentioned aspects are all applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的电子设备的显示界面示例图;FIG1 is an example diagram of a display interface of an electronic device provided in an embodiment of the present application;

图2为本申请实施例提供的手动切换运行模式的示例图;FIG2 is an example diagram of a manual switching operation mode provided in an embodiment of the present application;

图3为本申请实施例提供的电子设备的硬件结构示例图;FIG3 is a diagram showing an example of a hardware structure of an electronic device provided in an embodiment of the present application;

图4为本申请实施例提供的设备控制方法的步骤流程图之一;FIG4 is a flowchart of one of the steps of the device control method provided in an embodiment of the present application;

图5为本申请实施例提供的CPU的功率表现示例图之一;FIG5 is one of the example diagrams of CPU power performance provided in an embodiment of the present application;

图6为本申请实施例提供的设备控制方法的步骤流程图之二;FIG6 is a second flow chart of the steps of the device control method provided in an embodiment of the present application;

图7为本申请实施例提供的GPU的TGP表现示例图之一;FIG. 7 is one of the exemplary diagrams of TGP performance of a GPU provided in an embodiment of the present application;

图8为本申请实施例提供的GPU的TGP表现示例图之二;FIG8 is a second example diagram of TGP performance of a GPU provided in an embodiment of the present application;

图9为本申请实施例提供的设备控制方法的步骤流程图之三;FIG9 is a flowchart of the third step of the device control method provided in an embodiment of the present application;

图10为本申请实施例提供的CPU的功率表现示例图之二;FIG10 is a second example diagram of CPU power performance provided by an embodiment of the present application;

图11为本申请实施例提供的设备控制方法的步骤流程图之四;FIG11 is a fourth step flow chart of the device control method provided in an embodiment of the present application;

图12为本申请实施例提供的电子设备的软硬件示例图。FIG. 12 is a diagram showing an example of software and hardware of an electronic device provided in an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请的描述中,除非另有说明,“至少一个”是指一个或多个,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。The technical scheme in the embodiment of the present application will be described below in conjunction with the accompanying drawings in the embodiment of the present application. Wherein, in the description of the present application, unless otherwise specified, "at least one" refers to one or more, and "a plurality of" refers to two or more than two. In addition, in order to facilitate the clear description of the technical scheme of the embodiment of the present application, in the embodiment of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit necessarily different.

随着技术的发展,性能和能耗已成为用户评估电子设备的两项重要指标。With the development of technology, performance and energy consumption have become two important indicators for users to evaluate electronic devices.

可以理解地,电子设备可以通过升级硬件的方式,提升电子设备的性能上限。比如,配置具有更多内核、更高频率及更高功率的CPU。再比如,配置更高频率及更高功率的GPU、配置更大的存储空间,提升电子设备的性能上限。Understandably, electronic devices can improve their performance ceiling by upgrading their hardware. For example, they can configure a CPU with more cores, higher frequency, and higher power. Another example is configuring a GPU with higher frequency and higher power, or configuring a larger storage space to improve the performance ceiling of electronic devices.

电子设备的性能上限越高,在需要高性能表现的场景下,如,运行游戏程序、仿真程序等占用系统资源量大(含存储资源、计算资源、图形处理资源等)的程序时,电子设备实际可释放出的性能越高。比如,电子设备可以调用更多的CPU内核,运算能力更强,再如,电子设备可以启用更高的CPU主频率,运算速度更快,再比如,电子设备的CPU功率更高,可支持CPU更好的运行,再比如,电子设备可以启用更高的GPU主频率,图形处理速度更快,再比如,电子设备的GPU功率更高,支持GPU更好的运行。也就是,CPU和GPU的工作能力更强。在此场景下,电子设备调度上述系统资源(如,GPU资源和CPU资源),能够向用户提供更优质的服务。The higher the performance ceiling of an electronic device, the higher the performance that the electronic device can actually release in scenarios that require high performance, such as running game programs, simulation programs, and other programs that occupy a large amount of system resources (including storage resources, computing resources, graphics processing resources, etc.). For example, an electronic device can call more CPU cores and have stronger computing power. For another example, an electronic device can enable a higher CPU main frequency and a faster computing speed. For another example, the CPU power of an electronic device is higher, which can support better CPU operation. For another example, an electronic device can enable a higher GPU main frequency and a faster graphics processing speed. For another example, the GPU power of an electronic device is higher, which supports better GPU operation. In other words, the CPU and GPU have stronger working capabilities. In this scenario, electronic devices dispatch the above-mentioned system resources (such as GPU resources and CPU resources) to provide users with better services.

然而,电子设备在释放出高性能的同时,也必然会带来较高能源的损耗。也就是,在相同时段下,电子设备实际释放出的性能和实际产生的能耗,很难都达到最优。但是,电子设备可以在释放最优的性能时,将能耗维持于相对优的水平,也即,性能优先。或者,在保持最优的能耗状态下,释放相对优的性能,也即,能耗优先。再比如,在释放的性能与保持的能耗之间,维持于平衡的状态,也即,性能和能耗均衡。However, while electronic devices release high performance, they will inevitably bring about higher energy loss. That is, in the same period of time, it is difficult for the performance actually released by electronic devices and the actual energy consumption generated to reach the optimal level. However, electronic devices can maintain energy consumption at a relatively optimal level while releasing the optimal performance, that is, performance is prioritized. Or, while maintaining the optimal energy consumption, relatively excellent performance is released, that is, energy consumption is prioritized. For another example, a balanced state is maintained between the released performance and the maintained energy consumption, that is, performance and energy consumption are balanced.

在一些实施例中,电子设备可以配置多个不同的运行模式,如,节能模式、普通模式和高能模式。In some embodiments, the electronic device can be configured with multiple different operating modes, such as a power saving mode, a normal mode, and a high energy mode.

其中,节能模式是能耗优先的运行模式。电子设备运行于节能模式的情况下,电子设备的目标功率的上限为第一功率值。The energy-saving mode is an operation mode that prioritizes energy consumption. When the electronic device operates in the energy-saving mode, the upper limit of the target power of the electronic device is the first power value.

示例性地,上述目标功率可以是电子设备的CPU功率。比如,电子设备不含独立GPU芯片时,上述目标功率可以是该电子设备的CPU功率。又示例性地,目标功率可以是电子设备的GPU功率。例如,电子设备包含独立的GPU芯片时,上述目标功率可以是GPU功率。Exemplarily, the target power may be the CPU power of the electronic device. For example, when the electronic device does not include an independent GPU chip, the target power may be the CPU power of the electronic device. Another exemplary embodiment may be the GPU power of the electronic device. For example, when the electronic device includes an independent GPU chip, the target power may be the GPU power.

可以理解的,以上仅为示例,不含独立GPU芯片的电子设备,对应的目标功率也可以是GPU功率。包含独立GPU芯片的电子设备,对应的目标功率也可以是GPU功率,本申请实施例对此不做限定。It is understandable that the above is only an example, and the corresponding target power of an electronic device without an independent GPU chip can also be the GPU power. The corresponding target power of an electronic device including an independent GPU chip can also be the GPU power, and this embodiment of the application does not limit this.

上述高能模式是性能优先的运行模式。电子设备运行于高能模式的情况下,电子设备的目标功率的上限为第二功率值。The high energy mode is a performance-first operation mode. When the electronic device operates in the high energy mode, the upper limit of the target power of the electronic device is the second power value.

上述普通模式是性能和能耗均衡的运行模式。电子设备运行于普通模式的情况下,电子设备的目标功率的上限为第三功率值。The above-mentioned normal mode is an operation mode in which performance and energy consumption are balanced. When the electronic device operates in the normal mode, the upper limit of the target power of the electronic device is the third power value.

在一些实施例中,上述第一功率值小于第三功率值,第三功率值小于第二功率值。第二功率值是电子设备在最佳散热效果下,目标功率能够达到的最大功率值。第三功率值和第一功率值均可以是在第二功率值的基础上确定的值。比如,第二功率值为60w,第二功率值可以是35w,第一功率值可以是25w。In some embodiments, the first power value is less than the third power value, and the third power value is less than the second power value. The second power value is the maximum power value that the target power can reach under the best heat dissipation effect of the electronic device. The third power value and the first power value can both be values determined based on the second power value. For example, the second power value is 60w, the second power value can be 35w, and the first power value can be 25w.

可以理解地,目标功率的上限越高,电子设备能够释放的性能越高,比如,可调用的CPU内核数量更多,可启用的CPU主频率越高,可启用的GPU主频率越高,CPU功率越高,GPU功率也越高。反之,目标功率的上限越低,电子设备能够释放的性能越低。It can be understood that the higher the upper limit of the target power, the higher the performance that the electronic device can release, for example, the more CPU cores that can be called, the higher the CPU main frequency that can be enabled, the higher the GPU main frequency that can be enabled, the higher the CPU power, and the higher the GPU power. Conversely, the lower the upper limit of the target power, the lower the performance that the electronic device can release.

在电子设备运行节能模式的情况下,电子设备的整体能耗可以维持于较低水平,但是,电子设备实际能够释放的性能,相对于普通模式和高能模式实际释放出的性能更低。也就是,面对需要高性能表现的场景下,电子设备所提供的服务质量可能存在瑕疵,比如,运行大型游戏程序时,可能出现掉帧、卡顿等问题。When an electronic device is running in energy-saving mode, the overall energy consumption of the electronic device can be maintained at a low level, but the actual performance that the electronic device can release is lower than that of the normal mode and high-energy mode. In other words, in scenarios that require high performance, the quality of service provided by the electronic device may be flawed. For example, when running large-scale game programs, problems such as frame drops and freezes may occur.

在电子设备运行高能模式的情况下,电子设备实际能够输出的性能较高,也就是,面对需要高性能表现的场景下,电子设备所提供更为优质的服务,但是也会带来较高的能耗。When an electronic device operates in high-energy mode, the electronic device can actually output higher performance. That is, in scenarios requiring high performance, the electronic device provides better services, but it also results in higher energy consumption.

在电子设备运行普通模式的情况下,电子设备实际能够输出的性能和产生的能耗之间可以实现均衡,也就是,面对需要高性能表现的场景下,电子设备在普通模式下所提供服务,逊色于在高能模式下所提供服务,但优于在节能模式下所提供的服务。对应地,在普通模式下产生的能耗低于高能模式下产生的能耗,但高于节能模式下产生的能耗。When an electronic device is running in normal mode, a balance can be achieved between the performance that the electronic device can actually output and the energy consumption generated. That is, in scenarios that require high performance, the service provided by the electronic device in normal mode is inferior to the service provided in high-energy mode, but better than the service provided in energy-saving mode. Correspondingly, the energy consumption generated in normal mode is lower than the energy consumption generated in high-energy mode, but higher than the energy consumption generated in energy-saving mode.

另外,在一些实施例中,上述目标功率可以包括CPU功率和GPU功率。在目标功率包括CPU功率和GPU功率的情况下,第一功率值可以包括CPU对应的功率值和GPU对应的功率值,第一功率值中GPU对应的功率值与CPU对应的功率值可以不相同。比如,第一功率值包括CPU对应的35w和GPU对应的65w。这样,在电子设备运行于节能模式的情况下,CPU可达到的最高功率为35w,GPU可达到的最高功率为65w。In addition, in some embodiments, the above-mentioned target power may include CPU power and GPU power. In the case where the target power includes CPU power and GPU power, the first power value may include a power value corresponding to the CPU and a power value corresponding to the GPU, and the power value corresponding to the GPU in the first power value may be different from the power value corresponding to the CPU. For example, the first power value includes 35w corresponding to the CPU and 65w corresponding to the GPU. In this way, when the electronic device is running in energy-saving mode, the maximum power that the CPU can reach is 35w, and the maximum power that the GPU can reach is 65w.

同样地,第二功率值可以包括CPU对应的功率值和GPU对应的功率值,第二功率值中GPU对应的功率值与CPU对应的功率值可以不相同。第三功率值可以包括CPU对应的功率值和GPU对应的功率值,第三功率值中GPU对应的功率值与CPU对应的功率值可以不相同。Similarly, the second power value may include a power value corresponding to the CPU and a power value corresponding to the GPU, and the power value corresponding to the GPU in the second power value may be different from the power value corresponding to the CPU. The third power value may include a power value corresponding to the CPU and a power value corresponding to the GPU, and the power value corresponding to the GPU in the third power value may be different from the power value corresponding to the CPU.

在一些实施例中,可以由用户选择电子设备所启用的运行模式。In some embodiments, the operating mode enabled by the electronic device can be selected by the user.

示例性的,电子设备检测到用户的指定操作,如,用户点击指示切换运行模式的快捷键,可以响应于该指定操作,如图1所示,显示用于选择电子设备运行模式的系统配置界面101。该系统配置界面101中可以包含指示各个运行模式的选择项,如,指示节能模式的选择项102、指示普通模式的选择项103以及指示高能模式的选择项104。Exemplarily, when the electronic device detects a user's designated operation, such as when the user clicks a shortcut key indicating switching the operating mode, the electronic device may respond to the designated operation by displaying a system configuration interface 101 for selecting the operating mode of the electronic device, as shown in FIG1. The system configuration interface 101 may include selection items indicating various operating modes, such as a selection item 102 indicating an energy-saving mode, a selection item 103 indicating a normal mode, and a selection item 104 indicating a high-energy mode.

在一些示例中,电子设备中可预置一个默认运行模式,该默认运行模式可以是上述节能模式、普通模式和高能模式中的一个。在电子设备开机之后,以及用户未手动更改运行模式之前,电子设备可以直接启用默认运行模式。这样,在显示系统配置界面101时,默认运行模式对应的选择项处于选中状态,比如,电子设备中默认运行模式是普通模式,在显示的系统配置界面101中,普通模式所对应的选择项103处于选中状态。In some examples, a default operating mode may be preset in the electronic device, and the default operating mode may be one of the energy-saving mode, the normal mode, and the high-energy mode. After the electronic device is turned on and before the user manually changes the operating mode, the electronic device may directly enable the default operating mode. In this way, when the system configuration interface 101 is displayed, the option corresponding to the default operating mode is in a selected state. For example, the default operating mode in the electronic device is the normal mode, and in the displayed system configuration interface 101, the option 103 corresponding to the normal mode is in a selected state.

另外,在显示系统配置界面101期间,电子设备可以响应于用户在系统配置界面101中的选择操作,如,用户点选节能模式(或者点选高能模式)的操作,启用被用户选中的运行模式(如称为目标模式),并在系统配置界面101中,将目标模式对应的选择项更新为选中状态,将默认运行模式对应的选择项更新为未选中状态。比如,如图2所示,用户点选节能模式,那么电子设备在启用节能模式的情况下,还可以将系统配置界面101中节能模式对应的选择项102更新为选中状态,将普通模式对应的选择项103更新为未选中状态。In addition, during the display of the system configuration interface 101, the electronic device can respond to the user's selection operation in the system configuration interface 101, such as the user clicking the energy-saving mode (or clicking the high-energy mode), enable the operation mode selected by the user (such as the target mode), and update the selection item corresponding to the target mode to a selected state and the selection item corresponding to the default operation mode to an unselected state in the system configuration interface 101. For example, as shown in FIG. 2, the user clicks the energy-saving mode, then the electronic device can also update the selection item 102 corresponding to the energy-saving mode in the system configuration interface 101 to a selected state and update the selection item 103 corresponding to the normal mode to an unselected state when the energy-saving mode is enabled.

在另一些实施例中,电子设备可以根据设备电量,自动选择所需启用的运行模式。In other embodiments, the electronic device can automatically select the operating mode to be enabled based on the power level of the device.

示例性的,电子设备在插电(外接电源)的情况下,设备电量相对稳定,此时可自动选择启用高能模式。For example, when the electronic device is plugged in (external power supply), the power level of the device is relatively stable, and the high-energy mode can be automatically enabled.

又示例性的,电子设备的设备电量充足,但未插电的情况下,设备电量能够维持电子设备正常运转的时间相对长,但设备电量会持续减小,此时可以自动选择启用普通模式。As another example, when the electronic device has sufficient power but is not plugged in, the power of the device can maintain the normal operation of the electronic device for a relatively long time, but the power of the device will continue to decrease. At this time, the normal mode can be automatically selected to be enabled.

再示例性的,电子设备的设备电量不足,且未插电的情况下,设备电量能够维持电子设备正常运转的时间相对短,同时,设备电量也会持续减小,此时自动选择启用节能模式。As another example, when the power of the electronic device is low and it is not plugged in, the time that the power of the device can maintain the normal operation of the electronic device is relatively short, and at the same time, the power of the device will continue to decrease. At this time, the energy saving mode is automatically enabled.

在相关技术中,无论是用户手动切换运行模式,还是依据设备电量自动切换,电子设备所释放的性能会出现跳变,对应的,能耗也会出现徒增,或者性能出现徒降。In the related art, whether the user manually switches the operating mode or automatically switches according to the power level of the device, the performance released by the electronic device will jump, and correspondingly, the energy consumption will increase or the performance will decrease.

示例性地,在电子设备未插电的情况下,如果电子设备从普通模式或节能模式,切换至高能模式,那么电子设备在高能模式下,可以释放更多的性能。当然,电子设备的能耗也会增加。也就是,在电子设备未插电的情况下,切换至高能模式之后,电子设备的续航会明显地缩短。这样,相关技术中,大部分电子设备都不能在未插电的情况下,启用高能模式。For example, when the electronic device is not plugged in, if the electronic device switches from normal mode or energy-saving mode to high-energy mode, the electronic device can release more performance in high-energy mode. Of course, the energy consumption of the electronic device will also increase. That is, when the electronic device is not plugged in, after switching to high-energy mode, the battery life of the electronic device will be significantly shortened. In this way, in the related art, most electronic devices cannot enable high-energy mode when not plugged in.

再示例性地,在电子设备已运行于高能模式的情况下,如果切换至普通模式或者节能模式,那么电子设备所释放的性能会瞬降。也就是,在电子设备提供的服务未变的情况下,由于释放的性能瞬降,实际提供的服务质量也会瞬间变差。如,电子设备正在运行的游戏程序的过程中,突然掉电,电子设备需从高能模式切换至其他模式(如,普通模式或节能模式),否则电子设备会很快断电。然而,电子设备由高能模式切换至其他模式,正运行的游戏程序会出现明显掉帧、卡顿,十分影响用户的使用体验。As another example, when an electronic device is already running in high-energy mode, if it switches to normal mode or energy-saving mode, the performance released by the electronic device will drop instantly. That is, when the service provided by the electronic device remains unchanged, the quality of service actually provided will also deteriorate instantly due to the instantaneous drop in released performance. For example, when the electronic device is running a game program, the power suddenly cuts off, and the electronic device needs to switch from high-energy mode to other modes (such as normal mode or energy-saving mode), otherwise the electronic device will be powered off quickly. However, when the electronic device switches from high-energy mode to other modes, the running game program will show obvious frame drops and freezes, which greatly affects the user experience.

为了解决上述问题,本申请实施例提供了一种设备控制方法。其中,该设备控制方法应用于电子设备。这样,电子设备可以在切入高能模式的情况下,有效减小能耗的增加,提高设备的续航。In order to solve the above problems, an embodiment of the present application provides a device control method. The device control method is applied to an electronic device. In this way, the electronic device can effectively reduce the increase in energy consumption and improve the battery life of the device when switching to a high-energy mode.

另外,在电子设备切出高能模式的情况下,释放性能呈阶梯式变化,避免电子设备实际提供的服务质量徒降,影响用户的使用体验。In addition, when the electronic device switches out of the high-energy mode, the released performance changes in a step-by-step manner, thereby avoiding a sudden drop in the quality of service actually provided by the electronic device and affecting the user experience.

示例性的,本申请实施例中的电子设备可以是便携式计算机(如手机)、平板电脑、桌面型、膝上型、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personalcomputer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、媒体播放器等设备,本申请实施例对该电子设备的具体形态不作特殊限制。Exemplarily, the electronic device in the embodiments of the present application may be a portable computer (such as a mobile phone), a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), a media player, and the like. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.

当然,上述电子设备可以与外置电源连接。在电子设备外接电源的情况下,可以利用外置电源进行供电。如,电子设备可以通过插电的方式获得电能,以供设备运行。另外,电子设备还包括内置电源,如,电池。这样,在没有外接电源(如,未插电)的情况下,该电子设备可以凭借自身电池进行供电,供设备运行。Of course, the above-mentioned electronic device can be connected to an external power source. In the case of an external power source for the electronic device, the external power source can be used for power supply. For example, the electronic device can obtain electrical energy by plugging in to operate the device. In addition, the electronic device also includes a built-in power source, such as a battery. In this way, in the absence of an external power source (e.g., not plugged in), the electronic device can be powered by its own battery for operation of the device.

以电子设备为笔记本电脑举例,图3示出了笔记本电脑的结构示意图。Taking the electronic device as a laptop computer as an example, FIG3 shows a schematic structural diagram of the laptop computer.

笔记本电脑可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,麦克风170C,耳机接口170D,传感器模块180等。The laptop computer may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a microphone 170C, an earphone interface 170D, a sensor module 180, and the like.

可以理解的是,本发明实施例示意的结构并不构成对笔记本电脑的具体限定。在本申请另一些实施例中,笔记本电脑可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the laptop computer. In other embodiments of the present application, the laptop computer may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

笔记本电脑的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the notebook computer can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

天线1和天线2用于发射和接收电磁波信号。笔记本电脑中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the laptop can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

移动通信模块150可以提供应用在笔记本电脑上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to laptop computers. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

无线通信模块160可以提供应用在笔记本电脑上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to laptop computers. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

在一些实施例中,笔记本电脑的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得笔记本电脑可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the laptop is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the laptop can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and/or satellite based augmentation system (SBAS).

笔记本电脑通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The laptop computer implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc.

笔记本电脑可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The laptop computer can realize the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,笔记本电脑可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the laptop computer may include 1 or N cameras 193, where N is a positive integer greater than 1.

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当笔记本电脑在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when a laptop selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

视频编解码器用于对数字视频压缩或解压缩。笔记本电脑可以支持一种或多种视频编解码器。这样,笔记本电脑可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital videos. Laptops can support one or more video codecs. This allows them to play or record videos in a variety of encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

当然,笔记本电脑还可以包括充电管理模块240、电源管理模块241、电池242、指示器、键盘、鼠标、控制面板、散热装置以及1个或多个SIM卡接口等,本申请实施例对此不做任何限制。Of course, the laptop computer may also include a charging management module 240, a power management module 241, a battery 242, an indicator, a keyboard, a mouse, a control panel, a heat dissipation device, and one or more SIM card interfaces, etc., and the embodiments of the present application do not impose any restrictions on this.

另外,上述控制面板可以感知用户的触控动作,并转化为对应的触控指令。上述散热装置,用于协助笔记本电脑中的硬件(如,CPU、GPU等)进行散热。示例性地,上述散热装置可以是内置的散热风扇,也可以外置的散热风扇,还可以是液冷器件等,后续实施例中,主要以散热装置是散热风扇进行举例。In addition, the control panel can sense the user's touch actions and convert them into corresponding touch commands. The heat dissipation device is used to assist the hardware (such as CPU, GPU, etc.) in the laptop computer to dissipate heat. Exemplarily, the heat dissipation device can be a built-in heat dissipation fan, an external heat dissipation fan, or a liquid cooling device. In the subsequent embodiments, the heat dissipation device is mainly used as an example of a heat dissipation fan.

下面结合附图,以笔记本电脑为例,描述本申请实施例提供的设备控制方法的实现细节:The following describes the implementation details of the device control method provided in the embodiment of the present application by taking a laptop computer as an example in conjunction with the accompanying drawings:

在一些实施例中,如图4所示,上述设备控制方法可以包括以下步骤:In some embodiments, as shown in FIG4 , the device control method may include the following steps:

S101,笔记本电脑启用第一模式运行。S101, the notebook computer starts running in the first mode.

其中,第一模式可以是笔记本电脑的运行模式中的一种。笔记本电脑运行于第一模式的情况下,能够释放出的最大性能低于该笔记本电脑的性能上限。也就是说,第一模式可以是高能模式以外的运行模式,如,可以是节能模式或普通模式。The first mode may be one of the operating modes of the laptop computer. When the laptop computer is operating in the first mode, the maximum performance that can be released is lower than the performance upper limit of the laptop computer. That is, the first mode may be an operating mode other than the high-energy mode, such as the energy-saving mode or the normal mode.

在一些示例中,笔记本电脑可以在以下任意一种场景下启用第一模式:In some examples, the laptop computer may enable the first mode in any of the following scenarios:

场景一:第一模式是笔记本电脑中的默认模式。笔记本电脑开机之后,启用第一模式。另外,在运行过程中,如果未出现运行模式的切换,那么笔记本电脑继续启用第一模式。Scenario 1: The first mode is the default mode in the laptop. After the laptop is turned on, the first mode is enabled. In addition, during the operation, if the operation mode is not switched, the laptop continues to enable the first mode.

场景二:响应用户指示切换启用第一模式的操作,启用第一模式。其中,用户指示切换启用第一模式的操作可以是:通过按压快捷键,指示笔记本电脑显示系统配置界面101。在显示系统配置界面101期间,用户在系统配置界面101上,选择第一模式的操作。Scenario 2: In response to the user's instruction to switch to enable the first mode, the first mode is enabled. The user's instruction to switch to enable the first mode may be: by pressing a shortcut key, instructing the laptop to display the system configuration interface 101. While the system configuration interface 101 is displayed, the user selects the operation of the first mode on the system configuration interface 101.

场景三:笔记本电脑采用内置电池供电运行的情况下,启用第一模式运行。Scenario 3: When the laptop is powered by a built-in battery, the first mode is enabled.

场景四:笔记本电脑插电运行的情况下,也即,与外置电源连接的情况下,检测到与外置电源断开,也即,外置电源停止供电的情况下,启用第一模式。Scenario 4: When the laptop computer is plugged in, that is, connected to an external power source, it is detected that the external power source is disconnected, that is, the external power source stops supplying power, and the first mode is enabled.

在一些实施例中,笔记本电脑中预先配置有第一模式对应的第一运行参数(又可称为第一性能参数)。In some embodiments, the notebook computer is pre-configured with first operating parameters (also referred to as first performance parameters) corresponding to the first mode.

示例性地,上述第一运行参数包括目标功率的第一上限值,如,第一上限值可以是前述实施例中的第三功率值或者第一功率值。其中,上述目标功率可以是CPU功率和/或GPU功率。在按照第一运行参数运行时,笔记本电脑可以在目标功率不超过第一上限值的情况下,调度各类系统资源,比如,CPU资源、GPU资源和存储资源。换句话说,上述第一运行参数可以限制CPU内核数量、可启用的CPU主频率、可启用的CPU功率、可启用的GPU主频率以及可启用的GPU功率等,也就是,上述第一运行参数可以直接影响到笔记本电脑在第一模式下能释放的性能上限。Exemplarily, the first operating parameter includes a first upper limit value of the target power, such as the first upper limit value may be the third power value or the first power value in the aforementioned embodiment. Among them, the target power may be CPU power and/or GPU power. When operating according to the first operating parameter, the laptop computer may schedule various system resources, such as CPU resources, GPU resources, and storage resources, while the target power does not exceed the first upper limit value. In other words, the first operating parameter may limit the number of CPU cores, the enabled CPU main frequency, the enabled CPU power, the enabled GPU main frequency, and the enabled GPU power, etc., that is, the first operating parameter may directly affect the upper limit of the performance that the laptop computer can release in the first mode.

在一些实施例中,在第一模式下,笔记本电脑可以按照第一运行参数,控制各个硬件的运行状态,使笔记本电脑根据实际情况,在第一运行参数的约束下,释放运行所需性能。例如,第一运行参数为目标功率的第一上限值,如果目标功率是CPU功率,以CPU功率不超过第一上限值作为约束,调度CPU中启用的内核数量、确定CPU主频率等,如果目标功率是GPU功率,以GPU功率不超过第一上限值作为约束,确定GPU主频率。In some embodiments, in the first mode, the laptop computer can control the operating state of each hardware according to the first operating parameter, so that the laptop computer can release the required operating performance according to the actual situation under the constraint of the first operating parameter. For example, the first operating parameter is the first upper limit value of the target power. If the target power is the CPU power, the number of cores enabled in the CPU is scheduled and the CPU main frequency is determined with the CPU power not exceeding the first upper limit value as a constraint. If the target power is the GPU power, the GPU main frequency is determined with the GPU power not exceeding the first upper limit value as a constraint.

又示例性地,上述第一运行参数包括:可用的CPU内核数量、可启用的CPU主频率、可启用的CPU功率、可启用的GPU主频率以及可启用的GPU功率。当然,第一运行参数中的可用CPU内核数量小于笔记本电脑的总内核数,第一运行参数中的CPU主频率小于笔记本电脑实际可用的最大CPU主频率,第一运行参数对应的CPU功率小于笔记本电脑实际的最大CPU功率,第一运行参数对应的GPU主频率小于笔记本电脑实际可用的最大GPU主频率,第一运行参数中的GPU功率小于笔记本电脑实际的最大GPU功率。也就是,上述第一运行参数可以直接影响到笔记本电脑在第一模式下能释放的性能上限。As another example, the first operating parameter includes: the number of available CPU cores, the enabled CPU main frequency, the enabled CPU power, the enabled GPU main frequency, and the enabled GPU power. Of course, the number of available CPU cores in the first operating parameter is less than the total number of cores of the laptop computer, the CPU main frequency in the first operating parameter is less than the maximum CPU main frequency actually available in the laptop computer, the CPU power corresponding to the first operating parameter is less than the actual maximum CPU power of the laptop computer, the GPU main frequency corresponding to the first operating parameter is less than the actual maximum GPU main frequency available in the laptop computer, and the GPU power in the first operating parameter is less than the actual maximum GPU power of the laptop computer. That is, the first operating parameter can directly affect the upper limit of the performance that can be released by the laptop computer in the first mode.

在另一些实施例中,在第一模式下,笔记本电脑可以按照第一运行参数,控制各个硬件的运行状态,使笔记本电脑释放出的性能可以达到第一模式对应的性能上限。如,按照第一运行参数,调整CPU中启用的内核数量、功率、主频率,又如,按照第一运行参数,调整GPU的主频率和功率等。In other embodiments, in the first mode, the laptop computer can control the operating state of each hardware according to the first operating parameter, so that the performance released by the laptop computer can reach the performance upper limit corresponding to the first mode. For example, according to the first operating parameter, the number of cores enabled in the CPU, the power, and the main frequency are adjusted, and according to the first operating parameter, the main frequency and power of the GPU are adjusted.

示例性的,面对所需性能表现不高的情况,如笔记本电脑仅显示桌面的情况下,在第一模式下,笔记本电脑释放显示桌面所需的性能。此时所释放的性能可以小于第一模式对应的性能上限。For example, in the case where the required performance is not high, such as when the laptop only displays the desktop, in the first mode, the laptop releases the performance required to display the desktop. The released performance may be less than the performance upper limit corresponding to the first mode.

比如,第一运行参数指示最多可启用N个CPU内核,N是大于1的整数,那么笔记本电脑在显示桌面的情况下,可以只启用1个CPU内核,在此举例中,所启用内核数量少于第一运行参数对应的N个内核,也就是,第一模式下,可用的内核中还存在空闲内核,也即,笔记本电脑所释放的性能小于第一模式所对应的性能上限。同样,释放性能小于第一模式的性能上限还可以体现在其他方面,如,CPU主频率低于第一运行参数指示的CPU主频率,CPU功率小于第一运行参数指示的CPU功率等,在此不再赘述。For example, the first operating parameter indicates that a maximum of N CPU cores can be enabled, where N is an integer greater than 1. In this case, when the desktop is displayed, the laptop can only enable one CPU core. In this example, the number of enabled cores is less than the N cores corresponding to the first operating parameter, that is, in the first mode, there are still idle cores among the available cores, that is, the performance released by the laptop is less than the performance upper limit corresponding to the first mode. Similarly, the released performance is less than the performance upper limit of the first mode can also be reflected in other aspects, such as the CPU main frequency is lower than the CPU main frequency indicated by the first operating parameter, the CPU power is less than the CPU power indicated by the first operating parameter, etc., which will not be repeated here.

又示例性的,面对所需性能表现高的情况,如笔记本电脑运行实况游戏的情况下,在第一模式下,笔记本电脑所释放的性能可以等于第一模式对应的性能上限。As another example, in the case where high performance is required, such as when a laptop computer runs a live game, in the first mode, the performance released by the laptop computer can be equal to the performance upper limit corresponding to the first mode.

比如,第一运行参数指示最多可启用N个CPU内核,N是大于1的整数,那么笔记本电脑在运行实况游戏的情况下,可以同时启用N个CPU内核,在此举例中,所启用内核数量等于第一运行参数对应的N个内核,也就是,笔记本电脑所释放的性能等于第一模式所对应的性能上限。同样,释放性能等于第一模式的性能上限还可以体现在其他方面,如,CPU主频率等于第一运行参数指示的CPU主频率,CPU功率等于第一运行参数指示的CPU功率等,在此不再赘述。For example, the first operating parameter indicates that a maximum of N CPU cores can be enabled, where N is an integer greater than 1. In this case, when the laptop is running a live game, N CPU cores can be enabled at the same time. In this example, the number of enabled cores is equal to the N cores corresponding to the first operating parameter, that is, the performance released by the laptop is equal to the performance upper limit corresponding to the first mode. Similarly, the released performance equal to the performance upper limit of the first mode can also be reflected in other aspects, such as the CPU main frequency is equal to the CPU main frequency indicated by the first operating parameter, the CPU power is equal to the CPU power indicated by the first operating parameter, etc., which will not be repeated here.

S102,在启用第一模式期间,笔记本电脑识别出当前需要启用第二模式。S102: During the activation of the first mode, the notebook computer recognizes that the second mode needs to be activated currently.

其中,第二模式也可以是笔记本电脑的运行模式中的一种。笔记本电脑运行于第二模式的情况下,能够释放出的最大性能等于该笔记本电脑的性能上限。也就是说,第二模式可以是前述实施例中提到的高能模式。The second mode may also be one of the operation modes of the notebook computer. When the notebook computer is running in the second mode, the maximum performance that can be released is equal to the performance upper limit of the notebook computer. That is, the second mode may be the high-energy mode mentioned in the above embodiment.

在一些示例中,笔记本电脑可以在以下任意一种场景下,确定需要启用第二模式:In some examples, the laptop computer may determine that the second mode needs to be enabled in any of the following scenarios:

场景五:响应用户指示切换启用第二模式的操作,确定需要启用第二模式。其中,用户指示切换启用第二模式的操作可以是:通过按压快捷键,指示笔记本电脑显示系统配置界面。在显示系统配置界面期间,用户在系统配置界面上,选择第二模式的操作。Scenario 5: In response to the user's instruction to switch to enable the second mode, it is determined that the second mode needs to be enabled. The user's instruction to switch to enable the second mode may be: by pressing a shortcut key, instructing the laptop to display the system configuration interface. While the system configuration interface is displayed, the user selects the second mode operation on the system configuration interface.

场景六:在笔记本电脑未连接外置电源的情况下,也即,采用内置电池供电的场景下,笔记本电脑检测到连接上外置电源,也即,笔记本电脑开始采用外置电源供电之后,确定需要启用第二模式。Scenario 6: When the laptop computer is not connected to an external power source, that is, powered by a built-in battery, the laptop computer detects that an external power source is connected, that is, after the laptop computer starts to be powered by the external power source, it is determined that the second mode needs to be enabled.

场景七:笔记本电脑检测到特定的使用场景(如,笔记本电脑运行特定的程序,或者,程序处于特定的运行阶段)时,确定需要启用第二模式。其中,检测特定的使用场景的实现方式可以在后续实施例中详细介绍,在此暂不赘述。Scenario 7: When the laptop detects a specific usage scenario (e.g., the laptop runs a specific program, or the program is in a specific running stage), it determines that the second mode needs to be enabled. The implementation method of detecting the specific usage scenario can be described in detail in subsequent embodiments and will not be described here.

另外,笔记本电脑中也预先配置有第二模式对应的第二运行参数(又称为第二性能参数)。In addition, the notebook computer is also pre-configured with second operating parameters (also called second performance parameters) corresponding to the second mode.

示例性地,上述第二运行参数包括目标功率的第二上限值,如,第二上限值可以是前述实施例中的第二功率值,也即,笔记本电脑在最佳的散热效果下,能够达到的最大功率。其中,在按照第二运行参数运行时,笔记本电脑可以在目标功率不超过第二上限值的情况下,调度各类系统资源,比如,CPU资源、GPU资源和存储资源。换句话说,上述第二运行参数可以限制CPU内核数量、可启用的CPU主频率、可启用的CPU功率、可启用的GPU主频率以及可启用的GPU功率等,也就是,上述第二运行参数可以直接影响到笔记本电脑在第二模式下能释放的性能上限。Exemplarily, the second operating parameter includes a second upper limit value of the target power, such as the second upper limit value may be the second power value in the aforementioned embodiment, that is, the maximum power that the laptop can reach under the best heat dissipation effect. Wherein, when operating according to the second operating parameter, the laptop can schedule various system resources, such as CPU resources, GPU resources, and storage resources, without the target power exceeding the second upper limit value. In other words, the second operating parameter may limit the number of CPU cores, the enabled CPU main frequency, the enabled CPU power, the enabled GPU main frequency, and the enabled GPU power, etc., that is, the second operating parameter may directly affect the upper limit of the performance that the laptop can release in the second mode.

在一些实施例中,在第二模式下,笔记本电脑可以按照第二运行参数,控制各个硬件的运行状态,使笔记本电脑根据实际情况,在第二运行参数的约束下,释放运行所需性能。例如,第二运行参数为目标功率的第二上限值,如果目标功率是CPU功率,以CPU功率不超过第二上限值作为约束,调度CPU中启用的内核数量、确定CPU主频率等,如果目标功率是GPU功率,以GPU功率不超过第二上限值作为约束,确定GPU主频率。在第二上限值包括针对GPU功率的上限值和针对CPU功率的上限值时,以CPU功率不超过对应上限值和GPU功率也不超过对应的上限值作为约束,确定启用的CPU内核数量、CPU主频率、GPU主频率。In some embodiments, in the second mode, the laptop computer can control the operating state of each hardware according to the second operating parameter, so that the laptop computer can release the required performance for operation according to the actual situation under the constraint of the second operating parameter. For example, the second operating parameter is the second upper limit value of the target power. If the target power is the CPU power, the number of cores enabled in the CPU is scheduled, the CPU main frequency is determined, etc., with the CPU power not exceeding the second upper limit value as a constraint. If the target power is the GPU power, the GPU main frequency is determined with the GPU power not exceeding the second upper limit value as a constraint. When the second upper limit value includes an upper limit value for the GPU power and an upper limit value for the CPU power, the number of CPU cores enabled, the CPU main frequency, and the GPU main frequency are determined with the CPU power not exceeding the corresponding upper limit value and the GPU power not exceeding the corresponding upper limit value as constraints.

另外,第二上限值大于第一上限值。另外,上述第二运行参数可以直接影响笔记本电脑在第二模式下能释放的性能上限。同时,第二模式对应的性能上限与笔记本电脑的性能上限相同。In addition, the second upper limit value is greater than the first upper limit value. In addition, the second operating parameter can directly affect the upper limit of performance that can be released by the notebook computer in the second mode. At the same time, the upper limit of performance corresponding to the second mode is the same as the upper limit of performance of the notebook computer.

又示例性地,第二运行参数的参数类型包括可用的CPU内核数量、可启用的CPU主频率、可启用的CPU功率、可启用的GPU主频率以及可启用的GPU功率。当然,第二运行参数对应的可用CPU内核数量等于笔记本电脑的总内核数,第二运行参数对应的CPU主频率等于笔记本电脑实际可用的最大CPU主频率,第二运行参数对应的CPU功率等于笔记本电脑实际的最大CPU功率,第二运行参数对应的GPU主频率等于笔记本电脑实际可用的最大GPU主频率,第二运行参数对应的GPU功率等于笔记本电脑实际的最大GPU功率。也就是,上述第二运行参数中的各项取值都大于第一运行参数。另外,上述第二运行参数可以直接影响笔记本电脑在第二模式下能释放的性能上限。同时,第二模式对应的性能上限与笔记本电脑的性能上限相同。Also exemplarily, the parameter types of the second operating parameter include the number of available CPU cores, the enabled CPU main frequency, the enabled CPU power, the enabled GPU main frequency, and the enabled GPU power. Of course, the number of available CPU cores corresponding to the second operating parameter is equal to the total number of cores of the laptop computer, the CPU main frequency corresponding to the second operating parameter is equal to the maximum CPU main frequency actually available to the laptop computer, the CPU power corresponding to the second operating parameter is equal to the actual maximum CPU power of the laptop computer, the GPU main frequency corresponding to the second operating parameter is equal to the maximum GPU main frequency actually available to the laptop computer, and the GPU power corresponding to the second operating parameter is equal to the actual maximum GPU power of the laptop computer. That is, the values of each item in the above-mentioned second operating parameter are greater than the first operating parameter. In addition, the above-mentioned second operating parameter can directly affect the performance upper limit that the laptop computer can release in the second mode. At the same time, the performance upper limit corresponding to the second mode is the same as the performance upper limit of the laptop computer.

这样,笔记本电脑实际启用第二模式时,可以按照第二模式的第二性能参数,控制各个硬件的工作,使笔记本电脑按照第二模式运行。In this way, when the notebook computer actually enables the second mode, the operation of each hardware can be controlled according to the second performance parameter of the second mode, so that the notebook computer operates according to the second mode.

S103,笔记本电脑按照预设规则,交替启用第一模式和第二模式。S103, the notebook computer activates the first mode and the second mode alternately according to a preset rule.

其中,上述预设规则又可称为心跳控制策略,用于控制第一模式和第二模式启用时段,以使笔记本电脑能够交替启用第一模式和第二模式。The above-mentioned preset rule may also be referred to as a heartbeat control strategy, which is used to control the activation period of the first mode and the second mode, so that the notebook computer can activate the first mode and the second mode alternately.

在一些实施例中,上述心跳控制策略可以包括:在确定需要启用第二模式之后,先切换启用第二模式,也即,笔记本电脑的运行模式由第一模式切换为第二模式。在切换启用第二模式之后,笔记本电脑按照第二模式对应的第二运行参数,控制各个硬件的运行状态,使笔记本电脑释放出的性能可以达到第二模式对应的性能上限,具体实现原理可参考前述实施例,在此不再赘述。In some embodiments, the heartbeat control strategy may include: after determining that the second mode needs to be enabled, first switch to enable the second mode, that is, the operation mode of the laptop computer is switched from the first mode to the second mode. After switching to enable the second mode, the laptop computer controls the operation state of each hardware according to the second operation parameter corresponding to the second mode, so that the performance released by the laptop computer can reach the performance upper limit corresponding to the second mode. The specific implementation principle can be referred to the aforementioned embodiment, which will not be repeated here.

在其他实施例中,在切换启用第二模式之后,笔记本电脑还可以按照第二模式对应的第二运行参数,控制各个硬件的运行状态,使笔记本电脑根据实际情况,在第二运行参数的约束下,释放运行所需性能。In other embodiments, after switching to enable the second mode, the laptop computer can also control the operating status of each hardware according to the second operating parameters corresponding to the second mode, so that the laptop computer can release the required operating performance according to actual conditions under the constraints of the second operating parameters.

在按照第二模式运行一段时间之后,笔记本电脑按照心跳控制策略切换启用第一模式。其中,启用第一模式的过程可参考S101,在此不再赘述。同样,在按照第一模式运行一段时间之后,再次切换启用第二模式,如此交替。After running in the second mode for a period of time, the laptop switches to enable the first mode according to the heartbeat control strategy. The process of enabling the first mode can refer to S101, which will not be repeated here. Similarly, after running in the first mode for a period of time, the second mode is switched again, and so on.

在一些示例中,在不同使用场景下,上述第一模式与第二模式之间的交替次数可以不同。另外,在第一模式和第二模式交替的过程中,第一模式单次运行的时间长度,以及第二模式单次运行的时间长度也可以根据电池电量而定,具体可参考后续实施例中的描述。当然,第一模式单次运行的时间长度与第二模式单次运行的时间长度可以不相同。另外,不同次启用第一模式的时间长度也可以存在差异。不同次启用第二模式的时间长度也可以存在差异。也就是,本申请实施例中,不对运行第一模式的时长做具体限定,也不对运行第二模式的时长做具体限定。In some examples, in different usage scenarios, the number of alternations between the above-mentioned first mode and the second mode may be different. In addition, in the process of alternating between the first mode and the second mode, the duration of a single operation of the first mode and the duration of a single operation of the second mode may also be determined according to the battery power. For details, please refer to the description in the subsequent embodiments. Of course, the duration of a single operation of the first mode may be different from the duration of a single operation of the second mode. In addition, there may also be differences in the duration of enabling the first mode at different times. There may also be differences in the duration of enabling the second mode at different times. That is, in the embodiments of the present application, no specific limitation is made on the duration of running the first mode, nor is there a specific limitation on the duration of running the second mode.

在第一运行参数和第二运行参数均是目标功率的上限值的场景下,如果笔记本电脑的使用场景是对CPU性能要求较高的场景,比如,运行仿真类程序,或者,运行设计类程序,再比如,办公类程序加载体积较大的文本数据等场景,目标功率可以是CPU功率。这样,交替启用第一模式和第二模式期间,笔记本电脑的CPU功率表现可以如图5所示:在启用第二模式的情况下,笔记本电脑的CPU功率为PL2,在时段t1内,笔记本电脑的CPU功率保持在PL2。之后,第二模式与第一模式进行交替。也即,在时段t1之后的时段t2,笔记本电脑切换启用第一模式,这样,在时段t2内,笔记本电脑的CPU功率为PL1。其中,PL2大于PL1。之后,第一模式与第二模式还可以再次交替,也即,在时段t2之后的时段t3,笔记本电脑切换启用第二模式,这样,在时段t3内,笔记本电脑的CPU功率为PL2,如此循环更替。In the scenario where both the first operating parameter and the second operating parameter are the upper limit values of the target power, if the use scenario of the laptop computer is a scenario with high CPU performance requirements, such as running simulation programs, or running design programs, or for example, office programs loading large text data, the target power can be the CPU power. In this way, during the alternating activation of the first mode and the second mode, the CPU power performance of the laptop computer can be as shown in Figure 5: when the second mode is enabled, the CPU power of the laptop computer is PL2, and in the time period t1, the CPU power of the laptop computer remains at PL2. Afterwards, the second mode alternates with the first mode. That is, in the time period t2 after the time period t1, the laptop computer switches to enable the first mode, so that in the time period t2, the CPU power of the laptop computer is PL1. Among them, PL2 is greater than PL1. Afterwards, the first mode and the second mode can be alternated again, that is, in the time period t3 after the time period t2, the laptop computer switches to enable the second mode, so that in the time period t3, the CPU power of the laptop computer is PL2, and so on.

在上述实施例中,在切换启用第二模式的同时,笔记本电脑还可以调整散热装置的工作状态。示例性地,由第一模式切换启用第二模式之后,笔记本电脑可以提高散热风扇的转速,比如,将电子设备的散热风扇的转速由第一转速提升到第二转速,其中,第二转速大于第一转速。利用散热风扇,快速带走功率增加带来的热量。再示例性地,在从第二模式切换至第一模式之后,恢复散热风扇的转速。比如,将电子设备的散热风扇的转速恢复至第一转速。In the above embodiment, while switching to enable the second mode, the laptop computer can also adjust the working state of the heat dissipation device. Exemplarily, after switching from the first mode to enable the second mode, the laptop computer can increase the speed of the heat dissipation fan, for example, increase the speed of the heat dissipation fan of the electronic device from the first speed to the second speed, wherein the second speed is greater than the first speed. The heat dissipation fan is used to quickly take away the heat caused by the increase in power. Exemplarily again, after switching from the second mode to the first mode, the speed of the heat dissipation fan is restored. For example, the speed of the heat dissipation fan of the electronic device is restored to the first speed.

另外,在第一运行参数和第二运行参数均是目标功率的上限值的场景下,如果笔记本电脑的使用场景是对GPU性能要求较高的场景,比如,运行游戏类应用,比如,运行实况类应用,再如,视频应用播放视频期间,目标功率可以是GPU功率。这样,交替启用第一模式和第二模式期间,笔记本电脑的GPU功率的表现,与图5类似,在此不再赘述。In addition, in the scenario where both the first operating parameter and the second operating parameter are upper limits of the target power, if the use scenario of the laptop computer requires high GPU performance, such as running game applications, running live applications, or playing videos in a video application, the target power may be the GPU power. In this way, the performance of the GPU power of the laptop computer during the period of alternately enabling the first mode and the second mode is similar to that in FIG5 , which will not be described in detail here.

在其他可能的实施例中,交替启用第一模式和第二模式期间,CPU主频率、启用CPU内核数量以及GPU主频率等的表现,也与图5类似,在此不再赘述。In other possible embodiments, during the period of alternately enabling the first mode and the second mode, the performance of the CPU main frequency, the number of enabled CPU cores, and the GPU main frequency are also similar to those in FIG. 5 , and are not described in detail here.

在另一些实施例中,在S102之后,如果确定使用场景为启用第一类程序,在确定需要启用第二模式之后,可以直接启用第二模式运行,无需按照心跳控制策略,交替启用第一模式和第二模式。也即,流程不执行S103。其中,上述第一类程序可以是对笔记本电脑性能要求较高的程序,比如,第一类程序可以包括游戏程序、实况类程序等。In other embodiments, after S102, if it is determined that the usage scenario is to enable the first type of program, after it is determined that the second mode needs to be enabled, the second mode can be directly enabled to run, without the need to alternately enable the first mode and the second mode according to the heartbeat control strategy. That is, the process does not execute S103. Among them, the above-mentioned first type of program can be a program that has high performance requirements for the laptop computer, for example, the first type of program can include game programs, live programs, etc.

总之,在本申请实施例中,笔记本电脑可以智能地切换第一模式和第二模式,兼顾笔记本电脑释放的性能和能耗。另外,在笔记本电脑未连接外置电源的情况下,笔记本电脑可以利用内置电池的短时放电特效,支撑笔记本电脑周期性地切换启用第二模式。在未外接电源的情况下,相比于直接切换启用第二模式,能够增加设备续航。在外接电源的情况下,相比于直接切换启用第二模式,能够减少能耗。这样,无论是用户指示切换启用第二模式,还是实际的使用场景需要启用第二模式,都能够在满足用户对于设备性能的要求的同时,提高设备续航或者降低能耗。In summary, in an embodiment of the present application, the laptop computer can intelligently switch between the first mode and the second mode, taking into account the performance and energy consumption released by the laptop computer. In addition, when the laptop computer is not connected to an external power supply, the laptop computer can use the short-time discharge effect of the built-in battery to support the laptop computer to periodically switch and enable the second mode. In the absence of an external power supply, the device battery life can be increased compared to directly switching to enable the second mode. In the case of an external power supply, energy consumption can be reduced compared to directly switching to enable the second mode. In this way, whether the user instructs to switch to enable the second mode, or the actual usage scenario requires the second mode to be enabled, it can improve the device battery life or reduce energy consumption while meeting the user's requirements for device performance.

另外,上述方法也适用于节能模式切换普通模式,比如,按照预配置的规则,笔记本电脑当前的电量只支持启用节能模式的情况下,如果笔记本电脑响应用户操作,确定需要启动普通模式之后,也可以采用上述方式,也即,采用心跳控制策略,交替启用普通模式和节能模式。In addition, the above method is also applicable to switching from energy-saving mode to normal mode. For example, according to the pre-configured rules, the current power of the laptop only supports the activation of energy-saving mode. If the laptop responds to the user's operation and determines that the normal mode needs to be activated, the above method can also be used, that is, the heartbeat control strategy is used to alternately activate the normal mode and the energy-saving mode.

在一些实施例中,笔记本电脑也可以是在第一条件下,依次交替按照第二模式对应的第二性能参数和所述第一性能参数运行。其中,第一条件包括笔记本电脑运行第一应用(如,特定的程序)。其中,第一应用可以是对设备性能表现要求较高的程序数据,例如,上述第一应用可以是游戏类应用、实况类应用、仿真类应用以及设计类应用等。换句话说,上述第一应用在运行过程中,所需占用的系统资源(特别是,CPU资源和GPU资源)较大的应用程序。如,第一应用所需调用的CPU内核数量大于预设数量,所需的CPU主频率大于第一频率,再如,所需的GPU主频率大于第二频率等,再如,占用存储资源较大,且在所占用的存储资源中,数据读写速度大于第一速度。又可称为,第一应用在运行过程中,所占用的系统资源满足预设条件,另外,上述预设数量、第一频率和第二频率均可以是通过测试确定出的经验值,本申请对此不作具体限定。In some embodiments, the laptop computer may also be operated alternately according to the second performance parameter and the first performance parameter corresponding to the second mode in the first condition. The first condition includes the laptop computer running the first application (e.g., a specific program). The first application may be a program data that has high requirements for device performance. For example, the first application may be a game application, a live application, a simulation application, a design application, etc. In other words, the first application is an application that occupies a large amount of system resources (especially, CPU resources and GPU resources) during operation. For example, the number of CPU cores required to be called by the first application is greater than the preset number, the required CPU main frequency is greater than the first frequency, and the required GPU main frequency is greater than the second frequency. For example, the storage resources occupied are large, and the data read and write speed in the occupied storage resources is greater than the first speed. It can also be said that the system resources occupied by the first application during operation meet the preset conditions. In addition, the preset number, the first frequency, and the second frequency can all be empirical values determined by testing, and this application does not make specific restrictions on this.

另外,第一条件还包括检测到用户指示启用第二模式的操作。In addition, the first condition further includes detecting an operation of a user instructing to enable the second mode.

在一些实施例中,如图6所示,上述方法还可以包括以下步骤:In some embodiments, as shown in FIG6 , the method may further include the following steps:

S201,笔记本电脑启用第二模式运行。S201, the notebook computer starts running in the second mode.

在一些实施例中,上述S201可以是笔记本电脑在以下场景中启用第二运行模式:In some embodiments, the above S201 may be that the notebook computer enables the second operating mode in the following scenario:

场景a:笔记本电脑与外置电源连接,且启用需要高性能表现的程序,如,游戏程序。或者,笔记本电脑与外置电源连接。Scenario a: The laptop is connected to an external power source, and a program that requires high performance, such as a game program, is enabled. Alternatively, the laptop is connected to an external power source.

场景b:笔记本电脑响应用户操作,启用第二模式。Scenario b: The laptop computer responds to user operation and enables the second mode.

场景c:在S103中启用第二模式。Scenario c: the second mode is enabled in S103.

在一些实施例中,笔记本电脑可以按照第二运行参数控制各个硬件的工作状态,使笔记本电脑运行于第二模式下,具体实现细节可参考,前述实施例中的S101,在此不再赘述,二者差异在于启用的运行参数不同。另外,在笔记本电脑连接外置电源的情况下,可以启用第二模式运行。In some embodiments, the laptop computer can control the working state of each hardware according to the second operating parameter, so that the laptop computer operates in the second mode. The specific implementation details can be referred to S101 in the above embodiment, which will not be repeated here. The difference between the two is that the enabled operating parameters are different. In addition, when the laptop computer is connected to an external power supply, the second mode can be enabled.

S202,在启用第二模式期间,笔记本电脑识别出当前需要启用第一模式。S202: During activation of the second mode, the notebook computer recognizes that the first mode needs to be activated currently.

在一些实施例中,笔记本电脑检测到与外置电源断开连接的情况下,也即,笔记本电脑无法采用外置电源供电的情况下,笔记本电脑可以识别出当前需要启用第一模式。In some embodiments, when the laptop computer detects that it is disconnected from the external power source, that is, when the laptop computer cannot be powered by the external power source, the laptop computer may recognize that the first mode needs to be enabled currently.

示例性的场景,笔记本电脑在插电(由外置电源供电)的情况下,运行游戏程序。在此期间,笔记本电脑可以启用第二模式运行。在采用第二模式运行的情况下,笔记本电脑如果检测到与外置电源断开连接,可以确定当前电能不足以支持长时间运行第二模式,这样,笔记本电脑识别出当前需要启用第一模式。In an exemplary scenario, the laptop computer is plugged in (powered by an external power source) and runs a game program. During this period, the laptop computer can enable the second mode to run. When running in the second mode, if the laptop computer detects that it is disconnected from the external power source, it can be determined that the current power is insufficient to support the second mode for a long time. In this way, the laptop computer recognizes that the first mode needs to be enabled at present.

在另一些实施例中,笔记本电脑也可以是响应于用户指示切换启用第一模式的操作,识别出当前需要启用第一模式。In some other embodiments, the laptop computer may also recognize that the first mode needs to be enabled currently in response to a user instruction to switch to enable the first mode.

在另一些实施例中,笔记本电脑还可以是按照心跳控制策略确定需要启用第一模式。In other embodiments, the laptop computer may also determine that the first mode needs to be enabled according to a heartbeat control strategy.

S203,笔记本电脑采用阶梯下降的方式,将第二模式切换至第一模式。S203, the notebook computer switches from the second mode to the first mode in a step-down manner.

在一些实施例中,笔记本电脑可以在第一运行参数和第二运行参数之间,确定出至少一组第三运行参数。In some embodiments, the laptop computer may determine at least one set of third operating parameters between the first operating parameters and the second operating parameters.

示例性地,上述第三运行参数可以包括目标功率对应的第三上限值。上述第三上限值可以介于第一上限值和第二上限值之间。比如,目标功率为CPU功率,第一上限值是35w,第二上限值是65w,那么确定出的第三上限值可以是50w。另外,目标功率为GPU功率的场景同理,在此不再赘述。Exemplarily, the third operating parameter may include a third upper limit value corresponding to the target power. The third upper limit value may be between the first upper limit value and the second upper limit value. For example, if the target power is CPU power, the first upper limit value is 35w, and the second upper limit value is 65w, then the determined third upper limit value may be 50w. In addition, the same applies to the scenario where the target power is GPU power, which will not be described in detail here.

又示例性地,上述第三运行参数也可以对应有可用的CPU内核数量、可启用的CPU主频率、可启用的CPU功率、可启用的GPU主频率以及可启用的GPU功率。Also illustratively, the third operating parameter may correspond to the number of available CPU cores, an enabled CPU main frequency, an enabled CPU power, an enabled GPU main frequency, and an enabled GPU power.

可以理解地,第三运行参数的各项取值介于第一运行参数和第二运行参数之间。比如,上述第三运行参数中的可用CPU内核数量小于第二运行参数中的可用CPU内核数量,且大于第一运行参数中的可用CPU内核数量。上述第三运行参数中的CPU主频率小于第二运行参数中的CPU主频率,且大于第一运行参数中的CPU主频率。上述第三运行参数中的CPU功率小于第二运行参数中的CPU功率,且大于第一运行参数中的CPU功率。上述第三运行参数中的GPU主频率小于第二运行参数中的GPU主频率,且大于第一运行参数中的GPU主频率。上述第三运行参数中的GPU功率小于第二运行参数中的GPU功率,且大于第一运行参数中的GPU功率。It can be understood that the values of each item of the third operating parameter are between the first operating parameter and the second operating parameter. For example, the number of available CPU cores in the third operating parameter is less than the number of available CPU cores in the second operating parameter, and is greater than the number of available CPU cores in the first operating parameter. The CPU main frequency in the third operating parameter is less than the CPU main frequency in the second operating parameter, and is greater than the CPU main frequency in the first operating parameter. The CPU power in the third operating parameter is less than the CPU power in the second operating parameter, and is greater than the CPU power in the first operating parameter. The GPU main frequency in the third operating parameter is less than the GPU main frequency in the second operating parameter, and is greater than the GPU main frequency in the first operating parameter. The GPU power in the third operating parameter is less than the GPU power in the second operating parameter, and is greater than the GPU power in the first operating parameter.

在一些实施例中,仅有一组第三运行参数的情况下,该第三运行参数可称为第三性能参数。在具有多组第三运行参数的情况下,该多组第三运行参数包括第三性能参数和第四性能参数。第三性能参数的各项取值均大于第四性能参数,但第三性能参数的各项取值小于第二性能参数。第四性能参数的各项取值大于第一性能参数。In some embodiments, when there is only one set of third operating parameters, the third operating parameters may be referred to as third performance parameters. When there are multiple sets of third operating parameters, the multiple sets of third operating parameters include third performance parameters and fourth performance parameters. Each value of the third performance parameter is greater than the fourth performance parameter, but each value of the third performance parameter is less than the second performance parameter. Each value of the fourth performance parameter is greater than the first performance parameter.

在一些实施例中,在S203之前,笔记本电脑按照第二运行参数,控制各个硬件的运行状态。在S203中,笔记本电脑切换启用第一运行参数之前,先按照第三运行参数,调整各个硬件的运行状态。以第三运行参数是第三上限值的情况下,以目标功率不超过第三上限值为约束条件,调整启用的CPU内核数量、CPU主频率、GPU主频率或者GPU功率等。In some embodiments, before S203, the laptop computer controls the operating state of each hardware according to the second operating parameter. In S203, before the laptop computer switches to enable the first operating parameter, the operating state of each hardware is adjusted according to the third operating parameter. When the third operating parameter is the third upper limit value, the number of enabled CPU cores, CPU main frequency, GPU main frequency or GPU power is adjusted with the target power not exceeding the third upper limit value as a constraint condition.

当然,第三运行参数对应有可用的CPU内核数量、可启用的CPU主频率、可启用的CPU功率、可启用的GPU主频率以及可启用的GPU功率等的情况下,可以按照第三运行参数,调整CPU中启用的内核数量、功率、主频率,或者,调整GPU的主频率和功率等。Of course, when the third operating parameter corresponds to the number of available CPU cores, the enabled CPU main frequency, the enabled CPU power, the enabled GPU main frequency, and the enabled GPU power, etc., the number of enabled cores, power, and main frequency in the CPU can be adjusted according to the third operating parameter, or the main frequency and power of the GPU can be adjusted.

也就是,在S203中,笔记本电脑在按照第三运行参数运行一定时长之后,再按照第一模式对应的第一运行参数运行,也即,可以按照第一运行参数调整各个硬件的运行状态。这样,笔记本电脑从第二模式切入第一模式的过程中,可以得到缓冲,也即,用户使用笔记本电脑的过程中,不会感受到性能出现断崖式下降。That is, in S203, after the notebook computer runs according to the third operating parameter for a certain period of time, it runs according to the first operating parameter corresponding to the first mode, that is, the operating state of each hardware can be adjusted according to the first operating parameter. In this way, the notebook computer can be buffered in the process of switching from the second mode to the first mode, that is, the user will not feel a cliff-like drop in performance when using the notebook computer.

在一些实施例中,笔记本电脑还可以在第一运行参数和第二运行参数之间,确定多组第三运行参数。笔记本电脑按照各组第三运行参数,控制各个硬件的运行状态之后,能够释放的最大性能可称为第三运行参数对应的性能。In some embodiments, the laptop computer may also determine multiple sets of third operating parameters between the first operating parameters and the second operating parameters. After the laptop computer controls the operating state of each hardware according to each set of third operating parameters, the maximum performance that can be released may be referred to as the performance corresponding to the third operating parameters.

在具有多组第三运行参数的情况下,按照各组第三运行参数对应性能,由大到小的顺序,依次采用每组第三运行参数,控制各个硬件的运行状态。比如,首先按照性能最高的第三运行参数,控制笔记本电脑运行一段时长。然后,再按照性能第二高的第三运行参数,控制笔记本电脑运行一段时长,以此类推。这样,每个时段笔记本电脑的性能都比上一时段低,但是,相邻两个时段的性能下降幅度不大。在笔记本电脑按照所有第三运行参数都运行了一段时间之后,再按照第一模式对应的第一运行参数,控制笔记本电脑运行。In the case of having multiple sets of third operating parameters, each set of third operating parameters is used in turn in descending order according to the performance corresponding to each set of third operating parameters to control the operating state of each hardware. For example, first control the laptop to run for a period of time according to the third operating parameter with the highest performance. Then, control the laptop to run for a period of time according to the third operating parameter with the second highest performance, and so on. In this way, the performance of the laptop in each period is lower than that of the previous period, but the performance decline of two adjacent periods is not large. After the laptop has run for a period of time according to all the third operating parameters, the laptop is controlled to run according to the first operating parameters corresponding to the first mode.

这样,笔记本电脑由第二模式切换至第一模式的过程中,笔记本电脑所释放的性能会逐步下降,用户也不会感受到笔记本电脑性能的断崖式下降,提高用户的使用体验。In this way, when the laptop computer switches from the second mode to the first mode, the performance released by the laptop computer will gradually decrease, and the user will not feel the cliff-like drop in the performance of the laptop computer, thereby improving the user's usage experience.

另外,在采用阶梯下降的方式,将第二模式切换至第一模式的过程中,笔记本电脑的GPU的图形系统整体功耗(TGP)表现,如图7所示:笔记本电脑中配置有三组第三运行参数。其中,三组第三运行参数中,对应的TGP的功率值分别为功率值1、功率值2、功率值3。这样,在确定需由第二模式切换至第一模式之后,笔记本电脑的GPU的TGP,在时段t4内,笔记本电脑的TGP保持在功率值1。在时段t4之后的时段t5,笔记本电脑的TGP保持在功率值2,也即,笔记本电脑的性能在小幅度的下降之后,在时段t5中保持稳定。在时段5之后的时段t6,笔记本电脑的TGP保持在功率值3,也即,笔记本电脑的性能在小幅度的下降之后,在时段t6中保持稳定。最后,在时段t6之后,笔记本电脑的TGP保持在功率值4,该功率值4可以是第一模式下GPU所对应的功率。可见,在时段6之后,完成切换至第一模式。在切换至第一模式之前,笔记本电脑的性能逐步稳定下降,提升用户对性能下降的适应程度。In addition, in the process of switching the second mode to the first mode in a step-down manner, the overall power consumption (TGP) of the graphics system of the GPU of the laptop computer is shown in FIG7: three sets of third operating parameters are configured in the laptop computer. Among them, the corresponding power values of TGP in the three sets of third operating parameters are power value 1, power value 2, and power value 3, respectively. In this way, after determining that the second mode needs to be switched to the first mode, the TGP of the GPU of the laptop computer is maintained at power value 1 in time period t4. In time period t5 after time period t4, the TGP of the laptop computer is maintained at power value 2, that is, the performance of the laptop computer remains stable in time period t5 after a small drop. In time period t6 after time period 5, the TGP of the laptop computer is maintained at power value 3, that is, the performance of the laptop computer remains stable in time period t6 after a small drop. Finally, after time period t6, the TGP of the laptop computer is maintained at power value 4, which can be the power corresponding to the GPU in the first mode. It can be seen that after time period 6, the switch to the first mode is completed. Before switching to the first mode, the performance of the laptop computer gradually and steadily decreases, thereby improving the user's adaptability to the performance degradation.

另外,在第二模式切换至第一模式的过程中,笔记本电脑的CPU主频率、启用CPU内核数量、CPU功率以及GPU主频率等的表现,与图7类似,在此不再赘述。In addition, in the process of switching from the second mode to the first mode, the performance of the CPU main frequency, the number of enabled CPU cores, the CPU power and the GPU main frequency of the laptop computer are similar to those in FIG. 7 and are not described again here.

在一些实施例中,在第二模式切换至第一模式的过程中,如果笔记本电脑检测到再次连接外置电源,或者,接收到用户指示启用第二模式的操作,笔记本电脑可以直接恢复启用第二模式运行。也就是,笔记本电脑的GPU的TGP表现,如图8所示:在启用第二模式的情况下,笔记本电脑的GPU的TGP,在时段t4内,笔记本电脑的TGP保持在功率值1。在时段4之后的时段t5,笔记本电脑的TGP保持在功率值2,也即,笔记本电脑的性能在小幅度的下降之后,在时段t5中保持稳定。之后,如果检测到笔记本电脑再次与外置电源连接,或者,接收到用户指示再次启用第二模式的操作,那么笔记本电脑直接再次切换启用第二模式,这样,笔记本电脑的TGP可以立即恢复到功率值5。In some embodiments, during the process of switching from the second mode to the first mode, if the laptop detects that the external power source is connected again, or receives an operation instructing the user to enable the second mode, the laptop can directly resume the second mode. That is, the TGP performance of the GPU of the laptop is as shown in FIG8: when the second mode is enabled, the TGP of the GPU of the laptop, in time period t4, the TGP of the laptop remains at power value 1. In time period t5 after time period 4, the TGP of the laptop remains at power value 2, that is, the performance of the laptop remains stable in time period t5 after a small drop. Afterwards, if it is detected that the laptop is connected to the external power source again, or if an operation instructing the user to enable the second mode again is received, the laptop directly switches to enable the second mode again, so that the TGP of the laptop can be immediately restored to power value 5.

总之,笔记本电脑在当前电能不足以支持长时间运行第二模式的场景下,笔记本电脑可以触发将第二模式切换为第一模式。在笔记本电脑从第二模式切换第一模式的过程中,笔记本电脑可以利用内置电池的短时放电特性,支撑笔记本电脑性能的缓慢下降,使得笔记本电脑可以缓慢地从第二模式过渡到第一模式,避免用户感受到明显的性能落差。In short, when the current power of the laptop is insufficient to support the long-term operation of the second mode, the laptop can trigger the switch from the second mode to the first mode. In the process of switching from the second mode to the first mode, the laptop can use the short-time discharge characteristics of the built-in battery to support the slow decline of the laptop performance, so that the laptop can slowly transition from the second mode to the first mode, avoiding the user from feeling a significant performance gap.

当然,在可能的实施例中,在笔记本电脑接收到用户指示启用第一模式的操作时,也可以采用同样的方式,由第二模式切换至第一模式,本申请实施例对此不作限定。Of course, in a possible embodiment, when the laptop computer receives an operation instructing the user to enable the first mode, the second mode can be switched to the first mode in the same manner, and the embodiment of the present application is not limited to this.

在一些实施例中,图4所示的方法和图6所示的方法,是笔记本电脑运行过程中面临的两种运行场景,原则上二者没有必然的先后顺序。在部分情况下,比如,结束交替第一模式和第二模式之后,如果笔记本电脑检测到与外置电源连接上,可以按照第二模式对应的第二性能参数运行。在第二条件下,在第一时段(如,时段t4)内按照第三性能参数运行,第三性能参数和所述第一性能参数的参数类型相同,第三性能参数的取值大于所述第一性能参数的取值,且小于所述第二性能参数的取值;所述第二条件包括检测到所述电子设备与所述外置电源断开连接,且所述第一应用正在运行;在第一时段之后,按照所述第一模式对应的第一性能参数运行。In some embodiments, the method shown in FIG4 and the method shown in FIG6 are two operation scenarios faced by a laptop computer during operation. In principle, there is no necessary order between the two. In some cases, for example, after the alternation between the first mode and the second mode ends, if the laptop detects that it is connected to an external power source, it can operate according to the second performance parameter corresponding to the second mode. Under the second condition, the third performance parameter is operated in the first time period (such as time period t4), the parameter type of the third performance parameter is the same as that of the first performance parameter, the value of the third performance parameter is greater than the value of the first performance parameter, and less than the value of the second performance parameter; the second condition includes detecting that the electronic device is disconnected from the external power source and the first application is running; after the first time period, the first performance parameter corresponding to the first mode is operated.

当然,在具有第三性能参数和第四性能参数的情况下,在所述第一时段之后的第二时段(如,时段t5),还可以按照第四性能参数运行。在第二时段之后,按照所述第一模式对应的第一性能参数运行。Of course, in the case of the third performance parameter and the fourth performance parameter, the fourth performance parameter can be used in the second period (eg, period t5) after the first period. After the second period, the first performance parameter corresponding to the first mode can be used.

在一些实施例中,笔记本电脑还可以结合实际的使用场景,自动控制不同运行模式的切换。示例性地,如图9所示,上述方法可以包括以下步骤:In some embodiments, the laptop computer can also automatically control the switching of different operating modes in combination with actual usage scenarios. For example, as shown in FIG9 , the above method may include the following steps:

S301,笔记本电脑启用第一模式运行。S301, the notebook computer starts running in the first mode.

在一些实施例中,上述S301的实现细节可参考前述实施例中的S101,在此不再赘述。In some embodiments, the implementation details of the above S301 can refer to S101 in the aforementioned embodiment, which will not be repeated here.

S302,笔记本电脑识别当前的使用场景。S302, the notebook computer identifies a current usage scenario.

其中,上述使用场景可以是笔记本电脑运行特定程序。The above usage scenario may be a laptop computer running a specific program.

在一些实施例中,笔记本电脑中可以预先配置特定程序的相关信息。其中,相关信息可以是对应程序文件的体积大小、程序标识、服务类型描述等。这样,笔记本电脑可以通过事件追踪窗口(event tracing for windows,ETW),获取正在运行的程序所对应的相关信息1。在获取到的相关信息1与预先配置的相关信息匹配的情况下,识别出笔记本电脑运行特定程序。In some embodiments, the laptop computer may be pre-configured with relevant information of a specific program. The relevant information may be the size of the corresponding program file, the program identifier, the service type description, etc. In this way, the laptop computer may obtain relevant information 1 corresponding to the running program through the event tracing for windows (ETW). When the obtained relevant information 1 matches the pre-configured relevant information, it is identified that the laptop computer is running a specific program.

比如,笔记本电脑中游戏类程序、仿真类程序、设计类程序、办公类程序等为特定程序。这样,笔记本电脑中可以配置有游戏类程序、仿真类程序、设计类程序、办公类程序等软件程序的相关信息。在用户指示笔记本电脑运行游戏程序a时,笔记本电脑可以通ETW检测游戏程序a的体积大小、程序标识、服务类型描述等中的一项或多项,并将检测到的信息作为游戏程序a的相关信息1。For example, game programs, simulation programs, design programs, office programs, etc. in a laptop are specific programs. In this way, the laptop can be configured with relevant information of software programs such as game programs, simulation programs, design programs, office programs, etc. When the user instructs the laptop to run game program a, the laptop can detect one or more of the size, program identifier, service type description, etc. of game program a through ETW, and use the detected information as relevant information 1 of game program a.

在相关信息1中包含游戏程序a的体积大小1的情况下,如果体积大小1与任意一个预配置的特定程序的体积大小之间的差值小于预设阈值,也即,游戏程序a的体积大小与预配置的特定程序的体积大小接近,那么确定当前所运行的游戏程序a属于特定程序,这样,笔记本电脑可以识别出当前的使用场景是正运行特定程序。When the relevant information 1 includes the volume size 1 of the game program a, if the difference between the volume size 1 and the volume size of any preconfigured specific program is less than a preset threshold, that is, the volume size of the game program a is close to the volume size of the preconfigured specific program, then it is determined that the currently running game program a belongs to a specific program. In this way, the laptop computer can recognize that the current usage scenario is running a specific program.

在相关信息1中包含游戏程序a的程序标识1的情况下,如果程序标识1与任意一个预配置的特定程序的程序标识相同,那么确定当前所运行的游戏程序a属于特定程序,这样,笔记本电脑可以识别出当前的使用场景是正运行特定程序。When the relevant information 1 includes the program identifier 1 of the game program a, if the program identifier 1 is the same as the program identifier of any preconfigured specific program, then it is determined that the currently running game program a belongs to the specific program. In this way, the laptop computer can recognize that the current usage scenario is running a specific program.

在相关信息1中包含游戏程序a的服务类型描述1(如,多人在线战术竞技类游戏服务)的情况下,如果服务类型描述1与任意一个预配置的特定程序的服务类型描述相同,那么确定当前所运行的游戏程序a属于特定程序,这样,笔记本电脑可以识别出当前的使用场景是正运行特定程序。When the relevant information 1 includes a service type description 1 of a game program a (e.g., a multiplayer online tactical competitive game service), if the service type description 1 is the same as the service type description of any preconfigured specific program, then it is determined that the currently running game program a belongs to a specific program. In this way, the laptop computer can recognize that the current usage scenario is running a specific program.

另外,上述使用场景可以是程序处于特定的运行阶段。In addition, the above usage scenario may be that the program is in a specific running stage.

在一些实施例中,笔记本电脑中可以预先配置多个程序(可以是第一应用)所对应的运行阶段及不同运行阶段所对应的标识事件。比如,游戏程序对应有“游戏启动前”和“游戏启动后”两个阶段,其中,“游戏启动前”对应的标识事件可以是显示游戏大厅界面、显示游戏登录界面或者显示游戏等待界面等。“游戏启动后”对应的标识事件可以是显示游戏实时画面、接收到用户的交互操作、请求占用的资源量激增等。再比如,办公程序对应有“打开文档”和“浏览文档”等多个阶段,其中,“打开文档”对应的标识事件可以是接收到用户对指定文档的选中操作。“浏览文档”对应的标识事件可以是接收到用户指示滑动浏览的操作。In some embodiments, the notebook computer may pre-configure the operation stages corresponding to multiple programs (which may be the first application) and the identification events corresponding to different operation stages. For example, the game program corresponds to two stages, "before the game starts" and "after the game starts", where the identification event corresponding to "before the game starts" may be displaying the game lobby interface, displaying the game login interface, or displaying the game waiting interface, etc. The identification event corresponding to "after the game starts" may be displaying the real-time game screen, receiving the user's interactive operation, requesting a surge in the amount of resources occupied, etc. For another example, the office program corresponds to multiple stages such as "opening a document" and "browsing a document", where the identification event corresponding to "opening a document" may be receiving the user's selection operation for a specified document. The identification event corresponding to "browsing a document" may be receiving the user's instruction to slide and browse.

在一些实施例中,能够触发交替启用第一模式和第二模式的标识事件可称为第一事件。对于不同的第一应用,对应的第一事件可以不同。比如,在第一应用为文档编辑应用的情况下,第一事件为打开第一类文件,第一类文件是体积大于预设值的文件;在第一应用为仿真应用的情况下,第一事件为接收到启动仿真的操作。不同第一应用所对应的第一事件,可以由用户根据实际经验进行设定,本申请实施例对此不作具体限定。In some embodiments, an identification event that can trigger the alternating activation of the first mode and the second mode can be referred to as a first event. For different first applications, the corresponding first events may be different. For example, when the first application is a document editing application, the first event is opening a first type of file, and the first type of file is a file with a volume greater than a preset value; when the first application is a simulation application, the first event is receiving an operation to start the simulation. The first events corresponding to different first applications can be set by the user based on actual experience, and the embodiments of the present application do not specifically limit this.

这样,在笔记本电脑运行期间,可以通过ETW进行标识事件的检测,然后,依据检测到的标识事件,确定笔记本电脑的当前的使用场景。比如,笔记本电脑中预先配置标识事件a可以指示程序a所对应的运行阶段a。在笔记本电脑实际检测到标识事件a的情况下,笔记本电脑可以确定当前的使用场景是:程序a运行于阶段a。In this way, during the operation of the laptop, identification events can be detected through ETW, and then the current usage scenario of the laptop can be determined based on the detected identification events. For example, identification event a pre-configured in the laptop can indicate the running stage a corresponding to program a. When the laptop actually detects identification event a, the laptop can determine that the current usage scenario is: program a is running in stage a.

S303,在使用场景指示需要启用第二模式的情况下,采用与使用场景匹配的心跳控制策略,交替启用第一模式和第二模式。S303: When the usage scenario indicates that the second mode needs to be enabled, a heartbeat control strategy matching the usage scenario is adopted to alternately enable the first mode and the second mode.

在一些实施例中,笔记本电脑中可以预先配置多类使用场景1,该使用场景1是需要启用第二模式的场景。示例性地,上述使用场景1可以包括运行特定程序,比如,特定程序包括游戏类程序、仿真类程序。再比如,部分程序运行到特定的运行阶段是需要启用第二模式的使用场景。In some embodiments, multiple types of usage scenarios 1 may be pre-configured in the laptop computer, and the usage scenario 1 is a scenario where the second mode needs to be enabled. Exemplarily, the usage scenario 1 may include running a specific program, such as a game program or a simulation program. For another example, when some programs run to a specific running stage, it is a usage scenario where the second mode needs to be enabled.

另外,在另一些实施例中,笔记本电脑中可以预先配置每一类使用场景1对应的心跳控制策略。可以理解的,心跳控制策略可以针对使用场景1的场景特点进行配置。其中,心跳控制策略可以规定第一模式和第二模式的切换次数。或者,心跳控制策略可以规定启用该心跳控制策略的起、止时间点。In addition, in other embodiments, the laptop computer may pre-configure a heartbeat control strategy corresponding to each type of usage scenario 1. It is understandable that the heartbeat control strategy may be configured according to the scene characteristics of the usage scenario 1. The heartbeat control strategy may specify the number of switching times between the first mode and the second mode. Alternatively, the heartbeat control strategy may specify the start and end time points for enabling the heartbeat control strategy.

比如,运行文件浏览程序的场景,其场景特点可以是:在打开大体积文档的过程中,对于笔记本电脑的性能要求高。在文档打开后,实际显示文档内容的期间,对于笔记本电脑的性能要求不高。另外,打开文档所占的时间通常较短。结合上述场景特点,对应地心跳控制策略(如称为心跳控制策略1)可以指示笔记本电脑启用第二模式之后,切换至第一模式。在切换至第一模式之后,结束第一模式和第二模式的交替,也即,心跳控制策略1中规定第一模式和第二模式的交替次数较少,如,交替次数为1。For example, in the scenario of running a file browsing program, the scenario characteristics may be: in the process of opening a large-volume document, the performance requirements for the laptop are high. After the document is opened, the performance requirements for the laptop are not high during the period of actually displaying the document content. In addition, the time taken to open a document is usually short. In combination with the above-mentioned scenario characteristics, the corresponding heartbeat control strategy (such as heartbeat control strategy 1) can instruct the laptop to switch to the first mode after enabling the second mode. After switching to the first mode, the alternation between the first mode and the second mode ends, that is, the heartbeat control strategy 1 stipulates that the number of alternations between the first mode and the second mode is small, such as the number of alternations is 1.

这样,在按照心跳控制策略1控制笔记本电脑的情况下,笔记本电脑的CPU功率表现,如图10所示:在启用第二模式的情况下,笔记本电脑的CPU功率为PL2,在时段t7内,笔记本电脑的功率保持在PL2。在时段t7之后,笔记本电脑切换启用第一模式,笔记本电脑的CPU功率也保持在PL1。In this way, when the laptop is controlled according to the heartbeat control strategy 1, the CPU power performance of the laptop is as shown in Figure 10: when the second mode is enabled, the CPU power of the laptop is PL2, and in the period t7, the power of the laptop remains at PL2. After the period t7, the laptop switches to enable the first mode, and the CPU power of the laptop also remains at PL1.

再比如,运行设计程序的场景,其场景特点可以是:设计程序整个运行过程中,对笔记本电脑的性能要求都高。结合上述场景特点,对应地心跳控制策略可以指示笔记本电脑不断地交替启用第一模式和第二模式,直至设计程序停止运行。这样,该心跳控制策略中可以规定启用该心跳控制策略的起始时间点为确定需要启用第二模式的时刻,终止时间点为设计程序停止运行的时刻或者检测到连接外置电源的时刻。For another example, in the scenario of running a design program, the scenario characteristics may be: during the entire operation of the design program, the performance requirements for the laptop are high. In combination with the above-mentioned scenario characteristics, the corresponding heartbeat control strategy may instruct the laptop to continuously and alternately enable the first mode and the second mode until the design program stops running. In this way, the heartbeat control strategy may specify that the starting time point for enabling the heartbeat control strategy is the moment when it is determined that the second mode needs to be enabled, and the end time point is the moment when the design program stops running or the moment when the external power supply is detected to be connected.

再比如,游戏程序运行于“游戏启动前”的场景,其场景特点可以是:在游戏程序运行之后,游戏正式启动之前,如,显示游戏登录界面或者显示游戏大厅界面期间,对笔记本电脑的性能要求虽然高,但是偶尔笔记本电脑的性能下降,也不会影响用户在此阶段的使用体验。结合上述场景特点,对应地心跳控制策略可以指示笔记本电脑不断地交替启用第一模式和第二模式,直至该场景结束,如游戏程序进入“游戏启动后”阶段,或者游戏程序结束运行。这样,该心跳控制策略中可以规定启用该心跳控制策略的起始时间点为确定需要启用第二模式的时刻,终止时间点为游戏程序停止运行的时刻或者检测到连接外置电源的时刻。For another example, the game program runs in the "before game starts" scenario, and the scenario characteristics may be: after the game program runs and before the game is officially started, such as during the display of the game login interface or the display of the game lobby interface, although the performance requirements for the laptop are high, the occasional performance drop of the laptop will not affect the user experience at this stage. In combination with the above-mentioned scenario characteristics, the corresponding heartbeat control strategy can instruct the laptop to continuously and alternately enable the first mode and the second mode until the scenario ends, such as the game program enters the "after game starts" stage, or the game program ends running. In this way, the heartbeat control strategy can specify that the starting time point for enabling the heartbeat control strategy is the moment when it is determined that the second mode needs to be enabled, and the end time point is the moment when the game program stops running or the moment when the external power supply is detected to be connected.

再比如,游戏程序运行于“游戏启动后”的场景,其场景特点可以是:在游戏启动之后,对笔记本电脑的性能要求高,短暂的性能下降,也会出现游戏掉帧和卡顿,直接影响用户在此阶段的使用体验。结合上述场景特点,不启用心跳控制策略,笔记本电脑需要长期启用第二模式。For example, the game program is running in the "after the game is started" scenario. The scenario characteristics may be: after the game is started, the performance requirements of the laptop are high, and the performance drops for a short time, and the game will also drop frames and freeze, which directly affects the user experience at this stage. Combined with the above scenario characteristics, the heartbeat control strategy is not enabled, and the laptop needs to enable the second mode for a long time.

也就是,对于游戏程序而言,在一些实施例中,在程序运行之后,可以在“游戏启动前”的阶段,采用心跳控制策略。在“游戏启动后”的阶段,不采用心跳控制策略,保持启用第二模式的状态。That is, for the game program, in some embodiments, after the program is running, the heartbeat control strategy can be adopted in the stage of "before the game starts". In the stage of "after the game starts", the heartbeat control strategy is not adopted, and the state of enabling the second mode is maintained.

当然,在另一些实施例中,对于游戏程序而言,在程序运行之后,可以都不启用心跳控制策略,优先满足用户对笔记本电脑的性能需求。Of course, in other embodiments, for game programs, after the programs are running, the heartbeat control strategy may not be enabled, giving priority to satisfying the user's performance requirements for the laptop computer.

在另外一些实施例中,上述心跳控制策略可还可以规定单次启用第一模式的时长(启用时长1)和单次启用第二模式的时长(启用时长2)。In some other embodiments, the above-mentioned heartbeat control strategy may further specify the duration of a single activation of the first mode (activation duration 1) and the duration of a single activation of the second mode (activation duration 2).

可以理解地,启用时长1和启用时长2均与笔记本电脑的剩余电量(或者,短时放电能力)相关联。也即,在不同剩余电量下,对应的启用时长1可以不同,对应的启用时长2也可以不同,第一模式和第二模式的交替次数,也是可以不同。It can be understood that both the activation duration 1 and the activation duration 2 are associated with the remaining power (or short-time discharge capability) of the laptop computer. That is, under different remaining power, the corresponding activation duration 1 may be different, the corresponding activation duration 2 may also be different, and the number of alternations between the first mode and the second mode may also be different.

在一些示例中,可以在不同剩余电量(或者,短时放电能力)下,通过测试的方式,确定出最优的启用时长1和启用时长2。其中,最优的启用时长1和启用时长2,能够在不同的剩余电量(或者,短时放电能力)下,协调使用场景对性能的要求和笔记本电脑的续航。In some examples, the optimal enabling duration 1 and enabling duration 2 can be determined by testing under different remaining power (or short-time discharge capacity). The optimal enabling duration 1 and enabling duration 2 can coordinate the performance requirements of the usage scenario and the battery life of the laptop under different remaining power (or short-time discharge capacity).

当然,启用时长1和启用时长2也可以与所运行的第一应用相关,也即,在启用不同的第一应用时,对应的启用时长1可以不同,对应的启用时长2也可以不同,第一模式和第二模式的交替次数,也是可以不同。Of course, the activation duration 1 and the activation duration 2 may also be related to the first application being run. That is, when different first applications are enabled, the corresponding activation duration 1 may be different, the corresponding activation duration 2 may also be different, and the number of alternations between the first mode and the second mode may also be different.

在一些实施例中,还可以通过测试的方式,结合使用场景的场景特点,确定最优的启用时长1和启用时长2。当然,还可以通过测试的方式,在不同使用场景下,确定每次启用第一模式的启用时长1,和每次启用第二模式的启用时长2。比如,在一些使用场景下,不同次启用第一模式的启用时长1可以不同,不同次启用第二模式的启用时长2可以不同。再比如,在另一些使用场景下,不同次启用第一模式的启用时长1可以相同,不同次启用第二模式的启用时长2可以相同。In some embodiments, the optimal activation duration 1 and activation duration 2 can also be determined by testing in combination with the scenario characteristics of the usage scenario. Of course, the activation duration 1 for each activation of the first mode and the activation duration 2 for each activation of the second mode can also be determined in different usage scenarios by testing. For example, in some usage scenarios, the activation duration 1 for different activations of the first mode can be different, and the activation duration 2 for different activations of the second mode can be different. For another example, in other usage scenarios, the activation duration 1 for different activations of the first mode can be the same, and the activation duration 2 for different activations of the second mode can be the same.

可见,不同的使用场景1对应的心跳控制策略可能不同,当然,也可能相同,本申请实施例对此不作具体限定。It can be seen that the heartbeat control strategies corresponding to different usage scenarios 1 may be different, and of course, they may also be the same. The embodiments of the present application do not make specific limitations on this.

在一些实施例中,笔记本电脑在识别出当前的使用场景之后,如果当前的使用场景属于预先配置的使用场景1,按照匹配的心跳控制策略,交替启用第一模式和第二模式。由于心跳控制策略可以与对应的使用场景1的场景特点匹配,这样,可以确保在各类使用场景1下,对应的心跳控制策略都能够很好地协调续航和使用场景对于性能的要求。In some embodiments, after the laptop computer identifies the current usage scenario, if the current usage scenario belongs to the pre-configured usage scenario 1, the first mode and the second mode are alternately enabled according to the matching heartbeat control strategy. Since the heartbeat control strategy can match the scene characteristics of the corresponding usage scenario 1, it can be ensured that in various usage scenarios 1, the corresponding heartbeat control strategy can well coordinate the requirements of battery life and performance of the usage scenario.

另外,在笔记本电脑按照心跳控制策略切换第一模式和第二模式之后,如S103和S303之后,可以在以下几种情况下,结束交替切换第一模式和第二模式:In addition, after the notebook computer switches between the first mode and the second mode according to the heartbeat control strategy, such as after S103 and S303, the alternating switching between the first mode and the second mode can be terminated in the following cases:

1、到达心跳控制策略指示的止时间点。比如,第一模式和第二模式之间的交替次数已达到心跳控制策略中指示的次数。再比如,心跳控制策略的启用时间已达到预配置的最长时间。再比如,所运行的特定程序停止运行的时间点。再比如,特定的使用场景已不存在的时间点。1. The end time point indicated by the heartbeat control policy is reached. For example, the number of alternations between the first mode and the second mode has reached the number indicated in the heartbeat control policy. For another example, the activation time of the heartbeat control policy has reached the pre-configured maximum time. For another example, the time point when a specific program stops running. For another example, the time point when a specific usage scenario no longer exists.

2、笔记本电脑检测到连接上外置电源。2. The laptop detects that an external power source is connected.

3、接收到用户指示关闭交替启用第一模式和第二模式的操作。3. Receive a user instruction to close the operation of alternately enabling the first mode and the second mode.

在结束交替启用第一模式和第二模式之后,笔记本电脑可以根据预置的策略,选择所运行的模式。比如,当前连接有外置电源,则直接启用第二模式。比如,当前未连接外置电源,则直接启用第一模式。比如,在结束交替时,启用第一模式,那么继续启用第一模式;在结束交替时启用第二模式,那么继续启用第二模式。After the alternating activation of the first mode and the second mode ends, the notebook computer can select the running mode according to the preset strategy. For example, if an external power source is currently connected, the second mode is directly enabled. For example, if an external power source is not currently connected, the first mode is directly enabled. For example, when the alternation ends, the first mode is enabled, and the first mode continues to be enabled; when the alternation ends, the second mode is enabled, and the second mode continues to be enabled.

在一些实施例中,如图11所示,上述方法可以包括以下步骤:In some embodiments, as shown in FIG11 , the method may include the following steps:

S401,笔记本电脑启用第二模式运行。S401, the notebook computer starts running in the second mode.

在一些实施例中,上述S401的实现细节可参考前述实施例中的S201,在此不再赘述。In some embodiments, the implementation details of the above S401 can refer to S201 in the aforementioned embodiment, which will not be repeated here.

S402,笔记本电脑识别当前的使用场景。S402, the notebook computer identifies a current usage scenario.

在一些实施例中,上述S402的实现细节可参考前述实施例中的S302,在此不再赘述。In some embodiments, the implementation details of the above S402 may refer to S302 in the aforementioned embodiment, which will not be repeated here.

S403,笔记本电脑根据当前的使用场景,采用阶梯下降的方式,将第二模式切换至第一模式。S403, the laptop computer switches from the second mode to the first mode in a step-down manner according to the current usage scenario.

在一些实施例中,笔记本电脑中预先配置有多个使用场景1,以及使用场景1对应的阶梯下降方式。其中,阶梯下降方式可以规定有第三运行参数的数量,以及每次按照第三运行参数运行的时间长度。In some embodiments, the laptop is pre-configured with a plurality of usage scenarios 1 and a step-down method corresponding to the usage scenario 1. The step-down method may specify the number of third operating parameters and the duration of each operation according to the third operating parameters.

在一些实施例中,不同的使用场景1对应的阶梯下降方式可以不同,当然,也可以相同,本申请对此不作具体限定。In some embodiments, the step-down methods corresponding to different usage scenarios 1 may be different, or of course, they may be the same, and this application does not make any specific limitations on this.

在另一些实施例中,同一使用场景1还可以对应多个阶梯下降方式,每个阶梯下降方式对应有一个内置电池的剩余电量(或者,短时放电能力)。In other embodiments, the same usage scenario 1 may also correspond to multiple step-down modes, each of which corresponds to the remaining power (or short-time discharge capability) of a built-in battery.

这样,笔记本电脑在识别出当前的使用场景之后,如果当前的使用场景属于预先配置的使用场景1,那么结合当前内置电池的剩余电量(或,短时放电能力),确定匹配的阶梯下降方式。然后,按照匹配的阶梯下降方式,从启用第一模式对应的第一运行参数,过渡到启用第二模式对应的第二运行参数。In this way, after the laptop computer identifies the current usage scenario, if the current usage scenario belongs to the pre-configured usage scenario 1, it determines a matching step-down method in combination with the remaining power (or short-time discharge capacity) of the current built-in battery. Then, according to the matching step-down method, the first operating parameter corresponding to the first mode is enabled and the second operating parameter corresponding to the second mode is enabled.

作为一种实现方式,如图12所示,笔记本电脑可以包括应用层、中间件层、操作系统(operating system,OS)层以及硬件层等。As an implementation manner, as shown in FIG12 , the notebook computer may include an application layer, a middleware layer, an operating system (OS) layer, a hardware layer, and the like.

示例性地,上述应用层可以包括场景识别模块,该场景识别模块可以通过调用ETW,区分不同的使用场景,比如,运行游戏程序的场景、运行设计程序的场景、运行仿真程序的场景以及运行办公程序的场景。Exemplarily, the application layer may include a scenario recognition module, which may distinguish different usage scenarios by calling ETW, such as a scenario of running a game program, a scenario of running a design program, a scenario of running a simulation program, and a scenario of running an office program.

又示例性地,中间件层包括性能模式监控模块、CPU性能调度模块及GPU性能调度模块等。其中,性能模式监控模块,在笔记本电脑启用第一模式的情况下,监控是否需要启用第二模式。在确定需要启动第二模式的情况下,通过场景识别模块,识别当前的使用场景。然后,性能模式监控模块根据使用场景,确定匹配的心跳控制策略。As another example, the middleware layer includes a performance mode monitoring module, a CPU performance scheduling module, and a GPU performance scheduling module. Among them, the performance mode monitoring module monitors whether the second mode needs to be enabled when the laptop enables the first mode. When it is determined that the second mode needs to be enabled, the scene recognition module identifies the current usage scenario. Then, the performance mode monitoring module determines the matching heartbeat control strategy based on the usage scenario.

上述CPU性能调度模块及GPU性能调度模块,可以按照心跳控制策略,通过OS层,调整CPU、GPU、散热装置、内置电池的工作状态,实现对笔记本电脑性能的调整。The CPU performance scheduling module and the GPU performance scheduling module can adjust the working status of the CPU, GPU, heat dissipation device, and built-in battery through the OS layer according to the heartbeat control strategy to adjust the performance of the laptop computer.

又示例性地,OS层可以包括CPU管理策略模块、GPU管理策略模块、电池管理策略模块和散热控制模块。Also exemplarily, the OS layer may include a CPU management policy module, a GPU management policy module, a battery management policy module, and a heat dissipation control module.

其中,CPU管理策略模块可以直接驱动CPU,调整CPU的工作状态,如,调整主频率、启用内核数量、功率等。Among them, the CPU management policy module can directly drive the CPU and adjust the working status of the CPU, such as adjusting the main frequency, the number of enabled cores, power, etc.

GPU管理策略模块可以直接驱动GPU,调整GPU的工作状态,如,调整主频率、TGP等。The GPU management strategy module can directly drive the GPU and adjust the working status of the GPU, such as adjusting the main frequency, TGP, etc.

电池管理策略模块可以检测到笔记本电脑是否外接外置电源,还可以检测内置电池的剩余电量、短时放电能力等,还可以指示内置电池启动短时放电,供给笔记本电脑运行所需的电能。The battery management strategy module can detect whether the laptop is connected to an external power supply, and can also detect the remaining power and short-time discharge capability of the built-in battery. It can also instruct the built-in battery to start short-time discharge to supply the power required for the laptop to operate.

散热控制模块可以直接驱动散热装置(如,散热风扇),调整散热装置的工作状态。The heat dissipation control module can directly drive the heat dissipation device (eg, a heat dissipation fan) and adjust the working state of the heat dissipation device.

这样,笔记本电脑的各个软件模块能够实现前述实施例提供的方法。In this way, each software module of the notebook computer can implement the method provided by the aforementioned embodiment.

示例性地,上述S101、S201、S301和S401可以是由CPU性能调度模块调用CPU管理策略模块、电池管理策略模块及散热控制模块,驱动对应的硬件实现。当然,上述S101、S201、S301和S401也可以是由GPU性能调度模块调用GPU管理策略模块、电池管理策略模块及散热控制模块,驱动对应的硬件实现。Exemplarily, the above S101, S201, S301 and S401 can be implemented by the CPU performance scheduling module calling the CPU management policy module, the battery management policy module and the heat dissipation control module to drive the corresponding hardware. Of course, the above S101, S201, S301 and S401 can also be implemented by the GPU performance scheduling module calling the GPU management policy module, the battery management policy module and the heat dissipation control module to drive the corresponding hardware.

又示例性地,上述S102、S202、S302和S402可以由场景识别模块和性能模式监控模块,协同执行。As another example, the above S102, S202, S302 and S402 may be collaboratively executed by the scene recognition module and the performance mode monitoring module.

再示例性地,上述S103、S203、S303和S403可以由CPU性能调度模块调用CPU管理策略模块、电池管理策略模块及散热控制模块,驱动对应的硬件实现。当然,上述S103、S203、S303和S403也可以由GPU性能调度模块调用GPU管理策略模块、电池管理策略模块及散热控制模块,驱动对应的硬件实现。As another example, the above S103, S203, S303 and S403 can be implemented by the CPU performance scheduling module calling the CPU management strategy module, the battery management strategy module and the heat dissipation control module to drive the corresponding hardware. Of course, the above S103, S203, S303 and S403 can also be implemented by the GPU performance scheduling module calling the GPU management strategy module, the battery management strategy module and the heat dissipation control module to drive the corresponding hardware.

比如,按照心跳控制策略,CPU性能调度模块可以通过CPU管理策略模块、电池管理策略模块及散热控制模块,调整CPU、散热装置以及内置电池的工作状态,在周期性地提升CPU输出性能的同时,控制内置电池开启短时放电,提供笔记本电脑运行所需电量,以及,通过散热装置带走CPU性能提升后带来的热量。再比如,按照心跳控制策略,GPU性能调度模块可以通过GPU管理策略模块、电池管理策略模块及散热控制模块,调整GPU、散热装置以及内置电池的工作状态,在周期性地提升GPU输出性能的同时,控制内置电池开启短时放电,提供笔记本电脑运行所需电量,以及,通过散热装置带走GPU性能提升后带来的热量。For example, according to the heartbeat control strategy, the CPU performance scheduling module can adjust the working state of the CPU, the heat dissipation device and the built-in battery through the CPU management strategy module, the battery management strategy module and the heat dissipation control module, and control the built-in battery to start short-term discharge while periodically improving the CPU output performance, so as to provide the power required for the notebook computer to run, and remove the heat generated by the CPU performance improvement through the heat dissipation device. For another example, according to the heartbeat control strategy, the GPU performance scheduling module can adjust the working state of the GPU, the heat dissipation device and the built-in battery through the GPU management strategy module, the battery management strategy module and the heat dissipation control module, and control the built-in battery to start short-term discharge while periodically improving the GPU output performance, so as to provide the power required for the notebook computer to run, and remove the heat generated by the GPU performance improvement through the heat dissipation device.

本申请实施例还提供一种电子设备,该电子设备可以包括:存储器和一个或多个处理器。该存储器和处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,可使得电子设备执行上述实施例中手机执行的各个步骤。当然,该电子设备包括但不限于上述存储器和一个或多个处理器。The embodiment of the present application also provides an electronic device, which may include: a memory and one or more processors. The memory is coupled to the processor. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can execute the various steps executed by the mobile phone in the above embodiment. Of course, the electronic device includes but is not limited to the above memory and one or more processors.

在一些实施例中,通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。In some embodiments, through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.

以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims (11)

CN202310304793.5A2023-03-202023-03-20 Device control method and electronic deviceActiveCN117130462B (en)

Priority Applications (2)

Application NumberPriority DateFiling DateTitle
CN202310304793.5ACN117130462B (en)2023-03-202023-03-20 Device control method and electronic device
CN202410925739.7ACN118963530A (en)2023-03-202023-03-20 Device control method and electronic device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202310304793.5ACN117130462B (en)2023-03-202023-03-20 Device control method and electronic device

Related Child Applications (1)

Application NumberTitlePriority DateFiling Date
CN202410925739.7ADivisionCN118963530A (en)2023-03-202023-03-20 Device control method and electronic device

Publications (2)

Publication NumberPublication Date
CN117130462A CN117130462A (en)2023-11-28
CN117130462Btrue CN117130462B (en)2024-07-26

Family

ID=88851557

Family Applications (2)

Application NumberTitlePriority DateFiling Date
CN202410925739.7APendingCN118963530A (en)2023-03-202023-03-20 Device control method and electronic device
CN202310304793.5AActiveCN117130462B (en)2023-03-202023-03-20 Device control method and electronic device

Family Applications Before (1)

Application NumberTitlePriority DateFiling Date
CN202410925739.7APendingCN118963530A (en)2023-03-202023-03-20 Device control method and electronic device

Country Status (1)

CountryLink
CN (2)CN118963530A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120104200B (en)*2025-05-092025-08-05苏州元脑智能科技有限公司Method and device for executing system functions

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1877491A (en)*2005-06-112006-12-13乐金电子(昆山)电脑有限公司Method and apparatus for implementing a hybrid mode for a multi-core processor and powder supply manage mode setting method
CN101997956A (en)*2009-08-172011-03-30联想(北京)有限公司Method for switching work mode of mobile terminal and mobile terminal

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7500127B2 (en)*2003-09-182009-03-03Vulcan Portals Inc.Method and apparatus for operating an electronic device in a low power mode
FR2941799B1 (en)*2009-01-302011-03-04St Nxp Wireless France METHOD AND SYSTEM FOR MANAGING THE OPERATION OF A MULTI-COARSE DATA PROCESSING DEVICE
TWI521339B (en)*2015-03-092016-02-11光寶電子(廣州)有限公司External power supply and system connection detection unit applied thereto
CN109445858B (en)*2018-09-302021-10-22联想(北京)有限公司Switching method and system
CN111698544A (en)*2019-03-152020-09-22海信视像科技股份有限公司Display device
CN113784393B (en)*2021-05-142023-04-07荣耀终端有限公司Peak value downloading method and device
CN113778663B (en)*2021-07-282023-05-12荣耀终端有限公司Scheduling method of multi-core processor and electronic equipment
CN113986002B (en)*2021-12-312022-06-17荣耀终端有限公司Frame processing method, device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1877491A (en)*2005-06-112006-12-13乐金电子(昆山)电脑有限公司Method and apparatus for implementing a hybrid mode for a multi-core processor and powder supply manage mode setting method
CN101997956A (en)*2009-08-172011-03-30联想(北京)有限公司Method for switching work mode of mobile terminal and mobile terminal

Also Published As

Publication numberPublication date
CN117130462A (en)2023-11-28
CN118963530A (en)2024-11-15

Similar Documents

PublicationPublication DateTitle
EP4311314A1 (en)Sleep scheduling method and device
CN114924682A (en)Content connection method and electronic equipment
CN116680153B (en) Application frame rate smoothing method, electronic device and storage medium
CN112988282B (en) Application keep-alive method and terminal device
CN115657870A (en) A method for adjusting the sampling rate of a touch screen and electronic equipment
CN116028205A (en) Resource scheduling method and electronic device
WO2022237259A1 (en)Standby method for terminal device and terminal device
CN117130462B (en) Device control method and electronic device
EP4280060A1 (en)Power consumption control method and apparatus
CN116028207A (en)Scheduling policy determination method, device, equipment and storage medium
CN117666453A (en) Link control method and electronic device
CN117130454B (en)Power consumption adjustment method and electronic equipment
WO2024198667A1 (en)Configuration method and electronic device
CN116089055B (en)Resource scheduling method and device
EP4113276B1 (en)Sound playback method and device
CN114069740B (en)Charging method and electronic device
CN117130765A (en)Configuration method of computing resources and electronic equipment
CN116709476A (en)Method and device for waking up and keeping alive device, electronic device and storage medium
CN117270670B (en) Power consumption control method and electronic device
CN117724595B (en)Power management circuit, method, apparatus, electronic device, and readable storage medium
CN118519568B (en) Display control method, electronic device, computer program product, and storage medium
CN117130771B (en)Resource scheduling method, electronic equipment and storage medium
CN118398929B (en)Battery management method and electronic equipment
WO2024098975A9 (en)Power consumption control method and related apparatus
CN115904053A (en)Driving method, device and system of solid state disk

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
CP03Change of name, title or address
CP03Change of name, title or address

Address after:Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after:Honor Terminal Co.,Ltd.

Country or region after:China

Address before:3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before:Honor Device Co.,Ltd.

Country or region before:China


[8]ページ先頭

©2009-2025 Movatter.jp