Method for Managing Central Processing Unit and Related Products
Abstract
A method for managing a central processing unit and related products are provided. The method includes the follows. A first prediction condition and a second prediction condition are determined. Both the first prediction condition and the second prediction condition are factors that affect a wake-up moment of a central processing unit (CPU). A prediction accuracy rate of predicting the CPU entering a lower power mode (LPM) by using the first prediction condition is counted. The first prediction condition is continued to be used to predict a next wake-up moment of the CPU when the prediction accuracy rate is greater than a predetermined threshold. The second prediction condition is used to predict the next wake-up moment of the CPU when the prediction accuracy rate is not greater than the predetermined threshold.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method for managing a central processing unit, comprising:
determining a first prediction condition and a second prediction condition, both the first prediction condition and the second prediction condition being factors that affect a wake-up moment of a central processing unit (CPU); counting a prediction accuracy rate of predicting the CPU entering a lower power mode (LPM) by using the first prediction condition; continuing to use the first prediction condition to predict a next wake-up moment of the CPU when the prediction accuracy rate is greater than a predetermined threshold; and using the second prediction condition to predict the next wake-up moment of the CPU when the prediction accuracy rate is not greater than the predetermined threshold.
2 . The method of claim 1 , wherein the first prediction condition is a timer value and the second prediction condition is an interrupt moment.
3 . The method of claim 2 , wherein counting the prediction accuracy rate of predicting the CPU entering the LPM by using the first prediction condition comprises:
determining a response time of the CPU in a target LPM, after determining the timer value as a prediction condition to predict the next wake-up moment of the CPU and the CPU entering the target LPM; determining whether the response time of the CPU in the target LPM is between a sleep time of the CPU in the target LPM and the timer value of the CPU; determining the prediction as an inaccurate prediction based on a determination that the response time of the CPU in the target LPM is between the sleep time of the CPU in the target LPM and the timer value of the CPU; and counting the prediction accuracy rate after predicting the next wake-up moment of the CPU by using the timer value as the prediction condition for a pre-determined number of times.
4 . The method of claim 3 , wherein counting the prediction accuracy rate comprises:
counting the prediction accuracy rate by determining situations other than inaccurate predictions as corresponding to accurate predictions.
5 . The method of claim 2 , wherein counting the prediction accuracy rate of predicting the CPU entering the LPM by using the first prediction condition comprises:
determining the prediction as an accurate prediction, based on a determination comprising one of:
a response time of the CPU in target LPM is longer than a sleep time of the CPU in the LPM and the timer value of the CPU;
the response time of the CPU in the target LPM is less than the sleep time of the CPU in the LPM and the timer value of the CPU; and
a difference between the sleep time of the CPU in the LPM and the timer value of the CPU is less than a pre-determined threshold; and
counting the prediction accuracy rate after predicting the next wake-up moment of the CPU by using the timer value as the prediction condition for a pre-determined number of times.
6 . The method of claim 5 , wherein counting the prediction accuracy rate comprises:
counting the prediction accuracy rate by determining situations corresponding to accurate predictions as an accurate set and determining situations that do not belong to the accurate set as corresponding to inaccurate predictions.
7 . The method of claim 2 , wherein counting the prediction accuracy rate of predicting the CPU entering the LPM by using the first prediction condition comprises:
determining a response time of the CPU in a target LPM, after determining the timer value as a prediction condition to predict the next wake-up moment of the CPU and the CPU entering the target LPM; determining whether the response time of the CPU in the target LPM is between a sleep time of the CPU in the target LPM and the timer value of the CPU; determining the prediction as an inaccurate prediction based on a determination that the response time of the CPU in the target LPM is between the sleep time of the CPU in the target LPM and the timer value of the CPU; determining the prediction as an accurate prediction, based on a determination comprising one of:
the response time of the CPU in target LPM is longer than the sleep time of the CPU in the LPM and the timer value of the CPU;
the response time of the CPU in the target LPM is less than the sleep time of the CPU in the LPM and the timer value of the CPU; and
a difference between the sleep time of the CPU in the LPM and the timer value of the CPU is less than a pre-determined threshold; and
counting the prediction accuracy rate after predicting the next wake-up moment of the CPU by using the timer value as the prediction condition for a pre-determined number of times.
8 . The method of claim 7 , wherein counting the prediction accuracy rate comprises:
counting the prediction accuracy rate by determining situations corresponding to accurate predictions and inaccurate predictions as a full set and counting a proportion of the accurate predictions in the full set.
9 . The method of claim 1 , wherein the method for managing a CPU is applicable for managing a multi-core CPU.
10 . The method of claim 1 , wherein the LPM comprises at least one of: a waiting-for-interrupt mode, a suspending mode, and a power-down mode.
11 . An electronic device, comprising:
at least one processor; and a computer readable storage, coupled to the at least one processor and storing at least one computer executable instruction thereon, which when executed by the at least one processor, cause the at least one processor to:
determine a first prediction condition and a second prediction condition, both the first prediction condition and the second prediction condition being factors that affect a wake-up moment of a central processing unit (CPU);
count a prediction accuracy rate of predicting the CPU entering a lower power mode (LPM) by using the first prediction condition;
continue to use the first prediction condition to predict a next wake-up moment of the CPU when the prediction accuracy rate is greater than a predetermined threshold; and
use the second prediction condition to predict the next wake-up moment of the CPU when the prediction accuracy rate is not greater than the predetermined threshold.
12 . The electronic device of claim 11 , wherein the first prediction condition is a timer value and the second prediction condition is an interrupt moment.
13 . The electronic device of claim 12 , wherein the at least one processor caused to count the prediction accuracy rate of predicting the CPU entering the LPM by using the first prediction condition is caused to:
determine a response time of the CPU in a target LPM, after determining the timer value as a prediction condition to predict the next wake-up moment of the CPU and the CPU entering the target LPM; determine whether the response time of the CPU in the target LPM is between a sleep time of the CPU in the target LPM and the timer value of the CPU; determine the prediction as an inaccurate prediction based on a determination that the response time of the CPU in the target LPM is between the sleep time of the CPU in the target LPM and the timer value of the CPU; and count the prediction accuracy rate after predicting the next wake-up moment of the CPU by using the timer value as the prediction condition for a pre-determined number of times.
14 . The electronic device of claim 13 , wherein the at least one processor caused to count the prediction accuracy rate is caused to:
count the prediction accuracy rate by determining situations other than inaccurate predictions as corresponding to accurate predictions.
15 . The electronic device of claim 12 , wherein the at least one processor caused to the prediction accuracy rate of predicting the CPU entering the LPM by using the first prediction condition is caused to:
determine the prediction as an accurate prediction, based on a determination comprising one of:
a response time of the CPU in target LPM is longer than a sleep time of the CPU in the LPM and the timer value of the CPU;
the response time of the CPU in the target LPM is less than the sleep time of the CPU in the LPM and the timer value of the CPU; and
a difference between the sleep time of the CPU in the LPM and the timer value of the CPU is less than a pre-determined threshold; and
count the prediction accuracy rate after predicting the next wake-up moment of the CPU by using the timer value as the prediction condition for a pre-determined number of times.
16 . The electronic device of claim 15 , wherein the at least one processor caused to count the prediction accuracy rate is caused to:
count the prediction accuracy rate by determining situations corresponding to accurate predictions as an accurate set and determine situations that do not belong to the accurate set as corresponding to inaccurate predictions.
17 . The electronic device of claim 12 , wherein the at least one processor caused to count the prediction accuracy rate of predicting the CPU entering the LPM by using the first prediction condition is caused to:
determine a response time of the CPU in a target LPM, after determining the timer value as a prediction condition to predict the next wake-up moment of the CPU and the CPU entering the target LPM; determine whether the response time of the CPU in the target LPM is between a sleep time of the CPU in the target LPM and the timer value of the CPU; determine the prediction as an inaccurate prediction based on a determination that the response time of the CPU in the target LPM is between the sleep time of the CPU in the target LPM and the timer value of the CPU; determine the prediction as an accurate prediction, based on a determination comprising one of:
a response time of the CPU in target LPM is longer than a sleep time of the CPU in the LPM and the timer value of the CPU;
the response time of the CPU in the target LPM is less than the sleep time of the CPU in the LPM and the timer value of the CPU; and
a difference between the sleep time of the CPU in the LPM and the timer value of the CPU is less than a pre-determined threshold; and
counting the prediction accuracy rate after predicting the next wake-up moment of the CPU by using the timer value as the prediction condition for a pre-determined number of times.
18 . The electronic device of claim 17 , wherein the at least one processor caused to count the prediction accuracy rate is caused to:
count the prediction accuracy rate by determining situations corresponding to accurate predictions and inaccurate predictions as a full set and count a proportion of the accurate predictions in the full set.
19 . The electronic device of claim 11 , wherein the processor is a multi-core CPU.
20 . A non-transitory computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to:
determine a first prediction condition and a second prediction condition, both the first prediction condition and the second prediction condition being factors that affect a wake-up moment of a central processing unit (CPU); count a prediction accuracy rate of predicting the CPU entering a lower power mode (LPM) by using the first prediction condition; continue to use the first prediction condition to predict a next wake-up moment of the CPU when the prediction accuracy rate is greater than a predetermined threshold; and use the second prediction condition to predict the next wake-up moment of the CPU when the prediction accuracy rate is not greater than the predetermined threshold.Join the waitlist — get patent alerts
Track US2019138081A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.