US 12,353,910 B2
Method and apparatus for determining hardware usage, storage medium, and electronic device
Guoying Zhang, Hangzhou (CN)
Assigned to Horizon Journey (Hangzhou) Artificial Intelligence Technology Co., Ltd., Hangzhou (CN)
Filed by Horizon Journey (Hangzhou) Artificial Intelligence Technology Co., Ltd., Hangzhou (CN)
Filed on Dec. 6, 2021, as Appl. No. 17/543,668.
Claims priority of application No. 202011438885.5 (CN), filed on Dec. 11, 2020.
Prior Publication US 2022/0188156 A1, Jun. 16, 2022
Int. Cl. G06F 9/48 (2006.01); G06F 11/34 (2006.01)
CPC G06F 9/4881 (2013.01) [G06F 9/485 (2013.01); G06F 11/3419 (2013.01); G06F 2209/486 (2013.01); G06F 2209/508 (2013.01)] 17 Claims
OG exemplary drawing
 
1. A method for determining hardware usage implemented by a processor, including:
determining initial period duration and initial task duration corresponding to a current period, and executing at least one task in the current period by means of a hardware module;
receiving a usage invoking request at a current time point;
determining current task duration corresponding to the current time point based on task duration of tasks executed by the hardware module at the current time point and the initial task duration;
determining current period duration corresponding to the current time point based on the initial period duration and a difference between the current time point and a starting time point corresponding to the current period; and
determining, based on the current task duration and the current period duration, hardware usage of the hardware module that is requested by the usage invoking request,
wherein the determining initial period duration and initial task duration corresponding to a current period includes:
obtaining total duration and total task duration of a previous period before the current period;
determining the initial period duration corresponding to the current period based on the total duration of the previous period and a preset weighted ratio; and
determining the initial task duration corresponding to the current period based on the total task duration of the previous period and the preset weighted ratio.