自适应休眠概述Adaptive hibernate overview

如果系统未被使用,用户可以将其 Windows 设备中的 "休眠" 选项设置为使系统进入低功耗状态。Users can set the Hibernate option in their Windows devices to put the system into a low power state when the system is not in use. OS 中休眠的当前逻辑依赖于自适应休眠,使系统处于休眠状态,然后在新式备用期间排出一定百分比的电池容量。The current logic for hibernate in the OS relies on adaptive hibernate to put the system in hibernate after draining a certain percentage of battery capacity during Modern Standby.

Oem 或用户还可以将固定的 doze 配置为休眠计时器。OEMs or users can also configure a fixed doze to hibernate timer. 但是,基于计时器的逻辑具有显著的用户体验。However, the timer-based logic has significant user experience drawbacks. 如果在 doze 超时内发生了排出,或通过在 doze 超时休眠状态缩短了低排出新式备用体验,则固定 doze 计时器可导致系统完全耗尽备用电池。A fixed doze timer can result in the system fully draining the battery in standby if the drain happened within the doze timeout or cut short a low-drain Modern Standby experience by hibernating at the doze timeout. 因此,更可取的方法是根据电池消耗动态地利用自适应休眠休眠。Consequently, it is preferable to leverage adaptive hibernate to hibernate dynamically based on battery drain.

自适应休眠提供了允许系统智能地进入睡眠状态的触发器。Adaptive hibernate provides triggers which allow the system to hibernate intelligently. 这些触发器具有以下优势:These triggers provide the following benefits:

  • 避免恢复到电池电量不足的情况。Eliminate resuming to a dead battery.
  • 通过确保系统在最新的时间内保持最新状态,提供出色的 新式备用 体验。Provide a great Modern Standby experience by ensuring that the system remains in Modern Standby for as long as possible.

为支持自适应休眠触发器,系统启用了默认值。To support the adaptive hibernate triggers, the system is enabled with default values. 但是,Oem 可以对这些触发器进行编程,以确保计算机处于休眠状态,以便为用户提供最佳体验。However, OEMs can program these triggers to ensure that machines hibernate to provide the best possible experience to users.

系统要求System requirements

触发器仅适用于新式备用系统。The triggers apply to Modern Standby systems only.

默认行为Default behavior

默认情况下,计算机将启用自适应休眠超时;但是,Oem 可以使用预配包文件来配置设置。Machines will have adaptive hibernate timeout enabled by default; however, OEMs can configure the settings using a provisioning package file. 有关如何执行此操作的详细信息,请参阅以下各节。See the following sections for more information on how to do this.

备注

在应用其中一个触发器之前,Windows 有15分钟的宽限期。Windows has a 15-minute grace period before either of these triggers are applied. 这是为了确保系统不会迅速过渡到休眠状态。This is to ensure that the system does not rapidly transition into hibernate.

休眠触发器Hibernate triggers

自适应休眠设置 (备用预算设置和备用预留时间设置) 被公开为隐藏电源设置。Adaptive hibernate settings (standby budget setting and standby reserve time setting) are exposed as hidden power settings. 设置仅应用于 DC 上,不会影响到 AC。The settings are applied on DC only and have no impact on AC.

备用预算设置Standby budget setting

下表列出了可用于设置备用预算的设置,即允许用户在待机期间耗尽的电池量。The following table lists the settings you can use to set the standby budget, which is the amount of battery the user is allowed to drain during standby.

预算设置Budget setting 定义Definition 公开为Exposed as Powercfg 命令Powercfg command

StandbyBudgetPercentStandbyBudgetPercent

定义备用会话中允许用户使用的电池排出百分比。Defines the battery drain % that the user is allowed in a standby session. 默认值为5%。Default is 5%.

电源设置Power setting

powercfg /setdcvalueindex scheme_current sub_presence standbybudgetpercent

你还可以使用 OEM 映像的自定义设置包文件来配置这些设置。You can also configure these settings using a custom provisioning package file for OEM images. 有关 powercfg 的详细信息,请参阅 powercfg 命令行选项For more information about powercfg, see Powercfg command-line options.

备用保留时间设置Standby reserve time setting

预订时间是指系统从待机或休眠状态恢复后,保证用户可以打开屏幕的时间量。Reserve time is the amount of time the user is guaranteed to have the screen on after the system resumes from standby or hibernate. 下表列出了可用于设置预订时间的设置。The following table lists the settings you can use to set the reserve time.

预算设置Budget setting 定义Definition 公开为Exposed as Powercfg 命令Powercfg command

StandbyReserveTimeStandbyReserveTime

定义在备用退出并打开屏幕时,用户可使用的时间(以秒为单位)。Defines the screen on time, in seconds, that will be available to the user after standby exits and the screen turns on. 默认值为1200秒。Default is 1200 seconds.

电源设置Power setting

powercfg /setdcvalueindex scheme_current sub_presence standbyreservetime

你还可以使用 OEM 映像的自定义设置包文件来配置这些设置。You can also configure these settings using a custom provisioning package file for OEM images. 有关 powercfg 的详细信息,请参阅 powercfg 命令行选项For more information about powercfg, see Powercfg command-line options.

Windows 预配包示例Windows provisioning package sample

你可以使用 Windows 预配框架配置此部分中所述的自适应休眠设置。You can use the Windows Provisioning framework to configure the adaptive hibernate settings described in this section. 首先,使用 Windows 配置设计器创建预配包。First, create a provisioning package using Windows Configuration Designer. 然后,将编辑包中包含的 customizations.xml 文件,使其包含在命名空间下显示的电源设置 Common\Power\Policy\Settings\AdaptivePowerBehaviorYou will then edit the customizations.xml file contained in the package to include your power settings, which appear under the Common\Power\Policy\Settings\AdaptivePowerBehavior namespace. 使用 XML 文件作为 Windows 配置设计器命令行界面的输入之一来生成包含电源设置的预配包。Use the XML file as one of the inputs to the Windows Configuration Designer command-line interface to generate either a provisioning package that contains the power settings. 然后,你可以将预配包应用于映像。You can then apply the provisioning package to the image. 有关如何使用 Windows 配置设计器 CLI 的详细信息,请参阅 使用 Windows 配置设计器命令行界面For information on how to use the Windows Configuration Designer CLI, see Use the Windows Configuration Designer command-line interface.

下面的示例演示了在你编写了 Windows 预配答案文件以配置自适应休眠设置后,该文件可能如下所示。The following example shows what your Windows provisioning answer file might look like after you've written it to configure adaptive hibernate settings.

<?xml version="1.0" encoding="utf-8"?>
<WindowsCustomizatons>
  <PackageConfig xmlns="urn:schemas-Microsoft-com:Windows-ICD-Package-Config.v1.0">
    <ID>{XXXX GUID}</ID>  <!-- ID needs to be be unique GUID for the package -->
    <Name>CustomOEM.Power.Settings.Control</Name>
    <Version>1.0</Version>
    <OwnerType>OEM</OwnerType>
  </PackageConfig>

  <Settings xmlns="urn:schemas-microsoft-com:windows-provisioning">
     <Customizations>
        <Common>
           <Power>
              <Policy>
                 <Settings>
                    <AdaptivePowerBehavior>
                       <SchemePersonality>
                          <Default SchemeAlias="Balanced">
                             <Setting>
                                <!-- After entering standby, battery drain percentage allowed before the device transitions to hibernate -->
                                <StandbyBudgetPercent>
                                   <DcValue>3</DcValue>
                                </StandbyBudgetPercent>
                                <!-- After entering standby, number of seconds before the device automatically transitions to hibernate -->
                                <StandbyReserveTime>
                                   <DcValue>600</DcValue>
                                </StandbyReserveTime>
                             </Setting>

                          </Default>
                       </SchemePersonality>
                    </AdaptivePowerBehavior>
                 </Settings>
              </Policy>
           </Power>
        </Common>
     </Customizations>
  </Settings>