健康照護服務中的脫糖目標
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
健康照護服務現在支援即時指標的去跳出目標,例如心率、距離和速度。跳出目標可改善在健身期間維持特定門檻或範圍 (例如心率) 的使用者體驗。
「脫掉目標」可防止在短時間內,於每次條件為 true 時多次發出同一個事件。只有在一段可設定的時間範圍內持續超過門檻 (通常為幾秒鐘) 時,系統才會發出事件。達到門檻的持續時間是指使用者在健康照護服務傳送快訊事件之前,必須達到指定門檻的干擾時間。
您也可以避免在目標登錄後立即觸發事件。「初始延遲」是指因為目標登錄後,應用程式收到通知前必須通過的時間長度。
兩者合併後,如果應用程式可讓使用者設定健身目標或目標,就能減少向使用者顯示的偽陽性和重複快訊次數。
個案研究:心率
脫掉目標的常見用途包括心率區間。運動過程中,心率會持續波動,尤其是在心肺訓練期間的活動中。如未支援去除彈跳功能,應用程式可能會在短時間內收到許多快訊,例如每當使用者的心率高於或低於目標範圍時。
導入「初始延遲」後,您可以通知健康照護服務只在指定的時間範圍過後傳送目標快訊,您可以將此視為調整期。導入「持續時間門檻」後,即可進一步自訂這項自訂設定,指定在使用者進入或超過指定門檻後,該經過多少時間才能啟動目標。
實際上,這可能包括等待使用者離開目標心率範圍 15 秒,應用程式才會告知使用者增減運動強度。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Debounced goals in Health Services\n\nHealth Services now supports *debounced goals* for instantaneous metrics, such\nas heart rate, distance, and speed. Debounced goals improve the user experience\nfor people who want to maintain a specific threshold or range---such as heart\nrate---throughout their workout.\n\nDebounced goals prevent the same event from being emitted multiple times---every\ntime the condition is true---over a short time period. Instead, events are emitted\nonly if the threshold has been continuously exceeded for a configurable period\nof time, usually some number of seconds. **Duration at threshold** is the amount\nof uninterrupted time the user needs to cross the specified threshold before\nHealth Services sends an alert event.\n\nYou can also prevent events from being emitted immediately after goal\nregistration. **Initial delay** is the amount of time that must pass, since goal\nregistration, before your app is notified.\n\nWhen combined, \"duration at threshold\" and \"initial delay\" reduce the number of\nfalse positives and repeated alerts surfaced to users if your app lets users set\nfitness goals or targets.\n\nCase study: heart rate\n----------------------\n\nA common use case for debounced goals involves heart rate zones. Heart rate\ncontinuously fluctuates throughout an exercise, especially during\ncardio-intensive activities. Without support for debouncing, an app might get\nmany alerts in a short period of time, such as each time the user's heart rate\ndips above or below the target range.\n\nBy introducing an \"initial delay,\" you can inform Health Services to send a goal\nalert only after a specified time period has passed--you can think of this as an\nadjustment period. By introducing a \"duration at threshold,\" you can take this\ncustomization further, by specifying the amount of time that must elapse while\nthe user is in or out of the specified threshold for their goal to be activated.\n\nIn practice, this might involve waiting for the user to be out of their target\nheart rate range for 15 seconds before your app lets them know to increase or\ndecrease their exercise intensity."]]