CN107528977B - Resource allocation method and related product - Google Patents

Resource allocation method and related product Download PDF

Info

Publication number
CN107528977B
CN107528977B CN201710775951.XA CN201710775951A CN107528977B CN 107528977 B CN107528977 B CN 107528977B CN 201710775951 A CN201710775951 A CN 201710775951A CN 107528977 B CN107528977 B CN 107528977B
Authority
CN
China
Prior art keywords
scene
operating system
application program
news application
adjusted
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.)
Expired - Fee Related
Application number
CN201710775951.XA
Other languages
Chinese (zh)
Other versions
CN107528977A (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 Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710775951.XA priority Critical patent/CN107528977B/en
Publication of CN107528977A publication Critical patent/CN107528977A/en
Application granted granted Critical
Publication of CN107528977B publication Critical patent/CN107528977B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • 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]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a resource allocation method and a related product. The method comprises the following steps: an operating system of a mobile terminal receives a scene data packet from a running news application program, wherein the scene data packet comprises a performance improvement strategy generated by the news application program according to a running scene; the operating system analyzes the scene data packet to obtain the performance improvement strategy; and the operating system adjusts the distribution of the system resources of the news application program according to the performance improvement strategy. The embodiment of the application is beneficial to improving the processing speed of the operating system in the mobile terminal and improving the real-time performance of the mobile terminal for controlling the news application program to perform performance optimization.

Description

Resource allocation method and related product
Technical Field
The present application relates to the field of mobile terminal technologies, and in particular, to a resource allocation method and a related product.
Background
With the rapid development of related technologies of smart phones, more and more applications are installed in user mobile phones, such as reading applications, payment applications, game applications, music applications, and the like, and people's clothes and eating habits are inseparable from mobile phones.
At present, with the increasing performance requirements of people on various applications, such as the running speed of the applications, the image definition of the applications, and the like, the requirements of various applications on mobile phones to meet the requirements of people are also increasing.
Disclosure of Invention
The embodiment of the application provides a resource allocation method and a related product, which can improve the processing speed of an operating system in a mobile terminal and improve the real-time performance of the mobile terminal for controlling news application programs to perform performance optimization.
In a first aspect, an embodiment of the present application provides a resource allocation method, 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:
the operating system receives a scene data packet from a running news application program, wherein the scene data packet comprises a performance improvement strategy generated by the news application program according to a running scene;
the operating system analyzes the scene data packet to obtain the performance improvement strategy;
and the operating system adjusts the distribution of the system resources of the news application program according to the performance improvement strategy.
In a second aspect, an embodiment of the present application provides a resource allocation method, 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:
determining an operation scene by a news application program;
the news application program acquires a performance improvement strategy of the running scene;
and the news application program sends a scene data packet to the operating system, wherein the scene data packet comprises the performance improvement strategy, and the scene data packet is used for the operating system to adjust the distribution of the system resources of the news application program according to the performance improvement strategy.
In a third aspect, an embodiment of the present application provides a resource allocation apparatus, which is applied to a mobile terminal, where an operating system and one or more application programs run on the mobile terminal, the resource allocation apparatus includes a processing unit and a communication unit,
the processing unit is used for controlling the operating system to receive a scene data packet from a running news application program through the communication unit, wherein the scene data packet comprises a performance improvement strategy generated by the news application program according to a running scene; and the system is used for controlling the operating system to analyze the scene data packet to acquire the performance improvement strategy; and the system resource allocation module is used for controlling the operating system to adjust the system resource allocation of the news application program according to the performance improvement strategy.
In a fourth aspect, the present application provides a resource allocation apparatus, which is applied to a mobile terminal, where an operating system and one or more application programs run on the mobile terminal, the resource allocation apparatus includes a processing unit and a communication unit,
the processing unit is used for controlling the news application program to determine an operation scene; the performance improvement strategy is used for controlling the news application program to acquire the running scene; and the system is used for controlling the news application program to send a scene data packet to the operating system through the communication unit, wherein the scene data packet comprises the performance improvement strategy, and the scene data packet is used for the operating system to adjust the distribution of the system resources of the news application program according to the performance improvement strategy.
In a fifth aspect, 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 memory and configured to be executed by the processor, and the program includes instructions for executing steps of any one of the methods in the first aspect and/or the second aspect of the embodiment of the present application.
In a sixth aspect, embodiments of the present application provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program enables a computer to perform some or all of the steps described in any of the methods in the first aspect and/or the second aspect of the embodiments of the present application, and the computer includes a mobile terminal.
In a seventh aspect, this application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in any one of the methods of the first and/or second aspects of this application. The computer program product may be a software installation package, the computer comprising a mobile terminal.
It can be seen that, in the embodiment of the present application, after determining an operation scene, a news application of a mobile terminal acquires a performance enhancement policy of the operation scene, and then sends a scene data packet including the performance enhancement policy to an operating system, and after receiving the scene data packet from the news application, the operating system analyzes the scene data packet to obtain the performance enhancement policy, and adjusts allocation of system resources of the news application according to the performance enhancement policy. The scene data packet comprises a performance improvement strategy of the operation scene of the news application program, and the scene data packet is sent by the running news application program, so that the operating system can directly obtain the performance improvement strategy of the current operation scene of the news application program, the processing speed of the operating system in the mobile terminal is favorably improved, the operating system adjusts the configuration of system resources of the news application program in real time according to the performance improvement strategy, the real-time performance optimization of the news application program in the operation process by the operating system is realized, and the real-time performance of the mobile terminal for controlling the news application program to perform performance optimization is favorably improved.
Drawings
Reference will now be made in brief to the accompanying drawings, to which embodiments of the present application relate.
FIG. 1A is a system architecture diagram of a program runtime space;
FIG. 1B is a system architecture diagram of an android system;
fig. 2 is a schematic flowchart of a resource allocation method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a resource allocation method according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a resource allocation method according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a mobile terminal disclosed in an embodiment of the present application;
fig. 6 is a block diagram illustrating functional units of a mobile terminal according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a smart phone disclosed in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
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 application. The appearances of the 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 explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The Mobile terminal according to the embodiment of the present application may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, and various forms of User Equipment (UE), Mobile Stations (MS), terminal devices (terminal device), and the like. For convenience of description, the above-mentioned devices are collectively referred to as a mobile terminal. The operating system related to the embodiment of the invention is a software system which performs unified management on hardware resources and provides a service interface for a user.
As shown in fig. 1A, a current mobile terminal such as a smart phone is generally provided with a program running space, where the program running space includes a user space and an operating system space, where the user space runs one or more application programs, the one or more application programs are third-party application programs installed on the mobile terminal, and the operating system space runs an operating system of the mobile terminal. The mobile terminal can specifically run an Android system, a mobile operating system iOS developed by apple Inc., and the like, and the mobile terminal is not limited herein. As shown in fig. 1B, for example that the mobile terminal runs the Android system, the corresponding user space includes Application layers (Applications) in the Android system, and the operating system space may include an Application Framework layer (Application Framework) in the Android system, a system Runtime library layer (including system Runtime Libraries and Android Runtime runtimes), and a Linux Kernel layer (Linux Kernel). The application layer comprises various application programs which are directly interacted with the user or service programs which are written by Java language and run in the background. For example, programs that implement common basic functions on smartphones, such as Short Messaging Service (SMS) SMS, phone dialing, picture viewer, calendar, games, maps, World Wide Web (Web) browser, and other applications developed by developers. The application framework layer provides a series of class libraries required by Android application development, can be used for reusing components, and can also realize personalized extension through inheritance. And the system operation library layer is a support of an application program framework and provides services for each component in the Android system. The system operation library layer is composed of a system class library and Android operation. The Android runtime comprises two parts, namely a core library and a Dalvik virtual machine. The Linux kernel layer is used for realizing core functions such as hardware device driving, process and memory management, a network protocol stack, power management, wireless communication and the like.
The process created by the third-party application program is initially run in the user space, and when it is to perform the actions of sending data through the network, reading disk resources and the like, it must be completed by calling the standard interface functions provided by the operating system, such as write, send and the like, that is, the CPU calls the code of the operating system space to complete the requested operation of the user. It can be seen that the third party application program wants to call the function provided by the operating system, and can only call the standard interface function provided by the third party application program. Meanwhile, the operating system does not know which functions the third-party application is specifically executing, the news application cannot command the operating system to execute special operations, and the two are independent from each other, so that the operating system cannot distinguish internal operating scenes of the news application, only one set of standard parameters can be used for adaptation, and targeted performance optimization cannot be performed on the internal operating scenes of the news application.
In view of the above situation, an embodiment of the present application provides a resource configuration method for a news application of a mobile terminal, where in the method, an operating system receives a scene data packet from a running news application, and the scene data packet includes a performance improvement policy generated by the news application according to a running scene; the operating system analyzes the scene data packet to obtain the performance improvement strategy; and the operating system adjusts the distribution of the system resources of the news application program according to the performance improvement strategy. The performance of the news application program in the running process is optimized by the operating system, and the real-time performance of the mobile terminal for controlling the news application program to optimize the performance is improved.
Embodiments of the present application will be described below with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a flowchart illustrating a resource allocation method according to an embodiment of the present application, which is applied to a mobile terminal, where the mobile terminal runs an operating system and one or more application programs, and as shown in the figure, the resource allocation method includes:
s201, the operating system receives a scene data packet from a running news application program, wherein the scene data packet comprises a performance improvement strategy generated by the news application program according to a running scene.
The news application program refers to a third-party application program installed in a user space of the mobile terminal, and the third-party application program can be installed by a user or can be pre-installed by a developer before the mobile terminal leaves a factory, and the third-party application program is not limited uniquely here.
Wherein the operation scene at least comprises any one of the following: list sliding scene, detail reading scene, news comment scene and video playing scene.
And the operation scene is a scene in which the news application program is currently operated. The operation scenes can be divided according to different preset conditions, for example, the operation scenes can be divided into a list sliding scene, a detail reading scene, a news comment scene and the like according to the requirements on CPU resources, the operation scenes can be divided into a video playing scene, a picture viewing scene and the like according to the requirements on GPU resources, different operation scenes can be divided according to different requirements on various system resources, a performance improvement strategy can be determined quickly according to the operation scenes, in addition, the preset conditions can be associated with different applications of news applications, the same or different operation scenes can be divided according to the preset conditions by the different applications, and the unique limitation is not made here.
The performance improvement policy is a policy determined by the news application according to a current operation scene, and the performance improvement policy of the operation scene is used for improving the operation performance of the current operation scene, where the performance improvement policy may include a system resource to be adjusted, an adjustment amount of the system resource to be adjusted, or may further include an adjustment duration of the system resource to be adjusted. The format of the scene data packet may be, for example, a data transmission format such as JavaScript object notation (JSON), protocol buffer (protocol), custom format, etc., and is not limited herein.
In one possible example, before the operating system receives a scene data packet from a running news application, the method further comprises:
the operating system receives a connection request from the news application program, wherein the connection request comprises an application identifier of the news application program;
the operating system queries the authority tables aiming at the plurality of application programs by taking the application identifier as a query identifier;
when the authority list comprises the application identifier of the news application program, the operating system allocates a data transmission interface for the news application program, the data transmission interface is used for transmitting data between the news application program and the operating system, and the data at least comprises the scene data packet.
The authority table is a preset authority table in the operating system, the authority table is prestored in the operating system by a manufacturer, the authority table can be updated by updating the operating system, and the authority table comprises application identifications of a plurality of application programs which are allowed to realize interprocess communication with the operating system.
After the operating system allocates a data transmission interface to the news application program, the communication mode between the operating system and the news application program may be Socket port communication transmission, pipe communication, shared storage shared memory, shared file, and the like, which is not limited herein.
The data transmission interface provides an effective data transmission link between the news application program and the operating system when the news application program is running, the data transmission link is cleared after the news application program is not running any more, and the data transmission interface is forbidden.
As can be seen, in this example, when receiving the connection request from the news application, the operating system determines the authority of the news application, and then allocates a data transmission interface to the news application meeting the authority requirement, instead of blindly allocating the data transmission interface to any application, which is beneficial to avoiding disorder of data transmission and ensuring the security of data transmission.
S202, the operating system analyzes the scene data packet to obtain the performance improvement strategy.
The performance improvement policy refers to a resource configuration policy for improving the operation performance of the operation scene of the running news application, such as a CPU resource adjustment policy, a GPU resource adjustment policy, a memory bandwidth resource adjustment policy, a disk resource adjustment policy, a network resource adjustment policy, and the like, and is not limited herein.
The performance improvement policy may be an adjustment policy for one system resource, or may be an adjustment policy for multiple resources, which is not limited herein.
The scene data packet comprises a data format identifier, and the operating system analyzes the scene data packet according to the data format indicated by the data format identifier to acquire the performance improvement strategy.
S203, the operating system adjusts the distribution of the system resources of the news application program according to the performance improvement strategy.
In one possible example, the system resources include at least one of the following resources of the mobile terminal: CPU resources, GPU resources, memory bandwidth resources, disk resources, and network resources. The network resources comprise network resources of a data network of the mobile terminal, network resources of a wireless fidelity Wi-Fi network, control parameter resources of a Bluetooth module and the like.
When the system resource is at least one of a CPU resource, a GPU resource, a memory bandwidth resource, and a disk resource, the operating system may communicate with a kernel layer of an operating system space in a direct communication manner, where the direct communication manner is direct communication through an abstract Application Programming Interface (API), to adjust configuration of the system resource.
When the system resource is a network resource, the operating system may communicate with a kernel layer of an operating system space in an indirect communication manner to adjust the configuration of the system resource, where the indirect communication manner refers to indirect communication by invoking an agent service, for example, a Wi-Fi subsystem in the network resource or a data network subsystem and the operating system do not run in the same system and need to indirectly access the system resources in some agent manners, the operating system provides the agent service of Wi-Fi, and the operating system indirectly communicates with the Wi-Fi subsystem by invoking an interface of the agent service.
It can be seen that, in the embodiment of the present application, an operating system of a mobile terminal first receives a scene data packet from a running news application, where the scene data packet includes a performance improvement policy of a running scene generated by the news application, and then the operating system analyzes the scene data packet to obtain the performance improvement policy, and finally, the operating system adjusts allocation of system resources of the news application according to the performance improvement policy. The scene data packet comprises a performance improvement strategy of the operation scene of the news application program, and the scene data packet is sent by the running news application program, so that the operating system can directly obtain the performance improvement strategy of the current operation scene of the news application program, the processing speed of the operating system in the mobile terminal is favorably improved, the operating system adjusts the configuration of system resources of the news application program in real time according to the performance improvement strategy, the real-time performance optimization of the news application program in the operation process by the operating system is realized, and the real-time performance of the mobile terminal for controlling the news application program to perform performance optimization is favorably improved.
In one possible example, the operation scenario is a list sliding scenario, the performance improvement policy includes a system resource to be adjusted and an adjustment amount of the system resource to be adjusted, the system resource to be adjusted is a CPU resource and a GPU resource, and the adjustment amount is associated with the list sliding speed.
The adjustment quantity comprises the adjustment quantity of the CPU resource and the adjustment quantity of the GPU resource, the adjustment quantity is related to the list sliding speed, when the sliding speed is high, the obtained adjustment quantity is large, when the sliding speed is low, the obtained adjustment quantity is small, the interface loading speed can be accelerated by determining the adjustment quantity according to the list sliding speed, and the performance of news application programs is improved.
In one possible example, the scenario packet includes an application identifier and a scenario identifier, the performance improvement policy includes a system resource to be adjusted and an adjustment level of the system resource to be adjusted, and the operating system adjusts allocation of the system resource of the news application according to the performance improvement policy, including:
the operating system acquires the to-be-allocated amount of the to-be-adjusted system resource;
the operating system determines the target allocation amount of the system resource to be adjusted according to the adjustment level of the system resource to be adjusted;
when the amount to be allocated is less than or equal to the target allocation amount, the operating system adjusts the target allocation amount according to the scene identification and the amount to be allocated;
and the operating system adjusts the distribution of the system resources of the news application program according to the adjusted target distribution amount.
The amount to be allocated is a resource amount of a system resource that has not been allocated by the operating system, that is, a resource amount that can be currently allocated by the system resource.
The division of the adjustment level of the system resource to be adjusted by the news application program is the same as the division of the adjustment level of the system resource to be adjusted by the operating system, the division of the adjustment level may be divided by the operating system and sent to the news application program, or may be divided by the application program and shared to the operating system, which is not limited herein, the division of the adjustment level may be divided into a plurality of levels equally according to the total amount of the system resource, or divided into a plurality of levels unequally, or the like, which is not limited herein, for example, the CPU resource may be divided into level 1, level 2, … …, level 7, and level 8, each level representing the target allocation amount of one CPU resource.
When the amount to be allocated is greater than the target allocation amount, the operating system adjusts allocation of the system resources according to the performance improvement policy, and when the amount to be allocated is less than or equal to the target allocation amount, the operating system may re-determine the target allocation amount according to the scene identifier and the amount to be allocated, where a specific implementation manner may be: and determining the importance level of the operation scene according to the scene identification, and determining the target allocation amount according to the importance level and the amount to be allocated. The importance level of the operation scene is determined by the operating system according to a preset mapping relationship between the operation scene and the importance level, for example, the importance level can be divided into a high level, a middle level and a low level, when the importance level is the high level, the target allocation amount is not higher than allocation amount A, when the importance level is the middle level, the target allocation amount is not higher than allocation amount B, when the importance level is the low level, the target allocation amount is not higher than allocation amount C, A is larger than B, and B is larger than C.
As can be seen, in this example, when the operating system detects that the amount to be allocated of the system resource to be allocated is smaller than the target allocation amount of the system resource to be allocated, the unreasonable target allocation amount in the performance improvement policy is discarded, and the target allocation amount is re-determined according to the scene identifier and the size of the amount to be allocated, so that the situation that the performance improvement policy is unreasonable due to the fact that the news application program does not know the amount of the amount to be allocated in the operating system is avoided, and the rationality and the accuracy of resource allocation are improved.
In one possible example, the resource allocation request includes an application identifier, the performance improvement policy includes a system resource to be adjusted and an adjustment level of the system resource to be adjusted, and the operating system adjusts allocation of the system resource of the news application according to the resource allocation request, including:
the operating system determines the target allocation amount of the system resource to be adjusted according to the adjustment level of the system resource to be adjusted;
the operating system acquires the allocated resource amount of the system resource to be adjusted of a news application program, wherein the news application program is the application program indicated by the application identifier;
the operating system determines the adjustment amount of the system resource to be adjusted according to the target allocation amount and the allocated resource amount;
and the operating system adjusts the distribution of the system resources of the news application program according to the adjustment amount.
As can be seen, in this example, the operating system directly obtains the system resource to be adjusted and the adjustment amount of the system resource to be adjusted according to the performance improvement policy, without indirectly determining according to the scene data packet provided by the news application, which is beneficial to reducing the power consumption of the system and increasing the speed of the operating system in adjusting the allocation of the system resource.
In one possible example, the performance-enhancement policy includes a preset duration, and after the operating system adjusts allocation of system resources of the news application according to the performance-enhancement policy, the method further includes:
and when detecting that the adjusting time length according to the performance improvement strategy is greater than or equal to the preset time length, the operating system cancels the adjustment of the system resources of the news application program according to the performance improvement strategy.
And the preset time length is the adjustment time length of the system resource to be adjusted.
The preset time length is associated with the operation scene, and different system resource adjustment time lengths are preset in different operation scenes.
And canceling the distribution of the system resources of the news application program adjusted according to the performance improvement strategy to cancel the authority of the data transmission interface, and recovering the distribution of the system resources of the news application program before being adjusted according to the performance improvement strategy.
As can be seen, in this example, when the operating system detects that the adjustment duration is greater than or equal to the preset duration, the operating system actively cancels the adjustment of the allocation of the system resources of the news application according to the performance enhancement policy, instead of allowing the news application to occupy more system resources all the time, which is beneficial to reducing the power consumption and the power consumption of the mobile terminal.
In one possible example, after the operating system adjusts allocation of system resources of the news application according to the performance-enhancement policy, the method further includes:
the operating system receives an indication message from the news application program through the data transmission interface;
and the operating system cancels the adjustment of the distribution of the system resources of the news application program according to the performance improvement strategy according to the indication message.
The indication message is sent to the operating system when the news application detects that the running scene is ended (for example, when video shooting is completed, or news comments are refreshed successfully, or when exit operation for the running scene or the news application is detected, and the indication message is used for the operating system to cancel allocation of system resources of the news application according to the performance improvement policy.
As can be seen, in this example, the operating system cancels the adjustment of the allocation of the system resources of the news application according to the performance enhancement policy according to the indication message sent by the news application, which is beneficial to enhancing the accuracy of the cancellation time, instead of allowing the news application to occupy more system resources all the time, which is beneficial to reducing the power consumption and the power consumption of the mobile terminal.
Referring to fig. 3, fig. 3 is a schematic flowchart of a resource allocation method according to an embodiment of the present application, and the method is applied to a mobile terminal, where an operating system and one or more application programs run on the mobile terminal. As shown in the figure, the resource allocation method includes:
s301, the operating system receives a connection request from a news application program, wherein the connection request comprises an application identifier of the news application program.
S302, the operating system queries the authority tables aiming at the plurality of application programs by taking the application identifiers as query identifiers.
S303, when the authority list comprises the application identifier of the news application program, the operating system allocates a data transmission interface for the news application program.
S304, the operating system receives the scene data packet from the running news application program through the data transmission interface.
S305, the operating system analyzes the scene data packet to obtain the performance improvement strategy.
S306, the operating system adjusts the distribution of the system resources of the news application program according to the performance improvement strategy.
S307, the operating system receives the indication message from the news application program through the data transmission interface.
S308, the operating system cancels the adjustment of the distribution of the system resources of the news application program according to the performance improvement strategy according to the indication message.
It can be seen that, in the embodiment of the present application, an operating system of a mobile terminal first receives a scene data packet from a running news application, where the scene data packet includes a performance improvement policy of a running scene generated by the news application, and then the operating system analyzes the scene data packet to obtain the performance improvement policy, and finally, the operating system adjusts allocation of system resources of the news application according to the performance improvement policy. The scene data packet comprises a performance improvement strategy of the operation scene of the news application program, and the scene data packet is sent by the running news application program, so that the operating system can directly obtain the performance improvement strategy of the current operation scene of the news application program, the processing speed of the operating system in the mobile terminal is favorably improved, the operating system adjusts the configuration of system resources of the news application program in real time according to the performance improvement strategy, the real-time performance optimization of the news application program in the operation process by the operating system is realized, and the real-time performance of the mobile terminal for controlling the news application program to perform performance optimization is favorably improved.
In addition, when receiving a connection request from the news application program, the operating system firstly determines the authority of the news application program, and then allocates a data transmission interface to the news application program meeting the authority requirement instead of being blindly allocated to any application program data transmission interface, so that the disorder of data transmission is avoided, and the safety of data transmission is ensured.
In addition, the operating system cancels the adjustment of the distribution of the system resources of the news application program according to the performance improvement strategy according to the indication message sent by the news application program, so that the accuracy of canceling time is improved, the news application program does not occupy more system resources all the time, and the power consumption and the electric quantity consumption of the mobile terminal are reduced.
Referring to fig. 4, fig. 4 is a schematic flowchart of a resource allocation method provided in an embodiment of the present application, and is applied to a mobile terminal, where an operating system and one or more application programs run on the mobile terminal. As shown in the figure, the resource allocation method includes:
s401, the news application program determines an operation scene.
The specific implementation manner of determining the operation scene by the news application may be: when an operation request of a user is detected, a plurality of operation scenes stored in the news application program are inquired according to the operation request, and the operation scene corresponding to the operation request is determined.
Wherein the operation scene at least comprises any one of the following: list sliding scene, detail reading scene, news comment scene and video playing scene.
For example, when the running scene is a video scene, the operation request may be to detect that a play button of a small video in the news application is clicked.
The news application program refers to a third-party application program installed in a user space of the mobile terminal, and the third-party application program can be installed by a user or can be pre-installed by a developer before the mobile terminal leaves a factory, and the third-party application program is not limited uniquely here.
And the operation scene is a scene in which the news application program is currently operated. The operation scenes can be divided according to different preset conditions, for example, the operation scenes can be divided into a list sliding scene, a detail reading scene, a news comment scene and the like according to the requirements on CPU resources, the operation scenes can be divided into a video playing scene, a picture viewing scene and the like according to the requirements on GPU resources, different operation scenes can be divided according to different requirements on various system resources, a performance improvement strategy can be determined quickly according to the operation scenes, in addition, the preset conditions can be associated with different applications of news applications, the same or different operation scenes can be divided according to the preset conditions by the different applications, and the unique limitation is not made here.
S402, the news application program obtains the performance improvement strategy of the operation scene.
The performance improvement policy refers to a resource configuration policy for improving the operation performance of the running scene of the running news application, such as a CPU resource adjustment policy, a GPU resource adjustment policy, a memory bandwidth resource adjustment policy, a disk resource adjustment policy, a network resource adjustment policy, and the like, which are not limited herein.
The news application pre-stores the mapping relationship between a plurality of operation scenes and the performance improvement strategy, and the mapping relationship can be set by a developer according to a test result when the news application leaves a factory.
S403, the news application sends a scene data packet to the operating system, where the scene data packet includes the performance improvement policy.
And the scene data packet is used for the operating system to adjust the distribution of the system resources of the news application program according to the performance improvement strategy.
It can be seen that, in the embodiment of the present application, a news application of a mobile terminal determines an operation scene, then the news application acquires a performance enhancement policy of the operation scene, and finally the news application sends a scene data packet to the operating system, where the scene data packet includes the performance enhancement policy, and the scene data packet is used for the operating system to adjust allocation of system resources of the news application according to the performance enhancement policy. The scene data packet comprises a performance improvement strategy of the operation scene of the news application program, and the scene data packet is sent by the running news application program, so that the operating system can directly obtain the performance improvement strategy of the current operation scene of the news application program, the processing speed of the operating system in the mobile terminal is favorably improved, the operating system adjusts the configuration of system resources of the news application program in real time according to the performance improvement strategy, the real-time performance optimization of the news application program in the operation process by the operating system is realized, and the real-time performance of the mobile terminal for controlling the news application program to perform performance optimization is favorably improved.
In one possible example, the news application obtains the performance improvement policy of the operation scenario, including:
and the news application program queries the mapping relation between a preset operation scene and a performance improvement strategy by taking the operation scene as a query identifier, and acquires the performance improvement strategy corresponding to the operation scene.
As can be seen, in this example, the news application queries the mapping relationship between the preset operation scene and the performance improvement policy according to the operation scene, and directly obtains the performance improvement policy of the operation scene, which is beneficial to further improving the speed of resource configuration.
In one possible example, the operation scenario is a list sliding scenario, and the obtaining, by the news application, a performance improvement policy of the operation scenario includes:
the news application program takes the running scene as a query identifier, queries a mapping relation between a preset running scene and system resources, and acquires the system resources to be adjusted corresponding to the running scene as CPU resources and GPU resources;
the news application program acquires the list sliding speed;
the news application program determines the adjustment amount of the system resource to be adjusted according to the list sliding speed;
and the news application program generates a performance improvement strategy of the list sliding scene according to the system resource to be adjusted and the adjustment amount of the system resource to be adjusted.
The specific implementation manner of determining the adjustment amount of the system resource to be adjusted by the news application program according to the list sliding speed may be to query the mapping relationship between the numerical intervals of the sliding speeds and the CPU adjustment amount, determine the adjustment amount of the CPU resource to be adjusted, query the mapping relationship between the numerical intervals of the running speeds and the GPU resource, and determine the adjustment amount of the GPU resource to be adjusted, with the numerical intervals of the sliding speeds as query identifiers.
When the operation scene is the video playing scene, the news comment scene or the detail reading scene, the news application program can determine the adjustment amount of the system resource to be adjusted through the loading speed of the acquired document or video.
As can be seen, in this example, the news application determines the system resource to be adjusted according to the list sliding scene and quickly determines the accurate adjustment amount of the system resource to be adjusted according to the list sliding speed, which is beneficial to improving the speed and accuracy of resource configuration.
In one possible example, before the news application sends the scene data packet to the operating system, the method further includes:
the news application program sends a connection request to the operating system, the connection request comprises an application identifier of the news application program, the application identifier is used for the operating system to query the authority list aiming at the application programs by taking the application identifier as a query identifier, when the authority list comprises the application identifier of the news application program, the operating system allocates a data transmission interface for the news application program, the data transmission interface is used for transmitting data between the news application program and the operating system, and the data at least comprises the scene data packet.
In this example, the news application program sends a connection request to the operating system to request the operating system to allocate a data transmission interface, and the operating system allocates the data transmission interface to the news application program meeting the permission requirement after determining the permission of the news application program, instead of blindly allocating the data transmission interface to any application program, which is beneficial to avoiding disorder of data transmission and ensuring the security of data transmission.
In one possible example, after the news application sends the scene data packet to the operating system, the method further includes:
and the news application program sends an indication message to the operating system through the data transmission interface, wherein the indication message is used for canceling the allocation of the system resources of the news application program according to the performance improvement strategy and the adjustment of the system resources of the news application program by the operating system according to the indication message.
As can be seen, in this example, the news application sends an indication message to the operating system when the detection of the running scene is finished, and the operating system is instructed to cancel the allocation of the system resources of the news application adjusted according to the performance enhancement policy, which is beneficial to improving the accuracy of cancellation time, instead of allowing the news application to occupy more system resources all the time, and is beneficial to reducing the power consumption and the power consumption of the mobile terminal.
In accordance with the embodiments shown in fig. 2, fig. 3 or fig. 4, please refer to fig. 5, and fig. 5 is a schematic structural diagram of a mobile terminal provided in an embodiment of the present application, where the mobile terminal runs one or more application programs and an operating system, and as shown in the figure, the mobile terminal includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are different from the one or more application programs, and the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the following steps;
controlling the operating system to receive a scene data packet from a running news application program, wherein the scene data packet comprises a performance improvement strategy generated by the news application program according to a running scene;
controlling the operating system to analyze the scene data packet to acquire the performance improvement strategy;
and controlling the operating system to adjust the distribution of the system resources of the news application program according to the performance improvement strategy.
It can be seen that, in the embodiment of the present application, an operating system of a mobile terminal first receives a scene data packet from a running news application, where the scene data packet includes a performance improvement policy generated by the news application according to a running scene, and then the operating system analyzes the scene data packet to obtain the performance improvement policy, and finally, the operating system adjusts allocation of system resources of the news application according to the performance improvement policy. The scene data packet comprises a performance improvement strategy of the operation scene of the news application program, and the scene data packet is sent by the running news application program, so that the operating system can directly obtain the performance improvement strategy of the current operation scene of the news application program, the processing speed of the operating system in the mobile terminal is favorably improved, the operating system adjusts the configuration of system resources of the news application program in real time according to the performance improvement strategy, the real-time performance optimization of the news application program in the operation process by the operating system is realized, and the real-time performance of the mobile terminal for controlling the news application program to perform performance optimization is favorably improved.
In one possible example, the operation scenario includes at least any one of: list sliding scene, detail reading scene, news comment scene and video playing scene.
In one possible example, the operation scenario is a list sliding scenario, the performance improvement policy includes a system resource to be adjusted and an adjustment amount of the system resource to be adjusted, the system resource to be adjusted is a CPU resource and a GPU resource, and the adjustment amount is associated with the list sliding speed.
In one possible example, the context data packet includes an application identifier and a context identifier, the performance improvement policy includes a system resource to be adjusted and an adjustment level of the system resource to be adjusted, and in terms of controlling the operating system to adjust allocation of the system resource of the news application program according to the performance improvement policy, the instructions in the program are specifically configured to perform the following operations: controlling the operating system to acquire the to-be-allocated amount of the system resource to be adjusted; controlling the operating system to determine the target allocation amount of the system resource to be adjusted according to the adjustment level of the system resource to be adjusted; when the amount to be allocated is smaller than or equal to the target allocation amount, the operating system is controlled to adjust the target allocation amount according to the scene identification and the amount to be allocated; and controlling the operating system to adjust the distribution of the system resources of the news application program according to the adjusted target distribution amount.
In one possible example, the program further includes instructions for performing the steps of: before the control of the operating system receives a scene data packet from a running news application program, the control of the operating system receives a connection request from the news application program, wherein the connection request comprises an application identifier of the news application program; and controlling the operating system to query the authority tables aiming at the plurality of application programs by taking the application identifier as a query identifier; and controlling the operating system to distribute a data transmission interface for the news application program when the authority table comprises the application identifier of the news application program, wherein the data transmission interface is used for transmitting data between the news application program and the operating system, and the data at least comprises the scene data packet.
In one possible example, the performance-enhancing policy includes a preset duration, and the program further includes instructions for: after the operating system is controlled to adjust the allocation of the system resources of the news application program according to the performance improvement strategy, the operating system is controlled to cancel the allocation of the system resources of the news application program adjusted according to the performance improvement strategy when the fact that the adjustment duration according to the performance improvement strategy is greater than or equal to the preset duration is detected.
In one possible example, the program further includes instructions for performing the steps of: after the operating system is controlled to adjust the allocation of the system resources of the news application program according to the performance improvement strategy, the operating system is controlled to receive an indication message from the news application program through the data transmission interface; and controlling the operating system to cancel the allocation of the system resources for adjusting the news application program according to the performance improvement strategy according to the indication message.
Alternatively, the program includes instructions for performing the following steps;
controlling a news application program to determine an operation scene;
controlling the news application program to acquire a performance improvement strategy of the running scene;
and controlling the news application program to send a scene data packet to the operating system, wherein the scene data packet comprises the performance improvement strategy, and the scene data packet is used for the operating system to adjust the distribution of system resources of the news application program according to the performance improvement strategy.
It can be seen that, in the embodiment of the present application, a news application of a mobile terminal determines an operation scene, then the news application acquires a performance enhancement policy of the operation scene, and finally the news application sends a scene data packet to the operating system, where the scene data packet includes the performance enhancement policy, and the scene data packet is used for the operating system to adjust allocation of system resources of the news application according to the performance enhancement policy. The scene data packet comprises a performance improvement strategy of the operation scene of the news application program, and the scene data packet is sent by the running news application program, so that the operating system can directly obtain the performance improvement strategy of the current operation scene of the news application program, the processing speed of the operating system in the mobile terminal is favorably improved, the operating system adjusts the configuration of system resources of the news application program in real time according to the performance improvement strategy, the real-time performance optimization of the news application program in the operation process by the operating system is realized, and the real-time performance of the mobile terminal for controlling the news application program to perform performance optimization is favorably improved.
In one possible example, the operation scenario includes at least any one of: list sliding scene, detail reading scene, news comment scene and video playing scene.
In one possible example, in terms of the performance improvement policy for controlling the news application to acquire the operation scenario, the instructions in the program are specifically configured to perform the following operations: and controlling the news application program to query the mapping relation between a preset operation scene and a performance improvement strategy by taking the operation scene as a query identifier, and acquiring the performance improvement strategy corresponding to the operation scene.
In one possible example, the operation scenario is a list sliding scenario, and in terms of the performance improvement policy for controlling the news application to acquire the operation scenario, the instructions in the application are specifically configured to perform the following operations: controlling the news application program to query a mapping relation between a preset running scene and system resources by taking the running scene as a query identifier, and acquiring the system resources to be adjusted corresponding to the running scene as CPU resources and GPU resources; and the news application program is used for controlling the news application program to acquire the list sliding speed; the news application program is used for controlling the news application program to determine the adjustment amount of the system resource to be adjusted according to the list sliding speed; and a performance improvement strategy for controlling the news application program to generate the list sliding scene according to the system resource to be adjusted and the adjustment amount of the system resource to be adjusted.
In one possible example, the program further includes instructions for performing the steps of: before controlling the news application program to send a scene data packet to the operating system, controlling the news application program to send a connection request to the operating system, where the connection request includes an application identifier of the news application program, the application identifier is used for the operating system to query an authority table for the plurality of application programs by using the application identifier as a query identifier, and when the authority table includes the application identifier of the news application program, the operating system allocates a data transmission interface for the news application program, and the data transmission interface is used for transmitting data between the news application program and the operating system, where the data at least includes the scene data packet.
In one possible example, the program further includes instructions for performing the steps of: and after controlling the news application program to send a scene data packet to the operating system, controlling the news application program to send an indication message to the operating system through the data transmission interface, wherein the indication message is used for the operating system to cancel the allocation of the system resources of the news application program according to the performance improvement strategy according to the indication message.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the mobile terminal includes hardware structures and/or software modules for performing the respective functions in order to implement the above-described functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the mobile terminal may be divided into the functional units according to the 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 integrated unit can be realized in a form of hardware, and can also be realized in a 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 logic function division, and there may be another division manner in actual implementation.
In case of integrated units, fig. 6 shows a block diagram of a possible functional unit composition of the resource configuration device involved in the above-described embodiment. The resource allocation apparatus 600 is applied to a mobile terminal, on which an operating system and one or more application programs are running, and the resource allocation apparatus 600 includes: a processing unit 602 and a communication unit 603. The processing unit 602 is configured to control and manage actions of the resource configuration device, for example, the processing unit 602 is configured to support the resource configuration device to perform steps S201-S203 in fig. 2, steps S301-S308 in fig. 3, or to support the resource configuration device to perform steps S401-S403 in fig. 4 and/or other processes for the techniques described herein. The resource configuration means may further comprise a storage unit 601 for storing program codes and data.
The processing unit 602 is configured to control the operating system to receive, through the communication unit 603, a scene data packet from a running news application, where the scene data packet includes a performance improvement policy generated by the news application according to a running scene; and the system is used for controlling the operating system to analyze the scene data packet to acquire the performance improvement strategy; and the system resource allocation module is used for controlling the operating system to adjust the system resource allocation of the news application program according to the performance improvement strategy.
In one possible example, the operation scenario includes at least any one of: list sliding scene, detail reading scene, news comment scene and video playing scene.
In one possible example, the operation scenario is a list sliding scenario, the performance improvement policy includes a system resource to be adjusted and an adjustment amount of the system resource to be adjusted, the system resource to be adjusted is a CPU resource and a GPU resource, and the adjustment amount is associated with the list sliding speed.
In a possible example, the context data packet includes an application identifier and a context identifier, the performance improvement policy includes a system resource to be adjusted and an adjustment level of the system resource to be adjusted, and in terms of controlling the operating system to adjust allocation of the system resource of the news application according to the performance improvement policy, the processing unit 602 is specifically configured to: controlling the operating system to acquire the to-be-allocated amount of the system resource to be adjusted; the system resource allocation control module is used for controlling the operating system to determine a target allocation amount of the system resource to be adjusted according to the adjustment level of the system resource to be adjusted; and the operation system is used for controlling the operation system to adjust the target distribution amount according to the scene identification and the distribution amount when the distribution amount is less than or equal to the target distribution amount; and the system resource allocation control module is used for controlling the operating system to adjust the allocation of the system resources of the news application program according to the adjusted target allocation amount.
In one possible example, before the processing unit 602 controls the operating system to receive the scene data packet from the running news application through the communication unit 603, the processing unit is further configured to: controlling the operating system to receive a connection request from the news application through the communication unit 603, wherein the connection request includes an application identifier of the news application; and the control unit is used for controlling the operating system to query the authority table aiming at the plurality of application programs by taking the application identifier as a query identifier; and the data transmission interface is used for controlling the operating system to distribute a data transmission interface for the news application program when the authority table comprises the application identifier of the news application program, and the data transmission interface is used for transmitting data between the news application program and the operating system, and the data at least comprises the scene data packet.
In a possible example, the performance-improvement policy includes a preset duration, and after the processing unit 602 controls the operating system to adjust allocation of system resources of the news application according to the performance-improvement policy, the processing unit is further configured to: and controlling the operating system to cancel the allocation of the system resources for adjusting the news application program according to the performance improvement strategy when detecting that the adjustment duration according to the performance improvement strategy is greater than or equal to the preset duration.
In a possible example, after the processing unit 602 controls the operating system to adjust the allocation of the system resources of the news application according to the performance improvement policy, the processing unit is further configured to: controlling the operating system to receive an indication message from the news application program through the data transmission interface; and the system resource allocation control module is used for controlling the operating system to cancel the allocation of the system resource of the news application program according to the performance improvement strategy according to the indication message.
Alternatively, the first and second electrodes may be,
the processing unit 602 is configured to control the news application to determine an operation scene; the performance improvement strategy is used for controlling the news application program to acquire the running scene; and is configured to control the news application to send a scene data packet to the operating system through the communication unit 603, where the scene data packet includes the performance improvement policy, and the scene data packet is used for the operating system to adjust allocation of system resources of the news application according to the performance improvement policy.
In one possible example, the operation scenario includes at least any one of: list sliding scene, detail reading scene, news comment scene and video playing scene.
In a possible example, in terms of the performance improvement policy for controlling the news application to acquire the operation scenario, the processing unit 602 is specifically configured to: and controlling the news application program to query the mapping relation between a preset operation scene and a performance improvement strategy by taking the operation scene as a query identifier, and acquiring the performance improvement strategy corresponding to the operation scene.
In a possible example, the operation scenario is a list sliding scenario, and in terms of the controlling the news application to obtain the performance improvement policy of the operation scenario, the processing unit 602 is specifically configured to: controlling the news application program to query a mapping relation between a preset running scene and system resources by taking the running scene as a query identifier, and acquiring the system resources to be adjusted corresponding to the running scene as CPU resources and GPU resources; and the news application program is used for controlling the news application program to acquire the list sliding speed; the news application program is used for controlling the news application program to determine the adjustment amount of the system resource to be adjusted according to the list sliding speed; and a performance improvement strategy for controlling the news application program to generate the list sliding scene according to the system resource to be adjusted and the adjustment amount of the system resource to be adjusted.
In one possible example, before the processing unit 602 controls the news application to send the scene data packet to the operating system, the processing unit is further configured to: the news application program is controlled to send a connection request to the operating system through the communication unit 603, where the connection request includes an application identifier of the news application program, the application identifier is used for the operating system to query the authority table for the plurality of application programs by using the application identifier as a query identifier, and when the authority table includes the application identifier of the news application program, the operating system allocates a data transmission interface for the news application program, and the data transmission interface is used for transmitting data between the news application program and the operating system, where the data at least includes the scene data packet.
In one possible example, after the processing unit 602 controls the news application to send the scene data packet to the operating system, the processing unit is further configured to: and controlling the news application program to send an indication message to the operating system through the data transmission interface, wherein the indication message is used for the operating system to cancel the allocation of the system resources of the news application program according to the indication message and according to the performance improvement strategy.
Wherein, the processing unit 602 can be a processor or a controller, the communication unit 603 can be an internal communication interface between the processor and a program execution space, such as a communication interface between the processor and an operating system space, or a communication interface between the processor and a user space, and the storage unit 601 can be a memory.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a smart phone 700 according to an embodiment of the present application, where the smart phone 700 includes: casing 710, touch-sensitive display screen 720, mainboard 730, battery 740 and subplate 750, be provided with leading camera 731, processor 732, memory 733, power management chip 734 on mainboard 730, be provided with oscillator 751, integrative sound chamber 752, VOOC flash charging interface 753 and fingerprint identification module 754 on the subplate.
The smart phone comprises a news application program and an operating system, wherein the news application program runs in a user space, and the operating system runs in an operating system space. The method comprises the steps that an operating system receives a scene data packet from a running news application program, wherein the scene data packet comprises a performance improvement strategy generated by the news application program according to a running scene; the operating system analyzes the scene data packet to obtain the performance improvement strategy; and the operating system adjusts the distribution of the system resources of the news application program according to the performance improvement strategy.
The news application program determines an operation scene; the news application program obtains a performance improvement strategy of the operation scene; and the news application program sends a scene data packet to the operating system, wherein the scene data packet comprises the performance improvement strategy, and the scene data packet is used for the operating system to adjust the distribution of the system resources of the news application program according to the performance improvement strategy.
The processor 732 is a control center of the smart phone, connects various parts of the entire smart phone through various interfaces and lines, and executes various functions and processes data of the smart phone by operating or executing software programs and/or modules stored in the memory 733 and calling data stored in the memory 733, thereby integrally monitoring the smart phone. Alternatively, processor 732 may include one or more processing units; preferably, the processor 732 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 732. The Processor 732 may be, for example, a Central Processing Unit (CPU), a general purpose Processor, a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor described above may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, and the like.
The memory 733 may be used to store software programs and modules, and the processor 732 may execute various functional applications and data processing of the smart phone by operating the software programs and modules stored in the memory 733. The memory 733 may mainly include a program storage area that may store an operating system, an application program required for at least one function, and the like, and a data storage area; the storage data area may store data created according to the use of the smartphone, and the like. Further, the memory 733 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 device. The Memory 733 may be, for example, a Random Access Memory (RAM), a flash Memory, a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a register, a hard disk, a removable hard disk, a compact disc Read Only Memory (CD-ROM), or any other form of storage medium known in the art.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes a mobile terminal.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising a mobile terminal.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may 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 stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in view of the above, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. A resource allocation method is applied to a mobile terminal, wherein an operating system and one or more application programs run on the mobile terminal, and the method comprises the following steps:
the operating system receives a scene data packet from a running news application program, wherein the scene data packet comprises a performance improvement strategy generated by the news application program according to a current running scene, the running scene comprises a list sliding scene, a detail reading scene, a news comment scene and a video playing scene, the performance improvement strategy comprises system resources to be adjusted and adjustment quantity of the system resources to be adjusted, when the running scene is the list sliding scene, the system resources to be adjusted are obtained by querying a mapping relation between a preset running scene and the system resources by taking the current list sliding scene as a query identifier for the news application program, and the adjustment quantity of the system resources to be adjusted is obtained by taking a numerical interval of the list sliding speed as a query identifier for the news application program, inquiring the mapping relation between the numerical value intervals of the sliding speeds and the CPU adjustment amount, determining to obtain the adjustment amount of the CPU resource to be adjusted, inquiring the mapping relation between the numerical value intervals of the sliding speeds and the GPU resource, and determining to obtain the adjustment amount of the GPU resource to be adjusted;
the operating system analyzes the scene data packet to obtain the performance improvement strategy;
the operating system adjusts the distribution of the system resources of the news application program according to the performance improvement strategy;
and when detecting that the adjusting time length according to the performance improvement strategy is greater than or equal to the preset time length, the operating system cancels the allocation of the system resources for adjusting the news application according to the performance improvement strategy, wherein the preset time length is associated with the operation scene, and different system resource adjusting time lengths are preset in different operation scenes.
2. The method of claim 1, wherein the context data packet comprises an application identifier and a context identifier, wherein the performance-enhancement policy comprises system resources to be adjusted and an adjustment level of the system resources to be adjusted, and wherein the operating system adjusts allocation of the system resources of the news application according to the performance-enhancement policy, comprising:
the operating system acquires the to-be-allocated amount of the to-be-adjusted system resource;
the operating system determines the target allocation amount of the system resource to be adjusted according to the adjustment level of the system resource to be adjusted;
when the amount to be allocated is less than or equal to the target allocation amount, the operating system adjusts the target allocation amount according to the scene identification and the amount to be allocated;
and the operating system adjusts the distribution of the system resources of the news application program according to the adjusted target distribution amount.
3. The method of any of claims 1-2, wherein prior to the operating system receiving a scene packet from a running news application, the method further comprises:
the operating system receives a connection request from the news application program, wherein the connection request comprises an application identifier of the news application program;
the operating system queries the authority tables aiming at the plurality of application programs by taking the application identifier as a query identifier;
when the authority list comprises the application identifier of the news application program, the operating system allocates a data transmission interface for the news application program, the data transmission interface is used for transmitting data between the news application program and the operating system, and the data at least comprises the scene data packet.
4. The method of any of claims 1-2, wherein after the operating system adjusts allocation of system resources of the news application in accordance with the performance-enhancement policy, the method further comprises:
the operating system receives an indication message from the news application program through the data transmission interface;
and the operating system cancels the adjustment of the distribution of the system resources of the news application program according to the performance improvement strategy according to the indication message.
5. A resource allocation method is applied to a mobile terminal, wherein an operating system and one or more application programs run on the mobile terminal, and the method comprises the following steps:
the news application program determines a current operation scene, wherein the operation scene at least comprises any one of the following: list sliding scene, detail reading scene, news comment scene and video playing scene;
when the running scene is a list sliding scene, the news application program queries the mapping relation between a preset running scene and system resources by taking the current list sliding scene as a query identifier, and acquires the system resources to be adjusted corresponding to the current list sliding scene as CPU resources and GPU resources;
the news application program acquires the list sliding speed;
the news application program takes the numerical value intervals of the list sliding speed as query identifiers, queries the mapping relation between the numerical value intervals of the sliding speeds and the CPU adjustment amount, determines to obtain the adjustment amount of the CPU resource to be adjusted, queries the mapping relation between the numerical value intervals of the sliding speeds and the GPU resource, and determines to obtain the adjustment amount of the GPU resource to be adjusted;
the news application program generates a performance improvement strategy of the current operation scene according to the system resource to be adjusted, the adjustment quantity of the CPU resource to be adjusted and the adjustment quantity of the GPU resource to be adjusted;
and the news application program sends a scene data packet to the operating system, the scene data packet comprises the performance improvement strategy, the performance improvement strategy comprises the system resources to be adjusted, the adjustment amount of the CPU resources to be adjusted and the adjustment amount of the GPU resources to be adjusted, and the scene data packet is used for the operating system to adjust the distribution of the system resources of the news application program according to the performance improvement strategy.
6. A resource allocation device is applied to a mobile terminal, an operating system and one or more application programs run on the mobile terminal, the resource allocation device comprises a processing unit and a communication unit,
the processing unit is configured to control the operating system to receive, through the communication unit, a scene data packet from a running news application, where the scene data packet includes a performance improvement policy generated by the news application according to a current running scene, and the running scene at least includes any one of: list sliding scene, detail reading scene, news comment scene and video playing scene; and the performance improvement policy module is used for controlling the operating system to analyze the scene data packet to obtain the performance improvement policy, wherein the performance improvement policy comprises system resources to be adjusted and adjustment amounts of the system resources to be adjusted, when the operating scene is a list sliding scene, the system resources to be adjusted are CPU resources and GPU resources which are obtained by querying the news application program from a preset mapping relation between the operating scene and the system resources by taking a current list sliding scene as a query identifier, the adjustment amounts of the system resources to be adjusted are that the news application program takes a numerical interval of the list sliding speed as a query identifier, the mapping relation between the numerical intervals of a plurality of sliding speeds and the CPU adjustment amount is queried, the adjustment amounts of the CPU resources to be adjusted are determined, and the mapping relation between the numerical intervals of the plurality of sliding speeds and the GPU resources is queried, determining and obtaining the adjustment amount of the GPU resources to be adjusted; and the system is used for controlling the operating system to adjust the distribution of the system resources of the news application program according to the performance improvement strategy; and the system resource allocation module is used for canceling the allocation of the system resources for adjusting the news application programs according to the performance improvement strategy when detecting that the adjustment time length according to the performance improvement strategy is greater than or equal to the preset time length, wherein the preset time length is associated with the operation scene, and different system resource adjustment time lengths are preset in different operation scenes.
7. A resource allocation device is applied to a mobile terminal, an operating system and one or more application programs run on the mobile terminal, the resource allocation device comprises a processing unit and a communication unit,
the processing unit is configured to control the news application to determine a current operation scene, where the operation scene at least includes any one of: list sliding scene, detail reading scene, news comment scene and video playing scene; and is used for controlling the news application program to query the mapping relation between the preset running scene and the system resources by using the current list sliding scene as a query identifier when the running scene is the list sliding scene, acquiring the system resources to be adjusted corresponding to the current list sliding scene as CPU resources and GPU resources, acquiring the list sliding speed, the loading speed of the document or the loading speed of the video, using the numerical value interval of the sliding speed of the list as a query identifier, querying the mapping relation between the numerical value intervals of a plurality of sliding speeds and the CPU adjustment amount, determining to obtain the adjustment amount of the CPU resource to be adjusted, inquiring the mapping relation between the numerical value intervals of the sliding speeds and the GPU resources, determining the adjustment amount of the GPU resources to be adjusted, generating a performance improvement strategy of the current operation scene according to the system resource to be adjusted, the adjustment quantity of the CPU resource to be adjusted and the adjustment quantity of the GPU resource to be adjusted; and the system and the method are used for controlling the news application program to send a scene data packet to the operating system through the communication unit, the scene data packet comprises the performance improvement strategy, the performance improvement strategy comprises system resources to be adjusted, adjustment quantity of the CPU resources to be adjusted and adjustment quantity of the GPU resources to be adjusted, and the scene data packet is used for the operating system to adjust distribution of the system resources of the news application program according to the performance improvement strategy.
8. A mobile terminal comprising a processor, memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps of the method of any of claims 1-4 and/or 5.
9. 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 a computer to perform the method according to any of claims 1-4 and/or 5, the computer comprising a mobile terminal.
CN201710775951.XA 2017-08-31 2017-08-31 Resource allocation method and related product Expired - Fee Related CN107528977B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710775951.XA CN107528977B (en) 2017-08-31 2017-08-31 Resource allocation method and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710775951.XA CN107528977B (en) 2017-08-31 2017-08-31 Resource allocation method and related product

Publications (2)

Publication Number Publication Date
CN107528977A CN107528977A (en) 2017-12-29
CN107528977B true CN107528977B (en) 2020-07-07

Family

ID=60683204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710775951.XA Expired - Fee Related CN107528977B (en) 2017-08-31 2017-08-31 Resource allocation method and related product

Country Status (1)

Country Link
CN (1) CN107528977B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108646938B (en) * 2018-03-13 2020-04-17 Oppo广东移动通信有限公司 Configuration method and device of touch screen, terminal and storage medium
CN109542614B (en) * 2018-05-30 2023-06-23 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium
CN116700915A (en) * 2022-12-23 2023-09-05 荣耀终端有限公司 Resource scheduling method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095592A (en) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 A kind of prospect application scenarios synchronous method and device, system
CN106549880A (en) * 2016-11-25 2017-03-29 珠海市魅族科技有限公司 A kind of resource allocation methods and terminal unit of terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2696285A4 (en) * 2012-07-06 2014-02-26 Huawei Device Co Ltd Method and device for allocating resource
CN106293803B (en) * 2016-07-22 2019-10-11 宇龙计算机通信科技(深圳)有限公司 A kind of application control method and device
CN106874168A (en) * 2017-01-12 2017-06-20 北京奇虎科技有限公司 Determine method, device and the mobile terminal of application program runnability

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095592A (en) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 A kind of prospect application scenarios synchronous method and device, system
CN106549880A (en) * 2016-11-25 2017-03-29 珠海市魅族科技有限公司 A kind of resource allocation methods and terminal unit of terminal

Also Published As

Publication number Publication date
CN107528977A (en) 2017-12-29

Similar Documents

Publication Publication Date Title
CN107528976B (en) Resource allocation method and related product
CN107547746B (en) Resource allocation method and related product
CN107577533B (en) Resource allocation method and related product
CN107861816B (en) Resource allocation method and device
JP6996005B2 (en) Resource configuration method, equipment, terminals, and storage media
WO2019042171A1 (en) Resource allocation method and product related thereto
CN107861814B (en) Resource allocation method and equipment
CN107479970B (en) Resource allocation method and related product
US11151010B2 (en) Resource configuration method, mobile terminal and storage medium
WO2019047709A1 (en) Resource configuration method and related product
CN107450988B (en) Resource allocation method and related product
CN107547745B (en) Resource allocation method and related product
US10936371B2 (en) Method for resource allocation and related products
WO2019042180A1 (en) Resource allocation method and related product
WO2019109868A1 (en) Resource allocation method and related product
CN107807852B (en) Application program performance control method, device and computer readable storage medium
CN107797868B (en) Resource adjusting method and device
CN109542614B (en) Resource allocation method, device, terminal and storage medium
CN107786748B (en) Image display method and apparatus
CN107635078B (en) Game control method and device
CN107517306B (en) Resource allocation method and related product
WO2019047708A1 (en) Resource configuration method and related product
EP3486770B1 (en) Processing method, device and storage medium for implementing automatic startup
WO2019072208A1 (en) Application running control method and device
CN107528977B (en) Resource allocation method and related product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change 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.

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200707