CN116795628B - Power consumption processing method of terminal device, terminal device and readable storage medium - Google Patents
Power consumption processing method of terminal device, terminal device and readable storage medium Download PDFInfo
- Publication number
- CN116795628B CN116795628B CN202310598030.6A CN202310598030A CN116795628B CN 116795628 B CN116795628 B CN 116795628B CN 202310598030 A CN202310598030 A CN 202310598030A CN 116795628 B CN116795628 B CN 116795628B
- Authority
- CN
- China
- Prior art keywords
- power consumption
- application
- terminal device
- threshold
- feature
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title abstract description 17
- 238000000034 method Methods 0.000 claims abstract description 108
- 230000002159 abnormal effect Effects 0.000 claims abstract description 76
- 238000001514 detection method Methods 0.000 claims abstract description 39
- 238000012545 processing Methods 0.000 claims description 75
- 230000005856 abnormality Effects 0.000 claims description 46
- 238000004590 computer program Methods 0.000 claims description 18
- 238000012549 training Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 description 42
- 238000010586 diagram Methods 0.000 description 16
- 230000004044 response Effects 0.000 description 16
- 238000004891 communication Methods 0.000 description 11
- 238000004364 calculation method Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 7
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 6
- 230000003203 everyday effect Effects 0.000 description 6
- 238000012417 linear regression Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 5
- 238000012216 screening Methods 0.000 description 5
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 4
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 4
- 230000001419 dependent effect Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000000354 decomposition reaction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000033228 biological regulation Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
- 238000002759 z-score normalization Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3058—Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
- G06F11/3062—Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations where the monitored property is the power consumption
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3438—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/01—Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Computer Hardware Design (AREA)
- Evolutionary Computation (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Power Sources (AREA)
Abstract
本申请实施例提供一种终端设备的功耗处理方法、终端设备以及可读存储介质。该方法包括:终端设备采集终端设备的功耗数据,功耗数据包括第一应用的功耗数据;根据第一应用的功耗模型,确定终端设备对应的用户所属的用户群体,以及用户群体对应的主特征的阈值;根据主特征的阈值,以及第一应用的功耗数据中主特征的数值,检测第一应用的功耗是否异常,得到第一应用的功耗检测结果;根据第一应用的功耗检测结果,执行对应的操作。这样,终端设备可以针对用户使用终端设备的习惯,确定用户所属的群体,进而采用对应的主特征的阈值检测功耗,灵活性高。
The embodiment of the present application provides a power consumption processing method of a terminal device, a terminal device, and a readable storage medium. The method includes: the terminal device collects power consumption data of the terminal device, and the power consumption data includes power consumption data of a first application; according to the power consumption model of the first application, the user group to which the user corresponding to the terminal device belongs and the threshold of the main feature corresponding to the user group are determined; according to the threshold of the main feature and the value of the main feature in the power consumption data of the first application, whether the power consumption of the first application is abnormal is detected, and the power consumption detection result of the first application is obtained; according to the power consumption detection result of the first application, the corresponding operation is performed. In this way, the terminal device can determine the group to which the user belongs based on the user's habit of using the terminal device, and then use the corresponding threshold of the main feature to detect the power consumption, which is highly flexible.
Description
技术领域Technical Field
本申请涉及终端技术领域,尤其涉及一种终端设备的功耗处理方法、终端设备以及可读存储介质。The present application relates to the field of terminal technology, and in particular to a power consumption processing method of a terminal device, a terminal device, and a readable storage medium.
背景技术Background technique
随着终端设备的快速发展,终端设备上安装的应用越来越多。用户可以同时打开多个应用,应用的运行会增加终端设备的功耗,因此有必要对应用的功耗进行检测和管理,以延长终端设备的续航。With the rapid development of terminal devices, more and more applications are installed on terminal devices. Users can open multiple applications at the same time. The operation of applications will increase the power consumption of terminal devices. Therefore, it is necessary to detect and manage the power consumption of applications to extend the battery life of terminal devices.
目前,可以设置功耗阈值,且终端设备可以检测运行在后台的应用的功耗。当运行在后台的应用的功耗大于该功耗阈值时,终端设备可以杀掉该应用,以减少终端设备的功耗。Currently, a power consumption threshold can be set, and the terminal device can detect the power consumption of the application running in the background. When the power consumption of the application running in the background is greater than the power consumption threshold, the terminal device can kill the application to reduce the power consumption of the terminal device.
目前终端设备的功耗的处理方法虽然能够减少终端设备的功耗,但不同用户群体对终端设备的使用习惯不同,针对所有用户群体采用同一方法处理终端设备的功耗,灵活性差。Although the current method for processing the power consumption of terminal devices can reduce the power consumption of terminal devices, different user groups have different usage habits of terminal devices. Using the same method to process the power consumption of terminal devices for all user groups has poor flexibility.
发明内容Summary of the invention
本申请实施例提供一种终端设备的功耗处理方法、终端设备以及可读存储介质,应用于终端技术领域,可以针对用户对终端设备的使用习惯,适应性处理终端设备的功耗,灵活性高。The embodiments of the present application provide a method for processing power consumption of a terminal device, a terminal device, and a readable storage medium, which are applied to the field of terminal technology and can adaptively process the power consumption of the terminal device according to the user's usage habits of the terminal device, with high flexibility.
第一方面,本申请实施例提出一种终端设备的功耗处理方法,执行该方法的执行主体可以为终端设备或终端设备中的芯片,下述以终端设备为例进行说明。该方法包括:终端设备可以采集所述终端设备的功耗数据,所述功耗数据包括第一应用的功耗数据。第一应用的功耗数据为第一应用运行时,使用终端设备中各器件的功耗。In the first aspect, the embodiment of the present application proposes a method for processing power consumption of a terminal device. The execution subject of the method may be a terminal device or a chip in the terminal device. The following description is made using a terminal device as an example. The method includes: the terminal device may collect power consumption data of the terminal device, and the power consumption data includes power consumption data of a first application. The power consumption data of the first application is the power consumption of each device in the terminal device when the first application is running.
终端设备中可以存储第一应用的功耗模型,终端设备可以根据所述第一应用的功耗模型,确定所述终端设备对应的用户所属的用户群体,以及所述用户群体对应的主特征的阈值。终端设备可以根据所述主特征的阈值,以及所述第一应用的功耗数据中所述主特征的数值,检测所述第一应用的功耗是否异常,得到所述第一应用的功耗检测结果。终端设备可以根据所述第一应用的功耗检测结果,执行对应的操作,如降低第一应用的功耗。The terminal device may store a power consumption model of the first application, and the terminal device may determine the user group to which the user corresponding to the terminal device belongs and the threshold of the main feature corresponding to the user group based on the power consumption model of the first application. The terminal device may detect whether the power consumption of the first application is abnormal based on the threshold of the main feature and the value of the main feature in the power consumption data of the first application, and obtain the power consumption detection result of the first application. The terminal device may perform corresponding operations based on the power consumption detection result of the first application, such as reducing the power consumption of the first application.
本申请实施例中,不同应用可以对应不同的功耗模型,功耗模型的准确性高。另外,本申请实施例中,可以根据功耗数据,确定用户所属的用户群体,即可以根据用户使用终端设备的习惯或特征,以用户对应的主特征的阈值,检测第一应用的功耗是否异常。本申请实施例中,针对不同的用户群体,可以使用不同的主特征的阈值,检测第一应用的功耗是否异常,灵活性高,且更加匹配用户的习惯或特征,可以提高用户体验。In the embodiment of the present application, different applications may correspond to different power consumption models, and the power consumption model has high accuracy. In addition, in the embodiment of the present application, the user group to which the user belongs can be determined based on the power consumption data, that is, based on the user's habits or characteristics of using the terminal device, the threshold of the main feature corresponding to the user can be used to detect whether the power consumption of the first application is abnormal. In the embodiment of the present application, for different user groups, different thresholds of the main feature can be used to detect whether the power consumption of the first application is abnormal, which has high flexibility and better matches the user's habits or characteristics, and can improve the user experience.
在一种可能的实现方式中,所述第一应用的功耗模型包括:辅特征条件,以及至少一个用户群体对应的主特征的阈值,所述辅特征条件用于确定用户所属的用户群体,至少一个用户群体为基于所述辅特征条件确定的用户群体。In a possible implementation, the power consumption model of the first application includes: an auxiliary feature condition, and a threshold of a main feature corresponding to at least one user group, wherein the auxiliary feature condition is used to determine the user group to which the user belongs, and at least one user group is a user group determined based on the auxiliary feature condition.
终端设备可以根据所述辅特征条件,以及所述第一应用的功耗数据中辅特征的数值,确定所述终端设备对应的用户所属的用户群体。终端设备可以根据所述至少一个用户群体对应的主特征的阈值,以及所述终端设备对应的用户所属的用户群体,确定所述终端设备对应的用户所属的用户群体对应的主特征的阈值。The terminal device may determine the user group to which the user corresponding to the terminal device belongs based on the auxiliary feature condition and the value of the auxiliary feature in the power consumption data of the first application. The terminal device may determine the threshold of the main feature corresponding to the user group to which the user corresponding to the terminal device belongs based on the threshold of the main feature corresponding to the at least one user group and the user group to which the user corresponding to the terminal device belongs.
在该实现方式中,终端设备可以根据第一应用的功耗模型,确定用户所属的用户群体,以及该用户群体对应的主特征的阈值,以便可以采用该用户群体适配的主特征的阈值,检测第一应用的功耗是否异常。In this implementation, the terminal device can determine the user group to which the user belongs and the threshold of the main feature corresponding to the user group based on the power consumption model of the first application, so that the threshold of the main feature adapted for the user group can be used to detect whether the power consumption of the first application is abnormal.
在一种可能的实现方式中,所述第一应用的功耗模型具体为第一产品系列的第一应用的功耗模型,所述终端设备属于所述第一产品系列。In a possible implementation, the power consumption model of the first application is specifically a power consumption model of a first application of a first product series, and the terminal device belongs to the first product series.
在该实现方式中,终端设备可以根据第一产品系列的第一应用的功耗模型,确定所述终端设备对应的用户所属的用户群体,以及所述用户群体对应的主特征的阈值,进而基于该用户群体对应的主特征的阈值,检测第一应用的功耗是否异常。In this implementation, the terminal device can determine the user group to which the user corresponding to the terminal device belongs and the threshold of the main feature corresponding to the user group based on the power consumption model of the first application of the first product series, and then detect whether the power consumption of the first application is abnormal based on the threshold of the main feature corresponding to the user group.
在该实现方式中,因为不同产品系列的终端设备,使用的器件不同,因此在相同时间内第一应用运行时,器件的功耗不同,本申请实施例针对不同的产品系列,可以获取不同产品系列的不同应用的功耗模型,使得功耗模型的准确性更高,且更加适配终端设备,可以提高功耗处理的准确性。In this implementation, because terminal devices of different product series use different devices, the power consumption of the devices is different when the first application runs at the same time. The embodiment of the present application is targeted at different product series and can obtain power consumption models of different applications of different product series, so that the power consumption model is more accurate and more suitable for terminal devices, which can improve the accuracy of power consumption processing.
在一种可能的实现方式中,当所述主特征的数值大于或等于所述主特征的阈值时,终端设备确定所述第一应用的功耗异常,所述第一应用的功耗检测结果用于指示所述第一应用的功耗异常。当所述主特征的数值小于所述主特征的阈值时,终端设备确定所述第一应用的功耗正常,所述第一应用的功耗检测结果用于指示所述第一应用的功耗正常。In a possible implementation, when the value of the main feature is greater than or equal to the threshold of the main feature, the terminal device determines that the power consumption of the first application is abnormal, and the power consumption detection result of the first application is used to indicate that the power consumption of the first application is abnormal. When the value of the main feature is less than the threshold of the main feature, the terminal device determines that the power consumption of the first application is normal, and the power consumption detection result of the first application is used to indicate that the power consumption of the first application is normal.
在一种可能的实现方式中,终端设备不仅可以确定第一应用的功耗是否异常,还可以在第一应用的功耗异常时,确定异常等级。示例性的,所述主特征的阈值包括:第一阈值、第二阈值,以及第三阈值,所述第一阈值小于所述第二阈值,且所述第二阈值小于所述第三阈值。In a possible implementation, the terminal device can not only determine whether the power consumption of the first application is abnormal, but also determine the abnormality level when the power consumption of the first application is abnormal. Exemplarily, the threshold of the main feature includes: a first threshold, a second threshold, and a third threshold, the first threshold is less than the second threshold, and the second threshold is less than the third threshold.
其中,当所述主特征的数值大于或等于所述第一阈值,且小于所述第二阈值时,确定所述第一应用的功耗异常为第一异常等级,所述第一应用的功耗检测结果用于指示所述第一应用的功耗异常的等级为所述第一异常等级。当所述主特征的数值大于或等于所述第二阈值,且小于所述第三阈值时,确定所述第一应用的功耗异常为第二异常等级,所述第一应用的功耗检测结果用于指示所述第一应用的功耗异常的等级为所述第二异常等级。当所述主特征的数值大于或等于所述第三阈值时,确定所述第一应用的功耗异常为第三异常等级,所述第一应用的功耗检测结果用于指示所述第一应用的功耗异常的等级为所述第三异常等级。当所述主特征的数值小于所述第一阈值时,确定所述第一应用的功耗正常,所述第一应用的功耗检测结果用于指示所述第一应用的功耗正常。Wherein, when the value of the main feature is greater than or equal to the first threshold value and less than the second threshold value, the power consumption abnormality of the first application is determined to be the first abnormality level, and the power consumption detection result of the first application is used to indicate that the level of the power consumption abnormality of the first application is the first abnormality level. When the value of the main feature is greater than or equal to the second threshold value and less than the third threshold value, the power consumption abnormality of the first application is determined to be the second abnormality level, and the power consumption detection result of the first application is used to indicate that the level of the power consumption abnormality of the first application is the second abnormality level. When the value of the main feature is greater than or equal to the third threshold value, the power consumption abnormality of the first application is determined to be the third abnormality level, and the power consumption detection result of the first application is used to indicate that the level of the power consumption abnormality of the first application is the third abnormality level. When the value of the main feature is less than the first threshold value, the power consumption of the first application is determined to be normal, and the power consumption detection result of the first application is used to indicate that the power consumption of the first application is normal.
在一种可能的实现方式中,所述第一应用的功耗异常等级不同,所述终端设备执行的对应的操作不同。In a possible implementation, the power consumption abnormality level of the first application is different, and the corresponding operations performed by the terminal device are different.
在该实现方式中,终端设备可以基于第一应用的功耗异常等级,采用与异常等级对应的操作进行处理,灵活性高。In this implementation, the terminal device can process the abnormal power consumption level of the first application by adopting an operation corresponding to the abnormal level, which has high flexibility.
在一种可能的实现方式中,终端设备可以向云端发送功耗模型获取请求,以接收来自所述云端的所述第一应用的功耗模型。In a possible implementation, the terminal device may send a power consumption model acquisition request to the cloud to receive the power consumption model of the first application from the cloud.
在一些实施例中,终端设备可以接收来自云端的至少一个应用的功耗模型,该至少一个应用可以包括第一应用。或者,终端设备可以接收来自云端的至少一个系列的至少一个应用的功耗模型,该至少一个应用可以包括第一应用。In some embodiments, the terminal device may receive a power consumption model of at least one application from the cloud, and the at least one application may include the first application. Alternatively, the terminal device may receive a power consumption model of at least one application of at least one series from the cloud, and the at least one application may include the first application.
在一种可能的实现方式中,终端设备还可以向数据平台发送所述终端设备的功耗数据,以便云端可以基于终端设备的功耗数据,训练得到功耗模型,可以参照第二方面的描述。In a possible implementation, the terminal device may also send power consumption data of the terminal device to the data platform so that the cloud can train a power consumption model based on the power consumption data of the terminal device. Please refer to the description of the second aspect.
第二方面,本申请实施例提出一种终端设备的功耗处理方法,执行该方法的执行主体可以为云端或云端中的芯片,下述以云端为例进行说明。该方法包括:云端可以从数据平台获取至少一个终端设备的功耗数据,且根据所述至少一个终端设备的功耗数据,训练得到功耗模型。当云端接收来自终端设备的功耗模型获取请求时,可以向所述终端设备发送所述功耗模型。In the second aspect, the embodiment of the present application proposes a method for processing power consumption of a terminal device. The execution subject of the method can be the cloud or a chip in the cloud. The following description takes the cloud as an example. The method includes: the cloud can obtain power consumption data of at least one terminal device from the data platform, and train a power consumption model based on the power consumption data of the at least one terminal device. When the cloud receives a request to obtain a power consumption model from a terminal device, the power consumption model can be sent to the terminal device.
功耗模型可以包括至少一个应用的功耗模型,所述第一应用包含于所述至少一个应用中。相应的,每个终端设备的功耗数据可以包括所述至少一个应用的功耗数据。本申请实施例中,云端训练功耗模型,可以包括云端训练得到第一应用的功耗模型。下述以云端训练第一应用的功耗模型为例,说明云端训练功耗模型的过程。其中,云端可以根据预设时间段内所述第一应用的功耗数据,训练得到所述第一应用的功耗数据。The power consumption model may include a power consumption model of at least one application, and the first application is included in the at least one application. Correspondingly, the power consumption data of each terminal device may include the power consumption data of the at least one application. In an embodiment of the present application, training the power consumption model in the cloud may include obtaining the power consumption model of the first application through cloud training. The following takes the power consumption model of the first application trained in the cloud as an example to illustrate the process of training the power consumption model in the cloud. Among them, the cloud can train the power consumption data of the first application based on the power consumption data of the first application within a preset time period.
在一种可能的实现方式中,所述第一应用的功耗模型具体为第一产品系列的第一应用的功耗模型,所述第一产品系列的第一应用的功耗模型是基于所述预设时间段内所述第一产品系列的终端设备的所述第一应用的功耗数据训练得到的。In a possible implementation, the power consumption model of the first application is specifically a power consumption model of the first application of the first product series, and the power consumption model of the first application of the first product series is trained based on the power consumption data of the first application of the terminal device of the first product series within the preset time period.
下面具体以云端根据预设时间段内所述第一产品系列的终端设备的所述第一应用的功耗数据,训练得到第一产品系列的第一应用的功耗模型为例说明功耗模型的训练过程:The following specifically describes the training process of the power consumption model by taking the cloud as an example, in which the power consumption model of the first application of the first product series is obtained by training according to the power consumption data of the first application of the terminal device of the first product series within a preset time period:
云端可以根据所述预设时间段内所述第一产品系列的终端设备的第一应用的功耗数据,获取主特征与其他每个特征的相关系数,且根据所述主特征与其他每个特征的相关系数,确定辅特征。云端在确定辅特征后,可以根据所述预设时间段内所述第一产品系列的终端设备的第一应用的功耗数据,以及所述辅特征,获取辅特征条件,所述辅特征条件用于确定用户所属的用户群体。云端可以根据所述辅特征条件,以及所述预设时间段内所述第一产品系列的终端设备的第一应用的功耗数据,将所述至少一个终端设备对应的用户划分为至少两个用户群体。The cloud can obtain the correlation coefficient between the main feature and each other feature based on the power consumption data of the first application of the terminal device of the first product series within the preset time period, and determine the auxiliary feature based on the correlation coefficient between the main feature and each other feature. After determining the auxiliary feature, the cloud can obtain the auxiliary feature condition based on the power consumption data of the first application of the terminal device of the first product series within the preset time period and the auxiliary feature, and the auxiliary feature condition is used to determine the user group to which the user belongs. The cloud can divide the users corresponding to the at least one terminal device into at least two user groups based on the auxiliary feature condition and the power consumption data of the first application of the terminal device of the first product series within the preset time period.
云端可以根据每个用户群体的预设时间内第一产品系列的终端设备的第一应用的功耗数据,确定每个用户群体对应的主特征的阈值,所述主特征的阈值用于检测所述第一应用的功耗是否异常。云端根据所述辅特征条件,以及每个用户群体对应的主特征的阈值,生成所述第一产品系列的第一应用的功耗模型。其中,第一产品系列的第一应用的功耗模型可以包括:所述辅特征条件,以及至少一个用户群体对应的主特征的阈值。The cloud can determine the threshold of the main feature corresponding to each user group based on the power consumption data of the first application of the terminal device of the first product series within the preset time of each user group, and the threshold of the main feature is used to detect whether the power consumption of the first application is abnormal. The cloud generates a power consumption model of the first application of the first product series based on the auxiliary feature conditions and the threshold of the main feature corresponding to each user group. Among them, the power consumption model of the first application of the first product series may include: the auxiliary feature conditions, and the threshold of the main feature corresponding to at least one user group.
在一种可能的实现方式中,所述主特征与其他每个特征的相关系数包括皮尔逊Pearson相关系数和斯皮尔曼Spearman相关系数。所述根据所述主特征与其他每个特征的相关系数,确定辅特征,包括:将大于或等于Pearson相关系数阈值,且大于或等于Spearman相关系数阈值的特征作为第一候选辅特征;根据所述第一候选辅特征,确定所述辅特征。In a possible implementation, the correlation coefficient between the main feature and each of the other features includes a Pearson correlation coefficient and a Spearman correlation coefficient. Determining the auxiliary feature according to the correlation coefficient between the main feature and each of the other features includes: taking a feature greater than or equal to a Pearson correlation coefficient threshold and greater than or equal to a Spearman correlation coefficient threshold as a first candidate auxiliary feature; and determining the auxiliary feature according to the first candidate auxiliary feature.
在一种可能的实现方式中,可以将所述第一候选辅特征,作为所述辅特征。In a possible implementation manner, the first candidate auxiliary feature may be used as the auxiliary feature.
在一种可能的实现方式中,所述根据所述第一候选辅特征,确定所述辅特征,包括:In a possible implementation manner, determining the auxiliary feature according to the first candidate auxiliary feature includes:
步骤A,获取每个第一候选辅特征与其他第一候选辅特征的方差膨胀系数VIF;Step A, obtaining the variance expansion factor VIF of each first candidate auxiliary feature and other first candidate auxiliary features;
步骤B,针对最大VIF对应的第一候选辅特征,若所述最大VIF大于VIF阈值,且第一候选辅特征的数量大于数量阈值,执行步骤C;若所述最大VIF大于VIF阈值且第一候选辅特征的数量小于或等于所述数量阈值,或者,所述最大VIF小于或等于所述VIF阈值,则将所有的第一候选辅特征作为第二候选辅特征,且根据所述第二候选辅特征,确定所述辅特征;Step B, for the first candidate auxiliary feature corresponding to the maximum VIF, if the maximum VIF is greater than the VIF threshold and the number of the first candidate auxiliary features is greater than the number threshold, executing step C; if the maximum VIF is greater than the VIF threshold and the number of the first candidate auxiliary features is less than or equal to the number threshold, or the maximum VIF is less than or equal to the VIF threshold, all the first candidate auxiliary features are used as second candidate auxiliary features, and the auxiliary feature is determined according to the second candidate auxiliary features;
步骤C,删除所述最大VIF对应的第一候选辅特征,且返回执行步骤A-步骤B,直至最大VIF小于或等于所述VIF阈值,或者剩余的第一候选辅特征的数量小于或等于所述数量阈值,且将剩余的第一候选辅特征作为第二候选辅特征,且根据所述第二候选辅特征,确定所述辅特征。Step C, delete the first candidate auxiliary feature corresponding to the maximum VIF, and return to execute steps A-B until the maximum VIF is less than or equal to the VIF threshold, or the number of remaining first candidate auxiliary features is less than or equal to the number threshold, and use the remaining first candidate auxiliary features as second candidate auxiliary features, and determine the auxiliary feature based on the second candidate auxiliary feature.
在一种可能的实现方式中,可以将所述第二候选辅特征,作为所述辅特征。In a possible implementation manner, the second candidate auxiliary feature may be used as the auxiliary feature.
在一种可能的实现方式中,所述根据所述第二候选辅特征,确定所述辅特征,包括:根据最小绝对收缩和选择模型,获取每个第二候选辅特征的重要性值;将排序在前N的第二候选辅特征作为所述辅特征,所述N等于所述数量阈值。In a possible implementation, determining the auxiliary feature based on the second candidate auxiliary feature includes: obtaining the importance value of each second candidate auxiliary feature based on a minimum absolute shrinkage and selection model; and taking the second candidate auxiliary features ranked in the top N as the auxiliary feature, where N is equal to the quantity threshold.
在一种可能的实现方式中,所述根据所述预设时间段内所述第一产品系列的终端设备的第一应用的功耗数据,以及所述辅特征,获取辅特征条件,包括:根据所述辅特征,以及所述预设时间段内第一产品系列的终端设备的第一应用的功耗数据,训练分类与回归树CART;将所述CART中的叶子节点作为所述辅特征条件。In a possible implementation, the obtaining of auxiliary feature conditions based on the power consumption data of the first application of the terminal device of the first product series within the preset time period and the auxiliary feature includes: training a classification and regression tree CART based on the auxiliary feature and the power consumption data of the first application of the terminal device of the first product series within the preset time period; and using the leaf nodes in the CART as the auxiliary feature conditions.
在一种可能的实现方式中,所述根据每个用户群体的预设时间内第一产品系列的终端设备的第一应用的功耗数据,确定每个用户群体对应的主特征的阈值,包括:在所述每个用户群体的预设时间内第一产品系列的终端设备的第一应用的功耗数据中,根据所述主特征的数值,以及第一预设比例,确定所述每个用户群体对应的主特征的阈值。In a possible implementation, the method of determining the threshold of the main feature corresponding to each user group based on the power consumption data of the first application of the terminal device of the first product series within the preset time of each user group includes: determining the threshold of the main feature corresponding to each user group based on the value of the main feature and a first preset ratio in the power consumption data of the first application of the terminal device of the first product series within the preset time of each user group.
在一种可能的实现方式中,基于所述第一预设比例确定的所述每个用户群体对应的主特征的阈值为第一阈值。所述方法还包括:在所述每个用户群体的预设时间内第一产品系列的终端设备的第一应用的功耗数据中,根据所述主特征的数值,以及第二预设比例,确定所述每个用户群体对应的主特征的第二阈值;在所述每个用户群体的预设时间内第一产品系列的终端设备的第一应用的功耗数据中,根据所述主特征的数值,以及第三预设比例,确定所述每个用户群体对应的主特征的第三阈值,所述第一预设比例小于所述第二预设比例,所述第二预设比例小于所述第三预设比例,所述第一阈值、所述第二阈值,以及所述第三阈值用于确定所述第一应用的功耗异常的等级。In a possible implementation, the threshold of the main feature corresponding to each user group determined based on the first preset ratio is the first threshold. The method further includes: determining the second threshold of the main feature corresponding to each user group according to the value of the main feature and the second preset ratio in the power consumption data of the first application of the terminal device of the first product series within the preset time of each user group; determining the third threshold of the main feature corresponding to each user group according to the value of the main feature and the third preset ratio in the power consumption data of the first application of the terminal device of the first product series within the preset time of each user group, wherein the first preset ratio is less than the second preset ratio, the second preset ratio is less than the third preset ratio, and the first threshold, the second threshold, and the third threshold are used to determine the level of power consumption anomaly of the first application.
第三方面,本申请实施例提供一种终端设备,终端设备也可以称为终端(terminal)、用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等。终端设备可以是手机(mobile phone)、智能电视、穿戴式设备、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self-driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等等。In a third aspect, an embodiment of the present application provides a terminal device, which may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.
该终端设备包括:处理器和存储器;存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,使得终端设备执行如第一方面的方法。The terminal device comprises: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the method of the first aspect.
第四方面,本申请实施例提供一种电子设备,该电子设备可以为第二方面的云端。该电子设备包括:处理器和存储器;存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,使得电子设备执行如第二方面的方法。In a fourth aspect, an embodiment of the present application provides an electronic device, which may be the cloud of the second aspect. The electronic device comprises: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method of the second aspect.
第五方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序。计算机程序被处理器执行时实现如第一方面、第二方面的方法。In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the first aspect and the second aspect is implemented.
第六方面,本申请实施例提供一种计算机程序产品,计算机程序产品包括计算机程序,当计算机程序被运行时,使得计算机执行如第一方面、第二方面的方法。In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run, the computer executes the method of the first aspect or the second aspect.
第七方面,本申请实施例提供了一种芯片,芯片包括处理器,处理器用于调用存储器中的计算机程序,以执行如第一方面、第二方面所述的方法。In a seventh aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method described in the first aspect and the second aspect.
应当理解的是,本申请的第三方面至第七方面与本申请的第一方面的技术方案相对应,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。It should be understood that the third to seventh aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例提供的终端设备的功耗处理方法适用的系统架构一种示意图;FIG1 is a schematic diagram of a system architecture applicable to a method for processing power consumption of a terminal device provided in an embodiment of the present application;
图2A为本申请实施例提供的终端设备的功耗处理方法适用的系统架构另一种示意图;FIG2A is another schematic diagram of a system architecture applicable to the power consumption processing method of a terminal device provided in an embodiment of the present application;
图2B为本申请实施例提供的终端设备的功耗处理方法的一种流程示意图;FIG2B is a schematic diagram of a flow chart of a method for processing power consumption of a terminal device provided in an embodiment of the present application;
图3为本申请实施例提供的功耗模型的获取流程示意图;FIG3 is a schematic diagram of a process for obtaining a power consumption model according to an embodiment of the present application;
图4为本申请实施例提供的CART的一种示意图;FIG4 is a schematic diagram of a CART provided in an embodiment of the present application;
图5A为本申请实施例提供的筛选辅特征的一种示意图;FIG5A is a schematic diagram of a screening auxiliary feature provided in an embodiment of the present application;
图5B为本申请实施例提供的确定主特征的阈值的一种示意图;FIG5B is a schematic diagram of determining a threshold value of a main feature according to an embodiment of the present application;
图6为本申请实施例提供的终端设备的功耗处理方法的另一实施例的流程示意图;FIG6 is a flow chart of another embodiment of a method for processing power consumption of a terminal device provided in an embodiment of the present application;
图7为本申请实施例提供的终端设备的功耗处理方法的另一实施例的流程示意图;FIG7 is a flow chart of another embodiment of a method for processing power consumption of a terminal device provided in an embodiment of the present application;
图8为本申请实施例提供的终端设备的功耗处理方法的另一实施例的流程示意图;FIG8 is a flow chart of another embodiment of a method for processing power consumption of a terminal device provided in an embodiment of the present application;
图9为本申请实施例提供的电子设备的一种结构示意图。FIG. 9 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
具体实施方式Detailed ways
为了便于清楚地描述本申请实施例的技术方案,本申请实施例中,“示例性的”或者“例如”或者“如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "exemplary" or "for example" or "such as" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In the embodiment of the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association relationship of the associated objects, indicating that there may be three relationships, for example, A and/or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following items (individuals)" or similar expressions thereof refer to any combination of these items, including any combination of single items (individuals) or plural items (individuals). For example, at least one of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple. In addition, it should be understood that in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
需要说明的是,本申请实施例中的“在……时”或“当……时”,可以为在某种情况发生的瞬时,也可以为在某种情况发生后的一段时间内,本申请实施例对此不作具体限定。此外,本申请实施例提供的显示界面仅作为示例,显示界面还可以包括更多或更少的内容。It should be noted that the "at..." or "when..." in the embodiments of the present application can be the instant when a certain situation occurs, or can be a period of time after a certain situation occurs, and the embodiments of the present application do not specifically limit this. In addition, the display interface provided in the embodiments of the present application is only an example, and the display interface can also include more or less content.
随着终端设备的快速发展,终端设备上安装的应用越来越多。用户可以同时打开多个应用,应用的运行会增加终端设备的功耗,因此有必要对应用的功耗进行检测和管理,以延长终端设备的续航。With the rapid development of terminal devices, more and more applications are installed on terminal devices. Users can open multiple applications at the same time. The operation of applications will increase the power consumption of terminal devices. Therefore, it is necessary to detect and manage the power consumption of applications to extend the battery life of terminal devices.
在一些实施例中,相较于终端设备中前台运行的应用,用户对后台运行的应用的关注度低。因此目前可以设置功耗阈值,如功耗阈值可以为应用的中央处理器(centralprocessing unit,CPU)后台功耗的阈值,CPU后台功耗的阈值可以理解为应用在后台运行时使用CPU产生的功耗。终端设备可以检测运行在后台的应用的CPU功耗,当运行在后台的应用的CPU功耗大于该功耗阈值时,终端设备可以杀掉(kill)该应用,以减少终端设备的功耗。或者,终端设备会输出提示信息,以提示用户该后台应用的功耗大。当运行在后台的应用的CPU功耗小于或等于该功耗阈值时,该应用可以继续运行在后台,如终端设备可以不做处理。In some embodiments, compared with the applications running in the foreground of the terminal device, the user pays less attention to the applications running in the background. Therefore, a power consumption threshold can be set at present, such as the power consumption threshold can be the threshold of the background power consumption of the central processing unit (CPU) of the application, and the threshold of the CPU background power consumption can be understood as the power consumption generated by the application using the CPU when running in the background. The terminal device can detect the CPU power consumption of the application running in the background. When the CPU power consumption of the application running in the background is greater than the power consumption threshold, the terminal device can kill the application to reduce the power consumption of the terminal device. Alternatively, the terminal device will output a prompt message to prompt the user that the power consumption of the background application is high. When the CPU power consumption of the application running in the background is less than or equal to the power consumption threshold, the application can continue to run in the background, such as the terminal device can do no processing.
目前终端设备的功耗的处理方法虽然能够减少终端设备的功耗,但不同用户群体对终端设备的使用习惯不同,针对所有用户群体采用同一方法(如采用相同的功耗阈值)处理终端设备的功耗,灵活性差。Although the current method for processing the power consumption of terminal devices can reduce the power consumption of terminal devices, different user groups have different usage habits of terminal devices. Using the same method (such as using the same power consumption threshold) to process the power consumption of terminal devices for all user groups has poor flexibility.
示例性的,用户A喜欢听音乐,每天听音乐的时长较长,用户B不喜欢听音乐,每天几乎不听音乐,但是当用户A和用户B均打开音频播放类应用,且将音频播放类应用退至后台运行时,音频播放类应用可以播放音乐。对于用户A和用户B,若终端设备按照相同的处理逻辑,当音频播放类应用的CPU后台功耗大于功耗阈值时,终端设备会输出提示信息,提示用户该应用的功耗大,则对于喜欢音乐的用户A来说音频播放类应用一退至后台,就会收到提示信息,甚至不断收到提示信息,对用户的打扰过多,用户体验差。For example, user A likes to listen to music and listens to music for a long time every day, while user B does not like to listen to music and hardly listens to music every day. However, when both user A and user B open an audio playback application and return the audio playback application to the background, the audio playback application can play music. For user A and user B, if the terminal device follows the same processing logic, when the CPU background power consumption of the audio playback application is greater than the power consumption threshold, the terminal device will output a prompt message to prompt the user that the application has high power consumption. In this case, user A who likes music will receive a prompt message as soon as the audio playback application returns to the background, and may even receive prompt messages continuously, which disturbs the user too much and causes a poor user experience.
基于目前的问题,本申请实施例提供一种终端设备的功耗处理方法,可以针对用户使用应用的习惯或特征,确定用户所属的用户群体,不同的用户群体可以对应不同的功耗处理逻辑,以便针对不同的用户,终端设备可以适应性地调整功耗的处理方法,灵活性高,且功耗处理逻辑适配于用户的习惯或特征,可以提高用户体验。Based on the current problems, an embodiment of the present application provides a power consumption processing method for a terminal device, which can determine the user group to which a user belongs based on the user's habits or characteristics of using applications. Different user groups can correspond to different power consumption processing logics, so that for different users, the terminal device can adaptively adjust the power consumption processing method. It has high flexibility, and the power consumption processing logic is adapted to the user's habits or characteristics, which can improve the user experience.
示例性的,以音频播放类应用为例,且以CPU后台功耗为检测条件为例,如用户A喜欢听音乐,每天听音乐的时长较长,用户B不喜欢听音乐,每天几乎不听音乐。其中,用户A对应的功耗阈值可以为第一功耗阈值,用户B对应的功耗阈值可以为第二功耗阈值,第一功耗阈值大于第二功耗阈值。如当用户A和用户B均打开音频播放类应用,且将音频播放类应用退至后台运行时,用户A的终端设备可以比较音频播放类应用的CPU后台功耗和第一功耗阈值,如当音频播放类应用的CPU后台功耗大于该第一功耗阈值时,用户A的终端设备可以输出提示信息。用户B的终端设备可以比较音频播放类应用的CPU后台功耗和第二功耗阈值,如当音频播放类应用的CPU后台功耗大于该第二功耗阈值时,用户B的终端设备可以输出提示信息。Exemplarily, taking audio playback applications as an example, and taking CPU background power consumption as a detection condition as an example, user A likes to listen to music and listens to music for a long time every day, while user B does not like to listen to music and hardly listens to music every day. Among them, the power consumption threshold corresponding to user A can be a first power consumption threshold, and the power consumption threshold corresponding to user B can be a second power consumption threshold, and the first power consumption threshold is greater than the second power consumption threshold. For example, when both user A and user B open audio playback applications and return the audio playback applications to the background, user A's terminal device can compare the CPU background power consumption of the audio playback application with the first power consumption threshold. For example, when the CPU background power consumption of the audio playback application is greater than the first power consumption threshold, user A's terminal device can output a prompt message. User B's terminal device can compare the CPU background power consumption of the audio playback application with the second power consumption threshold. For example, when the CPU background power consumption of the audio playback application is greater than the second power consumption threshold, user B's terminal device can output a prompt message.
这样,对于喜欢音乐的用户A来说,音频播放类应用退至后台后,因为第一功耗阈值较大,因此用户A不会频繁收到提示信息。对于不喜欢音乐的用户B来说,音频播放类应用退至后台后,因为第二功耗阈值较小,用户B的终端设备会及时提醒用户B音频播放类应用较大,以便用户B可以及时了解终端设备中的应用的功耗。In this way, for user A who likes music, after the audio playback application is retired to the background, because the first power consumption threshold is large, user A will not receive prompt information frequently. For user B who does not like music, after the audio playback application is retired to the background, because the second power consumption threshold is small, user B's terminal device will promptly remind user B that the audio playback application is large, so that user B can timely understand the power consumption of the application in the terminal device.
在介绍本申请实施例提供的终端设备的功耗处理方法之前,首先介绍本申请实施例提供的终端设备的功耗处理方法适用的系统架构。图1为本申请实施例提供的终端设备的功耗处理方法适用的系统架构示意图。参照图1,该系统架构可以包括:至少一个终端设备、云端,以及数据平台。图1中以服务器表示云端、数据平台,本申请实施例对云端和数据平台的形态不做限制。应理解,图1中以1个终端设备为例。Before introducing the power consumption processing method of the terminal device provided in the embodiment of the present application, the system architecture applicable to the power consumption processing method of the terminal device provided in the embodiment of the present application is first introduced. Figure 1 is a schematic diagram of the system architecture applicable to the power consumption processing method of the terminal device provided in the embodiment of the present application. Referring to Figure 1, the system architecture may include: at least one terminal device, a cloud, and a data platform. In Figure 1, the cloud and the data platform are represented by a server, and the embodiment of the present application does not limit the form of the cloud and the data platform. It should be understood that Figure 1 takes one terminal device as an example.
终端设备,可以向数据平台上报终端设备的功耗数据。在一些实施例中,终端设备可以周期性地向数据平台上报终端设备的功耗数据,如终端设备可以每隔三天可以向数据平台上报一次终端设备的功耗数据。在一些实施例中,终端设备可以定时向数据平台上报终端设备的功耗数据,如终端设备可以在每天的6点向数据平台上报终端设备的功耗数据。The terminal device may report the power consumption data of the terminal device to the data platform. In some embodiments, the terminal device may periodically report the power consumption data of the terminal device to the data platform, such as the terminal device may report the power consumption data of the terminal device to the data platform once every three days. In some embodiments, the terminal device may periodically report the power consumption data of the terminal device to the data platform, such as the terminal device may report the power consumption data of the terminal device to the data platform at 6 o'clock every day.
终端设备的功耗数据可以包括:终端设备的每个应用的功耗数据。每个应用运行时,会使用终端设备中的不同器件,可以将应用运行时使用的器件称为应用对应的器件。每个应用的功耗数据可以包括:每个应用对应的器件的功耗数据。The power consumption data of the terminal device may include: the power consumption data of each application of the terminal device. When each application is running, different devices in the terminal device will be used. The devices used when the application is running can be called devices corresponding to the application. The power consumption data of each application may include: the power consumption data of the device corresponding to each application.
器件可以包括但不限于:CPU、图形处理器(graphics processing unit,GPU)、全球导航卫星系统(global navigation satellite system GNSS)、屏幕、传感器、相机、闪光灯、音频模块、蓝牙模块、调制解调器(modem)、Wi-Fi模块。示例性的,蓝牙模块如可以为蓝牙芯片,Wi-Fi模块如可以为Wi-Fi芯片,本申请实施例对此不作显示。其中,终端设备可以通过蓝牙模块实现蓝牙通信,终端设备可以通过Wi-Fi模块实现Wi-Fi通信。The device may include, but is not limited to: a CPU, a graphics processing unit (GPU), a global navigation satellite system (GNSS), a screen, a sensor, a camera, a flash, an audio module, a Bluetooth module, a modem, and a Wi-Fi module. For example, the Bluetooth module may be a Bluetooth chip, and the Wi-Fi module may be a Wi-Fi chip, which is not shown in the embodiment of the present application. Among them, the terminal device can realize Bluetooth communication through the Bluetooth module, and the terminal device can realize Wi-Fi communication through the Wi-Fi module.
终端设备中的传感器可以包括但不限于:压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器。The sensors in the terminal device may include but are not limited to: pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor, bone conduction sensor.
终端设备中的音频模块可以包括但不限于:扬声器,受话器,麦克风等。示例性的,终端设备可以通过音频模块播放音乐、采集声音等。The audio module in the terminal device may include but is not limited to: a speaker, a receiver, a microphone, etc. Exemplarily, the terminal device can play music, collect sound, etc. through the audio module.
本申请实施例中对终端设备中包括的器件不做限制,且对终端设备中器件的划分方式不做限制。示例性的,在一些实施例中,可以将蓝牙模块、modem以及Wi-Fi模块划分成一个模块,如可以称为通信模块。在一些实施例中,如还可以将器件划分为更细粒度或者更粗粒度的器件,本申请实施例对此不作限制。In the embodiments of the present application, there is no restriction on the devices included in the terminal device, and there is no restriction on the division method of the devices in the terminal device. For example, in some embodiments, the Bluetooth module, modem, and Wi-Fi module can be divided into one module, such as a communication module. In some embodiments, the devices can also be divided into finer-grained or coarser-grained devices, and the embodiments of the present application do not limit this.
终端设备可以周期性地统计终端设备的每个应用的功耗数据,且周期性地向数据平台上报终端设备的功耗数据。The terminal device may periodically collect statistics on the power consumption data of each application of the terminal device, and periodically report the power consumption data of the terminal device to the data platform.
示例性的,以“一天”统计一次应用的功耗数据为例,一天中每个应用的功耗数据可以包括如下至少一项:应用对应的器件的前台使用时长、前台功耗、后台使用时长、后台功耗、前台总流量,以及后台总流量。For example, taking the power consumption data of an application counted once a day as an example, the power consumption data of each application in a day may include at least one of the following items: foreground usage time, foreground power consumption, background usage time, background power consumption, total foreground traffic, and total background traffic of the device corresponding to the application.
应理解,不同的器件对应的功耗数据可以不同。示例性的,如通信模块,如终端设备通过modem以及Wi-Fi模块实现通信,会使用终端设备的流量,因此modem以及Wi-Fi模块的功耗数据可以包括:前台总流量,以及后台总流量。示例性的,如屏幕的状态包括亮屏和熄屏,屏幕不会运行在后台,因此屏幕的功耗数据可以包括:屏幕亮屏功耗、屏幕亮屏使用时长、屏幕前台功耗以及屏幕前台使用时长。示例性的,应用无论运行在前台或者后台,均会使用CPU的资源,因此CPU的功耗数据可以包括:CPU前台功耗、CPU前台使用时长、CPU后台功耗,以及CPU后台使用时长。It should be understood that the power consumption data corresponding to different devices may be different. Exemplarily, such as a communication module, if the terminal device communicates through a modem and a Wi-Fi module, the traffic of the terminal device will be used, so the power consumption data of the modem and the Wi-Fi module may include: total foreground traffic, and total background traffic. Exemplarily, if the status of the screen includes screen on and screen off, the screen will not run in the background, so the power consumption data of the screen may include: screen power consumption when the screen is on, screen usage time, screen foreground power consumption, and screen foreground usage time. Exemplarily, whether the application is running in the foreground or the background, it will use the resources of the CPU, so the power consumption data of the CPU may include: CPU foreground power consumption, CPU foreground usage time, CPU background power consumption, and CPU background usage time.
示例性的,以终端设备“一星期”向数据平台上报一次终端设备的功耗数据为例。终端设备可以每隔一星期向数据平台上报一次终端设备的功耗数据,该功耗数据可以包括终端设备7天的功耗数据。For example, the terminal device reports the power consumption data of the terminal device to the data platform once a week. The terminal device may report the power consumption data of the terminal device to the data platform once every week, and the power consumption data may include power consumption data of the terminal device for 7 days.
表一为终端设备的功耗数据中包括的内容,以及内容的含义的一种示例图。应理解,终端设备的数据功耗可以以文本形式、表格形式等方式上报至数据平台,本申请实施例对功耗数据的数据形式不做限制。Table 1 is an example diagram of the content included in the power consumption data of the terminal device and the meaning of the content. It should be understood that the data power consumption of the terminal device can be reported to the data platform in text form, table form, etc., and the embodiment of the present application does not limit the data form of the power consumption data.
表一Table I
表一中,FG表征前台(foreground),BG表征后台(background),trfc表征流量(traffic)。In Table 1, FG represents the foreground, BG represents the background, and trfc represents the traffic.
在一些实施例中,因为终端设备的功耗数据可以包括终端设备的每个应用的功耗数据,因此为了便于区域终端设备的不同应用的功耗数据,终端设备的功耗数据还可以包括应用信息。示例性的,如应用信息可以包括应用名和应用版本。在一些实施例中,应用名还可以替换为应用编号、应用图标等可以区分不同应用的信息。In some embodiments, because the power consumption data of the terminal device may include the power consumption data of each application of the terminal device, in order to facilitate the power consumption data of different applications of the terminal device, the power consumption data of the terminal device may also include application information. Exemplarily, the application information may include the application name and the application version. In some embodiments, the application name may also be replaced with information that can distinguish different applications, such as the application number and the application icon.
在一些实施例中,终端设备的功耗数据还可以包括:设备信息。示例性的,如设备信息可以包括终端设备的名称(产品名)、终端型号(产品版本),以及序列号(serialnumber,SN)。在一些实施例中,产品名还可以替换为产品编号等可以区分不同产品的信息。In some embodiments, the power consumption data of the terminal device may also include: device information. For example, the device information may include the name of the terminal device (product name), the terminal model (product version), and the serial number (serial number, SN). In some embodiments, the product name may also be replaced with information such as the product number that can distinguish different products.
在一些实施例中,终端设备的功耗数据还可以包括:时间戳。时间戳表示终端设备向数据平台上报终端设备的功耗数据的时间。In some embodiments, the power consumption data of the terminal device may further include: a timestamp. The timestamp indicates the time when the terminal device reports the power consumption data of the terminal device to the data platform.
应注意的是,表一中还将终端设备的功耗数据进行分类,展示了功耗数据对应的特征。示例性的,设备信息可以表征产品相关特征,应用信息可以表征应用特征,屏幕亮屏功耗、屏幕亮屏使用时长、屏幕前台功耗以及屏幕前台使用时长可以表征屏幕相关特征。终端设备的其他相关特征可以参照表一所示。It should be noted that Table 1 also classifies the power consumption data of the terminal device and shows the characteristics corresponding to the power consumption data. For example, device information can represent product-related characteristics, application information can represent application characteristics, and screen power consumption, screen usage time, screen foreground power consumption, and screen foreground usage time can represent screen-related characteristics. Other relevant characteristics of the terminal device can be shown in Table 1.
应理解的是,因为至少一个终端设备可以向数据平台上报终端设备的功耗数据,因此数据平台可以存储至少一个终端设备的功耗数据。It should be understood that, because at least one terminal device can report the power consumption data of the terminal device to the data platform, the data platform can store the power consumption data of the at least one terminal device.
示例性的,表二中展示了数据平台接收到的多个终端设备在一天内的应用1的功耗数据。应理解,表二中以应用1的功耗数据包括应用1对应的器件的前台功耗为例。For example, Table 2 shows the power consumption data of Application 1 of multiple terminal devices received by the data platform in one day. It should be understood that Table 2 takes the power consumption data of Application 1 including the foreground power consumption of the device corresponding to Application 1 as an example.
表二Table II
示例性的,本申请实施例涉及的功耗的单位可以为毫安时(mAh)。Exemplarily, the unit of power consumption involved in the embodiments of the present application may be milliampere-hour (mAh).
应理解,表1中展示了产品1的不同序列号的终端设备,且展示了终端设备在同一天(2023/5/15)中应用1对应的器件的前台功耗。应理解,终端设备不同,终端设备的产品名可以相同或不同。示例性的,当终端设备属于同一产品系列时,终端设备的产品名相同,当终端设备不属于同一产品系列时,终端设备的产品名不同。终端设备不同,终端设备的SN不同,可以以SN区分不同的终端设备。It should be understood that Table 1 shows terminal devices with different serial numbers of product 1, and shows the foreground power consumption of the device corresponding to application 1 of the terminal device on the same day (2023/5/15). It should be understood that the product names of different terminal devices may be the same or different. Exemplarily, when the terminal devices belong to the same product series, the product names of the terminal devices are the same, and when the terminal devices do not belong to the same product series, the product names of the terminal devices are different. Different terminal devices have different SNs, and different terminal devices can be distinguished by SN.
云端可以从数据平台获取终端设备的功耗数据,且基于终端设备的功耗数据训练功耗模型。在一些实施例中,云端可以周期性的从数据平台获取终端设备的功耗数据,或者,云端可以定时从数据平台获取终端设备的功耗数据。功耗模型可以用于确定终端设备对应的用户所属的用户群体,以及用户群体对应的功耗处理逻辑。The cloud can obtain the power consumption data of the terminal device from the data platform, and train the power consumption model based on the power consumption data of the terminal device. In some embodiments, the cloud can periodically obtain the power consumption data of the terminal device from the data platform, or the cloud can periodically obtain the power consumption data of the terminal device from the data platform. The power consumption model can be used to determine the user group to which the user corresponding to the terminal device belongs, and the power consumption processing logic corresponding to the user group.
应注意的是,云端可以周期性更新功耗模型。示例性的,以1天为例,云端可以每隔1天,根据前一天从数据平台获取的终端设备的功耗数据,更新功耗模型,以保证功耗模型的准确性和实时性。It should be noted that the cloud can periodically update the power consumption model. For example, taking one day as an example, the cloud can update the power consumption model every other day based on the power consumption data of the terminal device obtained from the data platform the previous day to ensure the accuracy and real-time performance of the power consumption model.
云端训练得到功耗模型,或者云端更新功耗模型后,可以向终端设备下发功耗模型。After the power consumption model is obtained through cloud training or updated on the cloud, the power consumption model can be sent to the terminal device.
终端设备可以存储功耗模型。终端设备在运行过程中,可以实时采集终端设备的功耗数据,且基于该功耗模型,得到终端设备对应的用户所属的用户群体,以及用户群体对应的功耗处理逻辑。终端设备可以按照用户群体对应的功耗处理逻辑,处理终端设备的功耗,终端设备的处理逻辑可以参照图6、图7中的相关描述。The terminal device can store the power consumption model. During operation, the terminal device can collect the power consumption data of the terminal device in real time, and based on the power consumption model, obtain the user group to which the user corresponding to the terminal device belongs, and the power consumption processing logic corresponding to the user group. The terminal device can process the power consumption of the terminal device according to the power consumption processing logic corresponding to the user group. The processing logic of the terminal device can refer to the relevant descriptions in Figures 6 and 7.
在一些实施例中,参照图2A,终端设备可以包括计算引擎和功耗处理模块。In some embodiments, referring to FIG. 2A , the terminal device may include a computing engine and a power consumption processing module.
功耗处理模块,用于实时采集终端设备的功耗数据,且向计算引擎发送终端设备的功耗数据。The power consumption processing module is used to collect the power consumption data of the terminal device in real time and send the power consumption data of the terminal device to the calculation engine.
计算引擎,用于存储功耗模型,且将来自功耗处理模块的终端设备的功耗数据输入至功耗模型,得到终端设备对应的用户所属的用户群体,以及用户群体对应的功耗处理逻辑。计算引擎可以按照用户群体对应的功耗处理逻辑,处理终端设备的功耗。The calculation engine is used to store the power consumption model and input the power consumption data of the terminal device from the power consumption processing module into the power consumption model to obtain the user group to which the user corresponding to the terminal device belongs and the power consumption processing logic corresponding to the user group. The calculation engine can process the power consumption of the terminal device according to the power consumption processing logic corresponding to the user group.
在一些实施例中,计算引擎可以按照用户群体对应的功耗处理逻辑,检测终端设备的功耗是否异常,具体可以检测终端设备的应用的功耗是否异常,且向功耗处理模块发送功耗检测结果。功耗检测结果可以包括但不限于:功耗正常、功耗异常。In some embodiments, the computing engine can detect whether the power consumption of the terminal device is abnormal according to the power consumption processing logic corresponding to the user group, and specifically detect whether the power consumption of the application of the terminal device is abnormal, and send the power consumption detection result to the power consumption processing module. The power consumption detection result may include but is not limited to: normal power consumption, abnormal power consumption.
相应的,功耗处理模块,响应于来自计算引擎的功耗检测结果,可以基于功耗检测结果,执行相应的操作,以对终端设备的应用的功耗进行管控。Accordingly, the power consumption processing module, in response to the power consumption detection result from the computing engine, can perform corresponding operations based on the power consumption detection result to control the power consumption of the application of the terminal device.
在一些实施例中,计算引擎可以包括功耗业务模块。功耗业务模块可以包括:功耗接口、功耗模型调用单元,以及功耗模型存储单元。In some embodiments, the computing engine may include a power consumption service module. The power consumption service module may include: a power consumption interface, a power consumption model calling unit, and a power consumption model storage unit.
其中,功耗接口,用于传输来自功耗处理模块的终端设备的功耗数据,以及功耗检测结果。Among them, the power consumption interface is used to transmit the power consumption data of the terminal device from the power consumption processing module, as well as the power consumption detection result.
功耗模型存储单元,用于存储功耗模型。功耗模型调用单元,用于调用功耗模型存储单元中的功耗模型,以检测终端设备的功耗是否异常。The power consumption model storage unit is used to store the power consumption model. The power consumption model calling unit is used to call the power consumption model in the power consumption model storage unit to detect whether the power consumption of the terminal device is abnormal.
在一些实施例中,功耗处理模块可以包括:功耗处理进程和功耗响应单元。在一些实施例中,功耗处理进程和功耗相应单元可以单独设置,如终端设备可以包括计算引擎、功耗处理进程,以及功耗响应单元。在一些实施例中,功耗处理进程和功耗相应单元可以集成一体设置,图2A中以功耗处理进程和功耗响应单元包含于功耗处理模块中为例。In some embodiments, the power consumption processing module may include: a power consumption processing process and a power consumption response unit. In some embodiments, the power consumption processing process and the power consumption response unit may be set separately, such as a terminal device may include a computing engine, a power consumption processing process, and a power consumption response unit. In some embodiments, the power consumption processing process and the power consumption response unit may be integrated into one, and FIG2A takes the power consumption processing process and the power consumption response unit as an example of being included in the power consumption processing module.
其中,功耗处理进程,用于采集终端设备的功耗数据,且向数据平台上报终端设备的功耗数据。功耗处理进程,还用于实时采集终端设备的功耗数据,且通过功耗接口向计算引擎发送终端设备的功耗数据,以及接收来自计算引擎的功耗检测结果。The power consumption processing process is used to collect the power consumption data of the terminal device and report the power consumption data of the terminal device to the data platform. The power consumption processing process is also used to collect the power consumption data of the terminal device in real time, send the power consumption data of the terminal device to the computing engine through the power consumption interface, and receive the power consumption detection results from the computing engine.
功耗处理进程,可以基于根据功耗检测结果,指示功耗响应单元执行相应的操作,以对应用的功耗进行管控。The power consumption processing process can instruct the power consumption response unit to perform corresponding operations based on the power consumption detection result to control the power consumption of the application.
图2B为本申请实施例提供的终端设备的功耗处理方法的一种流程示意图。图2B中以一个终端设备为例,说明终端设备和云端、数据平台的交互过程。参照图2B,本申请实施例提供的终端设备的功耗处理方法可以包括:FIG2B is a flow chart of a method for processing power consumption of a terminal device provided in an embodiment of the present application. FIG2B takes a terminal device as an example to illustrate the interaction process between the terminal device and the cloud and the data platform. Referring to FIG2B , the method for processing power consumption of a terminal device provided in an embodiment of the present application may include:
S201,功耗处理进程采集终端设备的功耗数据。S201, the power consumption processing process collects power consumption data of the terminal device.
示例性的,功耗处理进程可以每隔10min钟采集一次终端设备的功耗数据。Exemplarily, the power consumption processing process may collect power consumption data of the terminal device every 10 minutes.
S202,功耗处理进程向数据平台上报终端设备的功耗数据。S202: The power consumption processing process reports the power consumption data of the terminal device to the data platform.
示例性的,以“一天”上报一次终端设备的功耗数据为例,功耗处理进程每隔10min钟采集一次终端设备的功耗数据后,可以每天对该“一天”中采集的终端设备的功耗数据进行统计,且一天向数据平台上报一次终端设备的功耗数据。For example, taking the power consumption data of the terminal device reported once a day as an example, after the power consumption data of the terminal device is collected every 10 minutes, the power consumption data of the terminal device collected in the "day" can be counted every day, and the power consumption data of the terminal device can be reported to the data platform once a day.
S203,数据平台存储至少一个终端设备的功耗数据。S203: The data platform stores power consumption data of at least one terminal device.
S204,云端从数据平台获取至少一个终端设备的功耗数据。S204, the cloud obtains power consumption data of at least one terminal device from the data platform.
S205,云端根据至少一个终端设备的功耗数据,训练功耗模型。S205: The cloud trains a power consumption model based on power consumption data of at least one terminal device.
在一些实施例中,不同应用的功耗数据不同,每个应用可以对应一个功耗模型。对于一个应用的功耗模型来说,云端可以根据至少一个终端设备的该应用的功耗数据,训练得到该应用的功耗模型。在该实施例中,云端可以训练得到每个应用对应的功耗模型。In some embodiments, the power consumption data of different applications are different, and each application may correspond to a power consumption model. For a power consumption model of an application, the cloud can train the power consumption model of the application based on the power consumption data of the application of at least one terminal device. In this embodiment, the cloud can train the power consumption model corresponding to each application.
在该实施例中,云端训练得到的功耗模型可以包括:应用的标识,以及应用的功耗模型。In this embodiment, the power consumption model obtained through cloud training may include: an identification of the application and a power consumption model of the application.
在一些实施例中,不同产品系列的终端设备,其中布局的器件的型号不同,因此在相同的时间内,同一应用使用同一器件时,该器件的功耗不同。示例性的,如产品系列1的终端设备使用蓝牙芯片1,产品系列2的终端设备使用蓝牙芯片2,在相同的时间内,产品系列1的终端设备和产品系列2的终端设备中的同一应用使用各自的蓝牙芯片分别进行通信,蓝牙芯片1和蓝牙芯片2的功耗不同。在该实施例中,针对不同的产品系列,云端可以根据不同产品系列的终端设备的功耗数据,训练得到每个产品系列的终端设备的功耗模型。In some embodiments, terminal devices of different product series have different models of devices arranged therein, so when the same application uses the same device at the same time, the power consumption of the device is different. For example, if the terminal devices of product series 1 use Bluetooth chip 1, and the terminal devices of product series 2 use Bluetooth chip 2, at the same time, the same application in the terminal devices of product series 1 and the terminal devices of product series 2 use their respective Bluetooth chips for communication, and the power consumption of Bluetooth chip 1 and Bluetooth chip 2 is different. In this embodiment, for different product series, the cloud can train the power consumption model of the terminal devices of each product series based on the power consumption data of the terminal devices of different product series.
应理解,在同一产品系列中,云端可以根据该产品系列中不同应用的功耗数据,训练得到该产品系列中每个应用的功耗模型。在该实施例中,云端训练得到的功耗模型可以包括:产品系列的标识、应用的标识,以及产品系列下应用的功耗模型。It should be understood that in the same product series, the cloud can train the power consumption model of each application in the product series based on the power consumption data of different applications in the product series. In this embodiment, the power consumption model trained by the cloud may include: the identification of the product series, the identification of the application, and the power consumption model of the application under the product series.
其中,S205的具体训练过程可以参照图3中的描述。The specific training process of S205 may refer to the description in FIG. 3 .
S206,计算引擎从云端获取功耗模型。S206, the computing engine obtains a power consumption model from the cloud.
在一些实施例中,计算引擎可以周期性地或定时地从云端获取功耗模型。示例性的,计算引擎可以每天向云端发送一次功耗模型获取请求,该功耗模型获取请求用于请求最新的功耗模型。In some embodiments, the computing engine may periodically or regularly obtain the power consumption model from the cloud. For example, the computing engine may send a power consumption model acquisition request to the cloud once a day, and the power consumption model acquisition request is used to request the latest power consumption model.
其中,终端设备第一次开机时,计算引擎中未存储功耗模型。计算引擎可以向云端发送功耗模型获取请求,云端响应于该向功耗模型获取请求,可以向计算引擎发送云端中最新的功耗模型。When the terminal device is powered on for the first time, the computing engine does not store the power consumption model. The computing engine may send a request to obtain the power consumption model to the cloud, and the cloud may send the latest power consumption model in the cloud to the computing engine in response to the request.
因为云端可以更新功耗模型,本申请实施例中,为了便于区分不同版本的功耗模型,可以对功耗模型进行版本标识或者编号标识。以版本标识为例,当终端设备第一次开机时,因为计算引擎中未存储功耗模型,因此计算引擎发送的功耗模型获取请求中可以不包括功耗模型的版本标识,或者该功耗模型获取请求中可以包括用于指示计算引擎还未请求过功耗模型的标识。Because the cloud can update the power consumption model, in the embodiment of the present application, in order to facilitate the distinction between different versions of the power consumption model, the power consumption model can be version-identified or numbered. Taking the version identification as an example, when the terminal device is turned on for the first time, because the power consumption model is not stored in the computing engine, the power consumption model acquisition request sent by the computing engine may not include the version identification of the power consumption model, or the power consumption model acquisition request may include an identification indicating that the computing engine has not yet requested the power consumption model.
在一些实施例中,计算引擎在向云端发送功耗模型获取请求时,该功耗模型获取请求中可以包括计算引擎中存储的功耗模型的版本标识。这样,云端响应于来自计算引擎的功耗模型获取请求,可以确定计算引擎中已存储的功耗模型的版本,当云端存储有最新的功耗模型时,云端可以向计算引擎发送该最新的功耗模型。当云端存储的功耗模型的版本与计算引擎的功耗模型的版本相同时,即云端还未更新功耗模型,则云端可以向计算引擎反馈“未更新功耗模型”的响应消息。In some embodiments, when the computing engine sends a request to obtain a power consumption model to the cloud, the request may include a version identifier of the power consumption model stored in the computing engine. In this way, the cloud can determine the version of the power consumption model stored in the computing engine in response to the request to obtain a power consumption model from the computing engine. When the cloud stores the latest power consumption model, the cloud can send the latest power consumption model to the computing engine. When the version of the power consumption model stored in the cloud is the same as the version of the power consumption model of the computing engine, that is, the cloud has not updated the power consumption model, the cloud can feedback a response message of "power consumption model not updated" to the computing engine.
S207,功耗处理进程通过功耗接口向计算引擎发送终端设备的功耗数据。S207, the power consumption processing process sends the power consumption data of the terminal device to the calculation engine through the power consumption interface.
应理解,S207与S202可以同时执行,没有先后顺序的区分。It should be understood that S207 and S202 can be executed simultaneously without distinction of order.
示例性的,功耗处理进程可以每隔10min钟采集一次终端设备的功耗数据,功耗处理进程可以每隔10min钟通过功耗接口向计算引擎发送一次终端设备的功耗数据。Exemplarily, the power consumption processing process may collect the power consumption data of the terminal device once every 10 minutes, and the power consumption processing process may send the power consumption data of the terminal device to the calculation engine once every 10 minutes through the power consumption interface.
S208,计算引擎调用功耗模型,且将终端设备的功耗数据输入至功耗模型,得到功耗检测结果。S208, the calculation engine calls the power consumption model, and inputs the power consumption data of the terminal device into the power consumption model to obtain the power consumption detection result.
S209,计算引擎向功耗处理进程发送功耗检测结果。S209: The computing engine sends the power consumption detection result to the power consumption processing process.
S210,功耗处理进程根据功耗检测结果,指示功耗响应单元执行对应的操作。S210, the power consumption processing process instructs the power consumption response unit to perform corresponding operations according to the power consumption detection result.
S208-S210可以参照图6、图7中的相关描述。S208 - S210 may refer to the relevant descriptions in FIG. 6 and FIG. 7 .
图3以一个产品系列的终端设备的一个应用为例,说明云端获取功耗模型的过程。应理解,对于其他产品系列,以及其他应用的功耗模型的获取过程,可以参照图3中的描述。FIG3 takes an application of a terminal device of a product series as an example to illustrate the process of obtaining a power consumption model in the cloud. It should be understood that the process of obtaining power consumption models of other product series and other applications can refer to the description in FIG3 .
图3为本申请实施例提供的功耗模型的获取流程示意图。参照图3,本申请实施例提供的终端设备的功耗处理方法可以包括:FIG3 is a schematic diagram of a process for obtaining a power consumption model provided in an embodiment of the present application. Referring to FIG3 , a method for processing power consumption of a terminal device provided in an embodiment of the present application may include:
S301,云端确定目标应用,目标应用为待训练功耗模型的应用。S301, the cloud determines a target application, where the target application is an application for which a power consumption model is to be trained.
在一些实施例中,S301为可选步骤。在一些实施例中,针对每个应用,云端可以训练每隔应用的功耗模型。其中,目标应用可以包括终端设备的每个应用。In some embodiments, S301 is an optional step. In some embodiments, for each application, the cloud can train a power consumption model for each application. The target application can include each application of the terminal device.
在一些实施例中,目标应用可以为预设的应用。在一些实施例中,目标应用可以为热门应用。在一些实施例中,目标应用可以为研发人员自定义的应用。In some embodiments, the target application may be a preset application. In some embodiments, the target application may be a popular application. In some embodiments, the target application may be an application customized by a developer.
在一些实施例中,云端可以根据至少一个终端设备的功耗数据,基于应用的功耗数据的数据量,确定目标应用。以终端设备一天统计1次应用的功耗数据为例,参照表二,表二中的一行数据可以作为应用1的1条功耗数据。其中,使用应用的用户越多,越多的终端设备上报该应用的功耗数据,则该应用的功耗数据的数据量越多。In some embodiments, the cloud can determine the target application based on the power consumption data of at least one terminal device and the amount of power consumption data of the application. For example, if the terminal device collects power consumption data of an application once a day, referring to Table 2, a row of data in Table 2 can be used as one piece of power consumption data of application 1. The more users use the application, the more terminal devices report the power consumption data of the application, and the more the amount of power consumption data of the application.
示例性的,云端可以按照从多到少的顺序,对所有应用的功耗数据的数据量进行排序,云端可以选取排序前150的应用作为目标应用。应理解,150为示例说明,该数值可以自定义修改。在一些实施例中,排序前150的应用可以简称为top150应用。Exemplarily, the cloud can sort the data volume of the power consumption data of all applications in order from most to least, and the cloud can select the top 150 applications as target applications. It should be understood that 150 is an example and the value can be customized. In some embodiments, the top 150 applications can be referred to as top150 applications.
在一些实施例中,因为终端设备的一些应用是常驻应用,该常驻应用不运行会引发终端设备出现故障(bug)。示例性的,常驻应用可以为系统应用,可以包括但不限于:桌面应用、锁屏应用等。In some embodiments, because some applications of the terminal device are resident applications, the failure of the resident application to run may cause a malfunction (bug) of the terminal device. Exemplarily, the resident application may be a system application, which may include but is not limited to: a desktop application, a lock screen application, and the like.
本申请实施例中,云端可以按照从多到少的顺序,对所有应用的功耗数据的数据量进行排序后,可以删除常驻应用,再选取top150应用作为目标应用。In an embodiment of the present application, the cloud can sort the data volume of the power consumption data of all applications in order from most to least, delete the resident applications, and then select the top 150 applications as target applications.
在一些实施例中,对于不同产品系列,以及不同应用来说,功耗数据的数据量不同。示例性的,以应用为例,如社交类应用、娱乐类应用等具有大量用户,一天内应用的功耗数据的数据量可以达到上百万条,而对于一些办公类应用等具有少量用户,一天内应用的功耗数据的数据量较少。In some embodiments, the amount of power consumption data is different for different product lines and different applications. For example, for applications such as social applications and entertainment applications with a large number of users, the amount of power consumption data of the applications in one day can reach millions, while for some office applications with a small number of users, the amount of power consumption data of the applications in one day is relatively small.
本申请实施例中,为了避免预设时间段内第一产品系列的终端设备的第一应用的功耗数据的数据量过多,造成训练资源的浪费的问题,以及为了避免数据量过少,造成功耗模型的准确性低等问题,可以预先设置第一数据量阈值和第二数据量阈值,第一数据量阈值大于第二数据量阈值。示例性的,第一数量阈值可以为100万条,第二数据量阈值可以为10万条。In the embodiment of the present application, in order to avoid the problem of excessive amount of power consumption data of the first application of the terminal device of the first product series within a preset time period, resulting in a waste of training resources, and to avoid the problem of low accuracy of the power consumption model due to too little data, a first data amount threshold and a second data amount threshold can be preset, and the first data amount threshold is greater than the second data amount threshold. Exemplarily, the first amount threshold can be 1 million, and the second data amount threshold can be 100,000.
其中,当预设时间段内第一产品系列的终端设备的第一应用的功耗数据的数据量大于100万条(第一数据量阈值)时,云端可以在预设时间段内第一产品系列的终端设备的第一应用的功耗数据的数据量中,随机抽取100万条功耗数据作为训练数据。其中,当预设时间段内第一产品系列的终端设备的第一应用的功耗数据的数据量小于或等于100万条(第一数据量阈值)且大于或等于10万条(第二数据量阈值)时,云端可以将预设时间段内第一产品系列的终端设备的第一应用的功耗数据,作为训练数据。当预设时间段内第一产品系列的终端设备的第一应用的功耗数据的数据量小于10万条(第二数据量阈值)时,云端可以不训练功耗模型,因为数据量少会导致功耗模型的准确性低。Among them, when the amount of power consumption data of the first application of the terminal device of the first product series within the preset time period is greater than 1 million (the first data amount threshold), the cloud can randomly extract 1 million power consumption data from the amount of power consumption data of the first application of the terminal device of the first product series within the preset time period as training data. Among them, when the amount of power consumption data of the first application of the terminal device of the first product series within the preset time period is less than or equal to 1 million (the first data amount threshold) and greater than or equal to 100,000 (the second data amount threshold), the cloud can use the power consumption data of the first application of the terminal device of the first product series within the preset time period as training data. When the amount of power consumption data of the first application of the terminal device of the first product series within the preset time period is less than 100,000 (the second data amount threshold), the cloud may not train the power consumption model, because the small amount of data will result in low accuracy of the power consumption model.
S302,云端对预设时间段内第一产品系列的终端设备的第一应用的功耗数据进行预处理。S302, the cloud pre-processes the power consumption data of the first application of the terminal device of the first product series within a preset time period.
在一些实施例中,S302为可选步骤。在一些实施例中,云端可以不对预设时间段内第一产品系列的终端设备的第一应用的功耗数据进行预处理,而是直接根据预设时间段内第一产品系列的终端设备的第一应用的功耗数据进行训练,得到功耗模型。In some embodiments, S302 is an optional step. In some embodiments, the cloud may not pre-process the power consumption data of the first application of the terminal device of the first product series within the preset time period, but directly train according to the power consumption data of the first application of the terminal device of the first product series within the preset time period to obtain the power consumption model.
应理解,第一产品系列可以表示每个产品系列,第一应用可以表示目标应用中的每个应用。本申请实施例中,云端可以按照产品系列,以及应用对所有的功耗数据进行划分,得到第一产品系列的终端设备的第一应用的功耗数据。可以理解的是,同一产品系列中可以包括多个机型的终端设备。It should be understood that the first product series can represent each product series, and the first application can represent each application in the target application. In the embodiment of the present application, the cloud can divide all power consumption data according to the product series and the application to obtain the power consumption data of the first application of the terminal device of the first product series. It is understandable that the same product series can include terminal devices of multiple models.
在一些实施例中,预设时间段如可以为一天、一周或一个月等,本申请实施例对此不作限制。示例性的,以预设时间段为30天为例,云端可以获取最近30天内第一产品系列的终端设备的第一应用的功耗数据。换句话说,云端可以获取最近30天内每个产品系列的终端设备的每个应用的功耗数据,以根据每个产品系列的终端设备的每个应用的功耗数据,获取每个产品系列的终端设备的每个应用的功耗模型,可以参照“第一产品系列的终端设备的第一应用”的相关描述。In some embodiments, the preset time period may be one day, one week, or one month, etc., which is not limited in the embodiments of the present application. Exemplarily, taking the preset time period of 30 days as an example, the cloud can obtain the power consumption data of the first application of the terminal device of the first product series in the last 30 days. In other words, the cloud can obtain the power consumption data of each application of the terminal device of each product series in the last 30 days, and obtain the power consumption model of each application of the terminal device of each product series based on the power consumption data of each application of the terminal device of each product series, and refer to the relevant description of "the first application of the terminal device of the first product series".
下面对预处理过程进行说明:The preprocessing process is described below:
其一,在一些实施例中,因为网络不稳定等原因,终端设备上报的功耗数据中可能会缺失一些特征的数据,本申请实施例中,云端可以删除缺失特征的数据的功耗数据。示例性的,参照表二,如有一条功耗数据中缺少屏幕前台功耗的数据,则云端可以删除该条功耗数据。First, in some embodiments, due to network instability and other reasons, some characteristic data may be missing in the power consumption data reported by the terminal device. In the embodiment of the present application, the cloud can delete the power consumption data of the missing characteristic data. For example, referring to Table 2, if there is a power consumption data missing the screen foreground power consumption data, the cloud can delete the power consumption data.
在一些实施例中,终端设备上报至数据平台的功耗数据还可能存储重复的问题,如一天内终端设备的一个应用存在多条功耗数据,该种情况下,云端可以做去重处理,保留该终端设备的一个应用的一条功耗数据。示例性的,如云端可以保留CPU后台功耗最大的那条功耗数据,本申请实施例对此不作限制。In some embodiments, the power consumption data reported by the terminal device to the data platform may also store duplicates. For example, if there are multiple power consumption data for an application on the terminal device in one day, the cloud can perform deduplication processing and retain one power consumption data for an application on the terminal device. For example, the cloud can retain the power consumption data with the highest CPU background power consumption, which is not limited in the embodiments of the present application.
其二,因为不同应用运行时,使用的器件不同,器件的功耗数值的数量级存在差异。示例性的,如表二所示,产品系列1、SN1的终端设备中,应用1的Wi-Fi模块前台功耗仅有0.29,但产品系列1、SN2的终端设备中,应用1的屏幕前台功耗有780.33,后者是前者的7000倍,功耗数值的数量级的差异较大。若云端直接使用数量级差异大的功耗数据,则数值较大的特征,在功耗模型中的作用就会显得较为突出和重要,而数值较小的特征,在功耗模型中的作用会显得微不足道,导致功耗模型的准确性低。Secondly, because different applications use different devices when running, the power consumption values of the devices have different orders of magnitude. For example, as shown in Table 2, in the terminal devices of product series 1 and SN1, the foreground power consumption of the Wi-Fi module of application 1 is only 0.29, but in the terminal devices of product series 1 and SN2, the foreground power consumption of the screen of application 1 is 780.33, which is 7000 times that of the former. The order of magnitude difference of power consumption values is large. If the cloud directly uses power consumption data with large orders of magnitude differences, the features with larger values will appear more prominent and important in the power consumption model, while the features with smaller values will appear insignificant in the power consumption model, resulting in low accuracy of the power consumption model.
因此,为了统一比较的标准,保证功耗模型的准确性,云端可以对功耗数据进行标准化处理,以便预设时间段内第一产品系列的终端设备的第一应用中,各器件的功耗数值,处于同一数量级,以消除不同特征之间因数量级不同而带来的影响。示例性的,云端可以对预设时间段内第一产品系列的终端设备的第一应用的功耗数据,进行Z-Score标准化处理。在一些实施例中,如云端还可以使用极差标准化法、或者线性比例标准化法等方法对功耗数据进行标准化处理。Therefore, in order to unify the comparison standards and ensure the accuracy of the power consumption model, the cloud can standardize the power consumption data so that the power consumption values of each device in the first application of the terminal device of the first product series within the preset time period are at the same order of magnitude to eliminate the impact of different features due to different orders of magnitude. Exemplarily, the cloud can perform Z-Score standardization on the power consumption data of the first application of the terminal device of the first product series within the preset time period. In some embodiments, the cloud can also use methods such as extreme value standardization or linear ratio standardization to standardize the power consumption data.
本申请实施例中,云端对预设时间段内第一产品系列的终端设备的第一应用的功耗数据,进行Z-Score标准化处理后,功耗数据之间的均值可以为0,标准差可以为1。In an embodiment of the present application, after the cloud performs Z-Score normalization processing on the power consumption data of the first application of the terminal device of the first product series within a preset time period, the mean value between the power consumption data can be 0 and the standard deviation can be 1.
S303,云端根据预设时间段内第一产品系列的终端设备的第一应用的功耗数据,获取功耗数据中每个特征与主特征的相关系数。S303, the cloud obtains the correlation coefficient between each feature and the main feature in the power consumption data based on the power consumption data of the first application of the terminal device of the first product series within a preset time period.
应注意的是,S303中使用的功耗数据为经过预处理的功耗数据。It should be noted that the power consumption data used in S303 is pre-processed power consumption data.
预设时间段内第一产品系列的终端设备的第一应用的功耗数据中,可以包括至少一个特征的数据。参照表一,如该至少一个特征可以包括但不限于:屏幕相关特征、CPU相关特征、GNSS相关特征、传感器相关特征、GPU相关特征、相机相关特征、闪光灯相关特征、音频相关特征、蓝牙相关特征、modem相关特征,以及Wi-Fi相关特征。应用特征、时间特征,以及产品相关特征不参与S303中与主特征的相关系数的计算。The power consumption data of the first application of the terminal device of the first product series within the preset time period may include data of at least one feature. Referring to Table 1, the at least one feature may include but is not limited to: screen-related features, CPU-related features, GNSS-related features, sensor-related features, GPU-related features, camera-related features, flash-related features, audio-related features, Bluetooth-related features, modem-related features, and Wi-Fi-related features. Application features, time features, and product-related features do not participate in the calculation of the correlation coefficient with the main feature in S303.
主特征用于检测第一应用的功耗是否异常。在一些实施例中,主特征可以为预先设定好的。The main feature is used to detect whether the power consumption of the first application is abnormal. In some embodiments, the main feature may be pre-set.
示例性的,如主特征可以为CPU后台功耗。示例性的,以主特征为CPU后台功耗为例,针对每条功耗数据,云端可以获取每条功耗数据中,每个特征与CPU后台功耗的相关系数。参照表一,针对产品1(第一产品系列)、SN1的终端设备,在2023/5/15时应用1的功耗数据来说,云端可以获取屏幕亮屏功耗与CPU后台功耗的相关系数,屏幕亮屏使用时长与CPU后台功耗的相关系数,屏幕前台功耗与CPU后台功耗的相关系数,……,以及Wi-Fi模块后台总流量与CPU后台功耗的相关系数。Exemplarily, the main feature may be the CPU background power consumption. Exemplarily, taking the CPU background power consumption as the main feature, for each power consumption data, the cloud can obtain the correlation coefficient between each feature and the CPU background power consumption in each power consumption data. Referring to Table 1, for the terminal devices of product 1 (first product series) and SN1, and the power consumption data of application 1 on 2023/5/15, the cloud can obtain the correlation coefficient between the screen power consumption and the CPU background power consumption, the correlation coefficient between the screen usage time and the CPU background power consumption, the correlation coefficient between the screen foreground power consumption and the CPU background power consumption, ..., and the correlation coefficient between the total background traffic of the Wi-Fi module and the CPU background power consumption.
在一些实施例中,针对每条功耗数据,云端可以获取每个特征与主特征的皮尔逊相关系数(pearson correlation coefficient),简称Pearson相关系数。云端可以将Pearson相关系数作为每个特征与主特征的相关系数。其中,Pearson相关系数用于描述两个特征之间的线性关系,Pearson相关系数的取值可以在[-1,1]之间。In some embodiments, for each power consumption data, the cloud can obtain the Pearson correlation coefficient (Pearson correlation coefficient) between each feature and the main feature. The cloud can use the Pearson correlation coefficient as the correlation coefficient between each feature and the main feature. Among them, the Pearson correlation coefficient is used to describe the linear relationship between two features, and the value of the Pearson correlation coefficient can be between [-1, 1].
两个特征之间的线性关系越强,Pearson相关系数就会越接近-1或1,两个特征之间的线性关系越弱,Pearson相关系数越接近于0。云端可以采用如下公式1-公式4,计算每个特征和主特征的Pearson相关系数:The stronger the linear relationship between two features, the closer the Pearson correlation coefficient will be to -1 or 1. The weaker the linear relationship between two features, the closer the Pearson correlation coefficient will be to 0. The cloud can use the following formulas 1 to 4 to calculate the Pearson correlation coefficient between each feature and the main feature:
其中,Y可以表示主特征,如CPU后台功耗。X可以表示功耗数据中的每个特征,该每个特征可以包括主特征或者不包括主特征。公式1用于计算预设时间段内第一产品系列的终端设备的第一应用的功耗数据中,主特征的标准差σY,公式2用于计算预设时间段内第一产品系列的终端设备的第一应用的功耗数据中,每个特征的标准差σX。Wherein, Y may represent a main feature, such as CPU background power consumption. X may represent each feature in the power consumption data, and each feature may include or exclude the main feature. Formula 1 is used to calculate the standard deviation σ Y of the main feature in the power consumption data of the first application of the terminal device of the first product series within a preset time period, and Formula 2 is used to calculate the standard deviation σ X of each feature in the power consumption data of the first application of the terminal device of the first product series within a preset time period.
其中,i表示预设时间段内第一产品系列的终端设备的第一应用的功耗数据中,任意一条功耗数据,n表示功耗数据的数据量。Yi表示该任意一条功耗数据中主特征的数值,μY表示预设时间段内第一产品系列的终端设备的第一应用的功耗数据中,主特征的均值。同理的,以每个特征中包括第一特征为例,Xi表示该任意一条功耗数据中第一特征的数值,μX表示预设时间段内第一产品系列的终端设备的第一应用的功耗数据中,第一特征的均值。Among them, i represents any power consumption data in the power consumption data of the first application of the terminal device of the first product series within the preset time period, and n represents the data volume of the power consumption data. Yi represents the value of the main feature in the any power consumption data, and μY represents the mean value of the main feature in the power consumption data of the first application of the terminal device of the first product series within the preset time period. Similarly, taking the example that each feature includes the first feature, Xi represents the value of the first feature in the any power consumption data, and μX represents the mean value of the first feature in the power consumption data of the first application of the terminal device of the first product series within the preset time period.
其中,公式3用于计算每个特征和主特征之间的协方差cov(X,Y)。Among them, Formula 3 is used to calculate the covariance cov(X,Y) between each feature and the main feature.
其中,公式4用于计算每个特征和主特征之间的Pearson相关系数ρ(X,Y)。Wherein, Formula 4 is used to calculate the Pearson correlation coefficient ρ(X,Y) between each feature and the main feature.
在一些实施例中,针对每条功耗数据,云端可以获取每个特征与主特征的斯皮尔曼Spearman相关系数,且将Spearman相关系数作为每个特征与主特征的相关系数。Spearman相关系数可以表示两个特征之间的单调性关系,Spearman相关系数的取值也在[-1,1]之间。In some embodiments, for each power consumption data, the cloud can obtain the Spearman correlation coefficient between each feature and the main feature, and use the Spearman correlation coefficient as the correlation coefficient between each feature and the main feature. The Spearman correlation coefficient can represent the monotonic relationship between two features, and the value of the Spearman correlation coefficient is also between [-1, 1].
在一些实施例中,针对每条功耗数据,云端可以获取每个特征与主特征的Pearson相关系数,以及每个特征与主特征的Spearman相关系数,每个特征与主特征的相关系数可以包括:每个特征与主特征的Pearson相关系数,以及每个特征与主特征的Spearman相关系数。In some embodiments, for each power consumption data, the cloud can obtain the Pearson correlation coefficient between each feature and the main feature, and the Spearman correlation coefficient between each feature and the main feature. The correlation coefficient between each feature and the main feature may include: the Pearson correlation coefficient between each feature and the main feature, and the Spearman correlation coefficient between each feature and the main feature.
S304,云端根据每个特征与主特征的相关系数,确定辅特征。S304, the cloud determines the auxiliary features according to the correlation coefficient between each feature and the main feature.
在一些实施例中,可以预先设置Pearson相关系数阈值以及Spearman相关系数阈值。Pearson相关系数阈值以及Spearman相关系数阈值可以相等或不等。示例性的,如Pearson相关系数阈值可以为0.3,Spearman相关系数阈值可以为0.3。In some embodiments, a Pearson correlation coefficient threshold and a Spearman correlation coefficient threshold may be preset. The Pearson correlation coefficient threshold and the Spearman correlation coefficient threshold may be equal or unequal. For example, the Pearson correlation coefficient threshold may be 0.3, and the Spearman correlation coefficient threshold may be 0.3.
其中,当云端获取每个特征与主特征的Pearson相关系数时,云端可以将大于或等于Pearson相关系数阈值的特征作为辅特征。当云端获取每个特征与主特征的Spearman相关系数时,云端可以将大于或等于Spearman相关系数阈值的特征作为辅特征。当云端获取每个特征与主特征的Pearson相关系数,以及每个特征与主特征的Spearman相关系数时,云端可以将大于或等于Pearson相关系数阈值,且大于或等于Spearman相关系数阈值的特征作为辅特征。Among them, when the cloud obtains the Pearson correlation coefficient between each feature and the main feature, the cloud can use features greater than or equal to the Pearson correlation coefficient threshold as auxiliary features. When the cloud obtains the Spearman correlation coefficient between each feature and the main feature, the cloud can use features greater than or equal to the Spearman correlation coefficient threshold as auxiliary features. When the cloud obtains the Pearson correlation coefficient between each feature and the main feature, and the Spearman correlation coefficient between each feature and the main feature, the cloud can use features greater than or equal to the Pearson correlation coefficient threshold and greater than or equal to the Spearman correlation coefficient threshold as auxiliary features.
在一些实施例中,以云端获取每个特征与主特征的Pearson相关系数,以及每个特征与主特征的Spearman相关系数为例,云端可以将大于或等于Pearson相关系数阈值,且大于或等于Spearman相关系数阈值的特征作为第一候选辅特征。云端可以在第一候选辅特征中进行筛选,得到辅特征。In some embodiments, taking the cloud obtaining the Pearson correlation coefficient between each feature and the main feature, and the Spearman correlation coefficient between each feature and the main feature as an example, the cloud can use features that are greater than or equal to the Pearson correlation coefficient threshold and greater than or equal to the Spearman correlation coefficient threshold as the first candidate auxiliary features. The cloud can screen the first candidate auxiliary features to obtain auxiliary features.
在一些实施例中,一些第一候选辅特征之间会存在多重共线性,即第一候选辅特征不是互相独立的,一个第一候选辅特征可能是其他一个或几个第一候选辅特征的线性组合。示例性的,以导航应用为例,用户使用导航应用时,屏幕可以处于亮屏状态,则屏幕前台使用时长和屏幕亮屏使用时长,以及屏幕亮屏功耗存在多重共线性。该种情况下,若将该几个存在多重共线性的第一候选辅特征作为辅特征训练功耗模型,则该几个第一候选辅特征之间会相互影响,不利于功耗模型输出正确的功耗检测结果。In some embodiments, there will be multicollinearity between some first candidate auxiliary features, that is, the first candidate auxiliary features are not independent of each other, and one first candidate auxiliary feature may be a linear combination of one or several other first candidate auxiliary features. Exemplarily, taking a navigation application as an example, when a user uses a navigation application, the screen can be in a bright screen state, then there is multicollinearity in the screen foreground usage time, the screen bright screen usage time, and the screen bright screen power consumption. In this case, if the first candidate auxiliary features with multicollinearity are used as auxiliary features to train the power consumption model, the first candidate auxiliary features will affect each other, which is not conducive to the power consumption model outputting correct power consumption detection results.
在一些实施例中,方差膨胀系数(variance inflation factor,VIF)可以衡量第一候选辅特征之间的共线性,VIF值越大,特征之间共线性的问题越明显。在一些实施例中,可以预先设置第一VIF阈值和第二VIF阈值。示例性的,第一VIF阈值可以为100,第二VIF阈值可以为10。In some embodiments, the variance inflation factor (VIF) can measure the collinearity between the first candidate auxiliary features. The larger the VIF value, the more obvious the problem of collinearity between the features. In some embodiments, the first VIF threshold and the second VIF threshold can be preset. Exemplarily, the first VIF threshold can be 100, and the second VIF threshold can be 10.
其中,当第一候选辅特征之间的VIF大于或等于100时,表示第一候选辅特征之间存在严重的多重共线性,当第一候选辅特征之间的VIF小于10时,表示第一候选辅特征之间不存在共线性,当第一候选辅特征之间的VIF大于或等于10且小于100时,表示第一候选辅特征之间存在较强的多重共线性。Among them, when the VIF between the first candidate auxiliary features is greater than or equal to 100, it means that there is serious multicollinearity between the first candidate auxiliary features. When the VIF between the first candidate auxiliary features is less than 10, it means that there is no collinearity between the first candidate auxiliary features. When the VIF between the first candidate auxiliary features is greater than or equal to 10 and less than 100, it means that there is strong multicollinearity between the first candidate auxiliary features.
因此,本申请实施例中,云端可以执行如下步骤:Therefore, in the embodiment of the present application, the cloud can perform the following steps:
步骤A、以任意一个第一候选辅特征作为因变量,以其他每个第一候选辅特征作为自变量,且对该第一候选辅特征和其他第一候选辅特征进行线性回归处理,可以参照如下公式5-1:Step A: taking any first candidate auxiliary feature as the dependent variable and each other first candidate auxiliary feature as the independent variable, and performing linear regression processing on the first candidate auxiliary feature and the other first candidate auxiliary features, the following formula 5-1 can be referred to:
其中,X表征第一候选辅特征,第一候选辅特征的数量为p个。Xj表示任意一个第一候选辅特征,β0,β1,……,βj表示线性回归处理的系数。表示Xj经线性回归处理后的值。Wherein, X represents the first candidate auxiliary feature, and the number of the first candidate auxiliary features is p. Xj represents any first candidate auxiliary feature, and β0 , β1 , ..., βj represent coefficients of linear regression processing. Represents the value of X j after linear regression processing.
云端可以采用如下公式5-2和公式6计算该第一候选辅特征和其他第一候选辅特征之间的VIF:The cloud can use the following formula 5-2 and formula 6 to calculate the VIF between the first candidate auxiliary feature and other first candidate auxiliary features:
其中,i表示功耗数据中的任意一条功耗数据,n表示功耗数据的总条数,即功耗数据的数据量。Xji表示任意一条功耗数据中任意一个第一候选辅特征的数值,表示任意一条功耗数据中任意一个第一候选辅特征经线性回归处理后的值,/>表示n条功耗数据中该任意一个第一候选辅特征的均值。Rj 2表示该任意一个第一候选辅特征对应的决定系数。VIFj表示该任意一个第一候选辅特征的VIF。Wherein, i represents any one of the power consumption data, n represents the total number of power consumption data, that is, the data volume of the power consumption data. X ji represents the value of any first candidate auxiliary feature in any one of the power consumption data, Indicates the value of any first candidate auxiliary feature in any power consumption data after linear regression processing, /> represents the mean value of any first candidate auxiliary feature in the n power consumption data. R j 2 represents the determination coefficient corresponding to any first candidate auxiliary feature. VIF j represents the VIF of any first candidate auxiliary feature.
其中,Rj 2是线性回归处理模型里的决定系数,可以度量有多少因变量的变化能被自变量解释,Rj 2越大,VIFj越大,模型解释性越好,自变量和因变量间存在的线性关系越强,越可能存在多重共线性。Among them, R j 2 is the determination coefficient in the linear regression processing model, which can measure how much of the change in the dependent variable can be explained by the independent variable. The larger the R j 2 , the larger the VIF j , the better the model explanatory power, the stronger the linear relationship between the independent and dependent variables, and the more likely it is that multicollinearity exists.
示例性的,假设第一候选辅特征有10个,分别为第一候选辅特征1、第一候选辅特征2,……,以及第一候选辅特征10。云端可以采用公式5-1、公式5-2,以及公式6,计算第一候选辅特征1的VIF。For example, it is assumed that there are 10 first candidate auxiliary features, namely, first candidate auxiliary feature 1, first candidate auxiliary feature 2, ..., and first candidate auxiliary feature 10. The cloud can calculate the VIF of the first candidate auxiliary feature 1 using Formula 5-1, Formula 5-2, and Formula 6.
步骤B、重复步骤A,依次将其他每个第一候选辅特征作为因变量,计算该其他每个第一候选辅特征的VIF。Step B: repeat step A, taking each other first candidate auxiliary feature as a dependent variable in turn, and calculating the VIF of each other first candidate auxiliary feature.
示例性的,云端还可以计算第一候选辅特征2的VIF,第一候选辅特征3的VIF,……,以及第一候选辅特征10的VIF。Exemplarily, the cloud can also calculate the VIF of the first candidate auxiliary feature 2 , the VIF of the first candidate auxiliary feature 3 , . . . , and the VIF of the first candidate auxiliary feature 10 .
在一些实施例中,步骤B和步骤A可以合并为一个步骤,即云端获取每个第一候选辅特征与其他第一候选辅特征的方差膨胀系数VIF。In some embodiments, step B and step A may be combined into one step, that is, the cloud obtains the variance inflation coefficient VIF of each first candidate auxiliary feature and other first candidate auxiliary features.
步骤C、针对最大VIF对应的第一候选辅特征,若最大VIF大于10,且第一候选辅特征大于3个,则删除该最大VIF对应的第一候选辅特征,且执行步骤D。若所有的第一候选辅特征的VIF均小于或等于10,或者最大VIF大于10且第一候选辅特征小于或等于3个,则将所有的第一候选辅特征作为第二候选辅特征。应理解,3个为示例说明,还可以替换为其他数值,3可以称为数量阈值。在一些实施例中,10(第二VIF阈值)可以作为VIF阈值。Step C: For the first candidate auxiliary feature corresponding to the maximum VIF, if the maximum VIF is greater than 10 and the number of the first candidate auxiliary features is greater than 3, the first candidate auxiliary feature corresponding to the maximum VIF is deleted, and step D is performed. If the VIF of all first candidate auxiliary features is less than or equal to 10, or the maximum VIF is greater than 10 and the number of the first candidate auxiliary features is less than or equal to 3, all first candidate auxiliary features are used as second candidate auxiliary features. It should be understood that 3 is an example and can be replaced by other values. 3 can be called a quantity threshold. In some embodiments, 10 (second VIF threshold) can be used as the VIF threshold.
示例性的,如最大VIF对应的第一候选辅特征为第一候选辅特征1,且第一候选辅特征1的VIF大于10,且第一候选辅特征的数量为10个,第一候选辅特征的数量大于3个,则删除该第一候选辅特征1。若第一候选辅特征1的VIF(最大VIF)小于或等于10,则将第一候选辅特征1、第一候选辅特征2,……,以及第一候选辅特征10均作为第二候选辅特征。或者,最大VIF大于10,且第一候选辅特征的数量小于或等于3,如第一候选辅特征1的VIF大于10,但第一候选辅特征只有第一候选辅特征1、第一候选辅特征2以及第一候选辅特征3这三个,因此可以将第一候选辅特征1、第一候选辅特征2以及第一候选辅特征3作为第二候选辅特征。Exemplarily, if the first candidate auxiliary feature corresponding to the maximum VIF is the first candidate auxiliary feature 1, and the VIF of the first candidate auxiliary feature 1 is greater than 10, and the number of the first candidate auxiliary features is 10, and the number of the first candidate auxiliary features is greater than 3, then the first candidate auxiliary feature 1 is deleted. If the VIF (maximum VIF) of the first candidate auxiliary feature 1 is less than or equal to 10, then the first candidate auxiliary feature 1, the first candidate auxiliary feature 2, ..., and the first candidate auxiliary feature 10 are all used as the second candidate auxiliary features. Alternatively, the maximum VIF is greater than 10, and the number of the first candidate auxiliary features is less than or equal to 3, such as the VIF of the first candidate auxiliary feature 1 is greater than 10, but there are only three first candidate auxiliary features, namely, the first candidate auxiliary feature 1, the first candidate auxiliary feature 2, and the first candidate auxiliary feature 3, so the first candidate auxiliary feature 1, the first candidate auxiliary feature 2, and the first candidate auxiliary feature 3 can be used as the second candidate auxiliary features.
步骤D、对于删除最大VIF对应的第一候选辅特征后的其他第一候选辅特征,重复执行步骤A-步骤C,直至最大VIF小于或等于10,或者剩余的第一候选辅特征的数量小于或等于数量阈值(如3个),且将剩余的第一候选辅特征作为第二候选辅特征。Step D: For other first candidate auxiliary features after deleting the first candidate auxiliary feature corresponding to the maximum VIF, repeat steps A to C until the maximum VIF is less than or equal to 10, or the number of remaining first candidate auxiliary features is less than or equal to a quantity threshold (such as 3), and the remaining first candidate auxiliary features are used as second candidate auxiliary features.
示例性的,如删除最大VIF对应的第一候选辅特征为第一候选辅特征1后,还剩余9个第一候选辅特征,针对该9个第一候选辅特征,可以重新执行步骤A-步骤C,直至最大VIF小于或等于10,或者剩余的第一候选辅特征的数量小于或等于数量阈值,云端可以将最后剩余的第一候选辅特征作为第二候选辅特征。Exemplarily, if after deleting the first candidate auxiliary feature corresponding to the maximum VIF as the first candidate auxiliary feature 1, there are still 9 first candidate auxiliary features remaining, for these 9 first candidate auxiliary features, steps A to C can be re-executed until the maximum VIF is less than or equal to 10, or the number of remaining first candidate auxiliary features is less than or equal to the quantity threshold, the cloud can use the last remaining first candidate auxiliary feature as the second candidate auxiliary feature.
在一些实施例中,云端可以将第二候选辅特征作为辅特征。In some embodiments, the cloud may use the second candidate auxiliary feature as the auxiliary feature.
在一些实施例中,云端还可以在第二候选辅特征中进行筛选,得到辅特征。示例性的,云端可以采用最小绝对收缩和选择(least absolute shrinkage and selectionoperator,LASSO)模型,在第二候选辅特征中进行筛选,得到辅特征。In some embodiments, the cloud can also screen the second candidate auxiliary features to obtain the auxiliary features. Exemplarily, the cloud can use a least absolute shrinkage and selection operator (LASSO) model to screen the second candidate auxiliary features to obtain the auxiliary features.
LASSO模型的本质上也是一种线性回归模型,但区别与传统的线性模型,它加入了L1正则化的惩罚函数,因此LASSO模型拥如下两个特点:The LASSO model is essentially a linear regression model, but it is different from the traditional linear model in that it adds an L1 regularized penalty function. Therefore, the LASSO model has the following two characteristics:
1、压缩一些回归系数,即强制系数的绝对值之和小于某个固定值。1. Compress some regression coefficients, that is, force the sum of the absolute values of the coefficients to be less than a fixed value.
2、使得一些回归系数为零,形成稀疏的结果,有利于筛选出重要特征。2. Make some regression coefficients zero to form sparse results, which is conducive to screening out important features.
在预设时间段内第一产品系列的终端设备的第一应用的功耗数据中,云端可以获取主特征的数值,以及第二候选辅特征的数值,云端可以将主特征的数值,以及第二候选辅特征的数值输入至LASSO模型,得到每个第二候选辅特征的重要性值。In the power consumption data of the first application of the terminal device of the first product series within a preset time period, the cloud can obtain the value of the main feature and the value of the second candidate auxiliary feature. The cloud can input the value of the main feature and the value of the second candidate auxiliary feature into the LASSO model to obtain the importance value of each second candidate auxiliary feature.
本申请实施例中,云端可以将最大的3个重要性值对应的第二候选辅特征作为辅特征。3个为示例说明,还可以替换为其他数值。In the embodiment of the present application, the cloud can use the second candidate auxiliary features corresponding to the three largest importance values as auxiliary features. The three are examples and can be replaced by other values.
在一些实施例中,LASSO模型可以如公式7所示:In some embodiments, the LASSO model may be as shown in Formula 7:
其中,P表示第二辅特征的数量,j表示任一一个第二辅特征。λ为超参数,可以是预设值。β0是常数。Yi表示n条功耗数据中任一条功耗数据中的主特征的数值,Xji表示n条功耗数据中任一条功耗数据中的任一第二辅特征的数值。Wherein, P represents the number of second auxiliary features, j represents any second auxiliary feature. λ is a hyperparameter and can be a preset value. β 0 is a constant. Yi represents the value of the main feature in any one of the n power consumption data, and Xji represents the value of any second auxiliary feature in any one of the n power consumption data.
本申请实施例中,云端可以将主特征的数值,以及第二候选辅特征的数值输入至LASSO模型后,可以得到任一第二辅特征的βj,云端对βj取绝对值,βj的绝对值可以表示第二候选辅特征的重要性。βj的绝对值越大,第二候选辅特征的重要性值越大。In the embodiment of the present application, the cloud can input the value of the main feature and the value of the second candidate auxiliary feature into the LASSO model to obtain β j of any second auxiliary feature. The cloud takes the absolute value of β j , and the absolute value of β j can represent the importance of the second candidate auxiliary feature. The larger the absolute value of β j , the greater the importance value of the second candidate auxiliary feature.
图5A为本申请实施例提供的筛选辅特征的一种示意图。图5A中的a展示的为功耗数据中所有的特征。在进行Pearson相关系数和Spearman相关系数的计算后,筛选出第一候选辅特征。参照图5A中的b,如第一候选辅特征可以包括:相机前台功耗、相机前台使用时长、modem前台功耗、modem后台功耗、Wi-Fi模块前台功耗、Wi-Fi模块前台总流量,以及Wi-Fi模块后台功耗。在进行VIF计算筛选后,可以得到第二候选辅特征。参照图5A中的c,第二候选辅特征可以包括:相机前台使用时长、modem后台功耗、Wi-Fi模块前台功耗、Wi-Fi模块前台总流量,以及Wi-Fi模块后台功耗。在进行LASSO模型处理后,可以得到辅特征。参照图5A中的d,如辅特征可以包括:modem后台功耗、Wi-Fi模块前台总流量,以及Wi-Fi模块后台功耗。FIG5A is a schematic diagram of a screening auxiliary feature provided by an embodiment of the present application. FIG5A a shows all the features in the power consumption data. After calculating the Pearson correlation coefficient and the Spearman correlation coefficient, the first candidate auxiliary feature is screened out. Referring to FIG5A b, the first candidate auxiliary feature may include: camera foreground power consumption, camera foreground usage time, modem foreground power consumption, modem background power consumption, Wi-Fi module foreground power consumption, Wi-Fi module foreground total flow, and Wi-Fi module background power consumption. After VIF calculation and screening, the second candidate auxiliary feature can be obtained. Referring to FIG5A c, the second candidate auxiliary feature may include: camera foreground usage time, modem background power consumption, Wi-Fi module foreground power consumption, Wi-Fi module foreground total flow, and Wi-Fi module background power consumption. After LASSO model processing, auxiliary features can be obtained. Referring to FIG5A d, the auxiliary feature may include: modem background power consumption, Wi-Fi module foreground total flow, and Wi-Fi module background power consumption.
S305,云端获取辅特征条件,辅特征条件用于确定用户所属的用户群体。S305, the cloud obtains auxiliary feature conditions, and the auxiliary feature conditions are used to determine the user group to which the user belongs.
本申请实施例中,云端在确定辅特征后,还可以获取辅特征条件。辅特征条件用于确定用户所属的用户群体。In the embodiment of the present application, after determining the auxiliary feature, the cloud can also obtain the auxiliary feature condition. The auxiliary feature condition is used to determine the user group to which the user belongs.
在一些实施例中,云端可以基于辅特征,以及预设时间段内第一产品系列的终端设备的第一应用的功耗数据,训练一个分类与回归树(classification and regressiontree,CART),且将CART中的叶子节点作为辅特征条件。应理解,每个叶子节点中用户群体的习惯是相似的。应理解,S305-S307中使用的预设时间段内第一产品系列的终端设备的第一应用的功耗数据为未经Z-Score标准化处理的数据。In some embodiments, the cloud can train a classification and regression tree (CART) based on the auxiliary features and the power consumption data of the first application of the terminal device of the first product series within a preset time period, and use the leaf nodes in the CART as auxiliary feature conditions. It should be understood that the habits of the user groups in each leaf node are similar. It should be understood that the power consumption data of the first application of the terminal device of the first product series within the preset time period used in S305-S307 is data that has not been normalized by Z-Score.
在一些实施例中,为了防止CART发生过拟合,并保证每个叶子节点都有足够的数据量,本申请实施例中在训练CART时,可以设置如下超参数:In some embodiments, in order to prevent CART from overfitting and ensure that each leaf node has sufficient data, the following hyperparameters can be set when training CART in the embodiments of the present application:
1、损失函数为均方误差。1. The loss function is mean square error.
2、最大深度为3。其中,根节点可以作为第0层。2. The maximum depth is 3. Among them, the root node can be used as the 0th layer.
3、最多叶子节点数为8。3. The maximum number of leaf nodes is 8.
4、叶子节点最小数据量为5000条。4. The minimum amount of data for a leaf node is 5,000.
图4为本申请实施例提供的CART的一种示意图。图4中以CART中包括4个叶子节点为例,参照图4,辅特征条件可以包括:“Wi-Fi模块后台功耗小于或等于5.732,且modem后台功耗小于或等于0.942”,以及,“Wi-Fi模块后台功耗小于或等于5.732,且modem后台功耗大于0.942”,以及,“Wi-Fi模块后台功耗大于5.732,且modem后台功耗小于或等于24186.737”,以及,“Wi-Fi模块后台功耗大于5.732,且modem后台功耗大于24186.737”。FIG4 is a schematic diagram of a CART provided in an embodiment of the present application. FIG4 takes the CART including 4 leaf nodes as an example, and with reference to FIG4, the auxiliary feature conditions may include: "The background power consumption of the Wi-Fi module is less than or equal to 5.732, and the background power consumption of the modem is less than or equal to 0.942", and "The background power consumption of the Wi-Fi module is less than or equal to 5.732, and the background power consumption of the modem is greater than 0.942", and "The background power consumption of the Wi-Fi module is greater than 5.732, and the background power consumption of the modem is less than or equal to 24186.737", and "The background power consumption of the Wi-Fi module is greater than 5.732, and the background power consumption of the modem is greater than 24186.737".
S306,云端根据辅特征条件,以及预设时间段内第一产品系列的终端设备的第一应用的功耗数据,将终端设备对应的用户划分为至少两个用户群体。S306, the cloud divides the users corresponding to the terminal device into at least two user groups according to the auxiliary feature condition and the power consumption data of the first application of the terminal device of the first product series within a preset time period.
示例性的,采用图4中的辅特征条件,可以将用户划分为4类用户群体,分别为用户群体1、用户群体2、用户群体3以及用户群体4。如用户群体1对应的终端设备的功耗数据满足“Wi-Fi模块后台功耗小于或等于5.732,且modem后台功耗小于或等于0.942”,用户群体1对应的终端设备的功耗数据满足“Wi-Fi模块后台功耗小于或等于5.732,且modem后台功耗大于0.942”,用户群体3对应的终端设备的功耗数据满足“Wi-Fi模块后台功耗大于5.732,且modem后台功耗小于或等于24186.737”,以及用户群体4对应的终端设备的功耗数据满足“Wi-Fi模块后台功耗大于5.732,且modem后台功耗大于24186.737”。Exemplarily, using the auxiliary feature conditions in FIG. 4, users can be divided into four user groups, namely user group 1, user group 2, user group 3 and user group 4. For example, the power consumption data of the terminal device corresponding to user group 1 satisfies "the background power consumption of the Wi-Fi module is less than or equal to 5.732, and the background power consumption of the modem is less than or equal to 0.942", the power consumption data of the terminal device corresponding to user group 1 satisfies "the background power consumption of the Wi-Fi module is less than or equal to 5.732, and the background power consumption of the modem is greater than 0.942", the power consumption data of the terminal device corresponding to user group 3 satisfies "the background power consumption of the Wi-Fi module is greater than 5.732, and the background power consumption of the modem is less than or equal to 24186.737", and the power consumption data of the terminal device corresponding to user group 4 satisfies "the background power consumption of the Wi-Fi module is greater than 5.732, and the background power consumption of the modem is greater than 24186.737".
S307,云端根据每个用户群体的预设时间内第一产品系列的终端设备的第一应用的功耗数据,确定每个用户群体对应的主特征的阈值,主特征的阈值用于检测第一应用的功耗是否异常。S307, the cloud determines the threshold of the main feature corresponding to each user group based on the power consumption data of the first application of the terminal device of the first product series within a preset time of each user group, and the threshold of the main feature is used to detect whether the power consumption of the first application is abnormal.
云端在基于辅特征条件划分用户群体后,云端可以根据每个用户群体的预设时间内第一产品系列的终端设备的第一应用的功耗数据(简称为功耗数据),确定每个用户群体对应的主特征的阈值。主特征的阈值用于检测第一应用的功耗是否异常。示例性的,如主特征为CPU后台功耗,则云端可以根据每个用户群体的功耗数据,确定每个用户群体对应的CPU后台功耗的阈值,每个用户群体对应的CPU后台功耗的阈值,用于检测该用户群体的功耗数据中的CPU后台功耗是否异常,CPU后台功耗可以表示第一应用的功耗异常。After the cloud divides the user groups based on the auxiliary feature conditions, the cloud can determine the threshold of the main feature corresponding to each user group based on the power consumption data of the first application of the terminal device of the first product series within the preset time of each user group (referred to as power consumption data). The threshold of the main feature is used to detect whether the power consumption of the first application is abnormal. Exemplarily, if the main feature is CPU background power consumption, the cloud can determine the threshold of the CPU background power consumption corresponding to each user group based on the power consumption data of each user group. The threshold of the CPU background power consumption corresponding to each user group is used to detect whether the CPU background power consumption in the power consumption data of the user group is abnormal. The CPU background power consumption can indicate that the power consumption of the first application is abnormal.
在一些实施例中,可以预先设置第一预设比例,第一预设比例用于确定主特征的阈值。以主特征为CPU后台功耗为例,针对每个用户群体的功耗数据中的CPU后台功耗的数值,云端可以按照大小顺序进行排序,且将大于或等于90%的CPU后台功耗的数值的第一值,作为CPU后台功耗的阈值。In some embodiments, a first preset ratio may be pre-set, and the first preset ratio is used to determine the threshold of the main feature. Taking the main feature as CPU background power consumption as an example, the cloud can sort the CPU background power consumption values in the power consumption data of each user group in order of size, and use the first value of the CPU background power consumption value that is greater than or equal to 90% as the threshold of the CPU background power consumption.
示例性的,以用户群体1为例,如第一预设比例为90%,图5B中的a以矩形框表征用户群体1对应的功耗数据中的CPU后台功耗的数值的大小分布,在用户群体1对应的功耗数据中的CPU后台功耗的数值中,云端可以将大于或等于90%的CPU后台功耗的数值的第一值作为CPU后台功耗的阈值。示例性的,如用户群体1对应的100条功耗数据,按照CPU后台功耗的数值从小到大的顺序进行排布,将大于或等于第90条功耗数据中CPU后台功耗的数值的第一值,作为CPU后台功耗的阈值。示例性的,第90条功耗数据中CPU后台功耗的数值为A,第91条功耗数据中CPU后台功耗的数值为B,则可以将A和B中任一值作为第一值,或者可以将A或B作为第一值,即CPU后台功耗的阈值。Exemplarily, taking user group 1 as an example, if the first preset ratio is 90%, a in FIG5B represents the distribution of the value of the CPU background power consumption in the power consumption data corresponding to user group 1 with a rectangular box. In the value of the CPU background power consumption in the power consumption data corresponding to user group 1, the cloud can use the first value of the CPU background power consumption greater than or equal to 90% as the threshold of the CPU background power consumption. Exemplarily, if the 100 power consumption data corresponding to user group 1 are arranged in order from small to large according to the value of the CPU background power consumption, the first value greater than or equal to the value of the CPU background power consumption in the 90th power consumption data is used as the threshold of the CPU background power consumption. Exemplarily, the value of the CPU background power consumption in the 90th power consumption data is A, and the value of the CPU background power consumption in the 91st power consumption data is B, then any value of A and B can be used as the first value, or A or B can be used as the first value, that is, the threshold of the CPU background power consumption.
CPU后台功耗的阈值,用于检测第一应用的功耗是否异常。其中,当第一应用的功耗数据中CPU后台功耗的数值大于或等于该CPU后台功耗的阈值,则可以确定第一应用的功耗异常,当第一应用的功耗数据中CPU后台功耗的数值小于该CPU后台功耗的阈值,则可以确定第一应用的功耗正常。The threshold of CPU background power consumption is used to detect whether the power consumption of the first application is abnormal. When the value of the CPU background power consumption in the power consumption data of the first application is greater than or equal to the threshold of the CPU background power consumption, it can be determined that the power consumption of the first application is abnormal; when the value of the CPU background power consumption in the power consumption data of the first application is less than the threshold of the CPU background power consumption, it can be determined that the power consumption of the first application is normal.
在一些实施例中,云端还可以划分异常等级。本申请实施例中,还可以预先设置第二预设比例和第三预设比例。示例性的,如第二预设比例可以为98%,第三预设比例可以为99.5%。参照图5B中的b,图5B中的b以矩形框表征用户群体1对应的功耗数据中的CPU后台功耗的数值分布,云端可以计算大于或等于第二预设比例(98%)的CPU后台功耗的数值的第二值,以及大于或等于第三预设比例(99.5%)的CPU后台功耗的数值的第三值。In some embodiments, the cloud can also divide the abnormality level. In the embodiment of the present application, a second preset ratio and a third preset ratio can also be preset. Exemplarily, the second preset ratio can be 98%, and the third preset ratio can be 99.5%. Referring to b in Figure 5B, b in Figure 5B represents the numerical distribution of CPU background power consumption in the power consumption data corresponding to user group 1 with a rectangular box. The cloud can calculate a second value of the numerical value of the CPU background power consumption that is greater than or equal to the second preset ratio (98%), and a third value of the numerical value of the CPU background power consumption that is greater than or equal to the third preset ratio (99.5%).
在该实施例中,云端可以将第一值作为异常时CPU后台功耗的第一阈值,将第二值作为超异常时CPU后台功耗的第二阈值,将第三值作为极端异常时CPU后台功耗的第三阈值。In this embodiment, the cloud can use the first value as the first threshold of the CPU background power consumption during an abnormality, the second value as the second threshold of the CPU background power consumption during a super abnormality, and the third value as the third threshold of the CPU background power consumption during an extreme abnormality.
在一些实施例中,CPU后台功耗的阈值可以包括:用于检测第一应用的功耗是否异常的CPU后台功耗的第一阈值、用于检测第一应用的功耗是否超异常的CPU后台功耗的第二阈值,以及用于检测第一应用的功耗是否极端异常的CPU后台功耗的第三阈值。其中,当第一应用的功耗数据中CPU后台功耗的数值大于或等于第一阈值,且小于第二阈值时,可以确定第一应用的功耗异常,当第一应用的功耗数据中CPU后台功耗的数值大于或等于第二阈值且小于第三阈值时,可以确定第一应用的功耗超异常,当第一应用的功耗数据中CPU后台功耗的数值大于或等于第三阈值时,可以确定第一应用的功耗极端异常。In some embodiments, the threshold of CPU background power consumption may include: a first threshold of CPU background power consumption for detecting whether the power consumption of the first application is abnormal, a second threshold of CPU background power consumption for detecting whether the power consumption of the first application is extremely abnormal, and a third threshold of CPU background power consumption for detecting whether the power consumption of the first application is extremely abnormal. When the value of the CPU background power consumption in the power consumption data of the first application is greater than or equal to the first threshold and less than the second threshold, it can be determined that the power consumption of the first application is abnormal, when the value of the CPU background power consumption in the power consumption data of the first application is greater than or equal to the second threshold and less than the third threshold, it can be determined that the power consumption of the first application is extremely abnormal, and when the value of the CPU background power consumption in the power consumption data of the first application is greater than or equal to the third threshold, it can be determined that the power consumption of the first application is extremely abnormal.
在一些实施例中,可以分别将“异常、超异常以及极端异常”分别作为第一应用的功耗异常的三个异常等级。示例性的,当第一应用的功耗数据中CPU后台功耗的数值大于或等于第一阈值且小于第二阈值时,第一应用的功耗异常属于第一异常等级,当第一应用的功耗数据中CPU后台功耗的数值大于或等于第二阈值且小于第三阈值时,第一应用的功耗异常属于第二异常等级,当第一应用的功耗数据中CPU后台功耗的数值大于或等于第三阈值时,第一应用的功耗异常属于第三异常等级。其中,第一异常等级的异常程度小于第二异常等级的异常程度,且第二异常等级的异常程度小于第三异常等级的异常程度。In some embodiments, "abnormal, super abnormal, and extremely abnormal" can be respectively used as three abnormal levels of power consumption abnormality of the first application. Exemplarily, when the value of the CPU background power consumption in the power consumption data of the first application is greater than or equal to the first threshold and less than the second threshold, the power consumption abnormality of the first application belongs to the first abnormal level, when the value of the CPU background power consumption in the power consumption data of the first application is greater than or equal to the second threshold and less than the third threshold, the power consumption abnormality of the first application belongs to the second abnormal level, and when the value of the CPU background power consumption in the power consumption data of the first application is greater than or equal to the third threshold, the power consumption abnormality of the first application belongs to the third abnormal level. Among them, the abnormality degree of the first abnormality level is less than the abnormality degree of the second abnormality level, and the abnormality degree of the second abnormality level is less than the abnormality degree of the third abnormality level.
在一些实施例中,针对数据量较多的应用,主特征的数值的分布较为密集,会出现不同异常等级对应的阈值相差较小的问题。本申请实施例中,云端可以对第二阈值和第三阈值进行调整,以便基于调整后的第二阈值和调整后的第三阈值,可以明显区分第一应用的异常等级。In some embodiments, for applications with a large amount of data, the distribution of the values of the main features is relatively dense, and there will be a problem that the thresholds corresponding to different abnormal levels are slightly different. In the embodiment of the present application, the cloud can adjust the second threshold and the third threshold so that based on the adjusted second threshold and the adjusted third threshold, the abnormal level of the first application can be clearly distinguished.
针对第二阈值,云端的调整规则如下:For the second threshold, the cloud's adjustment rules are as follows:
云端可以采用如下公式8获取第二阈值的正态分布Z值,以检测第二阈值是否需要调整:The cloud can use the following formula 8 to obtain the normal distribution Z value of the second threshold to detect whether the second threshold needs to be adjusted:
其中,Q0.98表示第二阈值,μ表示每个用户群体对应的CPU后台功耗的数值的均值,σ表示每个用户群体对应的CPU后台功耗的数值的标准差。Wherein, Q 0.98 represents the second threshold, μ represents the mean value of the CPU background power consumption corresponding to each user group, and σ represents the standard deviation of the CPU background power consumption corresponding to each user group.
其中,基于公式8,若得到的正态分布Z值小于预设Z值时,云端可以增大第二阈值。云端采用增大后的第二阈值,重新采用公式8计算,得到的正态分布Z值等于预设Z值。示例性的,如预设Z值可以为3。Wherein, based on Formula 8, if the obtained normal distribution Z value is less than the preset Z value, the cloud can increase the second threshold. The cloud uses the increased second threshold and recalculates using Formula 8, and the obtained normal distribution Z value is equal to the preset Z value. For example, the preset Z value can be 3.
其中,调整后的第二阈值可以为原第二阈值和增大后的第二阈值中的最大值,如调整后的第二阈值可以为max(Q0.98,3σ+μ)。The adjusted second threshold may be a maximum value between the original second threshold and the increased second threshold. For example, the adjusted second threshold may be max(Q 0.98 , 3σ+μ).
针对第三阈值,云端的调整规则如下:For the third threshold, the cloud's adjustment rules are as follows:
云端可以采用如下公式9获取第三阈值的正态分布Z值,以检测第三阈值是否需要调整:The cloud can use the following formula 9 to obtain the normal distribution Z value of the third threshold to detect whether the third threshold needs to be adjusted:
其中,Q0.995表示第三阈值。基于公式9,若得到的正态分布Z值小于预设Z值时,云端可以增大第三阈值。云端采用增大后的第三阈值,重新采用公式9计算,得到的正态分布Z值等于预设Z值。示例性的,该增大后的第三阈值可以称为第一候选第三阈值。Wherein, Q 0.995 represents the third threshold. Based on Formula 9, if the obtained normal distribution Z value is less than the preset Z value, the cloud can increase the third threshold. The cloud uses the increased third threshold and recalculates using Formula 9, and the obtained normal distribution Z value is equal to the preset Z value. Exemplarily, the increased third threshold can be referred to as the first candidate third threshold.
另外,调整后第三阈值还需要大于箱型图的异常值outlier,箱型图的异常值outlier可以采用如下公式10计算得到:In addition, the adjusted third threshold value needs to be greater than the outlier of the box plot. The outlier of the box plot can be calculated using the following formula 10:
outlier=Q0.75+1.5(Q0.75-Q0.25) 公式10outlier = Q 0.75 + 1.5 (Q 0.75 - Q 0.25 ) Formula 10
其中,Q0.75表示在用户群体对应的功耗数据中的CPU后台功耗的数值中,大于或等于75%的CPU后台功耗的数值的值,Q0.25表示在用户群体对应的功耗数据中的CPU后台功耗的数值中,大于或等于25%的CPU后台功耗的数值的值。示例性的,该调整后的第三阈值,即大于箱型图的异常值outlier的第三阈值,可以称为第二候选第三阈值。Among them, Q 0.75 represents a value greater than or equal to 75% of the values of the CPU background power consumption in the power consumption data corresponding to the user group, and Q 0.25 represents a value greater than or equal to 25% of the values of the CPU background power consumption in the power consumption data corresponding to the user group. Exemplarily, the adjusted third threshold, i.e., the third threshold greater than the outlier of the box plot, can be called the second candidate third threshold.
可以理解的是,本申请实施例中,调整后的第三阈值可以为原第三阈值,第一候选第三阈值,以及第二候选第三阈值中的最大值。如调整后的第三阈值可以为max(Q0.995,3σ+μ,outlier)。It is understandable that in the embodiment of the present application, the adjusted third threshold may be the maximum value among the original third threshold, the first candidate third threshold, and the second candidate third threshold. For example, the adjusted third threshold may be max(Q 0.995 , 3σ+μ, outlier).
S308,云端根据辅特征条件,以及每个用户群体对应的主特征的阈值,生成第一产品系列的终端设备的第一应用的功耗模型。S308, the cloud generates a power consumption model of the first application of the terminal device of the first product series according to the auxiliary feature conditions and the threshold of the main feature corresponding to each user group.
在一些实施例中,第一产品系列的终端设备的第一应用的功耗模型可以简称为第一产品系列的第一应用的功耗模型。第一产品系列的第一应用的功耗模型可以包括:划分用户群体的辅特征条件,以及每个用户群体对应的主特征的阈值。在一些实施例中,主特征的阈值可以包括第一阈值。在一些实施例中,主特征的阈值可以包括:第一阈值、第二阈值以及第三阈值。在一些实施例中,主特征的阈值中的第二阈值可以为调整后的第二阈值,主特征中的第三阈值可以为调整后的第三阈值。In some embodiments, the power consumption model of the first application of the terminal device of the first product series may be referred to as the power consumption model of the first application of the first product series. The power consumption model of the first application of the first product series may include: auxiliary feature conditions for dividing user groups, and thresholds of main features corresponding to each user group. In some embodiments, the threshold of the main feature may include a first threshold. In some embodiments, the threshold of the main feature may include: a first threshold, a second threshold, and a third threshold. In some embodiments, the second threshold in the threshold of the main feature may be an adjusted second threshold, and the third threshold in the main feature may be an adjusted third threshold.
每个用户群体对应的主特征的阈值,用于检测第一应用的功耗是否异常,以及检测第一应用的功耗的异常等级。在一些实施例中,可以将每个用户群体对应的主特征的阈值可以称为第一应用的功耗的处理逻辑。The threshold of the main feature corresponding to each user group is used to detect whether the power consumption of the first application is abnormal and to detect the abnormal level of the power consumption of the first application. In some embodiments, the threshold of the main feature corresponding to each user group can be referred to as the processing logic of the power consumption of the first application.
在一些实施例中,云端可以以表格形式、文本形式等存储第一产品系列的第一应用的功耗模型,本申请实施例对功耗模型的形式不做限制。表三中以表格的形式展示了储第一产品系列的第一应用的功耗模型。In some embodiments, the cloud can store the power consumption model of the first application of the first product series in a table form, a text form, etc., and the embodiment of the present application does not limit the form of the power consumption model. Table 3 shows the power consumption model of the first application of the first product series in a table form.
表三Table 3
表三中的inf表示正无穷(infinity)。In Table 3, inf means positive infinity.
本申请实施例中,云端可以基于最新的终端设备的功耗数据,生成以及更新功耗模型,功耗模型的实时性和准确性高。另外,针对不同产品系列,以及针对不同应用,可以分别生成不同产品系列以及针对不同应用的功耗模型,粒度更细、精度更高。In the embodiment of the present application, the cloud can generate and update the power consumption model based on the latest power consumption data of the terminal device, and the power consumption model has high real-time and accuracy. In addition, for different product series and for different applications, power consumption models for different product series and for different applications can be generated respectively, with finer granularity and higher accuracy.
云端生成功耗模型或更新功耗模型后,可以下发至终端设备,下发方式可以参照上述实施例中的相关描述。在一些实施例中,终端设备可以使用功耗模型,检测终端设备的应用的功耗是否异常,以及异常等级,进而执行相应的操作,以减少应用的功耗。After the cloud generates a power consumption model or updates the power consumption model, it can be sent to the terminal device. The sending method can refer to the relevant description in the above embodiments. In some embodiments, the terminal device can use the power consumption model to detect whether the power consumption of the application of the terminal device is abnormal, and the abnormal level, and then perform corresponding operations to reduce the power consumption of the application.
图6为本申请实施例提供的终端设备的功耗处理方法的另一实施例的流程示意图。参照图6,本申请实施例提供的终端设备的功耗处理方法可以包括:FIG6 is a flow chart of another embodiment of a method for processing power consumption of a terminal device provided in an embodiment of the present application. Referring to FIG6 , the method for processing power consumption of a terminal device provided in an embodiment of the present application may include:
S601,终端设备采集终端设备的功耗数据,终端设备的功耗数据包括第一应用的功耗数据,终端设备属于第一产品系列。S601, a terminal device collects power consumption data of the terminal device, where the power consumption data of the terminal device includes power consumption data of a first application, and the terminal device belongs to a first product series.
应理解,本申请实施例以终端设备属于第一产品系列为例,说明终端设备采用第一产品系列的第一应用的功耗模型,以及第一应用的功耗数据,得到第一应用的功耗检测结果的过程。在一些实施例中,第一应用可以为终端设备前台运行的应用,和/或,后台运行的应用。It should be understood that the embodiment of the present application takes the terminal device belonging to the first product series as an example to illustrate the process of obtaining the power consumption detection result of the first application by the terminal device using the power consumption model of the first application of the first product series and the power consumption data of the first application. In some embodiments, the first application can be an application running in the foreground of the terminal device and/or an application running in the background.
本申请实施例中,终端设备可以采集终端设备的功耗数据,终端设备的功耗数据可以包括第一应用的功耗数据。In an embodiment of the present application, the terminal device may collect power consumption data of the terminal device, and the power consumption data of the terminal device may include power consumption data of the first application.
应理解的是,当云端下发的功耗模型为不同应用的功耗模型,并未区分产品系列时,终端设备可以使用第一应用的功耗模型,检测第一应用的功耗是否异常,可以参照第一产品系列的第一应用的功耗模型的相关描述。It should be understood that when the power consumption model sent down from the cloud is the power consumption model of different applications and does not distinguish between product series, the terminal device can use the power consumption model of the first application to detect whether the power consumption of the first application is abnormal, and can refer to the relevant description of the power consumption model of the first application in the first product series.
S602,终端设备根据第一产品系列的第一应用的功耗模型,以及第一应用的功耗数据,确定用户所属的用户群体,以及用户群体对应的主特征的阈值。S602: The terminal device determines the user group to which the user belongs and the threshold of the main feature corresponding to the user group according to the power consumption model of the first application of the first product series and the power consumption data of the first application.
终端设备根据第一应用的功耗数据,以及第一产品系列的第一应用的功耗模型中辅特征条件,可以确定用户所属的用户群体,以及该用户群体对应的主特征的阈值。用户可以理解为终端设备对应的用户。The terminal device can determine the user group to which the user belongs and the threshold of the main feature corresponding to the user group based on the power consumption data of the first application and the auxiliary feature condition in the power consumption model of the first application of the first product series. The user can be understood as the user corresponding to the terminal device.
示例性的,第一应用的功耗数据中,Wi-Fi模块后台功耗为6,modem后台功耗为20,则终端设备基于表三的功耗模型,可以确定用户属于用户群体3,用户群体3对应的主特征的阈值包括:第一阈值(90.83),第二阈值(146.64),以及第三阈值(203.57)。For example, in the power consumption data of the first application, the background power consumption of the Wi-Fi module is 6, and the background power consumption of the modem is 20. Based on the power consumption model in Table 3, the terminal device can determine that the user belongs to user group 3. The thresholds of the main features corresponding to user group 3 include: the first threshold (90.83), the second threshold (146.64), and the third threshold (203.57).
S603,终端设备根据用户群体对应的主特征的阈值,以及第一应用的功耗数据,获取第一应用的功耗检测结果。S603: The terminal device obtains a power consumption detection result of the first application according to the threshold of the main feature corresponding to the user group and the power consumption data of the first application.
第一应用的功耗数据可以包括主特征的数值。示例性的,如主特征为CPU后台功耗,第一应用的功耗数据中可以包括CPU后台功耗的数值。在一些实施例中,第一应用的功耗检测结果用于指示第一应用的功耗是否异常。其中,当第一应用的功耗数据主特征的数值大于或等于用户群体对应的主特征的阈值时,可以确定第一应用的功耗异常,当第一应用的功耗数据主特征的数值小于用户群体对应的主特征的阈值时,可以确定第一应用的功耗正常。The power consumption data of the first application may include the value of the main feature. Exemplarily, if the main feature is CPU background power consumption, the power consumption data of the first application may include the value of CPU background power consumption. In some embodiments, the power consumption detection result of the first application is used to indicate whether the power consumption of the first application is abnormal. When the value of the main feature of the power consumption data of the first application is greater than or equal to the threshold of the main feature corresponding to the user group, it can be determined that the power consumption of the first application is abnormal, and when the value of the main feature of the power consumption data of the first application is less than the threshold of the main feature corresponding to the user group, it can be determined that the power consumption of the first application is normal.
在一些实施例中,当功耗模型中主特征的阈值包括不同等级的异常阈值时,终端设备可以根据用户群体对应的主特征的阈值,以及第一应用的功耗数据,检测第一应用的功耗是否异常,且可以确定第一应用的功耗的异常等级。在该实施例中,第一应用的功耗检测结果用于指示第一应用的功耗是否异常,以及第一应用的功耗的异常等级。In some embodiments, when the threshold of the main feature in the power consumption model includes abnormal thresholds of different levels, the terminal device can detect whether the power consumption of the first application is abnormal based on the threshold of the main feature corresponding to the user group and the power consumption data of the first application, and can determine the abnormal level of the power consumption of the first application. In this embodiment, the power consumption detection result of the first application is used to indicate whether the power consumption of the first application is abnormal and the abnormal level of the power consumption of the first application.
示例性的,如用户属于用户群体3,参照表三,用户群体3对应的主特征的阈值包括:第一阈值(90.83),第二阈值(146.64),以及第三阈值(203.57)。如第一应用的功耗数据中,CPU后台功耗的数值为100,云端根据主特征的阈值,可以确定CPU后台功耗的数值大于第一阈值,且小于第二阈值,可以确定第一应用的功耗异常,且第一应用的功耗异常为第一异常等级。For example, if the user belongs to user group 3, referring to Table 3, the thresholds of the main features corresponding to user group 3 include: a first threshold (90.83), a second threshold (146.64), and a third threshold (203.57). For example, in the power consumption data of the first application, the value of the CPU background power consumption is 100. Based on the threshold of the main feature, the cloud can determine that the value of the CPU background power consumption is greater than the first threshold and less than the second threshold, and can determine that the power consumption of the first application is abnormal, and the power consumption abnormality of the first application is the first abnormality level.
S604,当第一应用的功耗异常时,终端设备执行对应的操作。S604: When the power consumption of the first application is abnormal, the terminal device performs a corresponding operation.
本申请实施例中,当第一应用的功耗是否异常时,终端设备执行对应的操作。示例性的,终端设备可以输出提示信息,该提示信息用于提示第一应用的功耗异常。In the embodiment of the present application, when the power consumption of the first application is abnormal, the terminal device performs a corresponding operation. Exemplarily, the terminal device can output a prompt message, which is used to prompt that the power consumption of the first application is abnormal.
在一些实施例中,当第一应用的功耗异常,且终端设备可以确定第一应用的功耗的异常等级时,终端设备可以根据第一应用的功耗的异常等级,执行对应的操作。其中,不同的异常等级,终端设备执行的操作可以不同。In some embodiments, when the power consumption of the first application is abnormal, and the terminal device can determine the abnormal level of the power consumption of the first application, the terminal device can perform corresponding operations according to the abnormal level of the power consumption of the first application. The operations performed by the terminal device may be different for different abnormal levels.
示例性的,当第一应用的功耗的异常等级为第一异常等级时,终端设备可以降低第一应用使用的CPU的频率至第一频率。当第一应用的功耗的异常等级为第二异常等级时,终端设备可以降低第一应用使用的CPU的频率至第二频率。当第一应用的功耗的异常等级为第三异常等级时,终端设备可以降低第一应用使用的CPU的频率至第三频率。其中,第一频率大于第二频率,且第二频率大于第三频率。也就是说,第一应用的功耗的异常等级越严重或越高,则CPU频率下降的越多。Exemplarily, when the abnormal level of the power consumption of the first application is the first abnormal level, the terminal device can reduce the frequency of the CPU used by the first application to the first frequency. When the abnormal level of the power consumption of the first application is the second abnormal level, the terminal device can reduce the frequency of the CPU used by the first application to the second frequency. When the abnormal level of the power consumption of the first application is the third abnormal level, the terminal device can reduce the frequency of the CPU used by the first application to the third frequency. Among them, the first frequency is greater than the second frequency, and the second frequency is greater than the third frequency. In other words, the more severe or higher the abnormal level of the power consumption of the first application is, the more the CPU frequency decreases.
本申请实施例中对不同的异常等级对应的终端设备的操作不做限制。In the embodiment of the present application, there is no restriction on the operations of terminal devices corresponding to different abnormality levels.
本申请实施例中,终端设备不是基于一个固定的功耗阈值对所有的终端设备的功耗进行管理,而是针对不同的用户,可以确定用户所属的用户群体,不同的用户群体对应的主特征的阈值可以不同。终端设备可以根据用户所属的用户群体对应的主特征的阈值,处理终端设备的功耗,以便终端设备可以基于用户的特征或使用习惯,灵活地管控终端设备的功耗。另外,当终端设备的功耗异常时,终端设备还可以确定异常等级,针对不同的异常等级,终端设备可以执行不同的响应操作,灵活性高。In the embodiment of the present application, the terminal device does not manage the power consumption of all terminal devices based on a fixed power consumption threshold, but for different users, the user group to which the user belongs can be determined, and the thresholds of the main features corresponding to different user groups can be different. The terminal device can process the power consumption of the terminal device according to the threshold of the main feature corresponding to the user group to which the user belongs, so that the terminal device can flexibly control the power consumption of the terminal device based on the user's characteristics or usage habits. In addition, when the power consumption of the terminal device is abnormal, the terminal device can also determine the abnormal level. For different abnormal levels, the terminal device can perform different response operations, which is highly flexible.
下面以终端设备中的模块交互的角度,说明本申请实施例提供的终端设备的功耗处理方法。图7为本申请实施例提供的终端设备的功耗处理方法的另一实施例的流程示意图。参照图7,本申请实施例提供的终端设备的功耗处理方法可以包括:The following describes the power consumption processing method of the terminal device provided by the embodiment of the present application from the perspective of module interaction in the terminal device. FIG7 is a flow chart of another embodiment of the power consumption processing method of the terminal device provided by the embodiment of the present application. Referring to FIG7, the power consumption processing method of the terminal device provided by the embodiment of the present application may include:
S701,功耗处理进程采集终端设备的功耗数据,终端设备的功耗数据包括第一应用的功耗数据,终端设备属于第一产品系列。S701, the power consumption processing process collects power consumption data of a terminal device, the power consumption data of the terminal device includes power consumption data of a first application, and the terminal device belongs to a first product series.
S701可以参照图2B中S201中的描述。S701 may refer to the description of S201 in FIG. 2B .
S702,功耗处理进程通过功耗接口向计算引擎发送终端设备的功耗数据。S702, the power consumption processing process sends the power consumption data of the terminal device to the calculation engine through the power consumption interface.
S703,计算引擎调用第一产品系列的第一应用的功耗模型,且根据第一应用的功耗数据,确定用户所属的用户群体,以及用户群体对应的主特征的阈值。S703: The computing engine calls the power consumption model of the first application of the first product series, and determines the user group to which the user belongs and the threshold of the main feature corresponding to the user group according to the power consumption data of the first application.
S704,计算引擎根据用户群体对应的主特征的阈值,以及第一应用的功耗数据,获取第一应用的功耗检测结果。S704: The calculation engine obtains a power consumption detection result of the first application according to the threshold of the main feature corresponding to the user group and the power consumption data of the first application.
S703-S704可以参照S602-S603中的描述。S703 - S704 may refer to the description in S602 - S603 .
S705,计算引擎向功耗处理进程发送第一应用的功耗检测结果。S705: The computing engine sends the power consumption detection result of the first application to the power consumption processing process.
S706,功耗处理进程根据第一应用的功耗检测结果,当确定第一应用的功耗异常时,向功耗响应单元发送控制指令,控制指令用于指示功耗响应单元执行对应的操作。S706, the power consumption processing process sends a control instruction to the power consumption response unit based on the power consumption detection result of the first application, when determining that the power consumption of the first application is abnormal, wherein the control instruction is used to instruct the power consumption response unit to perform a corresponding operation.
S707,功耗响应单元响应于控制指令,执行对应的操作。S707, the power consumption response unit executes a corresponding operation in response to the control instruction.
S707可以参照S604中的描述。S707 may refer to the description in S604.
本申请实施例中提供的终端设备的功耗处理方法,与图6所示的实施例具有相同的技术原理和技术效果,可以参照上述实施例中的相关描述。The power consumption processing method of the terminal device provided in the embodiment of the present application has the same technical principle and technical effect as the embodiment shown in Figure 6, and can refer to the relevant description in the above embodiment.
图8为本申请实施例提供的终端设备的功耗处理方法的另一实施例的流程示意图。图8结合了图2B、图3,以及图6、图7中的步骤。参照图8,本申请实施例提供的终端设备的功耗处理方法可以包括:FIG8 is a flow chart of another embodiment of a method for processing power consumption of a terminal device provided in an embodiment of the present application. FIG8 combines the steps in FIG2B, FIG3, and FIG6 and FIG7. Referring to FIG8, the method for processing power consumption of a terminal device provided in an embodiment of the present application may include:
S801,云端根据至少一个终端设备的功耗数据,确定top150应用作为目标应用。S801, the cloud determines the top 150 applications as target applications based on the power consumption data of at least one terminal device.
S802,云端删除常驻应用。S802, deleting resident applications in the cloud.
S803,云端获取最近30天,不同产品系列的终端设备的top150应用的功耗数据。S803, the cloud obtains the power consumption data of the top 150 applications of terminal devices of different product series in the past 30 days.
S804,云端对功耗数据的数据量进行判断。S804, the cloud determines the data volume of the power consumption data.
S801-S804可以参照S301中的相关描述。S801-S804 may refer to the relevant description in S301.
S805,云端对功耗数据进行预处理。S805, the cloud pre-processes the power consumption data.
S805可以参照S302中的相关描述。S805 may refer to the relevant description in S302.
S806,云端筛选辅特征。S806, cloud-based screening of auxiliary features.
S806可以参照S303-S304中的描述。S806 may refer to the description in S303-S304.
S807,云端基于辅特征,对功耗数据进行数据分解。S807, the cloud performs data decomposition on the power consumption data based on the auxiliary features.
云端对功耗数据进行数据分解,可以理解为:云端获取辅特征条件,可以参照S305中的描述。The cloud performs data decomposition on the power consumption data, which can be understood as: the cloud obtains auxiliary feature conditions, which can refer to the description in S305.
S808,云端获取每个用户群体对应的主特征的阈值。S808, the cloud obtains the threshold of the main feature corresponding to each user group.
S808可以参照S306-S307中的描述。S808 may refer to the description in S306-S307.
在一些实施例中,云端还可以对主特征的阈值中的第二阈值、第三阈值进行调整,可以参照S307中的相关描述。In some embodiments, the cloud may also adjust the second threshold and the third threshold in the threshold of the main feature, and reference may be made to the relevant description in S307.
S809,云端输出功耗模型。S809, cloud output power consumption model.
S810,终端设备根据功耗模型,对终端设备的功耗进行处理。S810: The terminal device processes the power consumption of the terminal device according to the power consumption model.
S810可以参照图6、图7所示的实施例中的描述。S810 may refer to the description in the embodiments shown in FIG. 6 and FIG. 7 .
应理解,图8中以实线线条划分了云端的步骤和终端设备的步骤,用虚线线条划分了云端执行的不同的步骤。It should be understood that in FIG. 8 , solid lines are used to divide the steps in the cloud and the steps in the terminal device, and dashed lines are used to divide the different steps performed in the cloud.
本申请实施例中提供的终端设备的功耗处理方法,与图2B、图3,以及图6、图7所示的实施例具有相同的技术原理和技术效果,可以参照上述实施例中的相关描述。The power consumption processing method of the terminal device provided in the embodiments of the present application has the same technical principles and technical effects as the embodiments shown in Figures 2B, 3, 6 and 7, and reference may be made to the relevant descriptions in the above embodiments.
本领域技术人员可以理解,本申请实施例中系统架构和终端设备的功耗处理方法可以相互结合和引用,本申请实施例提供的系统架构可以执行上述终端设备的功耗处理方法中的步骤。Those skilled in the art can understand that the system architecture and the power consumption processing method of the terminal device in the embodiment of the present application can be combined and referenced with each other, and the system architecture provided in the embodiment of the present application can execute the steps in the power consumption processing method of the above-mentioned terminal device.
需要说明的是,本申请所涉及的功耗数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,并且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准,并提供有相应的操作入口,供用户选择授权或者拒绝。It should be noted that the power consumption data involved in this application (including but not limited to data used for analysis, storage, display, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
本申请实施例提供的终端设备的功耗处理方法,可以应用在具备通信功能的电子设备中。电子设备包括终端设备,终端设备的具体设备形态等可以参照上述相关说明,此处不再赘述。The power consumption processing method of the terminal device provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic device includes the terminal device, and the specific device form of the terminal device can refer to the above related description, which will not be repeated here.
本申请实施例提供一种终端设备,该终端设备包括:包括:处理器和存储器;存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,使得终端设备执行上述方法。An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.
本申请实施例还提供一种电子设备,该电子设备可以为上述实施例中所述的终端设备、云端。参照图9,该电子设备中可以包括:处理器901(例如CPU)、存储器902。存储器902可能包含高速随机存取存储器(random-access memory,RAM),也可能还包括非易失性存储器(non-volatile memory,NVM),例如至少一个磁盘存储器,存储器902中可以存储各种指令,以用于完成各种处理功能以及实现本申请的方法步骤。The embodiment of the present application also provides an electronic device, which may be the terminal device or the cloud described in the above embodiment. Referring to Figure 9, the electronic device may include: a processor 901 (e.g., a CPU) and a memory 902. The memory 902 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory. Various instructions may be stored in the memory 902 to complete various processing functions and implement the method steps of the present application.
可选的,本申请涉及的电子设备还可以包括:电源903、通信总线904以及通信端口905。上述通信端口905用于实现电子设备与其他外设之间进行连接通信。在本申请实施例中,存储器902用于存储计算机可执行程序代码,程序代码包括指令;当处理器901执行指令时,指令使电子设备的处理器901执行上述方法实施例中的动作,其实现原理和技术效果类似,在此不再赘述。Optionally, the electronic device involved in the present application may further include: a power supply 903, a communication bus 904 and a communication port 905. The above-mentioned communication port 905 is used to realize the connection and communication between the electronic device and other peripherals. In the embodiment of the present application, the memory 902 is used to store computer executable program code, and the program code includes instructions; when the processor 901 executes the instruction, the instruction causes the processor 901 of the electronic device to perform the action in the above-mentioned method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
本申请实施例提供一种芯片。芯片包括处理器,处理器用于调用存储器中的计算机程序,以执行上述实施例中的技术方案。其实现原理和技术效果与上述相关实施例类似,此处不再赘述。The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
本申请实施例还提供了一种计算机可读存储介质。计算机可读存储介质存储有计算机程序。计算机程序被处理器执行时实现上述方法。上述实施例中描述的方法可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。如果在软件中实现,则功能可以作为一个或多个指令或代码存储在计算机可读介质上或者在计算机可读介质上传输。计算机可读介质可以包括计算机存储介质和通信介质,还可以包括任何可以将计算机程序从一个地方传送到另一个地方的介质。存储介质可以是可由计算机访问的任何目标介质。The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
一种可能的实现方式中,计算机可读介质可以包括RAM,ROM,只读光盘(compactdisc read-only memory,CD-ROM)或其它光盘存储器,磁盘存储器或其它磁存储设备,或目标于承载的任何其它介质或以指令或数据结构的形式存储所需的程序代码,并且可由计算机访问。而且,任何连接被适当地称为计算机可读介质。例如,如果使用同轴电缆,光纤电缆,双绞线,数字用户线(Digital Subscriber Line,DSL)或无线技术(如红外,无线电和微波)从网站,服务器或其它远程源传输软件,则同轴电缆,光纤电缆,双绞线,DSL或诸如红外,无线电和微波之类的无线技术包括在介质的定义中。如本文所使用的磁盘和光盘包括光盘,激光盘,光盘,数字通用光盘(Digital Versatile Disc,DVD),软盘和蓝光盘,其中磁盘通常以磁性方式再现数据,而光盘利用激光光学地再现数据。上述的组合也应包括在计算机可读介质的范围内。In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
本申请实施例提供一种计算机程序产品,计算机程序产品包括计算机程序,当计算机程序被运行时,使得计算机执行上述方法。An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程设备的处理单元以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理单元执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application embodiment is described with reference to the flowchart and/or block diagram of the method, device (system) and computer program product according to the present application embodiment. It should be understood that each flow process and/or box in the flow chart and/or block diagram and the combination of the flow chart and/or box in the flow chart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart or multiple flows and/or one box or multiple boxes of the block chart.
以上的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the protection scope of the present invention.
Claims (17)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310598030.6A CN116795628B (en) | 2023-05-24 | 2023-05-24 | Power consumption processing method of terminal device, terminal device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310598030.6A CN116795628B (en) | 2023-05-24 | 2023-05-24 | Power consumption processing method of terminal device, terminal device and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116795628A CN116795628A (en) | 2023-09-22 |
CN116795628B true CN116795628B (en) | 2024-05-14 |
Family
ID=88048895
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310598030.6A Active CN116795628B (en) | 2023-05-24 | 2023-05-24 | Power consumption processing method of terminal device, terminal device and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116795628B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116804960B (en) * | 2023-05-24 | 2024-06-04 | 荣耀终端有限公司 | Power consumption processing method and system of terminal equipment |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012063917A (en) * | 2010-09-15 | 2012-03-29 | Ntt Docomo Inc | Device for evaluating power consumption of application, distribution server and method |
CN108337358A (en) * | 2017-09-30 | 2018-07-27 | 广东欧珀移动通信有限公司 | Application cleaning method and device, storage medium and electronic equipment |
CN111045507A (en) * | 2019-11-27 | 2020-04-21 | RealMe重庆移动通信有限公司 | List management and control method, device, mobile terminal and storage medium |
CN111242808A (en) * | 2020-04-26 | 2020-06-05 | 广东电网有限责任公司东莞供电局 | A kind of power user classification method, electronic device and storage medium |
CN111316199A (en) * | 2018-10-16 | 2020-06-19 | 华为技术有限公司 | Information processing method and electronic equipment |
CN111722693A (en) * | 2020-05-29 | 2020-09-29 | 北京小米松果电子有限公司 | Power consumption adjusting method and device, storage medium, server and terminal |
CN113055984A (en) * | 2019-12-26 | 2021-06-29 | Oppo广东移动通信有限公司 | Terminal control method and device, mobile terminal and storage medium |
CN113055423A (en) * | 2019-12-27 | 2021-06-29 | Oppo广东移动通信有限公司 | Policy pushing method, policy execution method, device, equipment and medium |
CN113050782A (en) * | 2019-12-27 | 2021-06-29 | Oppo广东移动通信有限公司 | Image construction method and device, terminal and storage medium |
CN114417733A (en) * | 2022-01-29 | 2022-04-29 | 龙芯中科技术股份有限公司 | Method, device, electronic device and storage medium for constructing power consumption prediction model |
CN114595546A (en) * | 2020-12-03 | 2022-06-07 | Oppo广东移动通信有限公司 | Power consumption model modeling method, power consumption calculation method, device, medium and equipment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9495272B2 (en) * | 2009-06-11 | 2016-11-15 | Oracle America, Inc. | Method and system for generating a power consumption model of at least one server |
US8458116B2 (en) * | 2009-11-05 | 2013-06-04 | Qualcomm Incorporated | Generating a power model for an electronic device |
AU2017252091A1 (en) * | 2016-04-19 | 2018-11-22 | Grid4C | Method and system for energy consumption prediction |
JP7424807B2 (en) * | 2019-11-28 | 2024-01-30 | ファナック株式会社 | Machine learning device, power consumption prediction device, and control device |
CN111708427B (en) * | 2020-05-29 | 2022-07-22 | 广州三星通信技术研究有限公司 | Method and terminal for managing terminal |
-
2023
- 2023-05-24 CN CN202310598030.6A patent/CN116795628B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012063917A (en) * | 2010-09-15 | 2012-03-29 | Ntt Docomo Inc | Device for evaluating power consumption of application, distribution server and method |
CN108337358A (en) * | 2017-09-30 | 2018-07-27 | 广东欧珀移动通信有限公司 | Application cleaning method and device, storage medium and electronic equipment |
CN111316199A (en) * | 2018-10-16 | 2020-06-19 | 华为技术有限公司 | Information processing method and electronic equipment |
CN111045507A (en) * | 2019-11-27 | 2020-04-21 | RealMe重庆移动通信有限公司 | List management and control method, device, mobile terminal and storage medium |
CN113055984A (en) * | 2019-12-26 | 2021-06-29 | Oppo广东移动通信有限公司 | Terminal control method and device, mobile terminal and storage medium |
CN113055423A (en) * | 2019-12-27 | 2021-06-29 | Oppo广东移动通信有限公司 | Policy pushing method, policy execution method, device, equipment and medium |
CN113050782A (en) * | 2019-12-27 | 2021-06-29 | Oppo广东移动通信有限公司 | Image construction method and device, terminal and storage medium |
CN111242808A (en) * | 2020-04-26 | 2020-06-05 | 广东电网有限责任公司东莞供电局 | A kind of power user classification method, electronic device and storage medium |
CN111722693A (en) * | 2020-05-29 | 2020-09-29 | 北京小米松果电子有限公司 | Power consumption adjusting method and device, storage medium, server and terminal |
CN114595546A (en) * | 2020-12-03 | 2022-06-07 | Oppo广东移动通信有限公司 | Power consumption model modeling method, power consumption calculation method, device, medium and equipment |
CN114417733A (en) * | 2022-01-29 | 2022-04-29 | 龙芯中科技术股份有限公司 | Method, device, electronic device and storage medium for constructing power consumption prediction model |
Also Published As
Publication number | Publication date |
---|---|
CN116795628A (en) | 2023-09-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101166159B (en) | A method and system for identifying rubbish information | |
US9582569B2 (en) | Targeted content distribution based on a strength metric | |
US20180293978A1 (en) | Performing semantic analyses of user-generated textual and voice content | |
CN106649509B (en) | User feature extraction method and device | |
JP2013536488A (en) | Network server equipment configuration and related methods for handling non-parametric, multi-dimensional, spatial and temporal human behavior or a wide range of technical observations | |
CN109862013B (en) | Live broadcast room recommendation method, storage medium, electronic device and system | |
WO2017121355A1 (en) | Search processing method and device | |
CN116795628B (en) | Power consumption processing method of terminal device, terminal device and readable storage medium | |
CN110634030A (en) | Application service index mining method, device and equipment | |
CN115907056A (en) | Prediction model training method, information prediction method and corresponding devices | |
CN109039695B (en) | Service fault processing method, device and equipment | |
CN114240097B (en) | Risk assessment method and apparatus | |
CN109697224B (en) | Bill message processing method, device and storage medium | |
WO2024208076A1 (en) | Behavior data prediction model updating method, apparatus, device and storage medium | |
CN117395699A (en) | Monitoring factor energy-saving communication method and system based on Internet of things | |
CN113050782A (en) | Image construction method and device, terminal and storage medium | |
CN113672660B (en) | Data query method, device and equipment | |
CN116804960B (en) | Power consumption processing method and system of terminal equipment | |
CN111723202B (en) | Processing device, method and system for public opinion data | |
CN116070034A (en) | Graph Convolutional Network Recommendation Method Combining Adaptive Cycle and Interest Factor | |
CN118690074A (en) | Content recommendation method, device, computer equipment and storage medium | |
CN110019783A (en) | Attribute term clustering method and device | |
CN114386393A (en) | Short text keyword extraction method and device | |
CN119377242B (en) | Method for determining data node information modification permission, storage medium and equipment | |
CN110414813A (en) | Construction method, device and the equipment of index curve |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |