Movatterモバイル変換


[0]ホーム

URL:


CN107967178A - Resource allocation method and Related product - Google Patents

Resource allocation method and Related product
Download PDF

Info

Publication number
CN107967178A
CN107967178ACN201711276869.9ACN201711276869ACN107967178ACN 107967178 ACN107967178 ACN 107967178ACN 201711276869 ACN201711276869 ACN 201711276869ACN 107967178 ACN107967178 ACN 107967178A
Authority
CN
China
Prior art keywords
operating system
adjustment amount
camera preview
preview process
resources
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.)
Granted
Application number
CN201711276869.9A
Other languages
Chinese (zh)
Other versions
CN107967178B (en
Inventor
陈岩
程杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp LtdfiledCriticalGuangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711276869.9ApriorityCriticalpatent/CN107967178B/en
Publication of CN107967178ApublicationCriticalpatent/CN107967178A/en
Application grantedgrantedCritical
Publication of CN107967178BpublicationCriticalpatent/CN107967178B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The embodiment of the application discloses a resource allocation method and a related product. The method comprises the following steps: the method comprises the steps that an operating system detects that a target Application Programming Interface (API) applies for camera hardware, and obtains reference duration corresponding to at least one operation in the camera previewing process; the operating system determines the adjustment amount of system resources in the camera preview process according to the actual processing time of at least one operation and the corresponding reference time length; and the operating system adjusts the configuration of the system resources according to the adjustment amount. The embodiment of the application is beneficial to improving the refinement degree of the system resource allocation of the mobile terminal and realizing the balance control between the performance and the power consumption.

Description

Translated fromChinese
资源配置方法及相关产品Resource allocation method and related products

技术领域technical field

本申请涉及移动终端技术领域,具体涉及资源配置方法及相关产品。This application relates to the technical field of mobile terminals, in particular to resource allocation methods and related products.

背景技术Background technique

随着智能手机相关技术的快速发展,越来越多的应用被安装在用户手机中,如阅读类应用、支付类应用、游戏类应用、音乐类应用等,人们的衣食住行已经与手机密不可分。With the rapid development of smart phone-related technologies, more and more applications are installed in users' mobile phones, such as reading applications, payment applications, game applications, music applications, etc. People's basic necessities of life are already inseparable from mobile phones.

发明内容Contents of the invention

本申请实施例提供了资源配置方法及相关产品,可以提高移动终端进行系统资源配置的精细化程度,实现性能与功耗之间的平衡控制。Embodiments of the present application provide a resource configuration method and related products, which can improve the refinement of system resource configuration by a mobile terminal, and achieve balanced control between performance and power consumption.

第一方面,本申请实施例提供一种资源配置方法,应用于移动终端,上述移动终端上运行有操作系统以及一个或多个应用程序,上述方法包括:In the first aspect, the embodiment of the present application provides a method for resource configuration, which is applied to a mobile terminal, where an operating system and one or more application programs run on the mobile terminal, and the method includes:

所述操作系统检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长;The operating system detects that the target application programming interface API applies for camera hardware, and obtains a reference duration corresponding to at least one operation in the camera preview process;

所述操作系统根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量;The operating system determines an adjustment amount of system resources in the camera preview process according to the actual processing time of the at least one operation and the corresponding reference time length;

所述操作系统根据所述调整量调整所述系统资源的配置。The operating system adjusts the configuration of the system resources according to the adjustment amount.

第二方面,本申请实施例提供一种资源配置装置,应用于移动终端,所述移动终端运行有操作系统和一个或多个应用程序,所述资源配置装置包括获取单元、确定单元和调整单元,其中,In the second aspect, the embodiment of the present application provides a resource configuration device, which is applied to a mobile terminal, the mobile terminal runs an operating system and one or more application programs, and the resource configuration device includes an acquisition unit, a determination unit, and an adjustment unit ,in,

所述获取单元,用于检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长;The acquiring unit is configured to detect that the target application programming interface API applies for camera hardware, and acquire a reference duration corresponding to at least one operation in the camera preview process;

所述确定单元,用于根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量;The determining unit is configured to determine an adjustment amount of the system resource of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration;

所述调整单元,用于根据所述调整量调整所述系统资源的配置。The adjustment unit is configured to adjust the configuration of the system resource according to the adjustment amount.

第三方面,本申请实施例提供一种移动终端,包括处理器、存储器、通信接口以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行本申请实施例第一方面任一方法中的步骤的指令。In a third aspect, an embodiment of the present application provides a mobile terminal, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be processed by the above The above program includes instructions for executing the steps in any one of the methods in the first aspect of the embodiments of the present application.

第四方面,本申请实施例提供了一种计算机可读存储介质,其中,上述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,上述计算机程序使得计算机执行如本申请实施例第一方面任一方法中所描述的部分或全部步骤,上述计算机包括移动终端。In a fourth aspect, the embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned computer program enables the computer to execute In one aspect, for some or all of the steps described in any method, the above-mentioned computer includes a mobile terminal.

第五方面,本申请实施例提供了一种计算机程序产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面任一方法中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包,上述计算机包括移动终端。In a fifth aspect, the embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable the computer to execute the program as implemented in the present application. For example, some or all of the steps described in any method of the first aspect. The computer program product may be a software installation package, and the above-mentioned computer includes a mobile terminal.

可以看出,本申请实施例中,移动终端的操作系统首先检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长,其次,根据至少一个操作的实际处理时和对应的参考时长,确定相机预览过程的系统资源的调整量,最后,根据调整量调整系统资源的配置。可见,操作系统能够在相机预览过程所包含的细化操作层面,通过时长比对更为精细化地调整系统资源的配置,提高了移动终端进行系统资源配置的精细化程度,且调整量既可以用于申请更多系统资源,也可以用于释放系统资源,从而在性能与功耗之间实现平衡控制。It can be seen that in the embodiment of the present application, the operating system of the mobile terminal first detects that the target application programming interface API applies for camera hardware, and obtains the reference duration corresponding to at least one operation in the camera preview process, and secondly, according to the actual time of at least one operation The processing time and the corresponding reference time length determine the adjustment amount of the system resource in the camera preview process, and finally adjust the configuration of the system resource according to the adjustment amount. It can be seen that the operating system can adjust the configuration of system resources more finely through time comparison at the detailed operation level included in the camera preview process, which improves the refinement of system resource configuration for mobile terminals, and the adjustment amount can be It is used to apply for more system resources, and can also be used to release system resources, so as to achieve balance control between performance and power consumption.

附图说明Description of drawings

下面将对本申请实施例所涉及到的附图作简单地介绍。The drawings involved in the embodiments of the present application will be briefly introduced below.

图1A是本申请实施例提供了一种智能手机的结构示意图;FIG. 1A is a schematic structural diagram of a smart phone provided by an embodiment of the present application;

图1B是一种智能手机的程序运行空间的示意图;FIG. 1B is a schematic diagram of a program running space of a smart phone;

图1C是一种安卓系统的系统架构图;FIG. 1C is a system architecture diagram of an Android system;

图2是本申请实施例提供的一种资源配置方法的流程示意图;FIG. 2 is a schematic flowchart of a resource allocation method provided by an embodiment of the present application;

图3是本申请实施例公开的一种资源配置方法的流程示意图;FIG. 3 is a schematic flowchart of a resource allocation method disclosed in an embodiment of the present application;

图4是本申请实施例公开的一种资源配置方法的流程示意图;FIG. 4 is a schematic flowchart of a resource allocation method disclosed in an embodiment of the present application;

图5是本申请实施例公开的一种移动终端的结构示意图;FIG. 5 is a schematic structural diagram of a mobile terminal disclosed in an embodiment of the present application;

图6是本申请实施例公开的一种资源配置装置的功能单元组成框图。Fig. 6 is a block diagram of functional units of a resource configuration device disclosed in an embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。The terms "first", "second" and the like in the specification and claims of the present application and the above drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally further includes For other steps or units inherent in these processes, methods, products or devices.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.

图1A是本申请实施例提供了一种智能手机100的结构示意图,上述智能手机100包括:壳体110、触控显示屏120、主板130、电池140和副板150,主板130上设置有前置摄像头131、芯片级系统(System on Chip,SoC)132(包括应用处理器和基带处理器)、存储器133、电源管理芯片134、射频系统135等,副板上设置有振子151、一体音腔152、VOOC闪充接口153和指纹识别模组154。1A is a schematic structural diagram of a smart phone 100 provided by an embodiment of the present application. The smart phone 100 includes: a casing 110, a touch display screen 120, a main board 130, a battery 140, and a sub-board 150. The main board 130 is provided with a front camera 131, system on chip (System on Chip, SoC) 132 (including application processor and baseband processor), memory 133, power management chip 134, radio frequency system 135, etc. 152 , VOOC flash charging interface 153 and fingerprint identification module 154 .

所述SoC132是智能手机的控制中心,利用各种接口和线路连接整个智能手机的各个部分,通过运行或执行存储在存储器133内的软件程序和/或模块,以及调用存储在存储器133内的数据,执行智能手机的各种功能和处理数据,从而对智能手机进行整体监控。该SoC132可包括一个或多个处理单元,如可集成应用处理器AP和基带处理器(又称为基带芯片、基带)等,其中,应用处理器主要处理操作系统、用户界面和应用程序等,基带处理器主要处理无线通信。可以理解的是,上述基带处理器也可以不集成到SoC132中。该SoC132例如可以是中央处理器(Central Processing Unit,CPU),通用处理器,数字信号处理器(Digital Signal Processor,DSP),专用集成电路(Application-Specific IntegratedCircuit,ASIC),现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。上述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。The SoC132 is the control center of the smart phone, which uses various interfaces and lines to connect the various parts of the whole smart phone, by running or executing software programs and/or modules stored in the memory 133, and calling data stored in the memory 133 , perform various functions of the smartphone and process data, thereby performing overall monitoring of the smartphone. The SoC132 may include one or more processing units, such as an integrated application processor AP and a baseband processor (also called a baseband chip, baseband), etc., wherein the application processor mainly processes operating systems, user interfaces, and application programs, etc. The baseband processor mainly handles wireless communication. It can be understood that the above-mentioned baseband processor may not be integrated into the SoC132. The SoC132 can be, for example, a central processing unit (Central Processing Unit, CPU), a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), a field-programmable gate array ( Field Programmable Gate Array, FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various illustrative logical blocks, modules and circuits described in connection with the present disclosure. The above-mentioned processors may also be a combination of computing functions, for example, a combination of one or more microprocessors, a combination of DSP and a microprocessor, and so on.

所述存储器133可用于存储软件程序以及模块,SoC132通过运行存储在存储器133的软件程序以及模块,从而执行智能手机的各种功能应用以及数据处理。存储器133可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据智能手机的使用所创建的数据等。此外,存储器133可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。该存储器133例如可以是随机存取存储器(RandomAccess Memory,RAM)、闪存、只读存储器(Read Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(ElectricallyEPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质。The memory 133 can be used to store software programs and modules, and the SoC 132 executes various functional applications and data processing of the smart phone by running the software programs and modules stored in the memory 133 . The memory 133 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function, etc.; the data storage area may store data created according to the use of the smartphone, and the like. In addition, the memory 133 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. The memory 133 can be, for example, random access memory (Random Access Memory, RAM), flash memory, read only memory (Read Only Memory, ROM), erasable programmable read only memory (Erasable Programmable ROM, EPROM), electrically erasable Programming read-only memory (Electrically EPROM, EEPROM), registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art.

本申请实施例所涉及到的移动终端可以包括各种具有无线通信功能的手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(User Equipment,UE),移动台(Mobile Station,MS),终端设备(terminaldevice)等等。为方便描述,上面提到的设备统称为移动终端。本发明实施例所涉及到的操作系统是对硬件资源进行统一管理,并向用户提供业务接口的软件系统。The mobile terminals involved in the embodiments of the present application may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to wireless modems, as well as various forms of user equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal device (terminal device) and so on. For convenience of description, the devices mentioned above are collectively referred to as mobile terminals. The operating system involved in the embodiments of the present invention is a software system that uniformly manages hardware resources and provides service interfaces to users.

图1B是本申请实施例提供的智能手机的程序运行空间的示意图,目前智能手机等移动终端一般设置有程序运行空间,该程序运行空间包括用户空间和操作系统空间,其中,用户空间运行有一个或多个应用程序,该一个或多个应用程序为移动终端安装的第三方应用程序,操作系统空间运行有移动终端的操作系统。该移动终端具体可以运行安卓Android系统、苹果公司开发的移动操作系统iOS等,此处不做唯一限定。如图1C所示,以上述移动终端运行有Android系统为例,对应的用户空间包括该Android系统中的应用层(Applications),操作系统空间可以包括该Android系统中的应用程序框架层(Application Framework)、系统运行库层(包括系统运行库层Libraries和Android运行时Android Runtime)、Linux内核层(Linux Kernel)。其中,应用层上包括各类与用户直接交互的应用程序,或由Java语言编写的运行于后台的服务程序。例如,智能手机上实现的常见基本功能的程序,诸如短消息业务(Short Messaging Service,SMS)短信,电话拨号,图片浏览器,日历,游戏,地图,万维网(World Wide Web,Web)浏览器等程序,以及开发人员开发的其他应用程序。应用程序框架层提供开发Android应用程序所需的一系列类库,能够用于重用组件,也可以通过继承实现个性化的扩展。系统运行库层是应用程序框架的支撑,为Android系统中的各个组件提供服务。系统运行库层由系统类库和Android运行时构成。Android运行时包含核心库和Dalvik虚拟机两部分。Linux内核层用于实现硬件设备驱动,进程和内存管理,网络协议栈,电源管理,无线通信等核心功能。Fig. 1B is a schematic diagram of the program running space of the smart phone provided by the embodiment of the present application. At present, mobile terminals such as smart phones are generally provided with a program running space, and the program running space includes a user space and an operating system space. or multiple application programs, the one or multiple application programs are third-party application programs installed on the mobile terminal, and the operating system space runs the operating system of the mobile terminal. Specifically, the mobile terminal can run the Android system, the mobile operating system iOS developed by Apple, etc., and there is no exclusive limitation here. As shown in Figure 1C, taking the Android system running on the above-mentioned mobile terminal as an example, the corresponding user space includes the application layer (Applications) in the Android system, and the operating system space can include the Application Framework layer (Application Framework) in the Android system. ), system runtime layer (comprising system runtime layer Libraries and Android runtime Android Runtime), Linux kernel layer (Linux Kernel). Among them, the application layer includes various application programs that directly interact with users, or service programs written in Java language that run in the background. For example, programs of common basic functions implemented on smart phones, such as short message service (Short Messaging Service, SMS) text messages, telephone dialing, picture browsers, calendars, games, maps, World Wide Web (World Wide Web, Web) browsers, etc. programs, and other applications developed by developers. The application framework layer provides a series of class libraries required for developing Android applications, which can be used to reuse components, and can also implement personalized extensions through inheritance. The system runtime layer is the support of the application framework and provides services for various components in the Android system. The system runtime layer consists of the system class library and the Android runtime. The Android runtime consists of two parts, the core library and the Dalvik virtual machine. The Linux kernel layer is used to implement core functions such as hardware device drivers, process and memory management, network protocol stack, power management, and wireless communication.

上述第三方应用程序所创建的进程一开始是运行在用户空间的,当它要执行网络发送数据、读取磁盘资源等动作时,必须通过调用write、send等由操作系统提供的标准接口函数来完成,即由CPU调用操作系统空间的代码来完成用户的请求操作。可见,第三方应用程序想要调用操作系统提供的功能,只能调用其提供的标准接口函数。同时,操作系统不知道第三方应用程序具体在执行哪些功能,目标应用程序也不能命令操作系统执行特殊的操作,这两者是相互独立的,这使得操作系统无法区分目标应用程序的内部运行场景,只能使用一套标准的参数去适配,无法针对目标应用程序的内部运行场景进行针对性的性能优化。The process created by the above-mentioned third-party application runs in the user space at the beginning. When it wants to perform operations such as sending data over the network and reading disk resources, it must call write, send, etc. standard interface functions provided by the operating system. Completion, that is, the CPU calls the code in the operating system space to complete the user's requested operation. It can be seen that if a third-party application wants to call the functions provided by the operating system, it can only call the standard interface functions provided by it. At the same time, the operating system does not know what functions the third-party application program is performing, and the target application program cannot command the operating system to perform special operations. The two are independent of each other, which makes it impossible for the operating system to distinguish the internal operating scenarios of the target application program , can only use a set of standard parameters to adapt, and cannot perform targeted performance optimization for the internal operating scenarios of the target application.

针对上述情况,本申请实施例提出一种针对移动终端的目标应用程序的资源配置方法,该方法中,移动终端的操作系统首先检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长,其次,根据至少一个操作的实际处理时和对应的参考时长,确定相机预览过程的系统资源的调整量,最后,根据调整量调整系统资源的配置。可见,操作系统能够在相机预览过程所包含的细化操作层面,通过时长比对更为精细化地调整系统资源的配置,提高了移动终端进行系统资源配置的精细化程度,且调整量既可以用于申请更多系统资源,也可以用于释放系统资源,从而在性能与功耗之间实现平衡控制。In view of the above situation, the embodiment of the present application proposes a resource allocation method for the target application program of the mobile terminal. In this method, the operating system of the mobile terminal first detects that the target application programming interface API applies for the camera hardware, and obtains the camera preview process. The reference duration corresponding to at least one operation, and secondly, according to the actual processing time of at least one operation and the corresponding reference duration, determine the adjustment amount of the system resource in the camera preview process, and finally, adjust the configuration of the system resource according to the adjustment amount. It can be seen that the operating system can adjust the configuration of system resources more finely through time comparison at the detailed operation level included in the camera preview process, which improves the refinement of system resource configuration for mobile terminals, and the adjustment amount can be It is used to apply for more system resources, and can also be used to release system resources, so as to achieve balance control between performance and power consumption.

下面结合附图对本申请实施例进行介绍。Embodiments of the present application will be described below in conjunction with the accompanying drawings.

请参阅图2,图2是本申请实施例提供了一种资源配置方法的流程示意图,上述移动终端上运行有操作系统以及一个或多个应用程序,如图所示,本资源配置方法包括:Please refer to FIG. 2. FIG. 2 is a schematic flow diagram of a resource configuration method provided by an embodiment of the present application. The above-mentioned mobile terminal runs an operating system and one or more application programs. As shown in the figure, the resource configuration method includes:

S201,所述操作系统检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长。S201. The operating system detects that a target application programming interface API applies for camera hardware, and acquires a reference duration corresponding to at least one operation in the camera preview process.

其中,目标应用程序是指安装在移动终端的用户空间的第三方应用程序,该第三方应用程序例如可以是相机应用程序、即时通讯类应用、游戏类应用等,该第三方应用程序可以由用户安装,也可以由开发人员在移动终端出厂前预装,此处不做唯一限定。所述相机硬件包括前置摄像头或后置摄像头等外设。所述相机预览过程是指移动终端通过相机硬件采集拍摄范围内的影像信息,并将该影像信息呈现在相机预览界面上的过程,该过程在拍照、摄像、聊天、视频等各类场景中均会涉及到,此处对相机硬件关联的具体场景不做限定。Wherein, the target application program refers to a third-party application program installed in the user space of the mobile terminal. The third-party application program may be, for example, a camera application program, an instant messaging application, a game application program, etc. The installation may also be pre-installed by the developer before the mobile terminal leaves the factory, which is not limited here. The camera hardware includes peripherals such as a front camera or a rear camera. The camera preview process refers to the process in which the mobile terminal collects image information within the shooting range through the camera hardware, and presents the image information on the camera preview interface. It will be involved, and the specific scene associated with the camera hardware is not limited here.

其中,所述至少一个操作包括以下至少一种:界面内容获取操作、界面渲染操作、界面显示操作。Wherein, the at least one operation includes at least one of the following: an interface content acquisition operation, an interface rendering operation, and an interface display operation.

S202,所述操作系统根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量。S202. The operating system determines an adjustment amount of system resources for the camera preview process according to an actual processing time of the at least one operation and a corresponding reference time length.

其中,参考处理时长是指保证相机预览界面最低帧率的最长处理时长,即最低保证相机预览界面不卡顿的最长处理时长,该处理时长可以是一个经验值、也开始由厂家或用户预设,此处不做唯一限定。Among them, the reference processing time refers to the longest processing time to ensure the lowest frame rate of the camera preview interface, that is, the longest processing time to ensure that the camera preview interface does not freeze. The processing time can be an experience value, or it can be determined by the manufacturer or user By default, there is no unique limitation here.

其中,所述系统资源包括以下至少一种:CPU资源、GPU资源、内存带宽资源、磁盘资源。Wherein, the system resources include at least one of the following: CPU resources, GPU resources, memory bandwidth resources, and disk resources.

S203,所述操作系统根据所述调整量调整所述系统资源的配置。S203. The operating system adjusts the configuration of the system resource according to the adjustment amount.

可以看出,本申请实施例中,移动终端的操作系统首先检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长,其次,根据至少一个操作的实际处理时和对应的参考时长,确定相机预览过程的系统资源的调整量,最后,根据调整量调整系统资源的配置。可见,操作系统能够在相机预览过程所包含的细化操作层面,通过时长比对更为精细化地调整系统资源的配置,提高了移动终端进行系统资源配置的精细化程度,且调整量既可以用于申请更多系统资源,也可以用于释放系统资源,从而在性能与功耗之间实现平衡控制。It can be seen that in the embodiment of the present application, the operating system of the mobile terminal first detects that the target application programming interface API applies for camera hardware, and obtains the reference duration corresponding to at least one operation in the camera preview process, and secondly, according to the actual time of at least one operation The processing time and the corresponding reference time length determine the adjustment amount of the system resource in the camera preview process, and finally adjust the configuration of the system resource according to the adjustment amount. It can be seen that the operating system can adjust the configuration of system resources more finely through time comparison at the detailed operation level included in the camera preview process, which improves the refinement of system resource configuration for mobile terminals, and the adjustment amount can be It is used to apply for more system resources, and can also be used to release system resources, so as to achieve balance control between performance and power consumption.

在一个可能的示例中,所述操作系统根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量,包括:所述操作系统检测到所述至少一个操作的实际处理时长大于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第一差值大于第一预设差值时,确定所述相机预览过程的系统资源的上调调整量;In a possible example, the operating system determines the adjustment amount of the system resource of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference time length, including: the operating system detects that the determining that the camera The amount of upward adjustment for the system resources of the preview process;

所述操作系统根据所述调整量调整所述系统资源的配置,包括:所述操作系统额外申请所述上调调整量对应的系统资源以运行所述相机预览过程。The operating system adjusting the configuration of the system resources according to the adjustment amount includes: the operating system additionally applying for system resources corresponding to the increased adjustment amount to run the camera preview process.

其中,第一预设差值可以由参考处理时长乘以预设系数得到,如参考处理时长为30ms,系数为0.2,则第一预设差值为6ms。通过该第一预设差值既可以保证操作系统在上述第一差值较小时稳定运行相机预览过程,又可以在上述差值较大时及时调整资源进行适配,提高资源配置的稳定性。Wherein, the first preset difference can be obtained by multiplying the reference processing time by a preset coefficient, for example, if the reference processing time is 30 ms and the coefficient is 0.2, then the first preset difference is 6 ms. The first preset difference can not only ensure that the operating system runs the camera preview process stably when the first difference is small, but also adjust resources in time to adapt when the first difference is large, improving the stability of resource allocation.

具体实现中,移动终端在申请额外的系统资源之前,可以先检测当前系统的剩余系统资源的资源量,若该剩余系统资源的资源量大于上调调整量,则操作系统可以直接配置,若该剩余系统资源的资源量小于上调调整量,则操作系统需要释放更多的系统资源,具体可以是清理后台应用程序来释放系统资源。In specific implementation, before the mobile terminal applies for additional system resources, it can first detect the resource amount of the remaining system resources of the current system. If the resource amount of the remaining system resources is greater than the upward adjustment amount, the operating system can directly configure it. If the amount of system resources is less than the upward adjustment amount, the operating system needs to release more system resources. Specifically, the system resources can be released by cleaning background applications.

可见,本示例中,针对实际处理时长较大的情形,移动终端能够在适当时机及时确定上调调整量,额外申请上调调整量对应的系统资源以运行所述相机预览过程,保证相机预览过程不卡顿,提高资源配置的稳定性。It can be seen that in this example, for the situation where the actual processing time is relatively long, the mobile terminal can determine the adjustment amount at an appropriate time, and additionally apply for the system resources corresponding to the adjustment amount to run the camera preview process, so as to ensure that the camera preview process does not get stuck To improve the stability of resource allocation.

在本可能的示例中,所述操作系统确定所述相机预览过程的系统资源的上调调整量,包括:所述操作系统根据所述第一差值确定所述相机预览过程的系统资源的上调调整量。In this possible example, the determining, by the operating system, an upward adjustment amount of the system resource of the camera preview process includes: determining, by the operating system, the upward adjustment adjustment of the system resource of the camera preview process according to the first difference quantity.

其中,由于系统资源对运行性能的影响程度是可以通过测试或历史记录分析得到的,因此操作系统可以获取到系统资源的资源量与性能影响因素之间的对应的关系,该性能影响因素就可以包括处理时长,进而操作系统可以查询该映射关系,确定第一差值所对应的系统资源的资源量,即对应的所述相机预览过程的系统资源的上调调整量。Wherein, since the degree of influence of system resources on operating performance can be obtained through testing or historical record analysis, the operating system can obtain the corresponding relationship between the resource amount of system resources and performance influencing factors, and the performance influencing factors can be Including the processing duration, and then the operating system can query the mapping relationship to determine the resource amount of the system resource corresponding to the first difference, that is, the corresponding upward adjustment amount of the system resource in the camera preview process.

可见,本示例中,操作系统具体可以通过第一差值准确确定相机预览过程的系统资源的上调调整量,准确度高,误差小。It can be seen that in this example, the operating system can accurately determine the upward adjustment amount of the system resource in the camera preview process through the first difference, with high accuracy and small error.

在本可能的示例中,所述操作系统根据所述调整量调整所述系统资源的配置之后,所述方法还包括:所述操作系统获取所述相机预览过程的丢帧记录;所述操作系统根据所述丢帧记录,下调所述第一预设差值。In this possible example, after the operating system adjusts the configuration of the system resource according to the adjustment amount, the method further includes: the operating system acquires a frame loss record of the camera preview process; the operating system According to the frame loss record, the first preset difference is lowered.

其中,操作系统可以记录相机预览过程的丢帧记录,该丢帧记录具体可以包括丢帧的帧数或者频率等信息。具体实现中,操作系统可以根据丢帧的帧数确定第一预设差值的调整量,并进行下调。Wherein, the operating system may record a frame loss record during the camera preview process, and the frame loss record may specifically include information such as frame number or frequency of frame loss. In a specific implementation, the operating system may determine the adjustment amount of the first preset difference according to the number of lost frames, and perform downward adjustment.

可见,本示例中,操作系统在调整系统资源后,该相机预览过程仍然有丢帧,通过下调该第一预设差值,可以使得操作系统更早对该过程进行优化配置,从而尽可能降低丢帧可能性,提高资源配置效率和准确度。It can be seen that in this example, after the operating system adjusts the system resources, the camera preview process still loses frames. By lowering the first preset difference, the operating system can optimize the configuration of the process earlier, thereby reducing the The possibility of frame loss improves resource allocation efficiency and accuracy.

在一个可能的示例中,所述操作系统根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量,包括:所述操作系统检测到所述至少一个操作的实际处理时长小于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第二差值大于第二预设差值时,确定所述相机预览过程的系统资源的下调调整量;In a possible example, the operating system determines the adjustment amount of the system resource of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference time length, including: the operating system detects that the When the actual processing duration of at least one operation is less than the corresponding reference duration, and a second difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than a second preset difference, determine that the camera Down adjustment amount of system resources for preview process;

所述操作系统根据所述调整量调整所述系统资源的配置,包括:所述操作系统从所述相机预览过程已配置的系统资源中释放所述下调调整量对应的系统资源。The operating system adjusting the configuration of the system resources according to the adjustment amount includes: the operating system releasing the system resources corresponding to the downward adjustment amount from the system resources configured in the camera preview process.

其中,第二预设差值可以由参考处理时长乘以预设系数得到,如参考处理时长为20ms,系数为0.5,则第二预设差值为10ms。通过该第二预设差值既可以保证操作系统在上述第二差值较小时稳定运行相机预览过程,又可以在上述差值较大时及时释放空闲系统资源以降低功耗。Wherein, the second preset difference can be obtained by multiplying the reference processing duration by a preset coefficient. For example, if the reference processing duration is 20 ms and the coefficient is 0.5, then the second preset difference is 10 ms. The second preset difference can not only ensure that the operating system runs the camera preview process stably when the second difference is small, but also release idle system resources in time to reduce power consumption when the second difference is large.

可见,本示例中,操作系统通过第二差值释放系统资源,以及时降低功耗。It can be seen that in this example, the operating system releases system resources through the second difference to reduce power consumption in time.

在本可能的示例中,所述操作系统确定所述相机预览过程的系统资源的下调调整量,包括:所述操作系统根据所述差值确定所述相机预览过程的系统资源的下调调整量。In this possible example, the determining, by the operating system, the downward adjustment amount of the system resource of the camera preview process includes: determining, by the operating system, the downward adjustment amount of the system resource of the camera preview process according to the difference.

其中,由于系统资源对运行性能的影响程度是可以通过测试或历史记录分析得到的,因此操作系统可以获取到系统资源的资源量与性能影响因素之间的对应的关系,该性能影响因素就可以包括处理时长,进而操作系统可以查询该映射关系,确定第二差值所对应的系统资源的资源量,即对应的所述相机预览过程的系统资源的下调调整量。Wherein, since the degree of influence of system resources on operating performance can be obtained through testing or historical record analysis, the operating system can obtain the corresponding relationship between the resource amount of system resources and performance influencing factors, and the performance influencing factors can be Including the processing time, and then the operating system can query the mapping relationship to determine the resource amount of the system resource corresponding to the second difference, that is, the corresponding downward adjustment amount of the system resource in the camera preview process.

可见,本示例中,操作系统具体可以通过第二差值准确确定相机预览过程的系统资源的下调调整量,及时释放空闲系统资源以降低功耗,更好地平衡性能需求和实际功耗。It can be seen that in this example, the operating system can accurately determine the downward adjustment amount of system resources in the camera preview process through the second difference, release idle system resources in time to reduce power consumption, and better balance performance requirements and actual power consumption.

在本可能的示例中,所述操作系统根据所述调整量调整所述系统资源的配置之后,所述方法还包括:所述操作系统获取所述相机预览过程的帧率记录;所述操作系统根据所述帧率记录,下调所述第二预设阈值。In this possible example, after the operating system adjusts the configuration of the system resource according to the adjustment amount, the method further includes: the operating system acquiring a frame rate record of the camera preview process; the operating system According to the frame rate record, the second preset threshold is lowered.

其中,操作系统可以记录相机预览过程的帧率记录,该帧率信息结合相机预览过程的最低帧率可以用于确定是否丢帧。具体实现中,所述操作系统可以根据所述帧率记录和相机预览过程的最低帧率确定相机预览过程未发生丢帧,进而下调所述第二预设阈值。Wherein, the operating system can record the frame rate record of the camera preview process, and the frame rate information combined with the lowest frame rate of the camera preview process can be used to determine whether to drop frames. In a specific implementation, the operating system may determine that no frame loss occurs during the camera preview process according to the frame rate recording and the lowest frame rate of the camera preview process, and then lower the second preset threshold.

可见,本示例中,操作系统在调整系统资源后,该相机预览过程未出现丢帧,通过下调该第二预设差值,可以使得操作系统更早释放空闲系统资源,从而尽可能降低功耗。It can be seen that in this example, after the operating system adjusts system resources, no frame loss occurs during the camera preview process. By lowering the second preset difference, the operating system can release idle system resources earlier, thereby reducing power consumption as much as possible .

与上述图2所示的实施例一致的,请参阅图3,图3是本申请实施例提供的一种资源配置方法的流程示意图,应用于移动终端,所述移动终端运行有操作系统和一个或多个应用程序。如图所示,本资源配置方法包括:Consistent with the above embodiment shown in FIG. 2, please refer to FIG. 3. FIG. 3 is a schematic flowchart of a resource configuration method provided in the embodiment of the present application, which is applied to a mobile terminal, and the mobile terminal runs an operating system and a or multiple applications. As shown in the figure, this resource configuration method includes:

S301,所述操作系统检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长。S301. The operating system detects that a target application programming interface API applies for camera hardware, and acquires a reference duration corresponding to at least one operation in the camera preview process.

S302,所述操作系统检测到所述至少一个操作的实际处理时长大于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第一差值大于第一预设差值时,确定所述相机预览过程的系统资源的上调调整量。S302. The operating system detects that the actual processing duration of the at least one operation is longer than the corresponding reference duration, and a first difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than the first When the difference is preset, an upward adjustment amount of system resources in the camera preview process is determined.

S303,所述操作系统根据所述第一差值确定所述相机预览过程的系统资源的上调调整量。S303. The operating system determines an upward adjustment amount of system resources of the camera preview process according to the first difference value.

S304,所述操作系统额外申请所述上调调整量对应的系统资源以运行所述相机预览过程。S304. The operating system additionally applies for system resources corresponding to the upward adjustment amount to run the camera preview process.

S305,所述操作系统获取所述相机预览过程的丢帧记录。S305. The operating system acquires a frame loss record of the camera preview process.

S306,所述操作系统根据所述丢帧记录,下调所述第一预设差值。S306. The operating system lowers the first preset difference according to the frame loss record.

可以看出,本申请实施例中,移动终端的操作系统首先检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长,其次,根据至少一个操作的实际处理时和对应的参考时长,确定相机预览过程的系统资源的调整量,最后,根据调整量调整系统资源的配置。可见,操作系统能够在相机预览过程所包含的细化操作层面,通过时长比对更为精细化地调整系统资源的配置,提高了移动终端进行系统资源配置的精细化程度,且调整量既可以用于申请更多系统资源,也可以用于释放系统资源,从而在性能与功耗之间实现平衡控制。It can be seen that in the embodiment of the present application, the operating system of the mobile terminal first detects that the target application programming interface API applies for camera hardware, and obtains the reference duration corresponding to at least one operation in the camera preview process, and secondly, according to the actual time of at least one operation The processing time and the corresponding reference time length determine the adjustment amount of the system resource in the camera preview process, and finally adjust the configuration of the system resource according to the adjustment amount. It can be seen that the operating system can adjust the configuration of system resources more finely through time comparison at the detailed operation level included in the camera preview process, which improves the refinement of system resource configuration for mobile terminals, and the adjustment amount can be It is used to apply for more system resources, and can also be used to release system resources, so as to achieve balance control between performance and power consumption.

此外,针对实际处理时长较大的情形,移动终端能够在适当时机及时确定上调调整量,额外申请上调调整量对应的系统资源以运行所述相机预览过程,保证相机预览过程不卡顿,提高资源配置的稳定性。In addition, for the situation where the actual processing time is relatively long, the mobile terminal can timely determine the adjustment amount at an appropriate time, and additionally apply for the system resources corresponding to the adjustment amount to run the camera preview process, so as to ensure that the camera preview process does not freeze and improve resources. configuration stability.

此外,操作系统具体可以通过第一差值准确确定相机预览过程的系统资源的上调调整量,准确度高,误差小。In addition, the operating system can accurately determine the upward adjustment amount of the system resource in the camera preview process through the first difference value, with high accuracy and small error.

此外,操作系统在调整系统资源后,该相机预览过程仍然有丢帧,通过下调该第一预设差值,可以使得操作系统更早对该过程进行优化配置,从而尽可能降低丢帧可能性,提高资源配置效率和准确度。In addition, after the operating system adjusts system resources, the camera preview process still loses frames. By lowering the first preset difference, the operating system can optimize the configuration of the process earlier, thereby reducing the possibility of frame loss as much as possible. , improve resource allocation efficiency and accuracy.

与上述图2所示的实施例一致的,请参阅图4,图4是本申请实施例提供的一种资源配置方法的流程示意图,应用于移动终端,上述移动终端上运行有操作系统和一个或多个目标应用程序,上述操作系统包括管理模块、多个策略模块和数据连接管理模块,每个策略模块用于确定相同应用类型的至少一个应用程序中的应用程序的性能提升策略,上述目标应用程序包括数据连接模块,上述场景数据包包括目标应用程序的场景标识和关键性能参数,上述场景数据包包括数据格式标识。如图所示,本资源配置方法包括:Consistent with the above-mentioned embodiment shown in FIG. 2, please refer to FIG. 4. FIG. 4 is a schematic flowchart of a resource configuration method provided in the embodiment of the present application, which is applied to a mobile terminal, and the above-mentioned mobile terminal runs an operating system and a or a plurality of target application programs, the above-mentioned operating system includes a management module, a plurality of policy modules and a data connection management module, each policy module is used to determine the performance improvement strategy of the application program in at least one application program of the same application type, the above-mentioned target The application program includes a data connection module, the above-mentioned scene data package includes the scene identification and key performance parameters of the target application program, and the above-mentioned scene data package includes the data format identification. As shown in the figure, this resource configuration method includes:

S401,所述操作系统检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长。S401. The operating system detects that a target application programming interface API applies for camera hardware, and acquires a reference duration corresponding to at least one operation in the camera preview process.

S402,所述操作系统检测到所述至少一个操作的实际处理时长小于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第二差值大于第二预设差值时,确定所述相机预览过程的系统资源的下调调整量。S402. The operating system detects that the actual processing duration of the at least one operation is shorter than the corresponding reference duration, and a second difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than the second When the difference is preset, the down adjustment amount of system resources in the camera preview process is determined.

S403,所述操作系统根据所述差值确定所述相机预览过程的系统资源的下调调整量。S403. The operating system determines a downward adjustment amount of system resources of the camera preview process according to the difference value.

S404,所述操作系统从所述相机预览过程已配置的系统资源中释放所述下调调整量对应的系统资源。S404. The operating system releases system resources corresponding to the downward adjustment amount from system resources configured in the camera preview process.

S405,所述操作系统获取所述相机预览过程的帧率记录。S405. The operating system acquires a frame rate record of the camera preview process.

S406,所述操作系统根据所述帧率记录,下调所述第二预设阈值。S406. The operating system lowers the second preset threshold according to the frame rate record.

可以看出,本申请实施例中,移动终端的操作系统首先检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长,其次,根据至少一个操作的实际处理时和对应的参考时长,确定相机预览过程的系统资源的调整量,最后,根据调整量调整系统资源的配置。可见,操作系统能够在相机预览过程所包含的细化操作层面,通过时长比对更为精细化地调整系统资源的配置,提高了移动终端进行系统资源配置的精细化程度,且调整量既可以用于申请更多系统资源,也可以用于释放系统资源,从而在性能与功耗之间实现平衡控制。It can be seen that in the embodiment of the present application, the operating system of the mobile terminal first detects that the target application programming interface API applies for camera hardware, and obtains the reference duration corresponding to at least one operation in the camera preview process, and secondly, according to the actual time of at least one operation The processing time and the corresponding reference time length determine the adjustment amount of the system resource in the camera preview process, and finally adjust the configuration of the system resource according to the adjustment amount. It can be seen that the operating system can adjust the configuration of system resources more finely through time comparison at the detailed operation level included in the camera preview process, which improves the refinement of system resource configuration for mobile terminals, and the adjustment amount can be It is used to apply for more system resources, and can also be used to release system resources, so as to achieve balance control between performance and power consumption.

此外,操作系统通过第二差值释放系统资源,以及时降低功耗。In addition, the operating system releases system resources through the second difference value, so as to reduce power consumption in time.

此外,操作系统具体可以通过第二差值准确确定相机预览过程的系统资源的下调调整量,及时释放空闲系统资源以降低功耗,更好地平衡性能需求和实际功耗。In addition, the operating system can accurately determine the downward adjustment amount of system resources in the camera preview process through the second difference, release idle system resources in time to reduce power consumption, and better balance performance requirements and actual power consumption.

此外,操作系统在调整系统资源后,该相机预览过程未出现丢帧,通过下调该第二预设差值,可以使得操作系统更早释放空闲系统资源,从而尽可能降低功耗。In addition, after the operating system adjusts system resources, there is no frame loss during the camera preview process. By lowering the second preset difference, the operating system can release idle system resources earlier, thereby reducing power consumption as much as possible.

与上述图2、图3、图4所示的实施例一致的,请参阅图5,图5是本申请实施例提供的一种移动终端的结构示意图,该移动终端运行有一个或多个应用程序和操作系统,如图所示,该移动终端包括处理器、存储器、通信接口以及一个或多个程序,其中,上述一个或多个程序不同于上述一个或多个应用程序,且上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行以下步骤的指令;Consistent with the above embodiments shown in FIG. 2, FIG. 3, and FIG. 4, please refer to FIG. 5. FIG. 5 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present application. The mobile terminal runs one or more applications program and operating system, as shown in the figure, the mobile terminal includes a processor, memory, communication interface and one or more programs, wherein the one or more programs are different from the one or more application programs, and the one or more A plurality of programs are stored in the above-mentioned memory and are configured to be executed by the above-mentioned processor, the above-mentioned programs include instructions for performing the following steps;

检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长;Detect the target application programming interface API to apply for camera hardware, and obtain the reference duration corresponding to at least one operation in the camera preview process;

根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量;Determine an adjustment amount of system resources in the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration;

根据所述调整量调整所述系统资源的配置。Adjust the configuration of the system resource according to the adjustment amount.

可以看出,本申请实施例中,移动终端的操作系统首先检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长,其次,根据至少一个操作的实际处理时和对应的参考时长,确定相机预览过程的系统资源的调整量,最后,根据调整量调整系统资源的配置。可见,操作系统能够在相机预览过程所包含的细化操作层面,通过时长比对更为精细化地调整系统资源的配置,提高了移动终端进行系统资源配置的精细化程度,且调整量既可以用于申请更多系统资源,也可以用于释放系统资源,从而在性能与功耗之间实现平衡控制。It can be seen that in the embodiment of the present application, the operating system of the mobile terminal first detects that the target application programming interface API applies for camera hardware, and obtains the reference duration corresponding to at least one operation in the camera preview process, and secondly, according to the actual time of at least one operation The processing time and the corresponding reference time length determine the adjustment amount of the system resource in the camera preview process, and finally adjust the configuration of the system resource according to the adjustment amount. It can be seen that the operating system can adjust the configuration of system resources more finely through time comparison at the detailed operation level included in the camera preview process, which improves the refinement of system resource configuration for mobile terminals, and the adjustment amount can be It is used to apply for more system resources, and can also be used to release system resources, so as to achieve balance control between performance and power consumption.

在一个可能的示例中,在所述根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量方面,所述程序中的指令具体用于执行以下操作:检测到所述至少一个操作的实际处理时长大于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第一差值大于第一预设差值时,确定所述相机预览过程的系统资源的上调调整量;In a possible example, in terms of determining the adjustment amount of the system resource of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration, the instructions in the program are specifically used to execute The following operation: detecting that the actual processing duration of the at least one operation is greater than the corresponding reference duration, and a first difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than a first preset difference value, determine the upward adjustment amount of the system resource of the camera preview process;

在所述根据所述调整量调整所述系统资源的配置方面,所述程序中的指令具体用于执行以下操作:额外申请所述上调调整量对应的系统资源以运行所述相机预览过程。In terms of adjusting the configuration of the system resources according to the adjustment amount, the instructions in the program are specifically used to perform the following operations: additionally apply for system resources corresponding to the upward adjustment amount to run the camera preview process.

在本可能的示例中,在所述确定所述相机预览过程的系统资源的上调调整量方面,所述程序中的指令具体用于执行以下操作:根据所述第一差值确定所述相机预览过程的系统资源的上调调整量。In this possible example, in terms of determining the upward adjustment amount of the system resource of the camera preview process, the instructions in the program are specifically used to perform the following operations: determine the camera preview according to the first difference The upward adjustment amount for the process's system resources.

在本可能的示例中,所述程序还包括用于执行以下操作的指令:在所述根据所述调整量调整所述系统资源的配置之后,获取所述相机预览过程的丢帧记录;以及根据所述丢帧记录,下调所述第一预设差值。In this possible example, the program further includes an instruction for performing the following operations: after the configuration of the system resource is adjusted according to the adjustment amount, obtain a frame loss record of the camera preview process; and according to For the frame loss record, the first preset difference value is lowered.

在一个可能的示例中,在所述根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量方面,所述程序中的指令具体用于执行以下操作:检测到所述至少一个操作的实际处理时长小于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第二差值大于第二预设差值时,确定所述相机预览过程的系统资源的下调调整量;In a possible example, in terms of determining the adjustment amount of the system resource of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration, the instructions in the program are specifically used to execute The following operation: detecting that the actual processing duration of the at least one operation is less than the corresponding reference duration, and a second difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than a second preset difference value, determine the downward adjustment amount of the system resources of the camera preview process;

在所述根据所述调整量调整所述系统资源的配置方面,所述程序中的指令具体用于执行以下操作:从所述相机预览过程已配置的系统资源中释放所述下调调整量对应的系统资源。In terms of adjusting the configuration of the system resources according to the adjustment amount, the instructions in the program are specifically used to perform the following operations: release the system resources corresponding to the downward adjustment amount from the configured system resources in the camera preview process. system resource.

在本可能的示例中,在所述确定所述相机预览过程的系统资源的下调调整量方面,所述程序中的指令具体用于执行以下操作:根据所述差值确定所述相机预览过程的系统资源的下调调整量。In this possible example, in terms of determining the downward adjustment amount of the system resource of the camera preview process, the instructions in the program are specifically used to perform the following operations: determine the adjustment amount of the camera preview process according to the difference The downward adjustment amount for system resources.

在本可能的示例中,所述程序还包括用于执行以下操作的指令:在所述根据所述调整量调整所述系统资源的配置之后,获取所述相机预览过程的帧率记录;以及根据所述帧率记录下调,所述第二预设阈值。In this possible example, the program further includes instructions for performing the following operations: after the configuration of the system resource is adjusted according to the adjustment amount, obtain a frame rate record of the camera preview process; and The frame rate is recorded down, the second preset threshold.

在一个可能的示例中,所述目标应用程序为相机应用程序;In a possible example, the target application program is a camera application program;

所述至少一个操作包括以下至少一种:界面内容获取操作、界面渲染操作、界面显示操作;The at least one operation includes at least one of the following: interface content acquisition operation, interface rendering operation, interface display operation;

所述系统资源包括以下至少一种:CPU资源、GPU资源、内存带宽资源、磁盘资源。The system resources include at least one of the following: CPU resources, GPU resources, memory bandwidth resources, and disk resources.

上述主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,移动终端为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solutions of the embodiments of the present application from the perspective of executing the process on the method side. It can be understood that, in order to realize the above functions, the mobile terminal includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

本申请实施例可以根据上述方法示例对移动终端进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiments of the present application may divide the mobile terminal into functional units according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation.

在采用集成的单元的情况下,图6示出了上述实施例中所涉及的资源配置装置的一种可能的功能单元组成框图。该资源配置装置600应用于移动终端,包括:获取单元601、确定单元602和调整单元603,其中,In the case of using integrated units, FIG. 6 shows a possible functional unit composition block diagram of the resource configuration device involved in the above-mentioned embodiment. The resource configuration device 600 is applied to a mobile terminal, and includes: an acquisition unit 601, a determination unit 602, and an adjustment unit 603, wherein,

所述获取单元601,用于检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长;The acquisition unit 601 is configured to detect that the target application programming interface API applies for camera hardware, and acquire a reference duration corresponding to at least one operation in the camera preview process;

所述确定单元602,用于根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量;The determining unit 602 is configured to determine an adjustment amount of system resources of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference time length;

所述调整单元603,用于根据所述调整量调整所述系统资源的配置。The adjustment unit 603 is configured to adjust the configuration of the system resource according to the adjustment amount.

可以看出,本申请实施例中,移动终端的操作系统首先检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长,其次,根据至少一个操作的实际处理时和对应的参考时长,确定相机预览过程的系统资源的调整量,最后,根据调整量调整系统资源的配置。可见,操作系统能够在相机预览过程所包含的细化操作层面,通过时长比对更为精细化地调整系统资源的配置,提高了移动终端进行系统资源配置的精细化程度,且调整量既可以用于申请更多系统资源,也可以用于释放系统资源,从而在性能与功耗之间实现平衡控制。It can be seen that in the embodiment of the present application, the operating system of the mobile terminal first detects that the target application programming interface API applies for camera hardware, and obtains the reference duration corresponding to at least one operation in the camera preview process, and secondly, according to the actual time of at least one operation The processing time and the corresponding reference time length determine the adjustment amount of the system resource in the camera preview process, and finally adjust the configuration of the system resource according to the adjustment amount. It can be seen that the operating system can adjust the configuration of system resources more finely through time comparison at the detailed operation level included in the camera preview process, which improves the refinement of system resource configuration for mobile terminals, and the adjustment amount can be It is used to apply for more system resources, and can also be used to release system resources, so as to achieve balance control between performance and power consumption.

在一个可能的示例中,在所述根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量方面,所述确定单元602具体用于:检测到所述至少一个操作的实际处理时长大于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第一差值大于第一预设差值时,确定所述相机预览过程的系统资源的上调调整量;In a possible example, in terms of determining the adjustment amount of the system resource of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration, the determining unit 602 is specifically configured to: detect When the actual processing duration of the at least one operation is greater than the corresponding reference duration, and the first difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than a first preset difference, determine The upward adjustment amount of the system resources of the camera preview process;

在所述根据所述调整量调整所述系统资源的配置方面,所述调整单元603具体用于:额外申请所述上调调整量对应的系统资源以运行所述相机预览过程。In terms of adjusting the configuration of the system resources according to the adjustment amount, the adjustment unit 603 is specifically configured to: additionally apply for system resources corresponding to the upward adjustment amount to run the camera preview process.

在本可能的示例中,在所述确定所述相机预览过程的系统资源的上调调整量方面,所述确定单元602具体用于:根据所述第一差值确定所述相机预览过程的系统资源的上调调整量。In this possible example, in terms of determining the upward adjustment amount of the system resource of the camera preview process, the determining unit 602 is specifically configured to: determine the system resource of the camera preview process according to the first difference The upward adjustment amount of .

在本可能的示例中,所述获取单元601,在所述调整单元603根据所述调整量调整所述系统资源的配置之后,还用于获取所述相机预览过程的丢帧记录;In this possible example, the acquiring unit 601 is further configured to acquire the frame loss record of the camera preview process after the adjusting unit 603 adjusts the configuration of the system resource according to the adjustment amount;

所述调整单元603,还用于根据所述丢帧记录,下调所述第一预设差值。The adjustment unit 603 is further configured to lower the first preset difference according to the frame loss record.

在一个可能的示例中,在所述根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量方面,所述确定单元602具体用于:检测到所述至少一个操作的实际处理时长小于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第二差值大于第二预设差值时,确定所述相机预览过程的系统资源的下调调整量;In a possible example, in terms of determining the adjustment amount of the system resource of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration, the determining unit 602 is specifically configured to: detect When the actual processing duration of the at least one operation is less than the corresponding reference duration, and the second difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than a second preset difference, determine The downward adjustment amount of the system resources of the camera preview process;

所述调整单元603具体用于:从所述相机预览过程已配置的系统资源中释放所述下调调整量对应的系统资源。The adjusting unit 603 is specifically configured to: release the system resources corresponding to the downward adjustment amount from the configured system resources in the camera preview process.

在本可能的示例中,在所述确定所述相机预览过程的系统资源的下调调整量方面,所述确定单元602具体用于:根据所述差值确定所述相机预览过程的系统资源的下调调整量。In this possible example, in terms of determining the down adjustment amount of the system resource of the camera preview process, the determining unit 602 is specifically configured to: determine the down adjustment of the system resource of the camera preview process according to the difference Adjustment amount.

在本可能的示例中,所述获取单元601,在所述调整单元603根据所述调整量调整所述系统资源的配置之后,还用于获取所述相机预览过程的帧率记录;In this possible example, the acquiring unit 601 is further configured to acquire the frame rate record of the camera preview process after the adjusting unit 603 adjusts the configuration of the system resource according to the adjustment amount;

所述调整单元603,还用于根据所述帧率记录下调,所述第二预设阈值。The adjustment unit 603 is further configured to record and down-regulate the second preset threshold according to the frame rate.

在一个可能的示例中,所述目标应用程序为相机应用程序;In a possible example, the target application program is a camera application program;

所述至少一个操作包括以下至少一种:界面内容获取操作、界面渲染操作、界面显示操作;The at least one operation includes at least one of the following: interface content acquisition operation, interface rendering operation, interface display operation;

所述系统资源包括以下至少一种:CPU资源、GPU资源、内存带宽资源、磁盘资源。The system resources include at least one of the following: CPU resources, GPU resources, memory bandwidth resources, and disk resources.

其中,上述获取单元601和调整单元603可以是处理器,上述确定单元602可以是应用处理器和存储器。Wherein, the acquisition unit 601 and the adjustment unit 603 may be processors, and the determination unit 602 may be an application processor and a memory.

本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤,上述计算机包括移动终端。An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables the computer to execute some or all of the steps of any method described in the above method embodiments , the above-mentioned computer includes a mobile terminal.

本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤。该计算机程序产品可以为一个软件安装包,上述计算机包括移动终端。An embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable the computer to execute any one of the methods described in the above method embodiments. Some or all steps of the method. The computer program product may be a software installation package, and the above-mentioned computer includes a mobile terminal.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Depending on the application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by this application.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical or other forms.

上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the above-mentioned integrated units are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory. Several instructions are included to make a computer device (which may be a personal computer, server or network device, etc.) execute all or part of the steps of the above-mentioned methods in various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash disk , Read-only memory (English: Read-Only Memory, abbreviated: ROM), random access device (English: Random Access Memory, abbreviated: RAM), magnetic disk or optical disk, etc.

以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The embodiments of the present application have been introduced in detail above, and specific examples have been used in this paper to illustrate the principles and implementation methods of the present application. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application; meanwhile, for Those skilled in the art will have changes in specific implementation methods and application scopes based on the ideas of the present application. In summary, the contents of this specification should not be construed as limiting the present application.

Claims (11)

Translated fromChinese
1.一种资源配置方法,其特征在于,应用于移动终端,所述移动终端运行有操作系统和一个或多个应用程序,所述方法包括:1. A resource allocation method, characterized in that it is applied to a mobile terminal, and the mobile terminal runs an operating system and one or more application programs, and the method comprises:所述操作系统检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长;The operating system detects that the target application programming interface API applies for camera hardware, and obtains a reference duration corresponding to at least one operation in the camera preview process;所述操作系统根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量;The operating system determines an adjustment amount of system resources in the camera preview process according to the actual processing time of the at least one operation and the corresponding reference time length;所述操作系统根据所述调整量调整所述系统资源的配置。The operating system adjusts the configuration of the system resources according to the adjustment amount.2.根据权利要求1所述的方法,其特征在于,所述操作系统根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量,包括:2. The method according to claim 1, wherein the operating system determines the adjustment amount of the system resources of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration, comprising:所述操作系统检测到所述至少一个操作的实际处理时长大于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第一差值大于第一预设差值时,确定所述相机预览过程的系统资源的上调调整量;The operating system detects that the actual processing duration of the at least one operation is longer than the corresponding reference duration, and a first difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than a first preset difference, determine the upward adjustment amount of the system resource of the camera preview process;所述操作系统根据所述调整量调整所述系统资源的配置,包括:The operating system adjusts the configuration of the system resources according to the adjustment amount, including:所述操作系统额外申请所述上调调整量对应的系统资源以运行所述相机预览过程。The operating system additionally applies for system resources corresponding to the upward adjustment amount to run the camera preview process.3.根据权利要求2所述的方法,其特征在于,所述操作系统确定所述相机预览过程的系统资源的上调调整量,包括:3. The method according to claim 2, wherein the operating system determines an upward adjustment amount of system resources of the camera preview process, comprising:所述操作系统根据所述第一差值确定所述相机预览过程的系统资源的上调调整量。The operating system determines an upward adjustment amount of system resources of the camera preview process according to the first difference value.4.根据权利要求2或3所述的方法,其特征在于,所述操作系统根据所述调整量调整所述系统资源的配置之后,所述方法还包括:4. The method according to claim 2 or 3, wherein after the operating system adjusts the configuration of the system resources according to the adjustment amount, the method further comprises:所述操作系统获取所述相机预览过程的丢帧记录;The operating system obtains the frame loss record of the camera preview process;所述操作系统根据所述丢帧记录,下调所述第一预设差值。The operating system lowers the first preset difference according to the frame loss record.5.根据权利要求1所述的方法,其特征在于,所述操作系统根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量,包括:5. The method according to claim 1, wherein the operating system determines the adjustment amount of the system resources of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration, comprising:所述操作系统检测到所述至少一个操作的实际处理时长小于所述对应的参考时长、且所述至少一个操作的实际处理时长与所述对应的参考时长的第二差值大于第二预设差值时,确定所述相机预览过程的系统资源的下调调整量;The operating system detects that the actual processing duration of the at least one operation is less than the corresponding reference duration, and a second difference between the actual processing duration of the at least one operation and the corresponding reference duration is greater than a second preset When the difference is used, determine the downward adjustment amount of the system resource of the camera preview process;所述操作系统根据所述调整量调整所述系统资源的配置,包括:The operating system adjusts the configuration of the system resources according to the adjustment amount, including:所述操作系统从所述相机预览过程已配置的系统资源中释放所述下调调整量对应的系统资源。The operating system releases the system resources corresponding to the downward adjustment amount from the system resources configured in the camera preview process.6.根据权利要求5所述的方法,其特征在于,所述操作系统确定所述相机预览过程的系统资源的下调调整量,包括:6. The method according to claim 5, wherein the operating system determines the downward adjustment amount of the system resource of the camera preview process, comprising:所述操作系统根据所述差值确定所述相机预览过程的系统资源的下调调整量。The operating system determines a downward adjustment amount of system resources of the camera preview process according to the difference value.7.根据权利要求5或6所述的方法,其特征在于,所述操作系统根据所述调整量调整所述系统资源的配置之后,所述方法还包括:7. The method according to claim 5 or 6, wherein after the operating system adjusts the configuration of the system resources according to the adjustment amount, the method further comprises:所述操作系统获取所述相机预览过程的帧率记录;The operating system obtains the frame rate record of the camera preview process;所述操作系统根据所述帧率记录,下调所述第二预设阈值。The operating system lowers the second preset threshold according to the frame rate record.8.根据权利要求1-7任一项所述的方法,其特征在于,所述目标应用程序为相机应用程序;8. The method according to any one of claims 1-7, wherein the target application program is a camera application program;所述至少一个操作包括以下至少一种:界面内容获取操作、界面渲染操作、界面显示操作;The at least one operation includes at least one of the following: interface content acquisition operation, interface rendering operation, interface display operation;所述系统资源包括以下至少一种:中央处理单元CPU资源、图形处理单元GPU资源、内存带宽资源、磁盘资源。The system resources include at least one of the following: central processing unit CPU resources, graphics processing unit GPU resources, memory bandwidth resources, and disk resources.9.一种资源配置装置,其特征在于,应用于移动终端,所述移动终端运行有操作系统和一个或多个应用程序,所述资源配置装置包括获取单元、确定单元和调整单元,其中,9. A resource configuration device, characterized in that it is applied to a mobile terminal, the mobile terminal runs an operating system and one or more application programs, and the resource configuration device includes an acquisition unit, a determination unit, and an adjustment unit, wherein,所述获取单元,用于检测到目标应用程序编程接口API申请相机硬件,获取相机预览过程中的至少一个操作对应的参考时长;The acquiring unit is configured to detect that the target application programming interface API applies for camera hardware, and acquire a reference duration corresponding to at least one operation in the camera preview process;所述确定单元,用于根据所述至少一个操作的实际处理时和对应的参考时长,确定所述相机预览过程的系统资源的调整量;The determining unit is configured to determine an adjustment amount of the system resource of the camera preview process according to the actual processing time of the at least one operation and the corresponding reference duration;所述调整单元,用于根据所述调整量调整所述系统资源的配置。The adjustment unit is configured to adjust the configuration of the system resource according to the adjustment amount.10.一种移动终端,其特征在于,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行权利要求1-8任一项方法中的步骤的指令。10. A mobile terminal, characterized in that it comprises a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are configured by the processing executed by a computer, the program comprising instructions for performing the steps in any one of the methods of claims 1-8.11.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-8任一项所述的方法,所述计算机包括移动终端。11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the computer program according to any one of claims 1-8. According to the above method, the computer includes a mobile terminal.
CN201711276869.9A2017-12-062017-12-06Resource allocation method, resource allocation device, mobile terminal and mediumActiveCN107967178B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201711276869.9ACN107967178B (en)2017-12-062017-12-06Resource allocation method, resource allocation device, mobile terminal and medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201711276869.9ACN107967178B (en)2017-12-062017-12-06Resource allocation method, resource allocation device, mobile terminal and medium

Publications (2)

Publication NumberPublication Date
CN107967178Atrue CN107967178A (en)2018-04-27
CN107967178B CN107967178B (en)2020-03-17

Family

ID=61998833

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201711276869.9AActiveCN107967178B (en)2017-12-062017-12-06Resource allocation method, resource allocation device, mobile terminal and medium

Country Status (1)

CountryLink
CN (1)CN107967178B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2020038088A1 (en)*2018-08-222020-02-27Oppo广东移动通信有限公司Occupation control method and apparatus for camera application

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050235285A1 (en)*2004-04-142005-10-20Michael MonasterioSystems and methods for CPU throttling utilizing processes
WO2014200655A1 (en)*2013-06-092014-12-18Apple Inc.Initiating background updates based on user activity
WO2016195877A1 (en)*2015-06-042016-12-08Intel CorporationGraphics processor power management contexts & sequential control loops
US20170052826A1 (en)*2015-08-212017-02-23Fujitsu LimitedResource management device and resource management method
CN106549880A (en)*2016-11-252017-03-29珠海市魅族科技有限公司A kind of resource allocation methods and terminal unit of terminal
CN106874168A (en)*2017-01-122017-06-20北京奇虎科技有限公司Determine method, device and the mobile terminal of application program runnability
CN107368400A (en)*2017-08-012017-11-21广东欧珀移动通信有限公司 CPU monitoring method, device, computer readable storage medium and mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050235285A1 (en)*2004-04-142005-10-20Michael MonasterioSystems and methods for CPU throttling utilizing processes
WO2014200655A1 (en)*2013-06-092014-12-18Apple Inc.Initiating background updates based on user activity
WO2016195877A1 (en)*2015-06-042016-12-08Intel CorporationGraphics processor power management contexts & sequential control loops
US20170052826A1 (en)*2015-08-212017-02-23Fujitsu LimitedResource management device and resource management method
CN106549880A (en)*2016-11-252017-03-29珠海市魅族科技有限公司A kind of resource allocation methods and terminal unit of terminal
CN106874168A (en)*2017-01-122017-06-20北京奇虎科技有限公司Determine method, device and the mobile terminal of application program runnability
CN107368400A (en)*2017-08-012017-11-21广东欧珀移动通信有限公司 CPU monitoring method, device, computer readable storage medium and mobile terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2020038088A1 (en)*2018-08-222020-02-27Oppo广东移动通信有限公司Occupation control method and apparatus for camera application
US11419055B2 (en)2018-08-222022-08-16Guangdong Oppo Mobile Telecommunications Corp., Ltd.Occupation control method for camera application based on operating state of device and camera data requests

Also Published As

Publication numberPublication date
CN107967178B (en)2020-03-17

Similar Documents

PublicationPublication DateTitle
CN107547746B (en) Resource allocation method and related products
CN107861816B (en) Resource allocation method and device
CN107577533B (en) Resource allocation method and related products
CN107861814B (en) Resource allocation method and equipment
CN107426432B (en)Resource allocation method and Related product
CN107547745B (en)Resource allocation method and related product
CN107832142B (en)Resource allocation method and equipment for application program
CN107797868B (en)Resource adjusting method and device
CN107613107A (en) Resource allocation method and related products
CN107479970B (en) Resource allocation method and related products
CN107786748B (en) Image display method and device
CN107483725A (en) Resource allocation method and related products
CN107589998A (en)Resource allocation method and Related product
CN107450988B (en)Resource allocation method and related product
CN107635078B (en) Game control method and device
CN107577537A (en)Resource allocation method and Related product
CN108037999A (en)Resource allocation method and Related product
CN107995357A (en)Resource allocation method and device
CN107832141A (en) Application program running control method and device
CN107589977A (en)Resource allocation method and related product
CN107861603A (en) Power consumption control method and device
CN107807852A (en)Application program capacity control method and equipment
CN107517306B (en) Resource allocation method and related products
CN107832111A (en) Game application control method and device
CN107832148A (en)Performance optimization method and equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information
CB02Change of applicant information

Address after:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

Address before:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp