WO2019029245A1 - 启动应用程序时长确定方法、装置及存储介质 - Google Patents

启动应用程序时长确定方法、装置及存储介质 Download PDF

Info

Publication number
WO2019029245A1
WO2019029245A1 PCT/CN2018/089785 CN2018089785W WO2019029245A1 WO 2019029245 A1 WO2019029245 A1 WO 2019029245A1 CN 2018089785 W CN2018089785 W CN 2018089785W WO 2019029245 A1 WO2019029245 A1 WO 2019029245A1
Authority
WO
WIPO (PCT)
Prior art keywords
duration
application
startup
information
cpu
Prior art date
Application number
PCT/CN2018/089785
Other languages
English (en)
French (fr)
Inventor
胡晓宇
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2019029245A1 publication Critical patent/WO2019029245A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3612Software analysis for verifying properties of programs by runtime analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt

Definitions

  • the present disclosure relates to the field of communications, and in particular, to a method, an apparatus, and a storage medium for determining an application duration.
  • the terminal platform generally uses a multi-core central processing unit (CPU).
  • CPU central processing unit
  • the Android platform uniformly increases the CPU frequency during the cold start of the application and continues for a while. However, due to different application startup time, for faster startup applications, excessive battery consumption and lower battery life are reduced. For slower startup applications, the CPU high frequency duration is too short and the startup time is still long. In addition, the terminal running status and application implementation will have a great impact on application startup.
  • the present disclosure provides a method, apparatus, and storage medium for determining a duration of launching an application.
  • a method for determining an application duration including: acquiring startup information of an application, where the startup information includes at least a current usage rate of a central processing unit CPU, a memory occupancy, and the One of process information of the application; determining historical startup time information of the application according to the startup information; and determining, by using the historical startup time information, a duration of the CPU to start the application.
  • a startup application duration determining apparatus comprising: an obtaining module configured to acquire startup information of an application, wherein the startup information includes at least a current usage rate of a central processing unit CPU And a memory usage rate and one of process information of the application; a first determining module configured to determine historical startup time information of the application according to the startup information; and a second determining module configured to utilize the The history start time information determines the length of time the CPU starts the application.
  • a storage medium storing a computer executed program, wherein the program executes the above method while it is running.
  • a processor for executing a computer executable program, wherein the program executes the above method while it is running.
  • FIG. 1 is a structural block diagram of a mobile terminal that can implement a method for determining an application duration; according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a method for determining an application duration determining time according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a processor frequency control device in accordance with an embodiment of the present disclosure
  • FIG. 4 is a flowchart of a processor frequency control method in accordance with an embodiment of the present disclosure
  • FIG. 5 is a structural block diagram of a startup application duration determining apparatus according to an embodiment of the present disclosure.
  • FIG. 1 is a structural block diagram of a mobile terminal that can implement a method for determining an application duration, according to an embodiment of the present disclosure.
  • mobile terminal 10 may include one or more (only one shown in FIG. 1) processor 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA.
  • a memory 104 configured to store data, and a transmission device 106 configured as a communication function.
  • the structure shown in FIG. 1 is merely illustrative and does not limit the structure of the above electronic device.
  • the mobile terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • Memory 104 can be used to store applications as well as modules.
  • the memory 104 stores program instructions/modules that can implement a method of determining an application duration according to an embodiment of the present disclosure.
  • the processor 102 performs data processing by running an application and a module stored in the memory 104 to implement the above method.
  • Memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 104 can further include a remote memory relative to processor 102. These remote memories can be connected to the mobile terminal 10 through a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 106 is configured to receive or transmit data via a network.
  • the above-described network specific example may include a wireless network provided by a communication provider of the mobile terminal 10.
  • the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 can be a Radio Frequency (RF) module configured to communicate with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • FIG. 2 is a flowchart of a method for determining a duration of launching an application according to an embodiment of the present disclosure. As shown in FIG. 2, the method includes the following steps:
  • Step S202 acquiring startup information of the application, where the startup information includes at least one of a current usage rate of the CPU of the central processing unit, a memory occupancy rate, and process information of the application;
  • Step S204 determining historical startup time information of the application according to the startup information, and determining, by using the historical startup time information, a duration of the CPU to start the application.
  • the startup information of the application may be obtained, where the startup information includes at least one of a current usage rate of the CPU of the central processing unit, a memory usage, and process information of the application; and determining, according to the startup information, historical startup duration information of the application; Use the historical boot time information to determine how long the CPU is currently launching the application. In this way, the application can be started according to the determined duration, and the technical problem that the startup time of the CPU is inaccurate when the application is started is solved.
  • the subject performing the above steps may be a terminal or the like, but the present disclosure is not limited thereto.
  • the memory usage refers to the memory usage of the entire device.
  • the step of determining the historical startup duration information of the application according to the startup information comprises: starting the history when the startup information matches a historical startup duration of the recorded application The duration is used as the history start time information.
  • the step of determining, by the historical startup duration information, the duration of the CPU to start the application comprises: when the number of the historical startup duration information is greater than a predetermined number, according to a duration The historical start time information is classified; the classification including the most the number of the historical start time information is determined; and the average start time or the median time of the start time of the application is determined according to the plurality of the historical start time information in the classification And a median of the average boot time or boot time as the duration of the CPU launching the application.
  • classification can be performed according to a clustering algorithm.
  • the step of determining, by the historical startup duration information, the duration of the CPU to start the application comprises: when the number of the historical startup duration information is less than or equal to a predetermined number, reading the location a preset value of an application startup time; and a length of time when the preset value is used as the CPU to start the application.
  • the preset value may be a default value of the system when the application is launched, and may also be set by an operator or a developer.
  • the method further includes: starting the duration control of the application according to the determined CPU
  • the CPU starts the application at a predetermined frequency and a predetermined number of cores.
  • the predetermined frequency may be 2 GHz and the predetermined number of cores may be 8 cores.
  • the method further includes: recording a duration of the CPU starting the application.
  • the duration of the recording is used for the next time the reference information of the application is started.
  • This embodiment describes a method of processor frequency control.
  • the method includes: obtaining information such as current CPU usage, memory usage, and whether the application-related process is started before the application is cold-started; analyzing the historical startup time under the current condition according to the information; applying a clustering algorithm, and applying the data Divided into n categories; for the class with the most data, calculate the average value, and set the cold start time of this application; open a certain number of CPU cores, and set the duration of the CPU running at a fixed frequency.
  • This embodiment combines the main factors affecting application startup and applies a clustering algorithm to make the application startup time estimation more accurate. In this way, the user experience can be improved and the power consumption can be effectively controlled.
  • This startup method is a cold start. If the application already has the application's process in the background when it starts, it can be started from an existing process. This startup method is a hot start. When applying a cold start on the android system, the system will create a new process from the zygote process to assign a new process to the application. After that, the application class will be created in turn, and the main activity MainActivity class will be created. The whole process consumes more CPU resources. At this point, turning on a certain number of cores of the CPU and allowing the CPU to operate at a higher frequency can greatly shorten the application cold start time. This embodiment is used for such a scenario.
  • FIG. 3 is a schematic diagram of an apparatus for processor frequency control in accordance with an embodiment of the present disclosure. As shown in FIG. 3, the apparatus includes a processor S301, an internal memory S302, an external memory S303, and a bus S304.
  • the bus S304 is configured to connect to the processor S301, the internal memory S302, and the external memory S303.
  • the external memory S303 is configured to save the application execution file, the application name, the application cold start time, and the cold start preset default value.
  • the application startup processor S301 is configured to read the cold boot preset default value stored in the external memory S303 or the time of the previous cold boot corresponding to the application, wherein the parameters are temporarily stored in the internal memory S302, the processor S301 The time of the previous cold start is supplied to the register of the processor S301.
  • FIG. 4 is a flow chart of a processor frequency control method in accordance with an embodiment of the present disclosure. As shown in FIG. 4, the method includes:
  • Step S401 cold start an application
  • Step S402 acquiring the CPU usage rate and the memory occupancy rate of the current device, and obtaining the number of processes related to the application and the like, which may affect the cold start of the application;
  • step S403 the historical startup time data corresponding to the current condition is read and compared with the data to be classified. If the history startup time is divided into n categories, at least n+1 historical startup time data is needed, where n is greater than or Equal to 1;
  • Step S404 if the historical duration data is less than n+1, the default configuration start time is used;
  • Step S405 reading all historical time length data under the corresponding conditions
  • Step S406 classifying all the historical time data read
  • Step S407 selecting the most type of data, and calculating the mean or median of such data
  • Step S408 setting the average value calculated in step S407 as the duration that the CPU runs at a special frequency on some cores;
  • Step S409 launching an application
  • Step S410 recording the cold start duration of the application.
  • step S101 the user cold-starts an application, wherein a common cold start mode includes clicking a touch screen or a button.
  • the general application startup speed is mainly related to the CPU occupancy rate or the usage rate, the memory occupancy rate, or the usage rate.
  • Android some apps have background services. These processes are started at boot time and depend on these processes when applying a cold boot. But if these background processes are not started, or have been killed, then the application needs to start the service before starting the main thread. This will take a long time to start the application. The first few information of the general process name is the same. Back-end dependent services can have a significant impact on the startup speed, so you need to detect the background process.
  • Step S103 according to the condition in step S102, the system searches for all historical data that meets the condition, and determines whether the historical data satisfies the classification requirement. For example, historical data needs to be classified into n categories, and it should have n+1 historical data to facilitate selection of the most classified data.
  • step S104 if the historical data is less than n+1, the preset default duration value is read, and the data is used as the duration of the CPU running in the special configuration in step S108, and then the application is started.
  • step S105 the historical data read in step S103 is classified by a clustering algorithm.
  • the K-MEANS algorithm can be selected as the clustering algorithm.
  • k objects are arbitrarily selected from n data objects as the initial cluster center; and for other objects remaining, they are assigned to the most similar ones according to their similarity (distance) with these cluster centers ( Clustering represented by the clustering center; then calculating the clustering center of each new cluster obtained (the mean of all objects in the cluster); repeating this process until the standard measure function begins to converge.
  • K-MEDOIDS can also be used as the clustering algorithm. However, K-MEDOIDS is not sensitive to dirty data and abnormal data, and the calculation amount is larger than the K-MEANS algorithm.
  • step S107 after the classification is completed, the class with the most data is selected, and the average value of all the data in the classification is calculated, and the average value is taken as the duration of the CPU running in the special configuration in step S108. It is also possible to calculate the median of all the data in the classification as the length of time the CPU is operating in the special configuration in step S108. This is not sensitive to dirty data and abnormal data.
  • step S108 the average value or the median of the step S107 is calculated as the length of time the CPU is to be operated in a particular configuration. Depending on the CPU type, you can configure parameters such as the running core number and running frequency of the CPU.
  • step S109 a cold start of the application is started.
  • step S110 the duration of the application startup is recorded as a reference for applying the cold start duration for the next time.
  • the duration set in step S108 may be compared with the actual startup duration in step S110 until the two duration values satisfy a certain error, and it is considered that the determined value has been acquired.
  • This duration is used as the fixed startup time under such conditions and is configured into the official version of the system. This saves the classification calculation time.
  • the application startup speed can be improved by determining the CPU running time in the above. And can reduce power consumption and reduce heat.
  • a startup application duration determining apparatus for implementing the above embodiments and preferred embodiments.
  • the term “module” may implement a combination of software and/or hardware of a predetermined function.
  • the devices described in the following embodiments are preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 5 is a structural block diagram of a startup application duration determining apparatus according to an embodiment of the present disclosure. As shown in FIG. 5, the apparatus includes an acquisition module 502, a first determination module 504, and a second determination module 506. The device will be described in detail below.
  • the obtaining module 502 is configured to acquire startup information of the application, where the startup information includes at least a current usage rate of the central processing unit CPU, a memory usage rate, and process information of the application program; the first determining module 504 is connected.
  • the obtaining module 502 is configured to determine the historical startup duration information of the application according to the startup information; the second determining module 506 is connected to the first determining module 504, configured to utilize the historical startup duration The information determines how long the CPU starts the application.
  • the first determining module 504 includes: a first processing unit configured to use the historical startup duration as the historical startup duration when the startup information matches the historical startup duration of the record information.
  • the second determining module 506 includes: a classifying unit configured to classify the historical start duration information according to a duration when the number of the history start duration information is greater than a predetermined number; a determining unit, configured to determine a classification including a maximum number of the historical startup duration information; and a second determining unit configured to determine an average startup of the application according to the plurality of the historical startup duration information in the classification The median of the duration or the start duration; the second processing unit is configured to use the average boot time or the median of the center boot duration as the duration of the CPU launching the application.
  • the second determining module 506 includes: a reading unit configured to read the preset of the application startup time when the number of the historical startup time information is less than or equal to a predetermined number a third processing unit configured to use the preset value as a duration of the CPU to launch the application.
  • the apparatus further includes: a control module configured to, after determining, by using the historical boot duration information, how long the CPU starts the application, according to the determined CPU startup The duration of the application controls the CPU to launch the application at a predetermined frequency and a predetermined number of cores.
  • the apparatus further includes: a recording module, configured to record, after determining, by the historical boot duration information, how long the CPU starts the application, recording the CPU to start the application The length of the program.
  • a recording module configured to record, after determining, by the historical boot duration information, how long the CPU starts the application, recording the CPU to start the application The length of the program.
  • each of the above modules can be implemented by software or hardware.
  • the modules may be located in the same processor; or, the modules may be located in different processors in any combination.
  • Embodiments of the present disclosure also provide a storage medium storing a computer executable program, wherein the program is executed to perform the method of any of the above.
  • the above storage medium may be configured to store program code for performing the above steps.
  • the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM).
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • Embodiments of the present disclosure also provide a processor for executing a computer executable program, wherein the program is operative to perform the steps of any of the above methods.
  • the specific implementation manner in this embodiment may refer to the description of the method for determining the duration of the startup application of the present disclosure, and details are not described herein again.
  • modules or steps of the present disclosure described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. As such, the disclosure is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

一种启动应用程序时长确定方法、装置及存储介质。该方法包括:获取应用程序的启动信息,其中,启动信息至少包括中央处理器CPU当前使用率、内存占用率以及应用程序的进程信息之一(S202);根据启动信息确定应用程序的历史启动时长信息,以利用历史启动时长信息确定CPU启动应用程序的时长(S204)。

Description

启动应用程序时长确定方法、装置及存储介质 技术领域
本公开涉及通信领域,具体而言,涉及一种启动应用程序时长确定方法、装置及存储介质。
背景技术
目前,终端平台普遍使用多核中央处理器(Central Processing Unit,简称为CPU)。CPU在线核数越多,工作频率越高,运行能力越强,但是功耗高,发热多;相反,CPU在线核数越少,工作频率越低,运行能力越弱,但是功耗低,发热少。所以CPU工作频率和核数一般会根据负载及温度等因素进行动态调频。
Android平台在应用冷启动时统一提高CPU频率,并持续一段时间。但是,由于不同的应用启动时间不同,对于启动较快的应用会导致过多的电池消耗,降低续航时间;而对于启动较慢的应用,CPU高频率持续时间太短,启动时间还是较长。另外,终端运行状态和应用实现方式对应用启动会有很大影响。
针对上述中存在CPU在启动应用程序时,启动时间不准确的技术问题,相关技术中并未提出有效的解决方案。
公开内容
本公开提供了一种启动应用程序的时长的确定方法、装置及存储介质。
根据本公开的一个实施例,提供了一种启动应用程序时长确定方法,包括:获取应用程序的启动信息,其中,所述启动信息至少包括中央处理器CPU当前使用率、内存占用率以及所述应用程序的进程信息之一;根据所述启动信息确定所述应用程序的历史启动时长信息;以及利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长。
根据本公开的另一个实施例,还提出一种启动应用程序时长确定 装置,包括:获取模块,被配置为获取应用程序的启动信息,其中,所述启动信息至少包括中央处理器CPU当前使用率、内存占用率以及所述应用程序的进程信息之一;第一确定模块,被配置为根据所述启动信息确定所述应用程序的历史启动时长信息;以及第二确定模块,被配置为利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长。
根据本公开的又一个实施例,还提供了一种存储介质,所述存储介质存储有计算机执行程序,其中,所述程序运行时执行上述方法。
根据本公开的又一个实施例,还提供了一种处理器,所述处理器用于运行计算机可执行程序,其中,所述程序运行时执行上述方法。
附图说明
附图用来提供对本公开的进一步理解,构成本公开的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1是根据本公开实施例的可以实现启动应用程序时长确定方法的移动终端的结构框图;
图2是根据本公开实施例的启动应用程序时长确定方法的流程图;
图3是根据本公开实施例的处理器频率控制装置的示意图;
图4是根据本公开实施例的处理器频率控制方法的流程图;以及
图5是根据本公开实施例的启动应用程序时长确定装置的结构框图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开。需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本公开实施例所提供的方法可以在移动终端、计算机终端或者其他具有运算能力的装置中执行。下面以移动终端为例进行说明。图1是根据本公开实施例的可以实现启动应用程序时长确定方法的移动终端的结构框图。如图1所示,移动终端10可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、被配置为存储数据的存储器104、以及被配置为通信功能的传输装置106。本领域普通技术人员可以理解,图1所示的结构仅为示意性的,并不对上述电子装置的结构造成限定。例如,移动终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储应用程序以及模块。例如,存储器104存储有可以实现根据本公开实施例的启动应用程序时长确定方法的程序指令/模块。处理器102通过运行存储在存储器104内的应用程序以及模块,从而进行数据处理以实现上述方法。存储器104可以包括高速随机存储器,还可以包括非易失性存储器,例如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可以进一步包括相对于处理器102的远程存储器。这些远程存储器可以通过网络连接至移动终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106被配置为经由一个网络接收或者发送数据。上述的网络具体实例可以包括移动终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),该网络适配器可以通过基站与其他网络设备相连从而可与互联网进行通讯。在另一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,该射频模块被配置为通过无线方式与互联网进行通讯。
本公开的一个实施例提供了一种启动应用程序时长确定方法。图2是根据本公开实施例的启动应用程序的时长的确定方法的流程图,如图2所示,该方法包括如下步骤:
步骤S202,获取应用程序的启动信息,其中,所述启动信息至少 包括中央处理器CPU当前使用率、内存占用率以及所述应用程序的进程信息之一;以及
步骤S204,根据所述启动信息确定所述应用程序的历史启动时长信息,并且利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长。
通过上述步骤,可以获取应用程序的启动信息,其中,启动信息至少包括央处理器CPU当前使用率、内存占用率、应用程序的进程信息之一;根据启动信息确定应用程序的历史启动时长信息;利用历史启动时长信息确定CPU当前启动应用程序的时长。按照这种方式,可以根据确定的时长来启动应用程序,解决了CPU在启动应用程序时,启动时间不准确的技术问题。
可选地,执行上述步骤的主体可以为终端等,但本公开不限于此。
在本实施例中,所述内存占用率是指整个设备的内存占用率。
在一个可选的实施例中,根据所述启动信息确定所述应用程序的历史启动时长信息的步骤包括:在所述启动信息与记录的应用程序的历史启动时长匹配时,将所述历史启动时长作为所述历史启动时长信息。
在一个可选的实施例中,利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长的步骤包括:当所述历史启动时长信息的数目大于预定数目时,按照时长对所述历史启动时长信息进行分类;确定包括所述历史启动时长信息的数目最多的分类;根据所述分类中的多条所述历史启动时长信息确定所述应用程序的平均启动时长或启动时长的中位数;以及将所述平均启动时长或启动时长的中位数作为所述CPU启动所述应用程序的时长。在本实施例中,例如,可以根据聚类算法进行分类。
在一个可选的实施例中,利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长的步骤包括:当所述历史启动时长信息的数目小于或者等于预定数目时,读取所述应用程序启动时长的预设值;以及将所述预设值作为上述CPU启动所述应用程序的时长。在本实施例中,所述预设值可以是启动应用程序时,***的默认值,也可 以由操作人员或开发人员进行设定。
在一个可选的实施例中,在利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长之后,所述方法还包括:根据确定的所述CPU启动所述应用程序的时长控制所述CPU以预定频率以及预定核数启动所述应用程序。在本实施例中,例如,预定频率可以是2GHZ,预定核数可以是8核。
在一个可选的实施例中,利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长之后,所述方法还包括:记录所述CPU启动所述应用程序的时长。在本实施例中,记录的时长用于下一次启动应用程序的参考信息。
下面结合具体实施例对本公开进行详细说明。
本实施例描述了一种处理器频率控制的方法。该方法包括:在应用程序冷启动之前,获取当前的CPU使用率、内存使用率及应用相关进程是否启动等信息;根据这些信息,分析在当前条件下历史启动时间;应用聚类算法,把数据分为n类;对于数据最多的类,计算其平均值,并设置为本次应用冷启动时长;打开一定数目的CPU内核,并设置CPU在某个固定频率下运行的持续时间。本实施例结合了影响应用启动的主要因素,并应用聚类算法,使应用启动时间估算更加准确。这样,既可以提升用户体验,又可以有效的控制功耗。
在终端开机后,应用启动时,后台没有该应用的进程。这时,***会重新创建一个新的进程分配给应用。这种启动方式为冷启动。如果应用启动时后台已经有该应用的进程,则可以从已有进程来启动。这种启动方式为热启动。在android***上应用冷启动时,***会从zygote进程中分开fork创建出一个新的进程分配给该应用。之后,会依次创建应用Application类,创建主活动MainActivity类等,整个过程对CPU资源消耗较多。此时,打开CPU一定数量的核,并使CPU工作某个较高的频率,即可使应用冷启动时间大大缩短。本实施例即用于此类场景。
下面对zygote进程进行说明。在Android***中,所有的应用程序进程以及***服务进程SystemServer都是由Zygote进程分支(fork) 出来的。在Java中,不同的虚拟机实例会为不同的应用分配不同的内存。假如Android应用应该尽可能快地启动,但如果Android***为每一个应用启动不同的Dalvik虚拟机实例,就会消耗大量的内存以及时间。Zygote让Dalvik虚拟机共享代码、低内存占用以及最小的启动时间成为可能。Zygote是一个虚拟器进程,在***引导的时候启动。Zygote预加载以及初始化核心库类。通常,这些核心类一般是只读的,也是Android SDK或者核心框架的一部分。在Java虚拟机中,每一个实例都有它自己的核心库类文件和堆对象的拷贝。
图3是根据本公开实施例的处理器频率控制的装置示意图。如图3所示,该装置包括处理器S301、内部存储器S302、外部存储器S303以及总线S304。
总线S304被配置为连接处理器S301、内部存储器S302、外部存储器S303。
外部存储器S303被配置为保存了应用程序执行文件、应用名称,应用历次冷启动时间以及应冷启动预设默认值。
应用启动时处理器S301被配置为读取外部存储器S303中存储的应冷启动预设默认值或该应用对应的历次冷启动的时间,其中,这些参数会暂存在内部存储器S302中,处理器S301将所述历次冷启动的时间提供至处理器S301的寄存器。
图4是根据本公开实施例的处理器频率控制方法的流程图。如图4所示,该方法包括:
步骤S401,冷启动某个应用;
步骤S402,获取当前设备的CPU使用率和内存占用率,并获取和该应用相关的进程数等可能影响应用冷启动的数据;
步骤S403,读取当前条件对应的历史启动时长数据,并与待分类数据对比,其中,如果历史启动时长被分为n类,则至少需要n+1条历史启动时长数据,其中,n大于或者等于1;
步骤S404,如果历史时长数据不足n+1条,则使用默认配置idea启动时间;
步骤S405,读取对应条件下的所有历史时长数据;
步骤S406,对读取的所有历史时长数据进行分类;
步骤S407,选取数据最多的一类,并计算此类数据的均值或者中位数;
步骤S408,将在步骤S407中计算的平均值设置为CPU在某些核上以特殊频率运行的时长;
步骤S409,启动应用;以及
步骤S410,记录应用的冷启动时长。
本实施例以冷启动为例进行详细说明。
步骤S101,用户冷启动某个应用,其中,常见的冷启动方式包括点击触摸屏或者按键。
步骤S102,一般应用启动速度主要与CPU占用率或使用率,内存占用率或使用率等有关系。在Android上,某些应用会有后台服务。这些进程在开机时就已经启动,应用冷启动时依赖于这些进程。但是如果这些后台进程没有被启动,或者已经被杀死,这样应用启动的时候,需要先启动该服务,然后才启动主线程。这样应用启动耗时就会很长。一般进程名的前几个信息是一样的。后台依赖服务会对启动速度造成明显影响,因此,需要检测后台进程的情况。
步骤S103,根据步骤S102中的条件,***查找符合此条件的所有历史数据,并判断历史数据是否满足分类需要。例如,历史数据需要被分为n类,则应当具有n+1条历史数据,以方便选出数据最多的分类。
步骤S104,如果历史数据不足n+1条,则读取事先配置的默认时长值,以此数据作为在步骤S108中CPU在特殊配置下运行的时长,然后启动应用。
步骤S105,对在步骤S103读取的历史数据通过聚类算法进行分类。例如,历史数据可以分为n(例如,n=3)类。可以选用K-MEANS算法作为聚类算法。首先从n个数据对象任意选择k个对象作为初始聚类中心;而对于所剩下其它对象,则根据它们与这些聚类中心的相似度(距离),分别将它们分配给与其最相似的(聚类中心所代表的) 聚类;然后再计算每个所获新聚类的聚类中心(该聚类中所有对象的均值);不断重复这一过程直到标准测度函数开始收敛为止。也可以选用K-MEDOIDS作为聚类算法,但是,K-MEDOIDS对于脏数据和异常数据不敏感,并且计算量比K-MEANS算法大。
步骤S107,在分类完成后,选取数据最多的类,计算该分类中所有数据的平均值,将该平均值作为在步骤S108中CPU在特殊配置下运行的时长。也可以计算该分类中所有数据的中位数,将该中位数作为在步骤S108中CPU在特殊配置下运行的时长。这样对于脏数据和异常数据不敏感。
步骤S108,将步骤S107种计算得到平均值或中位数作为CPU将要运行在某个特殊配置的时长。根据CPU类型不同,可以配置CUP的运行核数,运行频率等参数。
步骤S109,开始应用的冷启动。
步骤S110,记录本次应用启动的时长,作为下次应用冷启动时长的参考。
上述方法也可以用于对已知应用做训练。例如,可以对在步骤S108中设置的时长与在步骤S110中实际启动时长进行对比,直到两个时长值满足一定误差后,认为已经获取到确定值。以该时长作为此类条件下的固定启动时长并且配置到正式版本的***中。这样可以节约分类计算时间。
综上所述,通过上述中的对CPU运行时间进行的确定,可以提升应用启动速度。并且可以降低功耗,减少发热。
上述中的实施例在其它嵌入式设备上也可以应用。此外,可以使用其它新的算法来统计预估应用启动时CPU在最高频工作的时间。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以 使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
在本实施例中还提供了一种启动应用程序时长确定装置,该装置用于实现上述实施例及优选实施方式。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图5是根据本公开实施例的启动应用程序时长确定装置的结构框图。如图5所示,该装置包括:获取模块502,第一确定模块504和第二确定模块506。下面对该装置进行详细说明。
获取模块502,被配置为获取应用程序的启动信息,其中,所述启动信息至少包括中央处理器CPU当前的使用率、内存占用率以及所述应用程序的进程信息;第一确定模块504,连接至所述获取模块502,被配置为根据所述启动信息确定上述应用程序的历史启动时长信息;第二确定模块506,连接至所述第一确定模块504,被配置为利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长。
在一个可选的实施例中,所述第一确定模块504包括:第一处理单元,被配置为在上述启动信息与记录的历史启动时长匹配时,将所述历史启动时长作为上述历史启动时长信息。
在一个可选的实施例中,第二确定模块506包括:分类单元,被配置为当所述历史启动时长信息的数目大于预定数目时,按照时长对所述历史启动时长信息进行分类;第一确定单元,被配置为确定包括所述历史启动时长信息的数目最多的分类;第二确定单元,被配置为根据所述分类中的多条所述历史启动时长信息确定所述应用程序的平均启动时长或启动时长的中位数;第二处理单元,被配置为将所述平均启动时长或所述中心启动时长的中位数作为所述CPU启动所述应用程序的时长。
在一个可选的实施例中,第二确定模块506包括:读取单元,被配置为当所述历史启动时长信息的数目小于或者等于预定数目时,读取所述应用程序启动时长的预设值;第三处理单元,被配置为将所述 预设值作为所述CPU启动所述应用程序的时长。
在一个可选的实施例中,所述装置还包括:控制模块,被配置为在利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长之后,根据确定的所述CPU启动所述应用程序的时长控制所述CPU以预定频率以及预定核数启动所述应用程序。
在一个可选的实施例中,所述装置还包括:记录模块,被配置为在利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长之后,记录所述CPU启动所述应用程序的时长。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的。在各个模块通过硬件来实现的情况下,模块可以位于同一处理器中;或者,模块以任意组合的形式分别位于不同的处理器中。
本公开的实施例还提供了一种存储介质,该存储介质存储有计算机可执行程序,其中,所述程序运行时执行上述任一项所述的方法。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以上各步骤的程序代码。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本公开的实施例还提供了一种处理器,该处理器用于运行计算机可执行程序,其中,该程序运行时执行上述任一项方法中的步骤。
可选地,本实施例中的具体实施方式可以参考本公开的启动应用程序时长确定方法的描述,在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (12)

  1. 一种启动应用程序时长确定方法,包括:
    获取应用程序的启动信息,其中,所述启动信息至少包括中央处理器CPU当前使用率、内存占用率以及所述应用程序的进程信息之一;
    根据所述启动信息确定所述应用程序的历史启动时长信息;以及利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长。
  2. 根据权利要求1所述的方法,其中,根据所述启动信息确定所述应用程序的历史启动时长信息的步骤包括:
    在所述启动信息与记录的所述应用程序的历史启动时长信息匹配时,将所述历史启动时长作为所述历史启动时长信息。
  3. 根据权利要求1所述的方法,其中,利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长的步骤包括:
    当所述历史启动时长信息的数目大于预定数目时,按照时长对所述历史启动时长信息进行分类;
    确定包括所述历史启动时长信息的数目最多的分类;
    根据所述分类中的多条所述历史启动时长信息确定所述应用程序的平均启动时长或启动时长的中位数;以及
    将所述平均启动时长或所述启动时长的中位数作为所述CPU启动所述应用程序的时长。
  4. 根据权利要求1所述的方法,其中,利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长的步骤包括:
    当所述历史启动时长信息的数目小于或者等于预定数目时,读取所述应用程序启动时长的预设值;以及
    将所述预设值作为所述CPU启动所述应用程序的时长。
  5. 根据权利要求1至4中任一项所述的方法,其中,在利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长之后,所述方法还包括:
    根据确定的所述CPU启动所述应用程序的时长控制所述CPU以预定频率以及预定核数启动所述应用程序。
  6. 根据权利要求5所述的方法,其中,在利用所述历史启动时长信息确定所述CPU当前启动所述应用程序的时长之后,所述方法还包括:
    记录所述CPU启动所述应用程序的时长。
  7. 一种启动应用程序时长确定装置,包括:
    获取模块,被配置为获取应用程序的启动信息,其中,所述启动信息至少包括中央处理器CPU当前使用率、内存占用率以及所述应用程序的进程信息之一;
    第一确定模块,被配置为根据所述启动信息确定所述应用程序的历史启动时长信息;以及
    第二确定模块,被配置为利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长。
  8. 根据权利要求7所述的装置,其中,所述第一确定模块包括:
    第一处理单元,被配置为在所述启动信息与记录的所述应用程序的历史启动时长匹配时,将所述历史启动时长作为所述历史启动时长信息。
  9. 根据权利要求7所述的装置,其中,第二确定模块包括:
    分类单元,被配置为当所述历史启动时长信息的数目大于预定数目时,按照时长对所述历史启动时长信息进行分类;
    第一确定单元,被配置为确定包括所述历史启动时长信息的数目最多的分类;
    第二确定单元,被配置为根据所述分类中的多条所述历史启动时长信息确定所述应用程序的平均启动时长或启动时长的中位数;
    第二处理单元,被配置为将所述平均启动时长或所述启动时长的中位数作为所述CPU启动所述应用程序的时长。
  10. 根据权利要7所述的装置,其中,第二确定模块包括:
    读取单元,被配置为当所述历史启动时长信息的数目小于或者等于预定数目时,读取所述应用程序启动时长的预设值;以及
    第三处理单元,被配置为将所述预设值作为所述CPU启动所述应用程序的时长。
  11. 根据权利要求7至10中任一项所述的装置,其中,所述装置还包括:
    控制模块,被配置为在利用所述历史启动时长信息确定所述CPU启动所述应用程序的时长之后,根据确定的所述CPU当前启动所述应用程序的时长控制所述CPU以预定频率以及预定核数启动所述应用程序。
  12. 一种存储介质,所述存储介质存储有计算机可执行程序,其中,所述程序运行时执行根据权利要求1-6中任一项所述的方法。
PCT/CN2018/089785 2017-08-07 2018-06-04 启动应用程序时长确定方法、装置及存储介质 WO2019029245A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710667951.8A CN109388552B (zh) 2017-08-07 2017-08-07 启动应用程序的时长的确定方法、装置及存储介质
CN201710667951.8 2017-08-07

Publications (1)

Publication Number Publication Date
WO2019029245A1 true WO2019029245A1 (zh) 2019-02-14

Family

ID=65271146

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089785 WO2019029245A1 (zh) 2017-08-07 2018-06-04 启动应用程序时长确定方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN109388552B (zh)
WO (1) WO2019029245A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117687769A (zh) * 2023-06-02 2024-03-12 荣耀终端有限公司 一种内存修复清理方法及相关设备

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110768835B (zh) * 2019-10-25 2022-03-25 杭州迪普科技股份有限公司 一种应用时长统计方法、装置、设备及存储介质
CN111651218A (zh) * 2020-05-26 2020-09-11 北京百度网讯科技有限公司 一种小程序保留方法、装置、电子设备及存储介质
CN112783761A (zh) * 2020-12-25 2021-05-11 广州品唯软件有限公司 一种应用程序的冷启动时长测试方法、装置及***

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309740A (zh) * 2013-06-05 2013-09-18 腾讯科技(深圳)有限公司 程序启动方法、装置和设备
CN104899090A (zh) * 2015-05-27 2015-09-09 努比亚技术有限公司 快速调度应用进程的方法、装置及移动终端
CN105045714A (zh) * 2015-07-25 2015-11-11 北京金山安全软件有限公司 一种应用软件启动时长的测试方法、装置及终端
CN106095489A (zh) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 一种应用控制方法及移动终端
JP2016201067A (ja) * 2015-04-14 2016-12-01 富士通株式会社 操作判断プログラム、操作判断方法および操作判断装置
CN106959892A (zh) * 2017-03-30 2017-07-18 联想(北京)有限公司 进程处理方法、装置及电子设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5573333B2 (ja) * 2010-04-26 2014-08-20 日本電気株式会社 携帯端末装置及び携帯端末装置のアプリケーション起動方法並びにコンピュータプログラム
CN102831045B (zh) * 2012-06-21 2015-04-08 北京奇虎科技有限公司 一种终端设备中启动项检测的方法和装置
CN105487779A (zh) * 2015-12-28 2016-04-13 宇龙计算机通信科技(深圳)有限公司 应用程序的启动方法、应用程序的启动装置和终端
CN105939225B (zh) * 2016-06-23 2019-04-02 微梦创科网络科技(中国)有限公司 一种业务执行的方法及装置
CN106528216A (zh) * 2016-10-26 2017-03-22 深圳市金立通信设备有限公司 一种启动应用程序的方法及终端
CN106658051B (zh) * 2016-12-30 2019-05-10 中广热点云科技有限公司 一种缓冲播放流媒体的控制方法及***

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309740A (zh) * 2013-06-05 2013-09-18 腾讯科技(深圳)有限公司 程序启动方法、装置和设备
JP2016201067A (ja) * 2015-04-14 2016-12-01 富士通株式会社 操作判断プログラム、操作判断方法および操作判断装置
CN104899090A (zh) * 2015-05-27 2015-09-09 努比亚技术有限公司 快速调度应用进程的方法、装置及移动终端
CN105045714A (zh) * 2015-07-25 2015-11-11 北京金山安全软件有限公司 一种应用软件启动时长的测试方法、装置及终端
CN106095489A (zh) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 一种应用控制方法及移动终端
CN106959892A (zh) * 2017-03-30 2017-07-18 联想(北京)有限公司 进程处理方法、装置及电子设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117687769A (zh) * 2023-06-02 2024-03-12 荣耀终端有限公司 一种内存修复清理方法及相关设备

Also Published As

Publication number Publication date
CN109388552B (zh) 2024-03-26
CN109388552A (zh) 2019-02-26

Similar Documents

Publication Publication Date Title
WO2019029245A1 (zh) 启动应用程序时长确定方法、装置及存储介质
EP2904494B1 (en) Method for preemptively restarting software in a multisubsystem mobile communication device to increase mean time between failures
US10127080B2 (en) Dynamically controlled distributed workload execution
CN107479951B (zh) 进程管控方法、装置、存储介质及电子设备
US9454206B2 (en) Power management techniques for computer-readable storage devices
EP3091434A1 (en) Chip starting method, multi-core processor chip and storage medium
US9747111B2 (en) Task execution on a managed node based on compliance with execution policy
CN110933178B (zh) 调整集群***内的节点配置的方法及服务器
US20160224381A1 (en) Dynamically Controlled Workload Execution
CN111191777A (zh) 一种神经网络处理器及其控制方法
US11861577B2 (en) System and method for distributed enforcement of configuration limitations
WO2017016371A1 (zh) 散热控制方法、装置和计算机存储介质
CN110688168A (zh) 提高应用程序启动速度方法、装置、设备及存储介质
US11520397B2 (en) Power management of artificial intelligence (AI) models
CN115033352A (zh) 多核处理器任务调度方法、装置及设备、存储介质
CN111767199A (zh) 一种基于批处理作业的资源管理方法、装置、设备及***
US8843545B2 (en) Supervision timer control mechanisms
US11907153B2 (en) System and method for distributed subscription management
WO2017113696A1 (zh) 调频参数的调节方法、装置、调频器及移动终端
CN115151902A (zh) 集群扩容方法、装置、存储介质及电子设备
US9746894B1 (en) Dynamic threshold voltage compensation
US11880259B2 (en) Smart assertion management
US10621008B2 (en) Electronic device with multi-core processor and management method for multi-core processor
US20220156086A1 (en) Processing computing jobs via an acceleration device
US20240231921A1 (en) System and method for distributed management of configurable hardware to satisfy user intent

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18844451

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18844451

Country of ref document: EP

Kind code of ref document: A1