WO2019042172A1 - 资源配置方法及相关产品 - Google Patents

资源配置方法及相关产品 Download PDF

Info

Publication number
WO2019042172A1
WO2019042172A1 PCT/CN2018/101183 CN2018101183W WO2019042172A1 WO 2019042172 A1 WO2019042172 A1 WO 2019042172A1 CN 2018101183 W CN2018101183 W CN 2018101183W WO 2019042172 A1 WO2019042172 A1 WO 2019042172A1
Authority
WO
WIPO (PCT)
Prior art keywords
target application
operating system
performance improvement
resource
application
Prior art date
Application number
PCT/CN2018/101183
Other languages
English (en)
French (fr)
Inventor
陈岩
程杰
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019042172A1 publication Critical patent/WO2019042172A1/zh

Links

Images

Classifications

    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the present application relates to the field of mobile terminal technologies, and in particular, to a resource configuration method and related products.
  • the embodiment of the present application provides a resource configuration method and related products, which can improve the processing speed of the operating system in the mobile terminal, and improve the real-time performance of the mobile terminal to control the target application for performance optimization.
  • the embodiment of the present application provides a resource configuration method, which is applied to a mobile terminal, where the mobile terminal runs an operating system and one or more applications, and the method includes:
  • the operating system receives a scenario data packet from a running target application, where the scenario data package includes a performance improvement policy of the running scenario generated by the target application;
  • the operating system parses the scenario data packet to obtain the performance improvement policy
  • the operating system adjusts allocation of system resources of the target application according to the performance improvement policy.
  • the embodiment of the present application provides a resource configuration method, which is applied to a mobile terminal, where the mobile terminal runs an operating system and one or more applications, and the method includes:
  • the target application determines the running scenario
  • the target application acquires a performance improvement policy of the running scenario
  • the target application sends a scenario data packet to the operating system, where the scenario data packet includes the performance improvement policy, and the scenario data packet is used by the operating system to adjust the target application according to the performance improvement policy.
  • the allocation of system resources is not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, and the scenario data packet is used by the operating system to adjust the target application according to the performance improvement policy.
  • the embodiment of the present application provides a resource configuration apparatus, which is applied to a mobile terminal, where the mobile terminal runs an operating system and one or more application programs, where the resource configuration device includes a processing unit and a communication unit.
  • the processing unit is configured to control the operating system to receive a scenario data packet from a running target application by using the communication unit, where the scenario data packet includes a performance improvement policy of an operation scenario generated by the target application; And controlling the operating system to parse the scenario data packet to obtain the performance improvement policy; and controlling the operating system to adjust the allocation of system resources of the target application according to the performance promotion policy.
  • the embodiment of the present application provides a resource configuration apparatus, which is applied to a mobile terminal, where the mobile terminal runs an operating system and one or more application programs, where the resource configuration device includes a processing unit and a communication unit.
  • the processing unit is configured to control a target application to determine an operation scenario; and a performance promotion policy for controlling the target application to acquire the running scenario; and to control the target application to pass through the communication unit
  • the operating system sends a scenario data packet, where the scenario data packet includes the performance improvement policy, and the scenario data packet is used by the operating system to adjust allocation of system resources of the target application according to the performance promotion policy.
  • an embodiment of the present application provides a mobile terminal, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the foregoing memory, and are configured by the foregoing processing. Executing, the above program includes instructions for performing the steps in any of the first aspect and/or the second aspect of the embodiments of the present application.
  • the embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the first embodiment of the present application.
  • the computer comprises a mobile terminal in some or all of the steps described in one aspect and/or in any of the methods of the second aspect.
  • the embodiment of the present application provides a computer program product, where the computer program product comprises a non-transitory computer readable storage medium storing a computer program, the computer program being operable to cause a computer to perform the implementation as in the present application.
  • the computer program product can be a software installation package, and the computer includes a mobile terminal.
  • 1A is a schematic diagram of a system architecture of a program running space
  • 1B is a schematic diagram of a system architecture of an Android system
  • FIG. 2 is a schematic flowchart of a resource configuration method according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a resource configuration method according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a resource configuration method according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a mobile terminal according to an embodiment of the present disclosure.
  • FIG. 6 is a block diagram of a functional unit of a mobile terminal disclosed in an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a smart phone disclosed in an embodiment of the present application.
  • references to "an embodiment” herein mean that a particular feature, structure, or characteristic described in connection with the embodiments can be included in at least one embodiment of the present application.
  • the appearances of the phrases in various places in the specification are not necessarily referring to the same embodiments, and are not exclusive or alternative embodiments that are mutually exclusive. Those skilled in the art will understand and implicitly understand that the embodiments described herein can be combined with other embodiments.
  • the mobile terminal involved in the embodiments of the present application may include various handheld devices having wireless communication functions, in-vehicle devices, wearable devices, computing devices, or other processing devices connected to the wireless modem, and various forms of user devices (User Equipment, UE), mobile station (MS), terminal device, and the like.
  • user devices User Equipment, UE
  • MS mobile station
  • terminal device terminal device, and the like.
  • the operating system involved in the embodiments of the present invention is a software system that uniformly manages hardware resources and provides a service interface to users.
  • a mobile terminal such as a smart phone is generally provided with a program running space
  • the program running space includes a user space and an operating system space, wherein the user space runs one or more applications, and the one or more applications
  • the program is a third-party application installed on the mobile terminal, and the operating system space runs an operating system with the mobile terminal.
  • the mobile terminal can specifically run the Android Android system, the mobile operating system iOS developed by Apple, etc., and is not limited herein.
  • FIG. 1B taking the mobile terminal running the Android system as an example, the corresponding user space includes an application layer in the Android system, and the operating system space may include an application framework layer in the Android system (Application Framework).
  • the application layer includes various types of applications that directly interact with the user, or a service program written in the Java language and running in the background. For example, programs that implement common basic functions on smartphones, such as Short Messaging Service (SMS) text messages, phone dialing, picture browsers, calendars, games, maps, World Wide Web (Web) browsers, etc. Programs, as well as other applications developed by developers.
  • SMS Short Messaging Service
  • the application framework layer provides a set of libraries needed to develop Android applications, which can be used to reuse components, or to extend personalization through inheritance.
  • the system runtime layer is the support of the application framework, providing services for the 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 a core library and a Dalvik virtual machine.
  • the Linux kernel layer is used to implement core functions such as hardware device driver, process and memory management, network protocol stack, power management, and wireless communication.
  • the process created by the above third-party application is initially run in the user space.
  • it When it wants to perform operations such as sending data and reading disk resources on the network, it must call the standard interface functions provided by the operating system, such as write and send. Completed, that is, the CPU calls the code of the operating system space to complete the user's request operation.
  • third-party applications want to call the functions provided by the operating system and can only call the standard interface functions they provide.
  • the operating system does not know which functions are actually executed by the third-party application, and the target application cannot command the operating system to perform special operations. The two are independent of each other, which makes the operating system unable to distinguish the internal running scenario of the target application.
  • the operating system when it detects that some important applications are running, it will select Adjust the CPU, GPU, memory bandwidth and other resources in the system resources to the highest state, so that the user experience is improved, but because the CPU, GPU, memory bandwidth, etc. are always running at the higher or highest state, it will cause higher power consumption and power consumption. Consumption.
  • the embodiment of the present application provides a resource configuration method for a target application of a mobile terminal, where the operating system receives a scenario data packet from a running target application, and the scenario data package includes a performance improvement policy of the running scenario generated by the target application; the operating system parses the scenario data packet to obtain the performance improvement policy; and the operating system adjusts system resources of the target application according to the performance improvement policy Distribution.
  • the implementation of the operating system to optimize the performance of the target application during operation is beneficial to improve the real-time and accuracy of the performance optimization of the mobile terminal control target application.
  • FIG. 2 is a schematic flowchart of a resource configuration method, which is applied to a mobile terminal, where the mobile terminal runs an operating system and one or more applications, as shown in the figure.
  • This resource configuration method includes:
  • the operating system receives a scenario data packet from a running target application, where the scenario data package includes a performance improvement policy of a running scenario generated by the target application.
  • the target application refers to a third-party application installed in a user space of the mobile terminal, and the third-party application may be, for example, an instant messaging application, a game application, or the like, and the third-party application may be installed by a user, or The developer pre-installs the mobile terminal before leaving the factory, and is not limited here.
  • the running scenario is a scenario in which the target application is currently running.
  • the running scenario can be divided according to different preset conditions.
  • the GPU can be divided into a startup scenario, a session scenario, and a session scenario according to the requirements of the CPU resource.
  • the requirements of the resources are divided into viewing the scenes, viewing the video scenes, and so on.
  • Different operating scenarios are defined according to different requirements of each system resource, which is beneficial to quickly determine the performance improvement strategy according to the running scenario.
  • the preset condition can also be Associated with different application types (for example, non-immediate communication applications), that is, applications of different application types may be divided into the same or different internal running scenarios according to preset conditions, which are not limited herein.
  • the performance improvement policy is a policy that is determined by the target application scenario according to the current running scenario, and the performance improvement policy of the running scenario is used to improve the running performance of the current running scenario, and may include system resources to be adjusted, to be adjusted.
  • the amount of adjustment of the system resources or may also include the adjustment time of the system resources to be adjusted.
  • the format of the scene data packet may be, for example, a Java Object Object Notation (JSON), a protocol buffer (ProtocolBuffer, Protobuf), a custom format, and the like, and is not limited herein.
  • the method before the operating system receives a scenario data packet from a running target application, the method further includes:
  • the operating system receives a connection request from the target application, the connection request including an application identifier of the target application;
  • the operating system uses the application identifier as a query identifier to query a permission table for the multiple applications;
  • the operating system allocates a data transmission interface to the target application, and the data transmission interface is used between the target application and the operating system Transmitting data, the data including at least the scene data packet.
  • the permission table is a permission table preset in the operating system, and the permission table is pre-existing in the operating system by the manufacturer, and may be updated by updating an operating system, where the permission table includes allowing inter-process communication with the operating system.
  • Application ID for multiple applications.
  • the communication mode between the operating system and the target application may be Socket port communication transmission, pipeline pipe communication, shared storage SharedMemory, and sharing.
  • Socket port communication transmission may be Socket port communication transmission, pipeline pipe communication, shared storage SharedMemory, and sharing.
  • the file and other methods are not limited here.
  • the data transmission interface provides an effective data transmission link between the target application and the operating system when the target application is running, and the data transmission link is cleared after the target application is no longer running.
  • the data transfer interface will be disabled.
  • the operating system when receiving the connection request from the target application, the operating system first determines the authority of the target application, and then assigns a data transmission interface to the target application that meets the permission requirement, instead of blindly dividing For any application data transmission interface, it helps to avoid the disorder of data transmission and ensure the security of data transmission.
  • the operating system parses the scenario data packet to obtain the performance improvement policy.
  • the performance improvement policy refers to a resource configuration policy, such as a CPU resource adjustment policy, a GPU resource adjustment policy, a memory bandwidth resource adjustment policy, a disk resource adjustment policy, and a resource configuration policy, which are used to improve the running performance of the running target application.
  • a resource configuration policy such as a CPU resource adjustment policy, a GPU resource adjustment policy, a memory bandwidth resource adjustment policy, a disk resource adjustment policy, and a resource configuration policy, which are used to improve the running performance of the running target application.
  • Network resource adjustment strategies, etc. are not limited here.
  • the performance improvement policy may be an adjustment policy for one system resource, or an adjustment policy for multiple resources, which is not limited herein.
  • the scenario data packet includes a data format identifier, and the operating system parses the scenario data packet according to the data format indicated by the data identifier to obtain the performance improvement policy.
  • the operating system adjusts allocation of system resources of the target application according to the performance improvement policy.
  • the system resource includes at least one of the following resources of the mobile terminal: a CPU resource, a GPU resource, a memory bandwidth resource, a disk resource, and a network resource.
  • the network resources include network resources of the data network of the mobile terminal, network resources of the wireless fidelity Wi-Fi network, and control parameter resources of the Bluetooth module.
  • the operating system can communicate with the kernel layer of the operating system space through direct connection communication, and adjust the configuration of the system resource.
  • Direct communication means direct communication through an abstract application programming interface (API).
  • API abstract application programming interface
  • the operating system can communicate with the kernel layer of the operating system space through indirect communication to adjust the configuration of the system resource, and the indirect communication mode refers to indirect communication by calling a proxy service, such as a network.
  • a proxy service such as a network.
  • the Wi-Fi subsystem or the data network subsystem in the resource does not run in the same system as the operating system. It needs to access these system resources indirectly through some proxy methods.
  • the Wi-Fi proxy service is provided in the operating system. The interface of the proxy service is invoked to communicate indirectly with the Wi-Fi subsystem.
  • the operating system of the mobile terminal first receives the scenario data packet from the running target application, and the scenario data packet includes a performance improvement strategy of the running scenario generated by the target application, and secondly The operating system parses the scenario data packet to obtain the performance improvement policy. Finally, the operating system adjusts the allocation of system resources of the target application according to the performance improvement policy. Since the scenario data packet includes a performance improvement policy of the running scenario of the target application, and the scenario data packet is sent by the running target application, the operating system can directly obtain the performance improvement policy of the current running scenario of the target application, which is beneficial to improving the mobile terminal.
  • the operating system adjusts the configuration of the system resources of the target application in real time according to the performance improvement strategy, realizing the real-time performance optimization of the target application in the running process by the operating system, and is beneficial to improving the control of the mobile terminal.
  • the real-time performance of the target application for performance optimization.
  • the performance improvement policy includes a system resource to be adjusted and an adjustment amount of the system resource to be adjusted, and the operating system adjusts allocation of system resources of the target application according to the performance improvement policy.
  • the operating system adjusts the allocation of the system resource to be adjusted of the target application according to the adjustment amount of the system resource to be adjusted.
  • the adjustment amount may be determined according to a to-be-adjusted level of the system resource, and the division of the adjustment level may be equally divided into multiple levels according to the total amount of system resources, or may be divided into multiple levels, etc., This is not limited here.
  • the operating system directly obtains the adjustment of the system resource to be adjusted and the system resource to be adjusted according to the performance improvement policy, and does not need to be indirectly determined according to the scenario data packet provided by the target application, which is beneficial to reducing system function consumption. , improve the operating system to adjust the speed of system resource allocation.
  • the performance improvement policy includes a preset duration
  • the method further includes:
  • the preset duration is the adjustment duration of the system resource to be adjusted.
  • the preset duration is associated with the running scenario, and different operating scenarios preset different system resource adjustment durations.
  • the canceling the system resource allocation of the target application according to the performance improvement policy is to interrupt the right to the data transmission interface, and restoring the system of the target application before adjusting the performance improvement policy.
  • the allocation of resources is to interrupt the right to the data transmission interface, and restoring the system of the target application before adjusting the performance improvement policy.
  • the operating system when the operating system detects that the adjustment duration is greater than or equal to the preset duration, the operating system actively cancels the allocation of the system resources of the target application according to the performance improvement policy, instead of allowing the target application
  • the program always occupies more system resources, which is beneficial to reducing the power consumption and power consumption of the mobile terminal.
  • the operating system cancels the allocation of the system resources of the target application according to the performance improvement policy, including: the operating system determines that the running scenario is not ended, and cancels the performance according to the performance.
  • the promotion policy adjusts the allocation of system resources of the target application.
  • the method further includes:
  • the operating system receives an indication message from the target application by using the data transmission interface, where the indication message is used to instruct the operating system to cancel the allocation of system resources of the target application according to the performance promotion policy. ;
  • the operating system cancels, according to the indication message, adjusting an allocation of system resources of the target application according to the performance promotion policy.
  • the indication message is an indication message that is sent to the operating system when the target application detects that the running scenario ends, that is, when the user operation exits the current running scenario, and the indication message is used for the The operating system cancels adjusting the allocation of system resources of the target application according to the performance improvement policy.
  • the operating system cancels the allocation of the system resources of the target application according to the performance improvement policy according to the indication message sent by the target application, which is beneficial to improving the accuracy of the interruption time, instead of letting the target application It has always occupied more system resources, which is beneficial to reducing the power consumption and power consumption of the mobile terminal.
  • FIG. 3 is a schematic flowchart of a resource configuration method according to an embodiment of the present disclosure, which is applied to a mobile terminal, where the mobile terminal runs an operating system and One or more applications.
  • the resource configuration method includes:
  • the operating system receives a connection request from a target application, where the connection request includes an application identifier of the target application.
  • the operating system uses the application identifier as a query identifier, and queries a permission table for the multiple applications.
  • the operating system allocates a data transmission interface to the target application.
  • the operating system receives a scenario data packet from a running target application by using the data transmission interface.
  • the operating system parses the scenario data packet to obtain the performance improvement policy.
  • the operating system adjusts allocation of system resources of the target application according to the performance improvement policy.
  • the operating system receives an indication message from the target application by using the data transmission interface.
  • the operating system cancels, according to the indication message, adjusting an allocation of system resources of the target application according to the performance promotion policy.
  • the operating system of the mobile terminal first receives the scenario data packet from the running target application, and the scenario data packet includes a performance improvement strategy of the running scenario generated by the target application, and secondly The operating system parses the scenario data packet to obtain the performance improvement policy. Finally, the operating system adjusts the allocation of system resources of the target application according to the performance improvement policy. Since the scenario data packet includes a performance improvement policy of the running scenario of the target application, and the scenario data packet is sent by the running target application, the operating system can directly obtain the performance improvement policy of the current running scenario of the target application, which is beneficial to improving the mobile terminal.
  • the operating system adjusts the configuration of the system resources of the target application in real time according to the performance improvement strategy, realizing the real-time performance optimization of the target application in the running process by the operating system, and is beneficial to improving the control of the mobile terminal.
  • the real-time performance of the target application for performance optimization.
  • the operating system when receiving the connection request from the target application, the operating system first determines the authority of the target application, and then assigns a data transmission interface to the target application that meets the permission requirement, instead of blindly distributing it to any application.
  • the data transmission interface helps to avoid the disorder of data transmission and ensures the security of data transmission.
  • the operating system cancels the allocation of the system resources of the target application according to the performance improvement policy according to the indication message sent by the target application, which is beneficial to improving the accuracy of the interruption time, instead of allowing the target application to occupy more
  • the system resources are beneficial to reduce the power consumption and power consumption of the mobile terminal.
  • FIG. 4 is a schematic flowchart of a resource configuration method according to an embodiment of the present disclosure, which is applied to a mobile terminal, where the operating system and one or more applications are run.
  • the resource configuration method includes:
  • the target application determines a running scenario.
  • the specific implementation manner of the target application determining the running scenario may be: when detecting an operation request of the user, querying a plurality of running scenarios stored in the target application according to the operation request, and determining the operation request. Corresponding running scenario.
  • the target application refers to a third-party application installed in a user space of the mobile terminal, and the third-party application may be, for example, an instant messaging application, a game application, or the like, and the third-party application may be installed by a user, or The developer pre-installs the mobile terminal before leaving the factory, and is not limited here.
  • the running scenario can be divided into different target conditions and stored in the target application.
  • the scenario can be divided into a startup scenario, a session scenario, and an exit session according to the requirements of the CPU resources.
  • the preset condition may also be associated with different application types (for example, non-instant messaging applications), that is, applications of different application types may be divided into the same or different internal running scenarios according to preset conditions, and are not limited herein. .
  • the target application acquires a performance improvement policy of the running scenario.
  • the performance improvement policy refers to a resource configuration policy, such as a CPU resource adjustment policy, a GPU resource adjustment policy, a memory bandwidth resource adjustment policy, a disk resource adjustment policy, and a resource configuration policy, which are used to improve the running performance of the running target application.
  • the network resource adjustment policy and the like are not limited.
  • the performance improvement policy may include the system resource to be adjusted, the adjustment amount of the system resource to be adjusted, or the adjustment time of the system resource to be adjusted.
  • the target application pre-stores a mapping relationship between the multiple running scenarios and the performance improvement policy, where the mapping relationship may be set by the developer according to the test result when the target application is shipped from the factory.
  • the target application sends a scenario data packet to the operating system, where the scenario data packet includes the performance promotion policy.
  • the scenario data packet is used by the operating system to adjust allocation of system resources of the target application according to the performance improvement policy.
  • the target application of the mobile terminal determines the running scenario, and secondly, the target application acquires the performance improvement policy of the running scenario, and finally, the target application sends the operating scenario to the operating system.
  • the scenario data packet includes the performance improvement policy, where the scenario data packet is used by the operating system to adjust allocation of system resources of the target application according to the performance promotion policy. Since the scenario data packet includes a performance improvement policy of the running scenario of the target application, and the scenario data packet is sent by the running target application, the operating system can directly obtain the performance improvement policy of the current running scenario of the target application, which is beneficial to improving the mobile terminal.
  • the operating system adjusts the configuration of the system resources of the target application in real time according to the performance improvement strategy, realizing the real-time performance optimization of the target application in the running process by the operating system, and is beneficial to improving the control of the mobile terminal.
  • the real-time performance of the target application for performance optimization.
  • the method before the target application sends the scenario data packet to the operating system, the method further includes:
  • the target application sends a connection request to the operating system, where the connection request includes an application identifier of the target application, and the application identifier is used by the operating system to use the application identifier as a query identifier, and the query is for the a permission table of a plurality of applications, and when the permission table includes an application identifier of the target application, the operating system allocates a data transmission interface to the target application, and the data transmission interface is used for the Data is transmitted between the target application and the operating system, the data including at least the scene data packet.
  • the target application sends a connection request to the operating system, requests the operating system to allocate a data transmission interface, and the operating system determines the authority of the target application, and then allocates a data transmission interface to the target application that meets the permission requirement. Rather than blindly assigning any application data transfer interface, it helps to avoid data transmission disorder and ensure data transmission security.
  • the method further includes:
  • the target application sends an indication message to the operating system through the data transmission interface, where the indication message is used by the operating system to cancel the system for adjusting the target application according to the performance improvement policy according to the indication message.
  • the allocation of resources is used by the operating system to cancel the system for adjusting the target application according to the performance improvement policy according to the indication message.
  • the target application sends an indication message to the operating system at the end of the detection running scenario, indicating that the operating system cancels the allocation of the system resources of the target application according to the performance improvement policy, which is beneficial to improving the interruption time.
  • Accuracy rather than letting the target application always occupy more system resources, helps to reduce the power consumption and power consumption of the mobile terminal.
  • FIG. 5 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application, where the mobile terminal runs one or more applications.
  • Program and operating system as shown, the mobile terminal includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are different from the one or more applications, and the one or more A plurality of programs are stored in said memory and configured to be executed by said processor, said program comprising instructions for performing the following steps;
  • the operating system of the mobile terminal first receives the scenario data packet from the running target application, and the scenario data packet includes a performance improvement strategy of the running scenario generated by the target application, and secondly The operating system parses the scenario data packet to obtain the performance improvement policy. Finally, the operating system adjusts the allocation of system resources of the target application according to the performance improvement policy. Since the scenario data packet includes a performance improvement policy of the running scenario of the target application, and the scenario data packet is sent by the running target application, the operating system can directly obtain the performance improvement policy of the current running scenario of the target application, which is beneficial to improving the mobile terminal.
  • the operating system adjusts the configuration of the system resources of the target application in real time according to the performance improvement strategy, realizing the real-time performance optimization of the target application in the running process by the operating system, and is beneficial to improving the control of the mobile terminal.
  • the real-time performance of the target application for performance optimization.
  • the above program further includes instructions for: controlling the operating system to receive the target data packet from the running target application before receiving the scene data packet from the running target application a connection request of the application, the connection request including an application identifier of the target application; and controlling the operating system to use the application identifier as a query identifier, querying a permission table for the plurality of applications; and controlling when When the permission table includes an application identifier of the target application, the operating system allocates a data transmission interface to the target application, and the data transmission interface is used to transmit between the target application and the operating system. Data, the data including at least the scene data packet.
  • the performance improvement policy includes a system resource to be adjusted and an adjustment amount of the system resource to be adjusted, where the operating system adjusts the target application according to the performance improvement policy.
  • the instruction in the program is specifically configured to: control the operating system to adjust the allocation of the system resource to be adjusted of the target application according to the adjustment amount of the system resource to be adjusted. .
  • the performance improvement policy includes a preset duration
  • the program further includes instructions for performing the following steps: the system for controlling the operating system to adjust the target application according to the performance improvement policy After the allocation of the resource, the operating system is configured to cancel the allocation of the system resource of the target application according to the performance improvement policy when detecting that the adjustment duration according to the performance improvement policy is greater than or equal to the preset duration .
  • the instruction in the program is specifically configured to: determine that the running scenario is not Ending, canceling the allocation of system resources of the target application according to the performance improvement policy.
  • the above program further includes instructions for performing the following steps: controlling the operating system after the operating system adjusts allocation of system resources of the target application according to the performance improvement policy Receiving, by the data transmission interface, an indication message from the target application, where the indication message is used to instruct the operating system to cancel an allocation of system resources of the target application according to the performance promotion policy; and The operating system cancels adjusting the allocation of system resources of the target application according to the performance promotion policy according to the indication message.
  • the above program includes instructions for performing the following steps;
  • Controlling the target application to send a scenario data packet to the operating system, where the scenario data packet includes the performance improvement policy, where the scenario data packet is used by the operating system to adjust the target application according to the performance improvement policy The allocation of system resources for the program.
  • the target application of the mobile terminal determines the running scenario, and secondly, the target application acquires the performance improvement policy of the running scenario, and finally, the target application sends the operating scenario to the operating system.
  • the scenario data packet includes the performance improvement policy, where the scenario data packet is used by the operating system to adjust allocation of system resources of the target application according to the performance promotion policy. Since the scenario data packet includes a performance improvement policy of the running scenario of the target application, and the scenario data packet is sent by the running target application, the operating system can directly obtain the performance improvement policy of the current running scenario of the target application, which is beneficial to improving the mobile terminal.
  • the operating system adjusts the configuration of the system resources of the target application in real time according to the performance improvement strategy, realizing the real-time performance optimization of the target application in the running process by the operating system, and is beneficial to improving the control of the mobile terminal.
  • the real-time performance of the target application for performance optimization.
  • the above program further includes instructions for: controlling the target application to send the target application to the operating system before transmitting the scenario data packet to the operating system a connection request, the connection request includes an application identifier of the target application, the application identifier is used by the operating system to use the application identifier as a query identifier, query a permission table for the multiple applications, and when When the permission table includes an application identifier of the target application, the operating system allocates a data transmission interface to the target application, and the data transmission interface is used to transmit between the target application and the operating system. Data, the data including at least the scene data packet.
  • the above program further includes instructions for: controlling the target application to pass the data transmission interface after the target application sends the scene data packet to the operating system And sending an indication message to the operating system, where the indication message is used by the operating system to cancel, according to the indication message, adjusting an allocation of system resources of the target application according to the performance promotion policy.
  • the mobile terminal includes corresponding hardware structures and/or software modules for performing various functions.
  • the present application can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for each particular application to implement the described functionality, but such implementation should not be considered to be beyond the scope of the application.
  • the embodiment of the present application may divide the functional unit into the mobile terminal according to the foregoing method example.
  • each functional unit may be divided according to each function, or two or more functions may be integrated into one processing unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logical function division. In actual implementation, there may be another division manner.
  • FIG. 6 shows a block diagram of one possible functional unit configuration of the resource configuration apparatus involved in the above embodiment.
  • the resource configuration device 600 is applied to a mobile terminal on which an operating system and one or more applications are run.
  • the resource configuration device 600 includes a processing unit 602 and a communication unit 603.
  • the processing unit 602 is configured to perform control management on the action of the resource configuration apparatus.
  • the processing unit 602 is configured to support the resource configuration apparatus to perform steps S201-S203 in FIG. 2, steps S301-S308 in FIG. 3, or to support resources.
  • the configuration device performs steps S401-S403 in FIG. 4 and/or other processes for the techniques described herein.
  • the resource configuration device may further include a storage unit 601 for storing program codes and data.
  • the processing unit 602 is configured to control the operating system to receive, by using the communication unit 603, a scenario data packet from a running target application, where the scenario data packet includes performance improvement of an execution scenario generated by the target application. a policy; and configured to control the operating system to parse the scenario data packet to obtain the performance promotion policy; and to control the operating system to adjust an allocation of system resources of the target application according to the performance promotion policy.
  • the processing unit 602 controls the operating system to receive the scenario data packet from the running target application through the communication unit 603, and is further configured to: control the operating system to pass the communication
  • the unit 603 receives a connection request from the target application, the connection request includes an application identifier of the target application, and controls the operating system to use the application identifier as a query identifier, and the query is for the multiple a permission table of the application; and for controlling when the permission table includes an application identifier of the target application, the operating system allocates a data transmission interface to the target application, and the data transmission interface is used for the Data is transmitted between the target application and the operating system, the data including at least the scene data packet.
  • the performance improvement policy includes a system resource to be adjusted and an adjustment amount of the system resource to be adjusted, where the operating system adjusts the target application according to the performance improvement policy.
  • the processing unit 602 is specifically configured to: control the operating system to adjust an allocation of the system resource to be adjusted of the target application according to the adjustment amount of the system resource to be adjusted.
  • the performance improvement policy includes a preset duration
  • the processing unit 602 controls the operating system to adjust the allocation of system resources of the target application according to the performance promotion policy, and is further configured to: Controlling the operating system to adjust the allocation of system resources of the target application according to the performance improvement policy when detecting that the adjustment duration according to the performance improvement policy is greater than or equal to the preset duration.
  • the processing unit 602 is specifically configured to: determine that the running scenario is not ended, and cancel according to the performance of adjusting the allocation of system resources of the target application according to the performance improvement policy.
  • the performance improvement policy adjusts allocation of system resources of the target application.
  • the processing unit 602 is further configured to: control the operating system to pass the data transmission.
  • the interface receives an indication message from the target application, the indication message is used to instruct the operating system to cancel the allocation of system resources of the target application according to the performance promotion policy; and to control the operating system And adjusting the allocation of system resources of the target application according to the performance promotion policy according to the indication message.
  • the processing unit 602 is configured to control a target application to determine an operation scenario; and a performance promotion policy for controlling the target application to acquire the running scenario; and to control the target application to pass the communication unit 603 Sending a scenario data packet to the operating system, where the scenario data packet includes the performance improvement policy, where the scenario data packet is used by the operating system to adjust allocation of system resources of the target application according to the performance improvement policy .
  • the processing unit 602 before the processing unit 602 controls the target application to send the scenario data packet to the operating system, the processing unit 602 is further configured to: control the target application to pass the communication unit 603 to the operating system.
  • Sending a connection request where the connection request includes an application identifier of the target application, the application identifier is used by the operating system to query the application identifier as a query identifier, and query a permission table for the multiple applications, and
  • the permission table includes an application identifier of the target application
  • the operating system allocates a data transmission interface to the target application, and the data transmission interface is used between the target application and the operating system Transmitting data, the data including at least the scene data packet.
  • the processing unit 602 controls the target application to send the scenario data packet to the operating system
  • the processing unit 602 is further configured to: control the target application to use the data transmission interface to the operating system. Sending an indication message, the indication message is used by the operating system to cancel, according to the indication message, adjusting an allocation of system resources of the target application according to the performance promotion policy.
  • the processing unit 602 may be a processor or a controller
  • the communication unit 603 may be an internal communication interface between the processor and the program running space, such as a communication interface between the processor and the operating system space, or a communication between the processor and the user space.
  • the interface or the like, the storage unit 601 may be a memory.
  • FIG. 7 is a schematic structural diagram of a smart phone 700.
  • the smart phone 700 includes a housing 710, a touch display screen 720, a main board 730, a battery 740, and a sub board 750.
  • the front camera 731, the processor 732, the memory 733, the power management chip 734, and the like are disposed on the 730.
  • the sub-board is provided with a vibrator 751, an integrated sound chamber 752, a VOOC flash charging interface 753, and a fingerprint recognition module 754.
  • the smart phone includes a target application and an operating system, the target application runs in a user space, and the operating system runs in an operating system space.
  • the operating system receives a scenario data packet from a running target application, the scenario data packet includes a performance improvement policy of the running scenario generated by the target application; and the operating system parses the scenario data packet to obtain the performance promotion policy; The operating system adjusts the allocation of system resources of the target application according to the performance improvement policy.
  • the target application determines a running scenario; the target application obtains a performance improvement policy of the running scenario; the target application sends a scenario data packet to the operating system, where the scenario data packet includes the performance improvement policy, and the scenario The data packet is used by the operating system to adjust allocation of system resources of the target application according to the performance improvement policy.
  • the processor 732 is a control center of the smartphone that connects various parts of the entire smartphone using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 733, and calling the memory stored in the memory 733. Data, perform various functions of the smartphone and process data to monitor the smartphone as a whole.
  • the processor 732 may include one or more processing units; preferably, the processor 732 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 732.
  • the processor 732 can be, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), and field programmable. Field Programmable Gate Array (FPGA) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the above processors may also be a combination of computing functions, such as one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like.
  • the above-described memory 733 can be used to store software programs and modules, and the processor 732 executes various functional applications and data processing of the smartphone by running software programs and modules stored in the memory 733.
  • the memory 733 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function, and the like; the storage data area may store data created according to usage of the smartphone, and the like.
  • the memory 733 may include a high speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the memory 733 can be, for example, a random access memory (RAM), a flash memory, a read only memory (ROM), an erasable programmable read only memory (EPROM), and an electrically erasable memory.
  • RAM random access memory
  • ROM read only memory
  • EPROM erasable programmable read only memory
  • EEPROM Electrically erasable memory.
  • registers hard disk, removable hard disk, compact disk read only (CD-ROM) or any other form of storage medium known in the art.
  • the embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, the computer program causing the computer to perform some or all of the steps of any of the methods described in the foregoing method embodiments.
  • the above computer includes a mobile terminal.
  • the embodiment of the present application further provides a computer program product, where the computer program product comprises a non-transitory computer readable storage medium storing a computer program, the computer program being operative to cause the computer to execute any one of the methods described in the foregoing method embodiments. Part or all of the steps of the method.
  • the computer program product can be a software installation package, and the computer includes a mobile terminal.
  • the disclosed apparatus may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the above units is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
  • the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the above-described integrated unit can be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a memory. A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-described methods of various embodiments of the present application.
  • the foregoing memory includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like, which can store program codes.
  • ROM Read-Only Memory
  • RAM Random Access Memory

Abstract

本申请实施例公开了一种资源配置方法及相关产品。方法包括:移动终端的操作系统接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;操作系统解析所述场景数据包获取所述性能提升策略;操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。本申请实施例有利于提升移动终端中操作系统的处理速度,以及提高移动终端控制目标应用程序进行性能优化的实时性。

Description

资源配置方法及相关产品 技术领域
本申请涉及移动终端技术领域,具体涉及资源配置方法及相关产品。
背景技术
随着智能手机相关技术的快速发展,越来越多的应用被安装在用户手机中,如阅读类应用、支付类应用、游戏类应用、音乐类应用等,人们的衣食住行已经与手机密不可分。
目前,随着人们对各个应用的性能需求越来越高,例如应用的运行速度,应用的画面清晰度等,致使各个应用为了满足人们的需求对手机的要求也就越来越高。
发明内容
本申请实施例提供了资源配置方法及相关产品,可以提升移动终端中操作系统的处理速度,以及提高移动终端控制目标应用程序进行性能优化的实时性。
第一方面,本申请实施例提供一种资源配置方法,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述方法包括:
所述操作系统接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;
所述操作系统解析所述场景数据包获取所述性能提升策略;
所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
第二方面,本申请实施例提供一种资源配置方法,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述方法包括:
目标应用程序确定运行场景;
所述目标应用程序获取所述运行场景的性能提升策略;
所述目标应用程序向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
第三方面,本申请实施例提供一种资源配置装置,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述资源配置装置包括处理单元和通信单元,
所述处理单元,用于控制所述操作系统通过所述通信单元接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;以及用于控制所述操作系统解析所述场景数据包获取所述性能提升策略;以及用于控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
第四方面,本申请实施例提供一种资源配置装置,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述资源配置装置包括处理单元和通信单元,
所述处理单元,用于控制目标应用程序确定运行场景;以及用于控制所述目标应用程序获取所述运行场景的性能提升策略;以及用于控制所述目标应用程序通过所述通信单元向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
第五方面,本申请实施例提供一种移动终端,包括处理器、存储器、通信接口以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行本申请实施例第一方面和/或第二方面中任一方法中的步 骤的指令。
第六方面,本申请实施例提供了一种计算机可读存储介质,其中,上述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,上述计算机程序使得计算机执行如本申请实施例第一方面和/或第二方面中任一方法中所描述的部分或全部步骤,上述计算机包括移动终端。
第七方面,本申请实施例提供了一种计算机程序产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面和/或第二方面中任一方法中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包,上述计算机包括移动终端。
附图说明
下面将对本申请实施例所涉及到的附图作简单地介绍。
图1A是一种程序运行空间的系统架构示意图;
图1B是一种安卓系统的系统架构示意图;
图2是本申请实施例提供的一种资源配置方法的流程示意图;
图3是本申请实施例公开的一种资源配置方法的流程示意图;
图4是本申请实施例公开的一种资源配置方法的流程示意图;
图5是本申请实施例公开的一种移动终端的结构示意图;
图6是本申请实施例公开的一种移动终端的功能单元组成框图;
图7是本申请实施例公开的一种智能手机的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
本申请实施例所涉及到的移动终端可以包括各种具有无线通信功能的手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(User Equipment,UE),移动台(Mobile Station,MS),终端设备(terminal device)等等。为方便描述,上面提到的设备统称为移动终端。本发明实施例所涉及到的操作系统是对硬件资源进行统一管理,并向用户提供业务接口的软件系统。
如图1A所示,目前智能手机等移动终端一般设置有程序运行空间,该程序运行空间包括用户空间和操作系统空间,其中,用户空间运行有一个或多个应用程序,该一个或多个应用程序为移动终端安装的第三方应用程序,操作系统空间运行有移动终端的操作系统。 该移动终端具体可以运行安卓Android系统、苹果公司开发的移动操作系统iOS等,此处不做唯一限定。如图1B所示,以上述移动终端运行有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内核层用于实现硬件设备驱动,进程和内存管理,网络协议栈,电源管理,无线通信等核心功能。
上述第三方应用程序所创建的进程一开始是运行在用户空间的,当它要执行网络发送数据、读取磁盘资源等动作时,必须通过调用write、send等由操作系统提供的标准接口函数来完成,即由CPU调用操作系统空间的代码来完成用户的请求操作。可见,第三方应用程序想要调用操作系统提供的功能,只能调用其提供的标准接口函数。同时,操作系统不知道第三方应用程序具体在执行哪些功能,目标应用程序也不能命令操作系统执行特殊的操作,这两者是相互独立的,这使得操作系统无法区分目标应用程序的内部运行场景,只能使用一套标准的参数去适配,无法针对目标应用程序的内部运行场景进行针对性的性能优化,另外,在一些方案中,操作系统检测到正在运行某些重要应用时,会选择调节系统资源中的CPU、GPU、内存带宽等资源到最高状态,使得用户体验得到提升,但是由于CPU、GPU、内存带宽等一直运行于较高或最高状态,会造成较高的功率消耗和电量消耗。
针对上述情况,本申请实施例提出一种针对移动终端的目标应用程序的资源配置方法,该方法中,所述操作系统接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;所述操作系统解析所述场景数据包获取所述性能提升策略;所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。实现由操作系统针对目标应用程序在运行过程中的性能进行优化,有利于提高移动终端控制目标应用程序进行性能优化的实时性和精确度。
下面结合附图对本申请实施例进行介绍。
请参阅图2,图2是本申请实施例提供了一种资源配置方法的流程示意图,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,如图所示,本资源配置方法包括:
S201,所述操作系统接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略。
其中,目标应用程序是指安装在移动终端的用户空间的第三方应用程序,该第三方应用程序例如可以是即时通讯类应用、游戏类应用等,该第三方应用程序可以由用户安装,也可以由开发人员在移动终端出厂前预装,此处不做唯一限定。
其中,所述运行场景为所述目标应用程序当前运行的场景。
其中,运行场景可以按照不同预设条件进行划分,如第三方应用程序为即时通讯类应用时,可以按照对CPU资源的需求划分为启动场景、进入会话场景、退出会话场景等,可以按照对GPU资源的需求划分为查看图片场景,查看视频场景等,按照对各个系统资源的不同需求划分出不同的运行场景,有利于根据运行场景快速的确定出性能提升策略,此外, 该预设条件还可以关联不同的应用类型(例如,非即时通讯类应用程序),即不同应用类型的应用可以根据预设条件划分出相同或不同的内部运行场景,此处不做唯一限定。
其中,所述性能提升策略为所述目标应用场景根据当前的运行场景确定的策略,所述运行场景的性能提升策略用于提升当前运行场景的运行性能,可以包括待调整的系统资源,待调整的系统资源的调整量,或者还可以包括待调整的系统资源的调整时长。此外,场景数据包的格式例如可以是Java脚本对象标记(JavaScript Object Notation,JSON)、协议缓冲区(ProtocolBuffer,Protobuf)、自定义格式等数据传输格式,此处不做唯一限定。
在一个可能的示例中,所述操作系统接收来自正在运行的目标应用程序的场景数据包之前,所述方法还包括:
所述操作系统接收来自所述目标应用程序的连接请求,所述连接请求包括所述目标应用程序的应用标识;
所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表;
当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
其中,所述权限表为操作系统中预设的权限表,所述权限表由生产厂家预存在操作系统中,可以通过更新操作系统更新,所述权限表中包括允许与操作系统实现进程间通信的多个应用程序的应用标识。
其中,所述操作系统给所述目标应用程序分配了数据传输接口之后,所述操作系统与所述目标应用程序之间的通信方式可以是Socket端口通信传输、管道pipe通信、共享存储SharedMemory、共享文件等方式,在此不做唯一限定。
其中,所述数据传输接口为目标应用程序正在运行时,为目标应用程序与操作系统之间提供有效的数据传输链路,目标应用程序不再运行后,该数据传输链路会被清除,该数据传输接口会被禁用。
可见,本示例中,操作系统在接收来自所述目标应用程序的连接请求时,先确定所述目标应用程序的权限,然后给符合权限要求的目标应用程序分配数据传输接口,而不是盲目的分给任何应用程序数据传输接口,有利于避免数据传输的紊乱,以及保证数据传输的安全性。
S202,所述操作系统解析所述场景数据包获取所述性能提升策略。
其中,性能提升策略是指用于提高上述正在运行的目标应用程序的运行场景的运行性能的资源配置策略,如CPU资源调整策略、GPU资源调整策略、内存带宽资源调整策略、磁盘资源调整策略、网络资源调整策略等,此处不做唯一限定。
其中,性能提升策略可以是针对一个系统资源的调整策略,也可以是针对多个资源的调整策略,在此不做限定。
其中,所述场景数据包中包括数据格式标识,所述操作系统根据所述数据标识所指示的数据格式解析所述场景数据包获取所述性能提升策略。
S203,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
在一个可能的示例中,所述系统资源包括所述移动终端的以下资源中的至少一种:CPU资源、GPU资源、内存带宽资源、磁盘资源、网络资源。其中,网络资源包括移动终端的数据网络的网络资源、无线保真Wi-Fi网络的网络资源、蓝牙模块的控制参数资源等。
其中,在所述系统资源为CPU资源、GPU资源、内存带宽资源、磁盘资源中的至少一种时,操作系统可以通过直连通信方式与操作系统空间的内核层通信,调整该系统资源的 配置,直连通信方式是指通过抽象的应用程序编程接口(Application Programming Interface,API)直接通信。
其中,在所述系统资源为网络资源时,操作系统可以通过间接通信方式与操作系统空间的内核层通信,调整该系统资源的配置,间接通信方式是指通过调用代理服务来间接通信,如网络资源中的Wi-Fi子系统或者数据网络子系统与操作系统不运行在同一个系统内,需要通过一些代理的方式,间接访问这些系统资源,操作系统中提供了Wi-Fi的代理服务,通过调用该代理服务的接口来间接和Wi-Fi子系统通信。
可以看出,本申请实施例中,移动终端的操作系统首先接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略,其次,所述操作系统解析所述场景数据包获取所述性能提升策略,最后,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。由于场景数据包包括目标应用程序的运行场景的性能提升策略,且场景数据包由正在运行的目标应用程序发送,操作系统能够直接获取目标应用程序当前运行场景的性能提升策略,有利于提升移动终端中操作系统的处理速度,操作系统按照该性能提升策略实时调整目标应用程序的系统资源的配置,实现了由操作系统对目标应用程序在运行过程中进行实时的性能优化,有利于提高移动终端控制目标应用程序进行性能优化的实时性。
在一个可能的示例中所述性能提升策略包括待调整的系统资源和所述待调整的系统资源的调整量,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配,包括:
所述操作系统按照所述待调整的系统资源的调整量调整所述目标应用程序的待调整的系统资源的分配。
其中,所述调整量可以为根据系统资源的待调整等级确定的,所述调整等级的划分可以按照系统资源的总量均等的划分为多个等级,或者不均等的划分为多个等级等,在此不作限定。
可见,本示例中,操作系统根据性能提升策略直接获取待调整的系统资源和待调整的系统资源的调整量,而不需要根据目标应用程序提供的场景数据包间接确定,有利于降低系统功能消耗,提升操作系统调整系统资源分配的速度。
在一个可能的示例中,所述性能提升策略包括预设时长,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配之后,所述方法还包括:
所述操作系统当检测到按照所述性能提升策略的调整时长大于或等于所述预设时长时,取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
其中,所述预设时长为所述待调整的系统资源的调整时长。
其中,所述预设时长关联运行场景,不同的运行场景预设不同的系统资源调整时长。
其中,所述取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配为中断对所述数据传输接口的权限,恢复按照所述性能提升策略调整之前的所述目标应用程序的系统资源的分配。
可见,本示例中,所述操作系统当检测到调整时长大于或等于所述预设时长时,主动取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配,而不是让目标应用程序一直占用较多的系统资源,有利于降低移动终端的功率消耗和电量消耗。
在一个可能的示例中,所述操作系统取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配,包括:所述操作系统判断出所述运行场景未结束,取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
在一个可能的示例中,所述操作系统按照所述性能提升策略调整所述目标应用程序的 系统资源的分配之后,所述方法还包括:
所述操作系统通过所述数据传输接口接收来自所述目标应用程序的指示消息,所述指示消息用于指示所述操作系统取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配;
所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
其中,所述指示消息为所述目标应用程序当检测到所述运行场景结束时,即检测到用户操作退出当前运行场景时,发送给所述操作系统的指示消息,所述指示消息用于所述操作系统取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
可见,本示例中,操作系统根据目标应用程序发送的指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配,有利于提升中断时间的准确性,而不是让目标应用程序一直占用较多的系统资源,有利于降低移动终端的功率消耗和电量消耗。
与上述图2所示的实施例一致的,请参阅图3,图3是本申请实施例提供的一种资源配置方法的流程示意图,应用于移动终端,所述移动终端上运行有操作系统和一个或多个应用程序。如图所示,本资源配置方法包括:
S301,所述操作系统接收来自目标应用程序的连接请求,所述连接请求包括所述目标应用程序的应用标识。
S302,所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表。
S303,当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口。
S304,所述操作系统通过所述数据传输接口接收来自正在运行的目标应用程序的场景数据包。
S305,所述操作系统解析所述场景数据包获取所述性能提升策略。
S306,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
S307,所述操作系统通过所述数据传输接口接收来自所述目标应用程序的指示消息。
S308,所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
可以看出,本申请实施例中,移动终端的操作系统首先接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略,其次,所述操作系统解析所述场景数据包获取所述性能提升策略,最后,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。由于场景数据包包括目标应用程序的运行场景的性能提升策略,且场景数据包由正在运行的目标应用程序发送,操作系统能够直接获取目标应用程序当前运行场景的性能提升策略,有利于提升移动终端中操作系统的处理速度,操作系统按照该性能提升策略实时调整目标应用程序的系统资源的配置,实现了由操作系统对目标应用程序在运行过程中进行实时的性能优化,有利于提高移动终端控制目标应用程序进行性能优化的实时性。
此外,操作系统在接收来自所述目标应用程序的连接请求时,先确定所述目标应用程序的权限,然后给符合权限要求的目标应用程序分配数据传输接口,而不是盲目的分给任何应用程序数据传输接口,有利于避免数据传输的紊乱,以及保证数据传输的安全性。
此外,操作系统根据目标应用程序发送的指示消息取消按照所述性能提升策略调整所 述目标应用程序的系统资源的分配,有利于提升中断时间的准确性,而不是让目标应用程序一直占用较多的系统资源,有利于降低移动终端的功率消耗和电量消耗。
请参阅图4,图4是本申请实施例提供的一种资源配置方法的流程示意图,应用于移动终端,所述移动终端上运行有操作系统和一个或多个应用程序。如图所示,本资源配置方法包括:
S401,目标应用程序确定运行场景。
其中,所述目标应用程序确定运行场景的具体实现方式可以是:当检测到用户的操作请求时,根据所述操作请求查询所述目标应用程序中存储的多个运行场景,确定所述操作请求对应的运行场景。
其中,目标应用程序是指安装在移动终端的用户空间的第三方应用程序,该第三方应用程序例如可以是即时通讯类应用、游戏类应用等,该第三方应用程序可以由用户安装,也可以由开发人员在移动终端出厂前预装,此处不做唯一限定。
其中,运行场景可以按照不同预设条件进行划分并存储在目标应用程序中,如第三方应用程序为即时通讯类应用时,可以按照对CPU资源的需求划分为启动场景、进入会话场景、退出会话场景等,可以按照对GPU资源的需求划分为查看图片场景,查看视频场景等,按照对各个系统资源的不同需求划分出不同的运行场景,有利于根据运行场景快速的确定出性能提升策略,此外,该预设条件还可以关联不同的应用类型(例如,非即时通讯类应用程序),即不同应用类型的应用可以根据预设条件划分出相同或不同的内部运行场景,此处不做唯一限定。
S402,所述目标应用程序获取所述运行场景的性能提升策略。
其中,性能提升策略是指用于提高上述正在运行的目标应用程序的运行场景的运行性能的资源配置策略,如CPU资源调整策略、GPU资源调整策略、内存带宽资源调整策略、磁盘资源调整策略、网络资源调整策略等,此处不做唯一限定,此外,性能提升策略可以包括待调整的系统资源,待调整的系统资源的调整量,或者还可以包括待调整的系统资源的调整时长。
其中,所述目标应用程序预存多个运行场景与性能提升策略的映射关系,所述映射关系可以为所述目标应用程序出厂时由开发人员根据测试结果设置的。
S403,所述目标应用程序向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略。
其中,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
可以看出,本申请实施例中,移动终端的目标应用程序确定运行场景,其次,所述目标应用程序获取所述运行场景的性能提升策略,最后,所述目标应用程序向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。由于场景数据包包括目标应用程序的运行场景的性能提升策略,且场景数据包由正在运行的目标应用程序发送,操作系统能够直接获取目标应用程序当前运行场景的性能提升策略,有利于提升移动终端中操作系统的处理速度,操作系统按照该性能提升策略实时调整目标应用程序的系统资源的配置,实现了由操作系统对目标应用程序在运行过程中进行实时的性能优化,有利于提高移动终端控制目标应用程序进行性能优化的实时性。
在一个可能的示例中,所述目标应用程序向所述操作系统发送场景数据包之前,所述方法还包括:
所述目标应用程序向所述操作系统发送连接请求,所述连接请求包括所述目标应用程序的应用标识,所述应用标识用于所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表,且当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
可见,本示例中,所述目标应用程序向所述操作系统发送连接请求,请求操作系统分配数据传输接口,操作系统确定目标应用程序的权限后给符合权限要求的目标应用程序分配数据传输接口,而不是盲目的分给任何应用程序数据传输接口,有利于避免数据传输的紊乱,以及保证数据传输的安全性。
在一个可能的示例中,所述目标应用程序向所述操作系统发送场景数据包之后,所述方法还包括:
所述目标应用程序通过所述数据传输接口向所述操作系统发送指示消息,所述指示消息用于所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
可见,本示例中,目标应用程序在检测运行场景结束时发送指示消息给操作系统,指示操作系统取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配,有利于提升中断时间的准确性,而不是让目标应用程序一直占用较多的系统资源,有利于降低移动终端的功率消耗和电量消耗。
与上述图2、图3或图4所示的实施例一致的,请参阅图5,图5是本申请实施例提供的一种移动终端的结构示意图,该移动终端运行有一个或多个应用程序和操作系统,如图所示,该移动终端包括处理器、存储器、通信接口以及一个或多个程序,其中,上述一个或多个程序不同于上述一个或多个应用程序,且上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行以下步骤的指令;
控制所述操作系统接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;
控制所述操作系统解析所述场景数据包获取所述性能提升策略;
控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
可以看出,本申请实施例中,移动终端的操作系统首先接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略,其次,所述操作系统解析所述场景数据包获取所述性能提升策略,最后,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。由于场景数据包包括目标应用程序的运行场景的性能提升策略,且场景数据包由正在运行的目标应用程序发送,操作系统能够直接获取目标应用程序当前运行场景的性能提升策略,有利于提升移动终端中操作系统的处理速度,操作系统按照该性能提升策略实时调整目标应用程序的系统资源的配置,实现了由操作系统对目标应用程序在运行过程中进行实时的性能优化,有利于提高移动终端控制目标应用程序进行性能优化的实时性。
在一个可能的示例中,上述程序还包括用于执行以下步骤的指令:所述控制所述操作系统接收来自正在运行的目标应用程序的场景数据包之前,控制所述操作系统接收来自所述目标应用程序的连接请求,所述连接请求包括所述目标应用程序的应用标识;以及控制所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表;以及控制当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数 据,所述数据至少包括所述场景数据包。
在一个可能的示例中,所述性能提升策略包括待调整的系统资源和所述待调整的系统资源的调整量,在所述控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配方面,所述程序中的指令具体用于执行以下操作:控制所述操作系统按照所述待调整的系统资源的调整量调整所述目标应用程序的待调整的系统资源的分配。
在一个可能的示例中,所述性能提升策略包括预设时长,上述程序还包括用于执行以下步骤的指令:所述控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配之后,控制所述操作系统当检测到按照所述性能提升策略的调整时长大于或等于所述预设时长时,取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
在一个可能的示例中,在所述取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配方面,所述程序中的指令具体用于执行以下操作:判断出所述运行场景未结束,取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
在一个可能的示例中,上述程序还包括用于执行以下步骤的指令:所述控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配之后,控制所述操作系统通过所述数据传输接口接收来自所述目标应用程序的指示消息,所述指示消息用于指示所述操作系统取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配;以及控制所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
或者,上述程序包括用于执行以下步骤的指令;
控制目标应用程序确定运行场景;
控制所述目标应用程序获取所述运行场景的性能提升策略;
控制所述目标应用程序向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
可以看出,本申请实施例中,移动终端的目标应用程序确定运行场景,其次,所述目标应用程序获取所述运行场景的性能提升策略,最后,所述目标应用程序向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。由于场景数据包包括目标应用程序的运行场景的性能提升策略,且场景数据包由正在运行的目标应用程序发送,操作系统能够直接获取目标应用程序当前运行场景的性能提升策略,有利于提升移动终端中操作系统的处理速度,操作系统按照该性能提升策略实时调整目标应用程序的系统资源的配置,实现了由操作系统对目标应用程序在运行过程中进行实时的性能优化,有利于提高移动终端控制目标应用程序进行性能优化的实时性。
在一个可能的示例中,上述程序还包括用于执行以下步骤的指令:所述控制所述目标应用程序向所述操作系统发送场景数据包之前,控制所述目标应用程序向所述操作系统发送连接请求,所述连接请求包括所述目标应用程序的应用标识,所述应用标识用于所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表,且当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
在一个可能的示例中,上述程序还包括用于执行以下步骤的指令:所述控制所述目标应用程序向所述操作系统发送场景数据包之后,控制所述目标应用程序通过所述数据传输 接口向所述操作系统发送指示消息,所述指示消息用于所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
上述主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,移动终端为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对移动终端进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用集成的单元的情况下,图6示出了上述实施例中所涉及的资源配置装置的一种可能的功能单元组成框图。资源配置装置600应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述资源配置装置600包括:处理单元602和通信单元603。处理单元602用于对资源配置装置的动作进行控制管理,例如,处理单元602用于支持资源配置装置执行图2中的步骤S201-S203、图3中的步骤S301-S308,或用于支持资源配置装置执行图4中的步骤S401-S403和/或用于本文所描述的技术的其它过程。资源配置装置还可以包括存储单元601,用于存储程序代码和数据。
所述处理单元602,用于控制所述操作系统通过所述通信单元603接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;以及用于控制所述操作系统解析所述场景数据包获取所述性能提升策略;以及用于控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
在一个可能的示例中,所述处理单元602控制所述操作系统通过所述通信单元603接收来自正在运行的目标应用程序的场景数据包之前,还用于:控制所述操作系统通过所述通信单元603接收来自所述目标应用程序的连接请求,所述连接请求包括所述目标应用程序的应用标识;以及用于控制所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表;以及用于控制当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
在一个可能的示例中,所述性能提升策略包括待调整的系统资源和所述待调整的系统资源的调整量,在所述控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配方面,所述处理单元602具体用于:控制所述操作系统按照所述待调整的系统资源的调整量调整所述目标应用程序的待调整的系统资源的分配。
在一个可能的示例中,所述性能提升策略包括预设时长,所述处理单元602控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配之后,还用于:控制所述操作系统当检测到按照所述性能提升策略的调整时长大于或等于所述预设时长时,取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
在一个可能的示例中,在所述取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配方面,所述处理单元602具体用于:判断出所述运行场景未结束,取消按照所 述性能提升策略调整所述目标应用程序的系统资源的分配。
在一个可能的示例中,所述处理单元602控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配之后,还用于:控制所述操作系统通过所述数据传输接口接收来自所述目标应用程序的指示消息,所述指示消息用于指示所述操作系统取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配;以及用于控制所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
或者,
所述处理单元602,用于控制目标应用程序确定运行场景;以及用于控制所述目标应用程序获取所述运行场景的性能提升策略;以及用于控制所述目标应用程序通过所述通信单元603向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
在一个可能的示例中,所述处理单元602控制所述目标应用程序向所述操作系统发送场景数据包之前,还用于:控制所述目标应用程序向所述操作系统通过所述通信单元603发送连接请求,所述连接请求包括所述目标应用程序的应用标识,所述应用标识用于所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表,且当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
在一个可能的示例中,所述处理单元602控制所述目标应用程序向所述操作系统发送场景数据包之后,还用于:控制所述目标应用程序通过所述数据传输接口向所述操作系统发送指示消息,所述指示消息用于所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
其中,处理单元602可以是处理器或控制器,通信单元603可以是处理器和程序运行空间之间的内部通信接口,如处理器与操作系统空间的通信接口,或者处理器与用户空间的通信接口等,存储单元601可以是存储器。
请参阅图7,图7是本申请实施例提供了一种智能手机700的结构示意图,上述智能手机700包括:壳体710、触控显示屏720、主板730、电池740和副板750,主板730上设置有前置摄像头731、处理器732、存储器733、电源管理芯片734等,副板上设置有振子751、一体音腔752、VOOC闪充接口753和指纹识别模组754。
其中,该智能手机包括目标应用程序和操作系统,目标应用程序运行于用户空间,操作系统运行于操作系统空间。操作系统接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;操作系统解析所述场景数据包获取所述性能提升策略;操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
其中,目标应用程序确定运行场景;目标应用程序获取所述运行场景的性能提升策略;目标应用程序向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
上述处理器732是智能手机的控制中心,利用各种接口和线路连接整个智能手机的各个部分,通过运行或执行存储在存储器733内的软件程序和/或模块,以及调用存储在存储器733内的数据,执行智能手机的各种功能和处理数据,从而对智能手机进行整体监控。可 选的,处理器732可包括一个或多个处理单元;优选的,处理器732可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器732中。该处理器732例如可以是中央处理器(Central Processing Unit,CPU),通用处理器,数字信号处理器(Digital Signal Processor,DSP),专用集成电路(Application-Specific Integrated Circuit,ASIC),现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。上述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。
上述存储器733可用于存储软件程序以及模块,处理器732通过运行存储在存储器733的软件程序以及模块,从而执行智能手机的各种功能应用以及数据处理。存储器733可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据智能手机的使用所创建的数据等。此外,存储器733可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。该存储器733例如可以是随机存取存储器(Random Access Memory,RAM)、闪存、只读存储器(Read Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质。
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤,上述计算机包括移动终端。
本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤。该计算机程序产品可以为一个软件安装包,上述计算机包括移动终端。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各 个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上上述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种资源配置方法,其特征在于,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述方法包括:
    所述操作系统接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;
    所述操作系统解析所述场景数据包获取所述性能提升策略;
    所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  2. 根据权利要求1所述的方法,其特征在于,所述操作系统接收来自正在运行的目标应用程序的场景数据包之前,所述方法还包括:
    所述操作系统接收来自所述目标应用程序的连接请求,所述连接请求包括所述目标应用程序的应用标识;
    所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表;
    当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
  3. 根据权利要求1或2所述的方法,其特征在于,所述性能提升策略包括待调整的系统资源和所述待调整的系统资源的调整量,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配,包括:
    所述操作系统按照所述待调整的系统资源的调整量调整所述目标应用程序的待调整的系统资源的分配。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述性能提升策略包括预设时长,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配之后,所述方法还包括:
    所述操作系统当检测到按照所述性能提升策略的调整时长大于或等于所述预设时长时,取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  5. 根据权利要求4所述的方法,其特征在于,所述取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配,包括:
    所述操作系统判断出所述运行场景未结束,取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  6. 根据权利要求1-3任一项所述的方法,其特征在于,所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配之后,所述方法还包括:
    所述操作系统通过所述数据传输接口接收来自所述目标应用程序的指示消息,所述指示消息用于指示所述操作系统取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配;
    所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述系统资源包括所述移动终端的以下资源中的至少一种:CPU资源、GPU资源、内存带宽资源、磁盘资源、网络资源。
  8. 根据权利要求7所述的方法,其特征在于,在所述系统资源为CPU资源、GPU资源、内存带宽资源、磁盘资源中的至少一种时,所述操作系统通过直连通信方式与核层通信以调整所述系统资源的配置,所述直连通信方式是指通过抽象的应用程序编程接口API直接通信。
  9. 根据权利要求7所述的方法,其特征在于,在所述系统资源为网络资源时,所述操 作系统可以通过间接通信方式与内核层通信以调整所述系统资源的配置,所述间接通信方式是指通过调用代理服务来间接通信。
  10. 一种资源配置方法,其特征在于,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述方法包括:
    目标应用程序确定运行场景;
    所述目标应用程序获取所述运行场景的性能提升策略;
    所述目标应用程序向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  11. 根据权利要求10所述的方法,其特征在于,所述目标应用程序向所述操作系统发送场景数据包之前,所述方法还包括:
    所述目标应用程序向所述操作系统发送连接请求,所述连接请求包括所述目标应用程序的应用标识,所述应用标识用于所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表,且当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
  12. 根据权利要求10或11所述的方法,其特征在于,所述目标应用程序向所述操作系统发送场景数据包之后,所述方法还包括:
    所述目标应用程序通过所述数据传输接口向所述操作系统发送指示消息,所述指示消息用于所述操作系统根据所述指示消息取消按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  13. 一种资源配置装置,其特征在于,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述资源配置装置包括处理单元和通信单元,
    所述处理单元,用于控制所述操作系统通过所述通信单元接收来自正在运行的目标应用程序的场景数据包,所述场景数据包包括所述目标应用程序生成的运行场景的性能提升策略;以及用于控制所述操作系统解析所述场景数据包获取所述性能提升策略;以及用于控制所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  14. 根据权利要求13所述的装置,其特征在于,所述处理单元控制所述操作系统通过所述通信单元接收来自正在运行的目标应用程序的场景数据包之前,还用于:接收来自所述目标应用程序的连接请求,所述连接请求包括所述目标应用程序的应用标识;以及以所述应用标识为查询标识,查询针对所述多个应用程序的权限表;以及当所述权限表包括所述目标应用程序的应用标识时,为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
  15. 根据权利要求13或14所述的装置,其特征在于,所述性能提升策略包括待调整的系统资源和所述待调整的系统资源的调整量,在所述按照所述性能提升策略调整所述目标应用程序的系统资源的分配方面,所述处理单元具体用于:按照所述待调整的系统资源的调整量调整所述目标应用程序的待调整的系统资源的分配。
  16. 根据权利要求13-15任一项所述的装置,其特征在于,所述性能提升策略包括预设时长,所述处理单元按照所述性能提升策略调整所述目标应用程序的系统资源的分配之后,还用于:当检测到按照所述性能提升策略的调整时长大于或等于所述预设时长时,取消按 照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  17. 一种资源配置装置,其特征在于,应用于移动终端,所述移动终端上运行有操作系统以及一个或多个应用程序,所述资源配置装置包括处理单元和通信单元,
    所述处理单元,用于控制目标应用程序确定运行场景;以及用于控制所述目标应用程序获取所述运行场景的性能提升策略;以及用于控制所述目标应用程序通过所述通信单元向所述操作系统发送场景数据包,所述场景数据包包括所述性能提升策略,所述场景数据包用于所述操作系统按照所述性能提升策略调整所述目标应用程序的系统资源的分配。
  18. 根据权利要求17所述的装置,其特征在于,所述处理单元控制所述目标应用程序通过所述通信单元向所述操作系统发送场景数据包,还用于:控制目标应用程序向所述操作系统发送连接请求,所述连接请求包括所述目标应用程序的应用标识,所述应用标识用于所述操作系统以所述应用标识为查询标识,查询针对所述多个应用程序的权限表,且当所述权限表包括所述目标应用程序的应用标识时,所述操作系统为所述目标应用程序分配数据传输接口,所述数据传输接口用于所述目标应用程序和所述操作系统之间传输数据,所述数据至少包括所述场景数据包。
  19. 一种移动终端,其特征在于,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行权利要求1-9和/或10-12中任一项方法中的步骤的指令。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-9和/或10-12中任一项所述的方法,所述计算机包括移动终端。
PCT/CN2018/101183 2017-08-31 2018-08-17 资源配置方法及相关产品 WO2019042172A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710771658.6 2017-08-31
CN201710771658.6A CN107577532B (zh) 2017-08-31 2017-08-31 资源配置方法及相关产品

Publications (1)

Publication Number Publication Date
WO2019042172A1 true WO2019042172A1 (zh) 2019-03-07

Family

ID=61030789

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/101183 WO2019042172A1 (zh) 2017-08-31 2018-08-17 资源配置方法及相关产品

Country Status (2)

Country Link
CN (1) CN107577532B (zh)
WO (1) WO2019042172A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577532B (zh) * 2017-08-31 2019-10-29 Oppo广东移动通信有限公司 资源配置方法及相关产品
CN111240837B (zh) * 2018-03-13 2023-12-26 Oppo广东移动通信有限公司 资源配置方法、装置、终端及存储介质
EP3779690A4 (en) 2018-04-20 2021-05-12 Guangdong Oppo Mobile Telecommunications Corp., Ltd. PROCESSOR CORE PLANNING METHOD AND DEVICE, TERMINAL DEVICE AND STORAGE MEDIUM

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106117A (zh) * 2012-12-25 2013-05-15 青岛海信电器股份有限公司 一种资源分配方法及电子设备
CN103294555A (zh) * 2012-03-05 2013-09-11 联想(北京)有限公司 一种获得硬件资源的方法及电子设备
CN106095592A (zh) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 一种前景应用程序场景同步方法及装置、系统
CN107577532A (zh) * 2017-08-31 2018-01-12 广东欧珀移动通信有限公司 资源配置方法及相关产品

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0346039A2 (en) * 1988-06-06 1989-12-13 Demax Software, Inc Dynamic load balancing for multi-user computers
US8875148B2 (en) * 2011-06-14 2014-10-28 International Business Machines Corporation Product-specific system resource allocation within a single operating system instance
CN102932383B (zh) * 2011-08-08 2015-07-29 联想(北京)有限公司 一种数据传输方法、终端及终端系统
US8832249B2 (en) * 2011-11-30 2014-09-09 At&T Intellectual Property I, L.P. Methods and apparatus to adjust resource allocation in a distributive computing network
JP5845351B2 (ja) * 2012-07-06 2016-01-20 ▲華▼▲為▼終端有限公司Huawei Device Co., Ltd. リソース割当方法及び装置
US9753766B2 (en) * 2014-11-25 2017-09-05 Raytheon Company Apparatus and method for allocating resources using prioritization of requests and updating of requests
CN106961677A (zh) * 2016-01-11 2017-07-18 中国移动通信集团公司 一种管理方法及服务器、终端
CN105843679B (zh) * 2016-03-18 2018-11-02 西北工业大学 自适应众核资源调度方法
CN106020990B (zh) * 2016-06-30 2020-01-10 宇龙计算机通信科技(深圳)有限公司 一种中央处理器的控制方法及终端设备
CN106201551A (zh) * 2016-07-22 2016-12-07 宇龙计算机通信科技(深圳)有限公司 一种应用程序退出方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294555A (zh) * 2012-03-05 2013-09-11 联想(北京)有限公司 一种获得硬件资源的方法及电子设备
CN103106117A (zh) * 2012-12-25 2013-05-15 青岛海信电器股份有限公司 一种资源分配方法及电子设备
CN106095592A (zh) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 一种前景应用程序场景同步方法及装置、系统
CN107577532A (zh) * 2017-08-31 2018-01-12 广东欧珀移动通信有限公司 资源配置方法及相关产品

Also Published As

Publication number Publication date
CN107577532A (zh) 2018-01-12
CN107577532B (zh) 2019-10-29

Similar Documents

Publication Publication Date Title
WO2019042171A1 (zh) 资源配置方法及相关产品
WO2019047709A1 (zh) 资源配置方法及相关产品
US10824470B2 (en) Method for resource allocation and terminal device
CN107528976B (zh) 资源配置方法及相关产品
WO2019042294A1 (zh) 资源配置方法及相关产品
US11151010B2 (en) Resource configuration method, mobile terminal and storage medium
CN107861814B (zh) 资源配置方法及设备
CN107577533B (zh) 资源配置方法及相关产品
CN107479970B (zh) 资源配置方法及相关产品
WO2019042180A1 (zh) 资源配置方法及相关产品
US10936371B2 (en) Method for resource allocation and related products
CN107450988B (zh) 资源配置方法及相关产品
WO2019109868A1 (zh) 资源配置方法及相关产品
CN107547745B (zh) 资源配置方法及相关产品
WO2019047708A1 (zh) 资源配置方法及相关产品
JP7100154B2 (ja) プロセッサコアのスケジューリング方法、装置、端末及び記憶媒体
WO2019072208A1 (zh) 应用程序运行控制方法及设备
CN107589977B (zh) 资源配置方法,资源配置装置,移动终端及介质
US11016812B2 (en) Method for resource allocation and terminal device
CN108536480B (zh) 输入法配置方法及相关产品
CN107517306B (zh) 资源配置方法及相关产品
WO2019042172A1 (zh) 资源配置方法及相关产品
WO2019072180A1 (zh) 应用程序的资源配置方法及设备
WO2019076213A1 (zh) 网络控制方法及设备
US11182210B2 (en) Method for resource allocation and terminal device

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: 18850690

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: 18850690

Country of ref document: EP

Kind code of ref document: A1