使用轉寄和反向 differentials 的 Windows 更新Windows Updates using forward and reverse differentials

Windows 10 月品質更新有累加性,包含所有先前已發佈的修正,以確保一致性與簡潔性。Windows 10 monthly quality updates are cumulative, containing all previously released fixes to ensure consistency and simplicity. 針對 Windows 10 版的作業系統平臺(例如,在多年中保持支援),每月品質更新的大小會快速擴大,因此會直接影響網路頻寬使用量。For an operating system platform like Windows 10, which stays in support for multiple years, the size of monthly quality updates can quickly grow large, thus directly impacting network bandwidth consumption.

今天,此問題的解決方式是使用快速下載,更新中每個已變更檔案的差異下載都會根據選取的歷史修訂和基版本來產生。Today, this problem is addressed by using express downloads, where differential downloads for every changed file in the update are generated based on selected historical revisions plus the base version. 在本文中,我們將推出新的技術來建立適用于任何基本版本修訂版本的精簡軟體更新套件,然後說明 Windows 10 品質更新如何使用這項技術。In this paper, we introduce a new technique to build compact software update packages that are applicable to any revision of the base version, and then describe how Windows 10 quality updates uses this technique.

一般詞彙General Terms

以下是本檔所適用的一般條款:The following general terms apply throughout this document:

  • 基底版本:主要的軟體版本,其中包含重要變更,例如 windows 10、版本 1809 (Windows 10 組建 17763.1) Base version: A major software release with significant changes, such as Windows 10, version 1809 (Windows 10 Build 17763.1)
  • 修訂:主要版本發行(例如 KB4464330 (Windows 10 組建17763.55)之間的次要發行) Revision: Minor releases in between the major version releases, such as KB4464330 (Windows 10 Build 17763.55)
  • *Baseless BASELESS PSF 中的 [修補程式儲存 (空間]) *:修補程式儲存檔或檔案包含完整二進位檔案Baseless Patch Storage Files (Baseless PSF): Patch storage files that contain full binaries or files

在本文中,我們引入了一種新的技術,可針對任何來源/目的地修訂對產生精簡的軟體更新。In this paper, we introduce a new technique that can produce compact software updates optimized for any origin/destination revision pair. 它會將變更的檔案從基本版本及其反向差異轉寄到基底版本,以進行這項工作。It does this by calculating forward the differential of a changed file from the base version and its reverse differential back to the base version. 接著,轉寄和反向 differentials 會打包成更新,併發布到執行要更新之軟體的端點。Both forward and reverse differentials are then packaged as an update and distributed to the endpoints running the software to be updated. 更新套件內容可以 symbolized,如下所示:The update package contents can be symbolized as follows:


具有檔案基底版本的端點 (V 0) 透過套用 簡單的轉換 (V N) 來 hydrate 目標版本 The endpoints that have the base version of the file (V0) hydrate the target revision (VN) by applying a simple transformation:

方程式: V sub 零 + delta sub zero to sub N = V sub n 的轉換

在 (V N) 的檔案中,包含修訂版 N 的端點 ,請套用 下列一組轉換,以 hydrate 目標版本) (V R):The endpoints that have revision N of the file (VN), hydrate the target revision (VR) by applying the following set of transformations:

方程式1: V sub n + delta sub n 轉換為 0 = V sun 0;方程式2: V sub 零 + delta sub 0 轉換為 R = V sub R

端點會保留它們所針對之軟體版本的反向 differentials,因此可用於 hydrating 並套用下一個修訂更新。The endpoints retain the reverse differentials for the software revision they are on, so that it can be used for hydrating and applying next revision update.

這項技術使用通用的比較基準來產生單一更新套件,具有許多優點:By using a common baseline, this technique produces a single update package with numerous advantages:

  • 壓縮大小Compact in size
  • 適用于所有比較基準Applicable to all baselines
  • 輕鬆建立Simple to build
  • 有效地安裝Efficient to install
  • Redistributable

在過去,下載 Windows 10 版1803品質更新 (Windows 10、版本以及舊版的 Windows 10) ,都是使用快速下載進行優化。Historically, download sizes of Windows 10 quality updates (Windows 10, version 1803 and older supported versions of Windows 10) are optimized by using express download. 快速下載已優化,更新 Windows 10 系統將會下載最小位元組數。Express download is optimized such that updating Windows 10 systems will download the minimum number of bytes. 如此一來,您可以根據所選的相同檔案基礎或 RTM 版本,為每個更新的檔案產生 differentials。This is achieved by generating differentials for every updated file based on selected historical base revisions of the same file + its base or RTM version.

例如,如果 [十月] 年10月的品質更新已更新 Notepad.exe,則在八月至十月、七月至十月、七月至十月,以及從原始功能版本到十月,都會產生此 Notepad.exe differentials。For example, if the October monthly quality update has updated Notepad.exe, differentials for Notepad.exe file changes from September to October, August to October, July to October, June to October, and from the original feature release to October are generated. 所有這些 differentials 都儲存在修補程式儲存檔中 (PSF (也稱為「快速下載檔案」) ) 並在 Windows Update 或其他更新管理或分發伺服器上存放或快取, (例如,Windows Server Update Services (WSUS) 、Microsoft 端點設定管理員,或是支援快速更新) 的非 Microsoft 更新管理或發佈伺服器。All these differentials are stored in a Patch Storage File (PSF, also referred to as “express download files”) and hosted or cached on Windows Update or other update management or distribution servers (for example, Windows Server Update Services (WSUS), Microsoft Endpoint Configuration Manager, or a non-Microsoft update management or distribution server that supports express updates). 利用快速更新的裝置會使用網路通訊協定來判斷最佳 differentials,然後只下載更新發佈端點所需的專案。A device leveraging express updates uses network protocol to determine optimal differentials, then downloads only what is needed from the update distribution endpoints.

[快速下載] 的 [翻轉] 側邊是 PSF 檔案的大小可能會非常大,這取決於計算 differentials 的歷史基準數量。The flip side of express download is that the size of PSF files can be very large depending on the number of historical baselines against which differentials were calculated. 下載大型 PSF 檔案並將它緩存到內部部署或遠端更新發佈伺服器對於大部分組織而言都有問題,因此他們無法利用快速更新來讓執行 Windows 10 的裝置成為最新版本。Downloading and caching large PSF files to on-premises or remote update distribution servers is problematic for most organizations, hence they are unable to leverage express updates to keep their fleet of devices running Windows 10 up to date. 其次,由於產生需要在更新發佈伺服器上快取的快速檔案 differentials 和大小,因此只會產生最常見基準的快速下載檔案,因此只適用于所選的比較基準。Secondly, due to the complexity of generating differentials and size of the express files that need to be cached on update distribution servers, it is only feasible to generate express download files for the most common baselines, thus express updates are only applicable to selected baselines. 最後,在系統記憶體使用量上,最佳 differentials 的計算成本會很高,尤其是對於低成本系統而言,這會影響其下載並套用無縫更新的能力。Finally, calculation of optimal differentials is expensive in terms of system memory utilization, especially for low-cost systems, impacting their ability to download and apply an update seamlessly.

在下列各節中,我們將說明 Windows 10 品質更新如何利用這項技術,以針對 Windows 10 與 Windows Server 更新版本進行轉寄和反向 differentials,以在快速下載中克服困難。In the following sections, we describe how Windows 10 quality updates will leverage this technique based on forward and reverse differentials for newer releases of Windows 10 and Windows Server to overcome the challenges with express downloads.

高層次設計High-level Design

更新封裝Update packaging

Windows 10 品質更新套件將包含 differentials 從品質更新 RTM 基線 (∆ RTM → N) 並將 differentials 改回 RTM (∆ N → RTM) ,在 RTM 之後已變更的每個檔案。Windows 10 quality update packages will contain forward differentials from quality update RTM baselines (∆RTM→N) and reverse differentials back to RTM (∆N→RTM) for each file that has changed since RTM. 透過使用 RTM 版本做為比較基準,我們可以確保所有裝置的負載都相同。By using the RTM version as the baseline, we ensure that all devices will have an identical payload. 更新套件中繼資料、內容資訊清單,以及轉寄和反向 differentials 會封裝到 cab 檔案 ( .cab) 中。Update package metadata, content manifests, and forward and reverse differentials will be packaged into a cabinet file (.cab). 這個 .cab 檔案和適用性邏輯,也會以 Microsoft 獨立更新 ( .msu) 格式進行封裝。This .cab file, and the applicability logic, will also be wrapped in Microsoft Standalone Update (.msu) format.

在服務期間,可能會有新檔案新增至系統的情況。There can be cases where new files are added to the system during servicing. 這些檔案將沒有 RTM 基線,因此無法使用轉寄和反向 differentials。These files will not have RTM baselines, thus forward and reverse differentials cannot be used. 在這些情況下,將會使用 null differentials 來處理服務。In these scenarios, null differentials will be used to handle servicing. Null differentials 是完整的完整二進位檔案壓縮與優化版本。Null differentials are the slightly compressed and optimized version of the full binaries. 更新套件可以是轉寄或反向 differentials,或其中任何指定二進位檔案的 null 差異。Update packages can have either forward or reverse differentials, or null differential of any given binary in them. 下列影像會象徵 Windows 10 品質更新安裝程式的內容:The following image symbolizes the content of a Windows 10 quality update installer:

標籤:包含兩個子方塊的 [.msu]: 1) 適用性邏輯,2) 方塊中包含四個子方塊: 1) 更新中繼資料、2) 內容資訊清單、3) delta sub RTM 轉換為 RTM (檔1、檔案2等。 ) 的第二個)

Hydration 和安裝Hydration and installation

當您在更新套件上執行一般的適用性檢查,且決定適用時,Windows 元件服務基礎結構將在安裝前 hydrate 完整檔案,然後繼續進行一般的安裝程式。Once the usual applicability checks are performed on the update package and are determined to be applicable, the Windows component servicing infrastructure will hydrate the full files during pre-installation and then proceed with the usual installation process.

以下是一個高層次的活動序列,元件服務基礎結構將在事務中執行,以完成更新的安裝:Below is a high-level sequence of activities that the component servicing infrastructure will run in a transaction to complete installation of the update:

  • 找出安裝更新所需的所有檔案。Identify all files that are required to install the update.
  • 使用) 檔案的目前版本 (的每個必要檔案 ,將 (V n --->rtm) 到品質更新 rtm/基本版本,並 將 ( R---從功能更新 rtm/基本版本轉寄到目標版本。Hydrate each of necessary files using current version (VN) of the file, reverse differential (VN--->RTM) of the file back to quality update RTM/base version and forward differential (VRTM--->R) from feature update RTM/base version to the target version. 此外,您也可以使用 null 差異 hydration 來 hydrate null 壓縮檔案。Also, use null differential hydration to hydrate null compressed files.
  • 暫存 hydrated 檔案 (完整檔案) ,轉寄 differentials ([f] 資料夾) ,然後將 differentials (在元件儲存) %windir%\WinSxS 資料夾 (中的 [n ] 資料夾) 或 null 壓縮檔案 (。Stage the hydrated files (full file), forward differentials (under ‘f’ folder) and reverse differentials (under ‘r’ folder) or null compressed files (under ‘n’ folder) in the component store (%windir%\WinSxS folder).
  • 解決任何相依性與安裝元件。Resolve any dependencies and install components.
  • 清理較舊的狀態 (V N-1 ) ; 前一個狀態 V N 則保留供卸載及還原或修復。Clean up older state (VN-1); the previous state VN is retained for uninstallation and restoration or repair.

復原 HydrationResilient Hydration

若要確保針對元件儲存區損壞或遺失的檔案(由於特定類型的硬體與檔案系統損毀而可能造成的復原),傳統上使用損壞修復服務來自動復原元件存放區, ( 「自動損毀修理」 ) 或根據需求 ( 「手動損壞修復」 ) 使用線上或本機修復來源。To ensure resiliency against component store corruption or missing files that could occur due to susceptibility of certain types of hardware to file system corruption, a corruption repair service has been traditionally used to recover the component store automatically (“automatic corruption repair”) or on demand (“manual corruption repair”) using an online or local repair source. 此服務將繼續提供修復及復原 hydration 內容的功能,並視需要成功安裝更新。This service will continue to offer the ability to repair and recover content for hydration and successfully install an update, if needed.

在更新作業期間檢測到損毀時,自動損壞修復將照常啟動,並使用針對每個更新發佈至 Windows Update 的 Baseless 修補程式儲存空間檔來修正損壞的資訊清單、二進位 differentials 或 hydrated 或完整檔案。When corruption is detected during update operations, automatic corruption repair will start as usual and use the Baseless Patch Storage File published to Windows Update for each update to fix corrupted manifests, binary differentials, or hydrated or full files. Baseless 修補程式儲存檔案將包含每個更新元件的反向和轉寄 differentials 及完整檔案。Baseless patch storage files will contain reverse and forward differentials and full files for each updated component. 修復檔案的完整性將由雜湊驗證。Integrity of the repair files will be hash verified.

損毀修復將使用元件資訊清單偵測遺失的檔案,並取得損毀檢測的雜湊值。Corruption repair will use the component manifest to detect missing files and get hashes for corruption detection. 在更新安裝期間,會設定電腦上每個分段的新登錄標記。During update installation, new registry flags for each differential staged on the machine will be set. 當自動損壞修復執行時,它會使用資訊清單與差異檔案來掃描 hydrated 檔案。When automatic corruption repair runs, it will scan hydrated files using the manifest and differential files using the flags. 如果無法找到或驗證差異,就會將它新增到要修復的損壞清單中。If the differential cannot be found or verified, it will be added to the list of corruptions to repair.

遲緩自動損毀修復Lazy automatic corruption repair

[惰性自動損壞修復] 會在更新操作期間執行,以偵測已損壞的二進位檔案與 differentials。“Lazy automatic corruption repair” runs during update operations to detect corrupted binaries and differentials. 在套用更新時,如果任何檔案的 hydration 失敗,"懶惰" 自動損壞修復會自動啟動,找出損壞的二進位檔案或差異檔案,然後將它新增到損壞的清單中。While applying an update, if hydration of any file fails, "lazy" automatic corruption repair automatically starts, identifies the corrupted binary or differential file, and then adds it to the corruption list. 之後,更新作業就會隨著它的執行繼續進行,因此「懶惰」自動損壞修復可能會收集許多損毀的檔案,以盡可能修正問題。Later, the update operation continues as far as it can go, so that "lazy" automatic corruption repair can collect as many corrupted files to fix as possible. 在 hydration 區段的結尾,更新失敗,且會啟動自動損壞修復。At the end of the hydration section, the update fails, and automatic corruption repair starts. 自動損壞修復會照常執行,並在作業結束時,在新清單的頂端新增「遲緩」自動損毀修復所產生的損壞清單,以進行修復。Automatic corruption repair runs as usual and at the end of its operation, adds the corruption list generated by "lazy" automatic corruption repair on top of the new list to repair. 自動損壞修復然後修復損壞清單上的檔案,並在下一次嘗試時,安裝更新將會成功。Automatic corruption repair then repairs the files on the corruption list and installation of the update will succeed on the next attempt.