CN117311938A - Application running method, device, computer equipment and storage medium - Google Patents

Application running method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117311938A
CN117311938A CN202311271714.1A CN202311271714A CN117311938A CN 117311938 A CN117311938 A CN 117311938A CN 202311271714 A CN202311271714 A CN 202311271714A CN 117311938 A CN117311938 A CN 117311938A
Authority
CN
China
Prior art keywords
data
application
released
resources
resource
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.)
Pending
Application number
CN202311271714.1A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311271714.1A priority Critical patent/CN117311938A/en
Publication of CN117311938A publication Critical patent/CN117311938A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

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

Abstract

The embodiment of the application discloses an application running method, an application running device, computer equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: receiving a foreground operation instruction of a first application; and responding to the foreground operation instruction, determining a second application under the condition that the idle operation resources of the current equipment cannot meet the requirement of operating the first application in the foreground, and releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high. In the embodiment of the application, the operation resources are released by adopting the order of the priority of the data from low to high, so that the idle operation resources can meet the requirement of operating the first resources in the foreground, and further, the foreground can still be used for operating the first applications under the condition that the idle resources are insufficient, and the second applications can be ensured to keep operating in the background, so that the subsequent rapid operation of the second applications is ensured when the second applications are operated in the foreground, the operation efficiency of the second applications is ensured, and further, the user experience is improved.

Description

Application running method, device, computer equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to an application running method, an application running device, computer equipment and a storage medium.
Background
With the development of computer technology, the functions of the terminal are becoming more and more powerful. The user can run a plurality of applications in the process of using the terminal. Under the condition that the terminal runs a plurality of applications, only one application runs in the foreground, the rest of the applications are all applications running in the background, and the application running in the foreground and the application running in the background occupy the running resources of the terminal. When a terminal runs a certain application in the foreground, if the currently idle running resources of the terminal cannot meet the requirement of running the application in the foreground, the application running in the background is usually closed to release the running resources occupied by the application running in the background, so that the terminal can run the application in the foreground, however, if the closed applications are used again by a user, the closed applications need to be restarted, a great amount of time is consumed, and the user experience is reduced.
Disclosure of Invention
The embodiment of the application running method, the device, the computer equipment and the storage medium can ensure that the second application can be quickly run when the second application is run in the foreground, ensure the running efficiency of the second application and further improve the user experience. The technical scheme is as follows:
In one aspect, there is provided an application running method, the method including:
receiving a foreground operation instruction of a first application;
responding to the foreground operation instruction, and determining a second application when idle operation resources of the current equipment cannot meet the condition that the first application is operated in the foreground, wherein the second application is an application operated in the background by the current equipment;
and releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high, wherein the data is the data occupying the operation resources of the current equipment in the second application.
In another aspect, there is provided an application running apparatus, the apparatus including:
the receiving module is used for receiving a foreground operation instruction of the first application;
the determining module is used for responding to the foreground operation instruction, and determining a second application when idle operation resources of the current equipment cannot meet the condition that the first application is operated in the foreground, wherein the second application is an application operated in the background by the current equipment;
and the releasing module is used for releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high, wherein the data is the data occupying the operation resources of the current equipment in the second application.
In one possible implementation manner, the determining module is configured to determine, in response to the foreground running instruction, the second application and an amount of resources to be released if the idle running resource cannot meet the requirement of running the first application in the foreground;
and the release module is used for releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high so as to release the operation resources of the resource quantity to be released.
In another possible implementation manner, the releasing module is configured to release, according to the order of the priority of the data from low to high, an operation resource occupied by first data in the second application, where the first data is data with a lowest priority in the data currently occupying the operation resource; and under the condition that the current released resource quantity does not reach the resource quantity to be released, releasing the operation resources occupied by second data according to the sequence from low priority to high priority of the data, wherein the priority of the second data is the upper level of the priority of the first data.
In another possible implementation manner, the determining module is configured to determine, in response to the foreground running instruction, the second application, the amount of resources to be released, and a resource type, where the idle running resource cannot meet the requirement of running the first application in the foreground, and the resource type indicates a type to which the running resource to be released belongs;
The release module is configured to release, according to the priority of the third data in the second application, the operation resource occupied by the third data, so as to release the operation resource that is to be released in the amount of the resource and belongs to the resource type, where the third data occupies the operation resource of the resource type.
In another possible implementation manner, the resource type includes a calculation type and a memory type, the resource amount to be released includes a first resource amount and a second resource amount, the first resource amount corresponds to the calculation type, and the second resource amount corresponds to the memory type; the release module is configured to release, according to the priority of fourth data in the second application, an operation resource occupied by the fourth data, so as to release the operation resource that belongs to the computing type and is the first resource amount, where the fourth data occupies the computing type operation resource; determining a third resource amount which is released currently, wherein the third resource amount is the resource amount of the running resource of the memory type in the process of releasing the running resource of the calculation type; and under the condition that the third resource amount is smaller than the second resource amount, releasing the operation resources occupied by the fifth data according to the priority of the fifth data in the second application so as to release the operation resources which are of the second resource amount and belong to the memory type, wherein the fifth data occupies the operation resources of the memory type.
In another possible implementation manner, the resource type includes a memory type, and the amount of the resource to be released is an amount of a running resource of the memory type to be released; the fifth data in the second application comprises first type data or second type data, the first type data is data loaded from the outside of the second application in the process of running the second application, the second type data is data generated in the process of running the second application, and the fifth data occupies the running resources of the memory type;
the release module is used for releasing the operation resources occupied by the first type of data according to the priority of the first type of data; and under the condition that the first type of data is released completely and the current released resource quantity does not reach the to-be-released resource quantity, releasing the operation resources occupied by the second type of data according to the priority of the second type of data so as to release the to-be-released resource quantity and the operation resources belonging to the memory type.
In another possible implementation, the apparatus further includes:
and the operation module is used for operating the first application in the foreground based on the current idle operation resource under the condition that the current released resource quantity reaches the resource quantity to be released.
In another possible implementation manner, the determining module is further configured to determine the priority of the data in response to the second application being switched from the foreground operation to the background operation.
In another possible implementation manner, the data includes fourth data or fifth data, the fourth data occupies operation resources of a computing type, and the fifth data occupies operation resources of a memory type; the determining module is used for determining the priority of each fourth data based on attribute information of the fourth data, wherein the attribute information comprises at least one of loading speed or importance; or, determining the priority of each fifth data based on the attribute information of the fifth data.
In another possible implementation manner, the fifth data includes a first type of data and a second type of data, the first type of data is data loaded from outside the second application in the process of running the second application, and the second type of data is data generated in the process of running the second application; the determining module is configured to determine a priority of each first type of data and a priority of each second type of data based on attribute information of the first type of data and attribute information of the second type of data, where the priority of the first type of data is lower than the priority of the second type of data.
In another possible implementation manner, the determining module is configured to determine, in response to the foreground operation instruction, the second application and an amount of resources to be released, where the idle operation resource cannot meet the requirement of running the first application in the foreground, and the amount of resources to be released is an amount of resources to be released;
the apparatus further comprises:
the display module is used for displaying prompt information when the operation resources occupied by the data are released and the current released resource quantity does not reach the to-be-released resource quantity, and the prompt information indicates that the operation resources occupied by the data in the second application cannot be met by releasing the operation resources occupied by the data in the foreground.
In another possible implementation, the apparatus further includes:
the closing module is used for responding to the confirmation operation of the prompt information and displaying the application running in the background; closing the application running in the background in response to closing operation of the application running in the background; or,
and the closing module is also used for closing the application running in the background in response to the time length reaching a time length threshold value, and the time length starts to be counted from the display of the prompt information.
In another possible implementation, the apparatus further includes:
the generation module is used for generating a release record in the process of releasing the operation resources occupied by the data, wherein the release record indicates the released data;
and the recovery module is used for responding to the switching of the second application from the background operation to the foreground operation and recovering the released data based on the release record.
In another possible implementation manner, the generating module is configured to generate, in a process of releasing the operation resource occupied by the data, the release record based on released fourth data or second type data, where the fourth data occupies an operation resource of a computing type, and the second type data is data generated in a process of executing the second application.
In another aspect, a computer device is provided, the computer device comprising a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to implement the operations performed by the application running method as described in the above aspect.
In another aspect, there is provided a computer readable storage medium having stored therein at least one computer program loaded and executed by a processor to implement the operations performed by the application execution method as described in the above aspect.
In yet another aspect, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the operations performed by the application running method as described in the above aspect.
In the scheme provided by the embodiment of the application, in response to the foreground operation instruction of the first application, and under the condition that the current idle operation resource cannot meet the requirement of operating the first application in the foreground, according to the sequence from low priority to high priority of data in the second application operated in the background, the operation resource occupied by the data in the second application is released, as the influence degree of the data on the operation of the second application can be reflected, the operation resource is released according to the sequence from low priority to high priority, the idle operation resource can be increased, the idle operation resource can meet the requirement of operating the first resource in the foreground, further, the first application can still be operated in the foreground under the condition that the idle resource is insufficient, the second application can also be ensured to be operated in the background, the condition of closing the application operated in the background can be avoided as much as possible, the survival rate of the application operated in the background can be improved, the second application can be rapidly operated when the second application is switched to the foreground operation in the follow-up mode, and the operation efficiency of the second application can be further improved, and the user experience is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a flowchart of an application running method provided in an embodiment of the present application;
FIG. 3 is a flowchart of another method for running an application provided in an embodiment of the present application;
FIG. 4 is a flowchart of yet another method for running an application provided in an embodiment of the present application;
FIG. 5 is a flow chart of yet another method of application execution provided by an embodiment of the present application;
fig. 6 is a schematic diagram of a terminal display interface according to an embodiment of the present application;
FIG. 7 is a schematic diagram of another display interface provided by an embodiment of the present application;
FIG. 8 is a flowchart for releasing an operating resource provided by an embodiment of the present application;
FIG. 9 is a flowchart of yet another method for running an application provided in an embodiment of the present application;
Fig. 10 is a schematic structural diagram of an application running device according to an embodiment of the present application;
FIG. 11 is a schematic structural diagram of another application running device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The terms "first," "second," "third," "fourth," "fifth," and the like as used herein may be used to describe various concepts, but are not limited by these terms unless otherwise specified. These terms are only used to distinguish one concept from another. For example, a first application may be referred to as a second application, and similarly, a second application may be referred to as a first application, without departing from the scope of the present application.
The terms "at least one," "a plurality," "each," "any one," as used herein, include one, two or more, a plurality includes two or more, and each refers to each of a corresponding plurality, any one referring to any one of the plurality. For example, the plurality of data includes 3 data, and each refers to each of the 3 data, and any one refers to any one of the 3 data, which can be the first data, or the second data, or the third data.
It should be noted that, information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals referred to in this application are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, the data in applications referred to in this application are all acquired with sufficient authorization.
The application running method provided by the embodiment of the application can be executed by the computer equipment. Optionally, the computer device is a terminal or a server. Optionally, the server is a stand-alone physical server, or is a server cluster or a distributed system formed by a plurality of physical servers, or is a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like. Optionally, the terminal is a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, and the like, but is not limited thereto.
In some embodiments, the computer program related to the embodiments of the present application may be deployed to be executed on one computer device or on multiple computer devices located at one site, or on multiple computer devices distributed across multiple sites and interconnected by a communication network, where the multiple computer devices distributed across multiple sites and interconnected by the communication network can form a blockchain system.
In some embodiments, the computer device is provided as a terminal. FIG. 1 is a schematic diagram of an implementation environment provided by embodiments of the present application. Referring to fig. 1, the implementation environment includes at least one terminal 101 and a server 102. The terminal 101 and the server 102 are connected by a wireless or wired network.
The terminal 101 installs thereon an application served by the server 102, by which the terminal 101 can realize functions such as data transmission, message interaction, and the like. Alternatively, the application is an application in the operating system of the terminal 101 or an application provided for a third party. For example, the application is a content sharing application having a content sharing function, but of course, the content sharing application can also have other functions such as a comment function, a shopping function, a navigation function, a game function, and the like.
The terminal 101 is configured to obtain, by interacting with the server 102, data required for running an application from the server 102, and further implement running the application based on the obtained data, and in a process of running the application, the terminal 101 is capable of switching the application from a foreground operation to a background operation, and of switching the application from the background operation to the foreground operation. For example, the server 102 is configured to provide a service for the first application, and if the idle running resource of the terminal 101 cannot meet the requirement of running the first application in the foreground in the case that the terminal 101 runs the second application in the background, according to the method provided in the embodiment of the present application, the running resource occupied by the data in the second application is released, so as to ensure that the idle running resource of the terminal 101 meets the requirement of running the first application in the foreground, and further, the idle running resource based on which the terminal 101 runs the first application in the foreground.
Fig. 2 is a flowchart of an application running method provided in an embodiment of the present application, where the method is performed by a computer device, as shown in fig. 2, and the method includes:
201. the computer device receives a foreground run instruction for a first application.
In the embodiment of the application, the computer device is provided with a first application, and the first application can be run, and the first application may be an application which is not started or is an application currently running in the background. And under the condition that the first application is not started or is operated in the background, the user can trigger the operation of starting the first application or operating the first application in the foreground through the computer equipment, and the computer equipment receives a foreground operation instruction of the first application.
The first application is any type of application, for example, the first application is a game application, a content sharing application, an instant messaging application, and the like.
202. And the computer equipment responds to the foreground operation instruction, and determines a second application which is an application of the current equipment operated in the background under the condition that idle operation resources of the current equipment cannot meet the requirement of operating the first application in the foreground.
In the embodiment of the application, when the computer device runs the application, the data in the application occupy the running resources of the computer device. That is, in the process of running the application, the data of the application is loaded into the running resource, so that the data in the application occupies the running resource, and the computer equipment supports the running of the application based on the data in the running resource. Whether the application is running in the foreground or in the background, the running resources of the computer device are occupied. The computer equipment responds to a foreground operation instruction of the first application, whether the current idle operation resource meets the requirement of operating the first application in the foreground or not is determined, and if the current idle operation resource can not meet the requirement of operating the first application in the foreground, a second application operated in the background is required to be determined, so that operation resources occupied by data in the second application operated in the background can be released subsequently, more idle operation resources can be released, and the computer equipment can operate the first application in the foreground.
In the embodiment of the application, the idle running resources of the computer device cannot meet the requirement of running the first application in the foreground, which means that the idle running resources are smaller than the running resources required to be occupied by running the first application in the foreground, so that the computer device cannot run the first application in the foreground.
Wherein the current device is a computer device. The second application is any type of application, for example, the second application is a game application, a content sharing application, an instant messaging application, and the like. In this embodiment of the present application, the second application is an application that subsequently releases the running resource, so that the running resource occupied by the data in the second application can be released subsequently, so that the computer device can subsequently run the first application in the foreground for use. The running resource is the resource used for bearing the data in the application. For example, the running resource is a memory, a CPU (Central Processing Unit ), a GPU (Graphics Processing Unit, graphics processor), an IO (Input/Output), or the like.
203. And the computer equipment releases the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high, wherein the data is the data occupying the operation resources of the current equipment in the second application.
In the embodiment of the application, in the process of running the second application by the computer device, the data in the second application occupy the running resource of the computer device. Because the second application is an application running in the background, the user does not use the second application through the computer equipment at the moment, and therefore, even if part of data in the second application is released, the use of the user is not affected, and therefore, according to the order of the priority of the data in the second application running in the background from low to high, the data in the second application is released, so that the data does not occupy the running resources any more, the running resources occupied by the data are converted into idle running resources, the idle running resources of the computer equipment are increased, so that the idle running resources can be expected to be released as much as possible, and the first resources running in the foreground can be met by the idle running resources.
The priority of the data can reflect the influence degree of the data on the operation of the second application, and also can reflect the influence degree of the data on the experience of the user when the user uses the second application, the lower the priority of the data is, the smaller the influence on the operation of the second application is, and the higher the priority of the data is, the larger the influence on the operation of the second application is. The data is any type of data, for example, the data is a thread created during running of the application, cached data, or data generated during running of the application, etc.
In the scheme provided by the embodiment of the application, in response to the foreground operation instruction of the first application, and under the condition that the current idle operation resource cannot meet the requirement of operating the first application in the foreground, according to the sequence from low priority to high priority of data in the second application operated in the background, the operation resource occupied by the data in the second application is released, as the influence degree of the data on the operation of the second application can be reflected, the operation resource is released according to the sequence from low priority to high priority, the idle operation resource can be increased, the idle operation resource can meet the requirement of operating the first resource in the foreground, further, the first application can still be operated in the foreground under the condition that the idle resource is insufficient, the second application can also be ensured to be operated in the background, the condition of closing the application operated in the background can be avoided as much as possible, the survival rate of the application operated in the background can be improved, the second application can be rapidly operated when the second application is switched to the foreground operation in the follow-up mode, and the operation efficiency of the second application can be further improved, and the user experience is further improved.
Based on the embodiment shown in fig. 2, the embodiment of the present application can also utilize the amount of resources to be released to release the running resources occupied by the data in the second application, and a specific process is described in the following embodiment.
Fig. 3 is a flowchart of an application running method provided in an embodiment of the present application, where the method is performed by a computer device, as shown in fig. 3, and the method includes:
301. the computer device receives a foreground run instruction for a first application.
In one possible implementation, this step 301 includes: in the case that the first application is an un-started application, the computer equipment responds to the starting operation of the first application and receives a foreground running instruction of the first application; or, in the case that the first application is a background running application, the computer device receives a foreground running instruction for the first application in response to an operation for switching the first application to a foreground running.
In the embodiment of the application, when the first application is an application that is not currently started by the computer device, the user can trigger the operation of starting the first application through the computer device, and the computer device detects the operation of starting the first application, which is equivalent to receiving a foreground operation instruction for the first application, and the subsequent computer device can operate the first application in the foreground. When the first application is an application currently running in the background, the user can trigger the operation of switching the first application to the foreground through the computer equipment, and the computer equipment detects the operation of switching the first application to the foreground, which is equivalent to receiving a foreground running instruction of the first application, and the subsequent computer equipment can run the first application in the foreground.
For example, if the computer device is a terminal and the first application is an application that is not started, the user clicks an icon of the first application through the terminal, and the terminal detects a start operation of the first application, which is equivalent to receiving a foreground running instruction of the first application. When the first application is an application running in the background, the user clicks the icon of the first application through the terminal, and the terminal detects the operation of switching the first application to the foreground running, which is equivalent to receiving a foreground running instruction of the first application.
302. The computer equipment responds to the foreground operation instruction, and determines a second application and the amount of resources to be released under the condition that idle operation resources of the current equipment cannot meet the requirement of operating the first application in the foreground, wherein the second application is an application of the current equipment in the background operation.
The second application is an application of the running resources to be released, and the amount of the resources to be released is the amount of the running resources which are lack by the computer equipment for running the first application in the foreground.
In one possible implementation, the process of determining the second application includes: and in response to the foreground operation instruction, determining an application with the lowest priority in the plurality of applications as a second application based on the priorities of the plurality of applications when idle operation resources of the current device cannot meet the requirement of operating the first application in the foreground and the plurality of applications are currently operated in the background.
In the embodiment of the application, the computer device currently runs a plurality of applications in the background, and under the condition that idle running resources cannot meet the requirement of running a first application in the background, the application with the lowest priority is selected from the plurality of applications running in the background and used as the application of the running resources to be released, so that the influence on the application running in the background is avoided under the condition that the computer device can normally run the first application in the background, and the influence on the application running in the background is reduced to the minimum.
In one possible implementation, the determining the amount of resources to be released includes: determining a fourth resource amount and a fifth resource amount in response to the foreground operation instruction, wherein the fourth resource amount is the resource amount of operation resources required by the first application in the foreground operation, and the fifth resource amount is the resource amount of idle operation resources; and under the condition that the fourth resource amount is larger than the fifth resource amount, determining that idle running resources of the current equipment cannot meet the requirement of running the first application in the foreground, and determining the difference value between the fourth resource amount and the fifth resource amount as the resource amount to be released.
In the embodiment of the application, in response to a foreground operation instruction of the first application, the resource amount of the operation resources required for operating the first application in the foreground and the resource amount of the idle operation resources are determined first, so that whether the idle operation resources of the current device meet the requirement of operating the first application in the foreground can be determined, and further, under the condition that the idle operation resources of the current device cannot meet the requirement of operating the first application in the foreground, the resource amount of the idle operation resources which are lack in the foreground for operating the first application is determined, namely, the resource amount to be released is determined, and the accuracy of the determined resource amount to be released is ensured.
It should be noted that, in this embodiment of the present application, the second application and the amount of resources to be released are determined when the idle running resources of the current device cannot meet the requirement of running the first application in the foreground, and in another embodiment, the step 302 is not required to be executed, but other manners are adopted, and in response to the foreground running instruction, the second application is determined when the idle running resources of the current device cannot meet the requirement of running the first application in the foreground.
303. And the computer equipment releases the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high so as to release the operation resources with the amount of resources to be released, wherein the data is the data occupying the operation resources of the current equipment in the second application.
In the embodiment of the application, the operation resources occupied by the data are released step by step according to the order of the priority of the data in the second application from low to high, so that the operation resources with the resource quantity to be released are released, the idle operation resources of the computer equipment are enough to meet the requirement of operating the first application in the foreground, the subsequent computer equipment can normally operate the first application in the foreground, and the feasibility of operating the first application in the foreground is ensured.
It should be noted that, in the embodiment of the present application, the operation resources occupied by the data in the second application are released to release the operation resources of the amount of resources to be released, and in another embodiment, the step 303 is not required to be executed, but other manners are adopted to release the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high.
In the scheme provided by the embodiment of the application, in response to the foreground operation instruction of the first application, and under the condition that the current idle operation resource cannot meet the requirement of operating the first application in the foreground, according to the sequence from low priority to high priority of data in the second application operated in the background, the operation resource occupied by the data in the second application is released, as the influence degree of the data on the operation of the second application can be reflected, the operation resource is released according to the sequence from low priority to high priority, the idle operation resource can be increased, the idle operation resource can meet the requirement of operating the first resource in the foreground, further, the first application can still be operated in the foreground under the condition that the idle resource is insufficient, the second application can also be ensured to be operated in the background, the condition of closing the application operated in the background can be avoided as much as possible, the survival rate of the application operated in the background can be improved, the second application can be rapidly operated when the second application is switched to the foreground operation in the follow-up mode, and the operation efficiency of the second application can be further improved, and the user experience is further improved. Through the scheme provided by the embodiment of the application, the long-term keep-alive of the application running in the background can be realized, the normal running of the application running in the foreground can be ensured, the integral use experience of equipment is ensured, and meanwhile, the keep-alive requirement of the application in the background can be considered.
And under the condition that the second application can run in the background, the running resources of the amount of resources to be released are released by releasing the running resources occupied by the data in the second application, so that the idle running resources of the computer equipment are enough to meet the requirement of running the first application in the foreground, the subsequent computer equipment can normally run the first application in the foreground, and the feasibility of running the first application in the foreground is ensured.
On the basis of the embodiment shown in fig. 3, in the embodiment of the present application, in the process of gradually releasing the operation resources occupied by the data according to the priority of the data, after each stage of data release, it is determined whether the current released resource amount reaches the required released resource amount to be released, and the specific process is as described in the following embodiment.
Fig. 4 is a flowchart of an application running method provided in an embodiment of the present application, where the method is performed by a computer device, as shown in fig. 4, and the method includes:
401. the computer device receives a foreground run instruction for a first application.
402. And the computer equipment responds to the foreground operation instruction, and determines the second application and the amount of resources to be released under the condition that the idle operation resources of the current equipment cannot meet the requirement of operating the first application in the foreground.
The steps 401-402 are the same as the steps 301-302 described above, and are not described in detail herein.
403. And the computer equipment releases the operation resources occupied by the first data in the second application according to the order of the priority of the data in the second application from low to high, wherein the first data is the data with the lowest priority in the data currently occupying the operation resources.
In this embodiment of the present application, according to the order of low-to-high priority of the data in the second application, the priority of the second data is the lowest priority of the data currently occupying the operation resources in the second application, and then the second data is released, so that the operation resources occupied by the second data are released, so that the data having a small influence on the operation of the second application is released as far as possible, and the occupied operation resources can be released.
404. And under the condition that the current released resource quantity does not reach the resource quantity to be released, the computer equipment releases the operation resources occupied by the second data according to the sequence from low priority to high priority of the data, wherein the priority of the second data is the upper level of the priority of the first data.
In the embodiment of the present application, in the case that the first data has been released, the operation resource occupied by the first data has been released, the resource amount of the released operation resource is determined, whether the released resource amount has reached the resource amount to be released is determined, in the case that the current released resource amount does not reach the resource amount to be released, the operation resource occupied by the data with the lowest priority among the data which is included in the second application and currently occupies the operation resource is released according to the order of the priority of the data from low to high, and the second data is the operation resource with the lowest priority among the data currently occupies the operation resource after the operation resource occupied by the first data is released, so that the operation resource occupied by the second data is released, and the operation resource with the resource amount to be released is released.
In this embodiment of the present application, among the data included in the second application, the priority of the first data is lowest, and after the first data is released, the priority of the second data is lowest. The current released resource amount does not reach the resource amount to be released, namely the current released resource amount is smaller than the resource amount to be released; the current released resource quantity reaches the resource quantity to be released, namely the current released resource quantity is larger than the resource quantity to be released.
It should be noted that, in the embodiment of the present application, the operation resources occupied by the first data and the second data are released as an example, and in another embodiment, in the case of releasing the operation resources occupied by the second data, it is determined whether the current released resource amount reaches the resource amount to be released according to the above step 404. And under the condition that the current released resource quantity does not reach the to-be-released resource quantity, releasing the operation resources occupied by the previous-level data of the second data according to the sequence of the priority of the data, and the like, and determining until the current released operation resources reach the to-be-released resource quantity. And under the condition that the current released resource quantity reaches the resource quantity to be released, the method indicates that enough operation resources are released, and operation resources occupied by the previous-level data of the second data are not required to be released.
It should be noted that, in the embodiment of the present application, after the operation resources occupied by the first data are released, the current released resource amount does not reach the amount of the resources to be released, which is described by taking as an example, and in another embodiment, after the operation resources occupied by the first data are released, when the current released resource amount reaches the amount of the resources to be released, it indicates that enough operation resources have been released, and no operation resources occupied by the second data need to be released.
It should be noted that, in this embodiment of the present application, after each stage of data is released, it is determined whether the amount of released resources reaches the amount of resources to be released that needs to be released, and then, in the case that the amount of released resources does not reach the amount of resources to be released, the operation resources occupied by the previous stage of data are released, and in another embodiment, the steps 403 to 404 are not required to be executed, but other manners are adopted, and the operation resources occupied by the data are released according to the order of the priority of the data in the second application from low to high, so as to release the operation resources of the amount of resources to be released.
In the scheme provided by the embodiment of the application, in response to the foreground operation instruction of the first application, and under the condition that the current idle operation resource cannot meet the requirement of operating the first application in the foreground, according to the sequence from low priority to high priority of data in the second application operated in the background, the operation resource occupied by the data in the second application is released, as the influence degree of the data on the operation of the second application can be reflected, the operation resource is released according to the sequence from low priority to high priority, the idle operation resource can be increased, the idle operation resource can meet the requirement of operating the first resource in the foreground, further, the first application can still be operated in the foreground under the condition that the idle resource is insufficient, the second application can also be ensured to be operated in the background, the condition of closing the application operated in the background can be avoided as much as possible, the survival rate of the application operated in the background can be improved, the second application can be rapidly operated when the second application is switched to the foreground operation in the follow-up mode, and the operation efficiency of the second application can be further improved, and the user experience is further improved.
In the process of releasing the operation resources occupied by the data in the second application step by step, after each stage of data release, determining whether the released resource quantity reaches the required resource quantity to be released, and then releasing the operation resources occupied by the previous stage of data under the condition that the released resource quantity does not reach the resource quantity to be released, so as to ensure that a small amount of data is released as far as possible, avoid affecting the background operation of the second application, and simultaneously ensure that the operation resources of the resource quantity to be released are released, so that the idle operation resources of the computer equipment are enough to meet the requirement of operating the first application in the foreground, the subsequent computer equipment can normally operate the first application in the foreground, and the feasibility of operating the first application in the foreground is ensured.
Based on the embodiment shown in fig. 3, in the embodiment of the present application, according to the type of the running resource that is missing when the computer device runs the first application in the foreground, the running resource occupied by the data in the application running in the background is released, and the specific process is described in the following embodiment.
Fig. 5 is a flowchart of an application running method provided in an embodiment of the present application, where the method is performed by a computer device, as shown in fig. 5, and the method includes:
501. The computer device receives a foreground run instruction for a first application.
The step 501 is the same as the step 301, and will not be described again.
502. The computer equipment responds to the foreground operation instruction, and determines a second application, the quantity of the resources to be released and the resource type under the condition that the idle operation resources of the current equipment cannot meet the requirement of operating the first application in the foreground, wherein the resource type indicates the type of the operation resources to be released.
In the embodiment of the present application, the resource type is a type to which an operation resource that is lack by the computer device to run the first application in the foreground belongs, and the amount of the resource to be released is an amount of the resource corresponding to the resource type.
In one possible implementation, the determining the amount of resources to be released and the type of resources includes: responding to a foreground operation instruction, and determining at least one first resource type and a resource amount corresponding to each first resource type; under the condition that the resource quantity corresponding to any first resource type is larger than the resource quantity of idle operation resources belonging to the first resource type, determining that the idle operation resources of the current equipment cannot meet the requirement of operating the first application in the foreground; determining a second resource type from at least one first resource type, wherein the resource quantity corresponding to the second resource type is larger than the resource quantity of idle operation resources belonging to the second resource type; and determining the difference value between the resource quantity corresponding to the second resource type and the resource quantity of the idle resource type belonging to the second resource type as the resource quantity to be released corresponding to the second resource type.
The first resource type is the type of the operation resource required by the operation of the first application in the foreground, and the second resource type is the type of the operation resource to be released.
In the embodiment of the application, in response to a foreground operation instruction of the first application, whether the current idle operation resource meets the operation resource of each resource type required by the first application in the foreground operation is determined, and under the condition that the idle operation resource of the current device cannot meet the operation requirement of the first application in the foreground operation, the resource type and the corresponding resource amount of the operation resource which is lack in the foreground operation of the first application are determined, so that the operation resource can be released according to the lack of the resource type and the corresponding resource amount, the accuracy of the release of the subsequent operation resource is ensured, and the possibility of the subsequent first application in the foreground operation is also ensured.
It should be noted that, in the embodiment of the present application, the second application, the amount of resources to be released, and the type of resources are determined when the idle running resources of the current device cannot meet the requirement of running the first application in the foreground, and in another embodiment, the step 502 is not required to be executed, but other manners are adopted, and in response to the foreground running instruction, the second application and the amount of resources to be released are determined when the idle running resources cannot meet the requirement of running the first application in the foreground.
503. And the computer equipment releases the operation resources occupied by the third data according to the priority of the third data in the second application so as to release the operation resources which are to be released in the amount of resources and belong to the resource type, wherein the third data occupies the operation resources of the resource type.
In the embodiment of the application, the operation resources occupied by the data are released step by step according to the order of the priority of the data in the second application from low to high, so that the operation resources which are to be released are released, and the operation resources belong to the resource types, and the idle operation resources of each resource type can meet the requirement of operating the first application in the foreground, so that the subsequent computer equipment can normally operate the first application in the foreground, and the feasibility of operating the first application in the foreground is ensured.
It should be noted that, in the embodiment of the present application, the operation resources occupied by the data in the second application are released to release the amount of the resources to be released and the operation resources belonging to the resource type, and in another embodiment, the step 503 is not required to be executed, but other manners are adopted to release the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high.
In the scheme provided by the embodiment of the application, in response to the foreground operation instruction of the first application, and under the condition that the current idle operation resource cannot meet the requirement of operating the first application in the foreground, according to the sequence from low priority to high priority of data in the second application operated in the background, the operation resource occupied by the data in the second application is released, as the influence degree of the data on the operation of the second application can be reflected, the operation resource is released according to the sequence from low priority to high priority, the idle operation resource can be increased, the idle operation resource can meet the requirement of operating the first resource in the foreground, further, the first application can still be operated in the foreground under the condition that the idle resource is insufficient, the second application can also be ensured to be operated in the background, the condition of closing the application operated in the background can be avoided as much as possible, the survival rate of the application operated in the background can be improved, the second application can be rapidly operated when the second application is switched to the foreground operation in the follow-up mode, and the operation efficiency of the second application can be further improved, and the user experience is further improved.
And under the condition that the second application can run in the background, the running resources occupied by the data in the second application are released to release the running resources which are to be released in the quantity of the resources and belong to the resource types, so that the idle running resources of each resource type can meet the requirement of running the first application in the foreground, the subsequent computer equipment can normally run the first application in the foreground, and the feasibility of running the first application in the foreground is ensured.
On the basis of the embodiment shown in fig. 5, the resource types to which the running resources to be released belong include a calculation type and a memory type, the resource quantity to be released includes a first resource quantity and a second resource quantity, the first resource quantity corresponds to the calculation type, and the second resource quantity corresponds to the memory type; the above step 503 includes the following steps 5031-5033.
5031. And the computer equipment releases the operation resources occupied by the fourth data according to the priority of the fourth data in the second application so as to release the operation resources which are of the first resource quantity and belong to the calculation type, wherein the fourth data occupies the operation resources of the calculation type.
In the embodiment of the present application, in the process of running the second application in the background, the data occupying the running resources of the computing type may be associated with other data, and other data may occupy the running resources of the memory type, so when the running resources of the computing type are released in the process of releasing the running resources occupied by the data in the second application, other data associated with the data occupying the running resources of the computing type may be released, and then the running resources of the memory type may be additionally released, so when the running resources of the computing type and the memory type need to be released, the running resources of the computing type are preferentially released, and then when the running resources of the memory type currently released are insufficient, the running resources of the memory type may be continuously released, so that the release of sufficient running resources can be reduced as much as possible while the first resources are operated in the foreground.
In the embodiment of the present application, in a process of running a first application in the background, data of an operation resource occupied in the first application includes fourth data and fifth data, where the fourth data is data of an operation resource of a calculation type occupied in the first application, and the fifth data is data of an operation resource of a memory type occupied in the first application. The first resource amount corresponds to the calculation type, and the second resource amount corresponds to the memory type, that is, the resource amount of the operation resource of the calculation type to be released is the first resource amount, and the resource amount of the operation resource of the memory type to be released is the second resource amount.
In one possible implementation, the data occupying the running resource in the second application includes a plurality of fourth data, and the step 5031 includes: releasing the operation resources occupied by the sixth data according to the sequence of the priorities of the plurality of fourth data from low to high, wherein the sixth data is the fourth data with the lowest priority in the plurality of fourth data occupying the operation resources; and when the current released resource quantity does not reach the first resource quantity, releasing the operation resources occupied by the seventh data according to the sequence from low priority to high priority of the fourth data, wherein the priority of the seventh data is the upper level of the priority of the sixth data.
It should be noted that, the above process of releasing the operation resources occupied by the fourth data according to the order of the priorities of the plurality of fourth data from low to high is the same as the above steps 403 to 404, and will not be described again here.
It should be noted that, in the embodiment of the present application, only the operation resources occupied by the sixth data and the seventh data in the plurality of fourth data are released as an example, and in another embodiment, in the case of releasing the operation resources occupied by the seventh data, it is determined whether the currently released resource amount reaches the first resource amount again according to the above step 404. And under the condition that the current released resource quantity reaches the first resource quantity, indicating that enough operation resources are released, and no operation resources occupied by the fourth data of the upper stage of the seventh data are released. And under the condition that the current released resource quantity does not reach the first resource quantity, releasing the operation resources occupied by the fourth data of the upper stage of the seventh data according to the order of the priority of the fourth data from low to high, and the like, and determining until the current released resource quantity of the operation resources belonging to the calculation type reaches the first resource quantity.
It should be noted that, in the embodiment of the present application, after the running resources occupied by the sixth data are released, an example is taken as an example that the amount of resources currently released belonging to the computing type does not reach the first amount of resources, and in another embodiment, after the running resources occupied by the sixth data are released, in the case that the amount of resources currently released belonging to the computing type reaches the first amount of resources, it indicates that enough running resources have been released, and no running resources occupied by the seventh data need to be released.
5032. The computer device determines a third amount of resources that has been currently released, the third amount of resources being an amount of resources that released the operating resources of the memory type in releasing the operating resources of the compute type.
In the embodiment of the present application, in the process of releasing the operation resources of the computing type, the operation resources of the memory type may be additionally released, so after the operation of the computing type is released, the resource amount of the operation resources of the currently released memory type is determined, so that the resource amount of the operation resources of the memory type that still needs to be released can be determined later.
In one possible implementation, the step 5032 includes: and in the process of releasing the operation resources of the calculation type, detecting the operation resources of the occupied memory type in real time, and determining the third quantity of the released resources.
In the embodiment of the application, in the process of releasing the operation resources of the calculation type, the operation resources of the occupied memory type are detected in real time, so that the operation resources of which memory types are released can be timely detected, and the resource quantity of the operation resources of the released memory type is further determined.
5033. And under the condition that the third resource amount is smaller than the second resource amount, the computer equipment releases the operation resources occupied by the fifth data according to the priority of the fifth data in the second application so as to release the operation resources which are of the second resource amount and belong to the memory type, wherein the fifth data occupies the operation resources of the memory type.
In the embodiment of the present application, in the process of releasing the operation resources of the computing type, under the condition that the amount of resources of the operation resources of the additional releasing memory type is smaller than the second amount of resources, according to the priority of the fifth data, the operation resources occupied by the fifth data are continuously released, so that the second amount of resources can be released finally, and the operation resources belong to the memory type.
In one possible implementation, the step 5033 includes: and under the condition that the third resource amount is smaller than the second resource amount, determining the difference between the third resource amount and the second resource amount as a sixth resource amount, and releasing the operation resources occupied by the fifth data according to the priority of the fifth data in the second application to release the operation resources which are of the sixth resource amount and belong to the memory type, so that the operation resources which are of the second resource amount and belong to the memory type are finally released.
It should be noted that, the process of releasing the running resource of the memory type and the sixth resource amount according to the priority of the fifth data in the second application is the same as the process of releasing the running resource of the first resource amount and the computing type according to the priority of the fourth data in the second application in step 5031, and is not repeated here.
In the scheme provided by the embodiment of the invention, when the operation resources of the calculation type are released, the operation resources of the memory type may be additionally released, so that the operation resources of the calculation type are released preferentially under the condition that the operation resources of the calculation type and the memory type are required to be released, then under the condition that the operation resources of the memory type which are released currently are insufficient, the operation resources of the memory type are released continuously, so that enough operation resources can be released to meet the requirement of operating the first resources in the foreground, data in the second application are released as much as possible, the idle operation resources can meet the requirement of operating the first resources in the foreground, the second application can be ensured to be kept operating in the background, the condition that the application operated in the background is closed due to the insufficient idle operation resources in the foreground is avoided, the rapid operation of the second application can be realized when the second application is operated in the foreground, the operation efficiency of the second application is ensured, and the user experience is further improved.
On the basis of the embodiment shown in fig. 5, the resource type includes a memory type, and the amount of resources to be released is the amount of resources of the running resources of the memory type to be released; the fifth data in the second application comprises first type data or second type data, wherein the first type data is data loaded from the outside of the second application in the process of running the second application, the second type data is data generated in the process of running the second application, and the fifth data occupies running resources of a memory type; the above step 503 includes the following steps 5034-5035.
5034. And the computer equipment releases the operation resources occupied by the first type of data according to the priority of the first type of data.
In the embodiment of the present application, idle running resources of a current memory type cannot meet the requirement of running a first application in the foreground, and the amount of resources to be released is the amount of resources of running resources of a memory type that are lack in running the first application in the foreground. In the embodiment of the present application, the fifth data is taken as data of an operation resource currently occupying a memory type in the second application, and the fifth data includes two types of data, that is, the fifth data includes first type data or second type data, and priority is also provided between the first type data and the second type data, where the first type data has a small influence on the operation of the second application, and the second type data has a large influence on the operation of the second application, that is, the priority of the first type data is lower than that of the second type data. When the operation resources of the memory type are required to be released, the operation resources occupied by the first type of data are released preferentially, and when the operation resources of the memory type occupied by the first type of data cannot reach the amount of the resources to be released, the operation resources occupied by the second type of data are released.
It should be noted that, the above step 5034 is the same as the above steps 403 to 404, and will not be described herein.
5035. And under the condition that the first type of data is released completely and the current released resource quantity does not reach the to-be-released resource quantity, the computer equipment releases the operation resource occupied by the second type of data according to the priority of the second type of data so as to release the to-be-released resource quantity and the operation resource belonging to the memory type.
In the embodiment of the present application, the first type of data is released, that is, the operation resources occupied by the first type of data are released, and at this time, when the amount of resources of the released memory resource type does not reach the amount of resources to be released, the operation resources occupied by the second type of data are released according to the priority of the second type of data, so as to release the amount of resources to be released and the operation resources belonging to the memory type.
It should be noted that, the above step 5035 is the same as the above steps 403 to 404, and will not be described herein.
In the scheme provided by the embodiment of the invention, the data of the operation resources currently occupying the memory type in the second application comprises two types of data, namely, the data loaded from the outside of the second application in the process of operating the second application and the data generated in the process of operating the second application, when the idle operation resources of the current memory type cannot meet the requirement of operating the first application in the foreground, the data loaded from the outside of the second application in the process of operating the second application is released preferentially according to the importance degree of the data occupying the memory type, and when the operation resources of the first type occupying the memory type cannot reach the amount of the resources to be released, the operation resources occupied by the second type data are released, so that the data with little influence on the background operation of the second application can be released as far as possible, the idle operation resources can meet the requirement of operating the first resources in the foreground, the situation that the background operation of the second application is closed due to the fact that the idle operation resources are insufficient in the foreground operation of the first application can be ensured, the subsequent operation of the foreground can be ensured, and the second application can be operated rapidly, and the second user experience can be further ensured when the second application is operated in the foreground operation, and the second user is further ensured.
It should be noted that, in the above embodiment, the running resources occupied by the first type of data and the second type of data are released to release the running resources of the to-be-released resource amount and the memory type, and in another embodiment, when the first type of data and the second type of data are both released and the current resource amount of the running resources of the to-be-released resource amount does not reach the to-be-released resource amount, the running resources occupied by the fourth data in the second application are released according to the order of the priority of the fourth data in the second application from low to high, and the running resources of the sufficient memory type are released.
In this embodiment of the present application, since in the background operation process of the second application, the fourth data in the second application occupies the operation resources of the computing type, and the operation resources occupied by the fourth data occupy the operation resources of the computing type may occupy some of the operation resources of the memory type, when both the first type data and the second type data have been released and the current amount of resources for releasing the operation resources belonging to the memory type does not reach the amount of resources to be released, the operation resources occupied by the fourth data are released according to the order of the priority of the fourth data from low to high, so as to release the operation resources of the memory type as sufficiently as possible.
On the basis of the embodiments shown in fig. 2 to 5, for determining the time for determining the priority of the data in the second application, the embodiment of the present application can determine when the second application is switched from the foreground operation to the background operation, that is, the method further includes: and determining the priority of the data in the second application in response to the second application being switched from the foreground operation to the background operation.
In the embodiment of the application, when the second application is switched from the foreground operation to the background operation, the priority of the data in the second application is determined, so that the priority of the data in the second application can be determined in time, and the operation resources can be released in time according to the priority of the data when the operation resources occupied by the data in the second application are required to be released later, so that the real-time performance of the operation resources released later is ensured.
In the embodiment of the present application, in the process of running the second application, multiple types of data occupy running resources of the current device, and the extent of influence on running the second application is different, that is, the influence on the experience of the user using the second application is different, so that the data in the second application is prioritized, and when the running resources occupied by the data in the second application need to be released, the running resources occupied by the data are released step by step according to the order of low priority, so that the influence on the use experience of the user after the data in the second application is released is reduced as much as possible.
In one possible implementation manner, the data in the second application includes fourth data or fifth data, the fourth data occupies operation resources of a computing type, and the fifth data occupies operation resources of a memory type; a process of prioritizing data in the second application comprising: determining a priority of each fourth data based on attribute information of the fourth data, the attribute information including at least one of a loading speed or importance; alternatively, the priority of each fifth data is determined based on the attribute information of the fifth data.
In the embodiment of the application, the loading speed can reflect the time consumption required by reloading after the data is released, and the faster the loading speed is, the shorter the time consumption required by reloading after the data is released is; the slower the loading speed, the longer it takes to reload after the data is released. The importance degree can reflect the influence degree of the data on the second application running in the foreground, and the larger the importance degree is, the more important the data is, namely, the larger the influence of the data on the second application running in the foreground is; the smaller the importance, the less important the data is represented, i.e. the less the data has an impact on running the second application in the foreground.
In the embodiment of the application, the priority of the data is determined based on at least one of the loading speed or the importance of the data, so that the priority of the data can reflect the time consumption required by reloading the data, or can reflect the influence degree of the data on the operation of the second application in the foreground, so as to ensure the accuracy of the priority, further ensure that the time consumption required by reloading the data by priority release is short when the operation resources occupied by the data are released according to the priority of the data, or ensure that the influence on the operation of the second application is smaller, and ensure that the second application can normally operate while the operation resources are released.
Optionally, in the case that the attribute information includes a loading speed, the priority of the fourth data has a negative correlation with the loading speed, and the priority of the fifth data has a negative correlation with the loading speed, that is, the faster the loading speed of the fourth data, the lower the priority of the fourth data, the slower the loading speed of the fourth data, and the higher the priority of the fourth data. In the case where the attribute information includes importance, the priority of the fourth data is in positive correlation with the importance, and the priority of the fifth data is in positive correlation with the importance, that is, the smaller the importance of the fourth data is, the lower the priority of the fourth data is, the greater the importance of the fourth data is, and the higher the priority of the fourth data is.
Optionally, weighting the loading speed and the importance of the fourth data to obtain attribute values, and determining the priority of the fourth data based on the attribute values of the fourth data, wherein the attribute information comprises the loading speed and the importance; and weighting the loading speed and importance of the fifth data to obtain attribute values, and determining the priority of the fifth data based on the attribute values of the fifth data.
For example, the fourth data is a thread, in the running process of the second application, a plurality of threads are created, and are respectively responsible for different functions, if the threads are released, the required time and the required running resources are different when the threads are re-created subsequently, and meanwhile, if the loading time of the threads is too long, that is, the loading speed of the threads is too slow, the loading time of the second application is too long when the second application is switched to run in the foreground, and the use experience of a user can be influenced as the running influence on the second application is larger after the threads are released. Therefore, the priority of the thread of the second application is classified into 5 levels based on the above influencing factors, the higher the priority, the longer the loading time is, and the greater the influence on the running of the second application after being released, the lower the possibility that the thread with the higher priority is released. The priority of the threads is shown in table 1 below, priority 1 being the lowest priority and priority 5 being the highest priority. The thread of the priority 1 is a thread temporarily created during the process of running the second application, the influence on the second application is small after the thread of the priority 1 is released, and the thread of the priority 1 can be quickly created after the thread of the priority 1 is released. For example, if the second application is a game application, the thread with the priority of 1 is a data reporting thread of various assistance in the game application. The thread of the priority 2 is a thread temporarily created in the process of running the second application, and after the thread of the priority 2 is released, the influence on the second application is small, but the reloading time of the thread of the priority 2 is long. For example, the second application is a game application, and the thread of priority 2 is a thread created by various types of third party SDKs (Software Development Kit, software development kits). The thread of priority 3 has an impact on the second application after being released, however, the reloading of the thread of priority 3 is time consuming. For example, the second application is a gaming application, and the thread of priority 3 is a lightly logical thread of various types created by the main thread of the gaming application. The thread of priority 4 has an impact on the second application after being released and the reloading of the thread of priority 3 takes a long time. For example, the second application is a gaming application and the thread of priority 4 is a logical thread created by the main thread of the gaming application. The thread with the priority 5 is a core thread of the second application, and after the thread with the priority 5 is released, logic of the second application cannot run. For example, the second application is a gaming application, and the threads of priority 5 are the main thread and rendering thread of the game.
TABLE 1
Optionally, for fifth data occupying the running resources of the memory type, the fifth data includes first type data and second type data, the first type data is data loaded from outside the second application in the process of running the second application, and the second type data is data generated in the process of running the second application; the process of determining the priority of the fifth data includes: and determining the priority of each first type of data and the priority of each second type of data respectively based on the attribute information of the first type of data and the attribute information of the second type of data, wherein the priority of the first type of data is lower than the priority of the second type of data.
In the embodiment of the present application, for a plurality of first-class data, the priority of each first-class data is determined according to the attribute information of the first-class data, for a plurality of second-class data, the priority of each second-class data is determined according to the attribute information of the second-class data, and because the first-class data is data that is loaded from outside the second application and the second-class data is data that is generated in the process of running the second application, the second-class data has a greater influence on running the second application than the first-class data, so that the priority of each second-class data is higher than that of each first-class data, and therefore, in the case that a memory-type running resource needs to be released later, the data loaded from outside the second application is released preferentially, and at the same time, the influence on running the second application is reduced as much as possible.
The above-mentioned process of determining the priority of each first type of data and the priority of each second type of data is the same as the above-mentioned process of determining the priority of the fourth data or the priority of the fifth data based on the attribute information, and will not be described in detail here.
For example, in the running process of the second application, in order to avoid repeated loading of data from an external storage or server, some data is cached in an internal memory, taking the second application as an example of a game application, the fifth thread is some picture resources, ranking list data and the like used in the game application, the priority of the data is low, and the running influence of the second application after cleaning is not great, that is, the experience of using the second application is not great, and under the condition that the running resources occupied by the first type of data in the second application need to be released, the cached data is released preferentially so as to release the running resources occupied by the cached data. The cache data comprises two types, namely dynamically updated cache data such as ranking list data, the data can be updated continuously in the process of running the second application, and even if the data is released, the data can be updated again later; the other is the cached data that is not updated statically. For the dynamically updated cache data, the priority of the dynamically updated cache data is set to 1, and for the statically non-updated cache data, if the statically non-updated cache data is not referenced by other data, the priority of the statically non-updated cache data is set to 1; if the static non-updated cache data is referenced by other data, the priority of the static non-updated cache data is set to 2.
For another example, the second class data is state/process data, and the second class data is prioritized based on factors such as the second class data is valid for running the second application, the loading speed, and whether it is currently valid. Taking the second application as a game application for example, the priorities of the second class of data are as shown in table 2 below, with priority 1 being the lowest priority and priority 5 being the highest priority. The second class data of the priority 1 is the data which is not used any more in the current game scene or the game copy in the game application, and the influence on the game application is small after the second class data of the priority 1 is released. For example, the scene currently displayed by the game application is a game lobby, and the second class data of priority 1 is temporary data in a history game. The second type data of the priority 2 is non-core data of the game application, the influence on the game application is small after the second type data of the priority 2 is released, and the loading speed of the second type data of the priority 2 is high. For example, the second class of data of priority 2 is data related to various auxiliary systems in the gaming application. The second type data of the priority 3 is non-core data of the game application, and after the second type data of the priority 3 is released, the influence on the game application is small, but the loading speed of the second type data of the priority 3 is slow. For example, the second class of data of priority 3 is data related to various auxiliary systems in the game application, and data which needs to be pulled from a server or obtained through complex operations. The second type data of the priority 4 is core data of the game application, and has influence on the game application after being released, but the loading speed of the second type data of the priority 4 is high. For example, the second class of data of priority 4 is various types of computational rules in gaming applications that need to be pulled from a server or that need to be obtained locally through complex logic. The second class data of the priority 5 is core data of the game application, and the influence on the game application is large after the second class data of the priority 5 is released. For example, the second class of data of priority 5 is login-related data and other related core data in the game application.
TABLE 2
It should be noted that, in this embodiment of the present application, the priority of the data is determined only based on the attribute information of the data in the second application, and in another embodiment, the above manner is not required to be performed, but the priority of the data in the second application is determined in other manners.
In one possible implementation, an automatic classification model is trained in the manner defined above, by which the priority of the data is determined based on the attribute information of the data in the second application.
In another possible implementation manner, in the process of developing the second application, the developer manually sets the priority for the data in the second application, and the set priority is directly adopted without executing the process of determining the priority.
In another possible implementation manner, in the process of developing the second application, the developer manually sets the priority of the data in the second application, and in the process of running the second application, the developer determines the priority of the data based on the attribute information of the data in the second application through an automatic classification model, and updates the data in the second application to set the priority of the developer, so that when the priority of the data of the second application needs to be determined again later, the updated priority is directly adopted, the priority is not required to be determined through the automatic classification model, the efficiency of determining the priority is ensured, and the resources of the device are also saved.
On the basis of the embodiments shown in fig. 2 to 5, in the case that the running resources released by the second application reach the amount of resources to be released, the first application is run in the foreground based on the current idle running resources, that is, the method further includes: and running the first application in the foreground based on the current idle running resource under the condition that the current released resource quantity reaches the resource quantity to be released.
In the embodiment of the application, under the condition that the current released resource quantity reaches the resource quantity to be released, at this time, the idle running resource of the current device meets the requirement of running the first application in the foreground, and then the first application is run in the foreground based on the current idle running resource, so that the background running of the second application is ensured as much as possible while the foreground running of the first application is realized, the situation that the application running in the background is closed due to insufficient idle running resource when the first application is run in the foreground is avoided, and further, the subsequent fast running of the second application when the second application is run in the foreground is ensured, the running efficiency of the second application is ensured, and further, the user experience is improved.
On the basis of the embodiments shown in fig. 3 to 5, when the running resources occupied by the data in the second application are released, but the released resources still do not reach the amount of resources to be released, the application running in the background is prompted to be closed by displaying a prompt message, so that more running resources can be released to run the first application in the foreground, that is, the method further includes the following steps 1-3.
And step 1, displaying prompt information when the operation resources occupied by the data are released and the current released resource quantity does not reach the to-be-released resource quantity, wherein the prompt information indicates that the operation resources occupied by the data in the second application are released and the operation of the first application in the foreground cannot be met.
In the embodiment of the application, the running resources occupied by the data in the second application are released, but the released resource quantity does not reach the to-be-released resource quantity at this time, which means that the idle running resources at this time cannot still meet the requirement of running the first application in the foreground, so that more running resources can be released in other ways later, so as to ensure that the first application can be run later in the foreground, and the first application can still be run later in the foreground under the condition of insufficient idle resources.
After the prompt information is displayed, any one of the following step 2 or step 3 can be adopted to close the application running in the background so as to release more running resources.
Step 2, responding to the confirmation operation of the prompt information, and displaying the application running in the background; and closing the application running in the background in response to the closing operation of the application running in the background.
In the embodiment of the application, the prompt information prompts that the released resource quantity does not reach the resource quantity to be released yet, and the application running in the background can be called out, so that the user can select to close the application in the background, further more running resources are released, and further the first application can still be run in the foreground under the condition of insufficient idle resources.
In one possible implementation, the step 2 includes: and displaying an application list in response to the confirmation operation of the prompt information, wherein the application list comprises identifiers of the applications running in the background, and closing the application corresponding to the identifier of the application in response to the closing operation of the identifier of any application in the application list.
In the embodiment of the application, the application list can be called through the prompt information to show which applications are running in the background, so that the user selects to close the application in the background, further more running resources are released, the user operation is facilitated, and the follow-up first application can be normally run in the foreground.
For example, the computer device is provided as a terminal, the terminal displays prompt information in a display interface, the prompt information includes management options, the user clicks the management options, the terminal displays an application list and a closing option in the display interface, and the user can learn the application running in the background by looking up the application list. And under the condition that the identifier of any application in the application list is selected, the user clicks the closing option to close the application corresponding to the identifier of the application.
And step 3, closing the application running in the background in response to the timing duration reaching the duration threshold, and starting timing from displaying the prompt information.
In the embodiment of the application, the timing is started from the display of the prompt information, and when the timing time reaches the time threshold and the operation condition of the user is not detected, the application operated by the background is automatically closed to release more operation resources, so that the first application can be operated in the foreground normally in the follow-up process, excessive operations are not required to be executed by the user, and the convenience of the application operation is ensured.
In one possible implementation, after step 3, the method further includes: and displaying a closing prompt, wherein the closing prompt is used for prompting that the application running in the background is closed.
For example, after the prompt information is displayed, if the user does not operate or does not release enough resources after the user finishes, the application running in the background is closed, and a closing prompt is displayed at the same time, so as to inform the user that the application running in the background is stopped.
In the embodiment of the application, when the running resources occupied by the data in the second application cannot meet the requirement of running the first application in the foreground, the display prompt information is taken as an example for illustration, in another embodiment, the computer device runs a plurality of applications in the background, the second application is the application with the lowest priority among the plurality of applications running in the background, when the running resources occupied by the data in the second application cannot meet the requirement of running the first application in the foreground, based on the priorities of the plurality of applications running in the background, a third application is determined from the applications running in the background and except the second application, the third application is the application with the lowest priority among the plurality of applications running in the background and the applications except the second application, and after the running resources are released, the idle running resources of the current device meet the requirement of running the first application in the foreground. For example, determining the amount of resources and the corresponding types of resources that need to be released currently, and according to the manner of releasing the running resources occupied by the data in the second application, releasing the running resources occupied by the data in the third application based on the amount of resources and the corresponding types of resources that need to be released currently and according to the priority of the data in the third application.
And under the condition that the operation resources occupied by the data in the third application cannot meet the requirement of operating the first application in the foreground, the operation resources occupied by the data in the next application operated in the background are also released, and the like, so that the idle operation resources of the current equipment meet the requirement of operating the first application in the foreground after the operation resources are released. And, in the case that the data in the plurality of applications running in the background are released and the current idle running resources cannot meet the requirement of running the first application in the foreground, a prompt message is displayed, and the applications running in the background are closed according to the steps 1-3 so as to release more running resources.
On the basis of the embodiments shown in fig. 2 to fig. 4, in the process of releasing the operation resources occupied by the data in the second application, the released data is recorded, so that when the second application is switched to the foreground operation, the released data is recovered based on the recording, that is, the method further includes: in the process of releasing the operation resources occupied by the data, generating a release record, wherein the release record indicates the released data; responsive to the second application switching from the background run to the foreground run, the released data is restored based on the release record.
In the embodiment of the application, in the process of releasing the operation resources occupied by the data in the second application, the release record is generated to record the released operation resources, so that when the subsequent second application is switched to the foreground operation, the released data is recovered based on the release record, when the second application is switched to the foreground operation, the released data can be quickly recovered, the second application can be ensured to normally operate in the foreground, the quick loading of the second application is realized, the influence caused by the released data of the second application is avoided as much as possible, and the experience of using the second application by a user is improved.
In this embodiment of the present application, when the second application is switched to the foreground running, that is, the user re-activates the second application, the environment of the second application needs to be quickly restored, and the released data needs to be quickly loaded when the second application runs in the background. Therefore, in the process of releasing the operation resources occupied by the data in the second application, which data are released is accurately recorded, and the released data are restored one by one based on the release record when the second application is re-activated.
In one possible implementation, the release record includes a data identification, a data priority, a data type, whether a connection service is required, data loading information, and the like.
Wherein the data identifier is a unique index indicating data, the priority of the data is the priority before the data is released, and the data identifier is represented by INT (integer type) data. The data priority is represented in enumerated types of data. The data types are represented by enumerated types of data, which can reflect what type of operating resources the data occupies, e.g., thread, cache data, state/process data, etc. For example, a data type of 0 or 1 indicates a data type of thread, and a data type of 1 indicates a data type of cache data, status/process data. Whether the connection service is needed refers to whether the connection with the server is needed when the data is loaded, if the data is a local resource of the device, the connection with the server is not needed when the data is loaded, and if the data is the data stored in the server, the connection with the server is needed when the data is loaded. Whether or not a connection service is required can be represented in boolean type data. Whether the connection service is required is represented by 0 or 1, whether the connection service is required is represented by 0, the data is a local resource of the device, the server is not required to be connected when the data is loaded, whether the connection service is required is represented by 1, the data is data stored in the server, and the data is required to be connected with the server when the data is loaded. The data loading information indicates a data structure, which can be used for fast loading data, and the data loading information of different data may be different, for example, the data loading information includes a storage path of a local file, a start parameter related to a thread, data in a thread running process, server address information, related request parameters and the like. The starting parameters related to the threads and the data in the thread running process are used for quickly creating new threads and recovering the current running state of the threads. For data that needs to be acquired by connecting to a server, the data loading information includes server address information and related request parameters, so as to be used for quickly connecting to the server and acquiring related information. The data loading information can be represented in Byte type data.
In one possible implementation, the process of generating a release record includes: in the process of releasing the operation resources occupied by the data, a release record is generated based on the released fourth data or second class data, wherein the fourth data occupies the operation resources of the calculation type, and the second class data is data generated in the process of operating the second application.
In the embodiment of the application, the fourth data and the second type data are data with larger influence on the operation of the second application, and the first type data have smaller influence on the operation of the second application, so that when the subsequent second application is switched to the foreground operation, the released data with larger influence on the operation of the second application can be quickly recovered based on the release record, the time consumption required for recovering the released data is saved as much as possible, the second application can be ensured to be normally operated, the interference on the use of the second application by a user is avoided, and the experience of the use of the second application by the user is further improved.
Since the first type of data is the cache data, the cache data is reloaded when being reused, the released cache data is not required to be recorded in the release record, and only the data with larger influence on the running of the second application is required to be recorded.
It should be noted that, in the above embodiment, only the computer device directly implements the application running method is described as an example, and in another embodiment, the computer device implements the application running method provided in the embodiment of the present application through bidirectional cooperation between the system and the process of the second application. That is, the foreground operation of the first application is controlled by the system, the operation resources occupied by the data in the second application are released by the process of the second application, and the resource release request is sent to the process of the second application by the system through the interaction between the system and the process of the second application, so that the operation resources occupied by the data are released by the process of the second application, and the release result is fed back to the system by the process of the second application.
In one possible implementation, the process of releasing the resource by the system and the process of the second application includes: the computer equipment can receive a foreground operation instruction of the first application through the system, and responds to the foreground operation instruction through the system, and determines a second application and sends a resource release request to a process of the second application under the condition that idle operation resources of the current equipment cannot meet the requirement of operating the first application in the foreground; responding to the resource release request by the computer equipment through the process of the second application, releasing the operation resources occupied by the data according to the sequence from low priority to high priority of the data in the second application, and feeding back the release result to the system; the computer device receives the release result through the system and performs subsequent processing based on the release result.
In one possible implementation manner, the resource release request carries the amount of resources to be released, and the computer device releases the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high through the process of the second application so as to release the operation resources of the amount of resources to be released, and sends a first notification to the system so as to notify the system that enough operation resources are released; the computer equipment receives a first notice through the system, and runs a first application in the foreground based on the current idle running resource under the condition that the current released resource quantity reaches the resource quantity to be released.
Optionally, the resource release request carries the amount of the to-be-released resource and the corresponding resource type, and then the computer device releases the operation resource occupied by the data according to the order of the priority of the data in the second application from low to high through the process of the second application, so as to release the amount of the to-be-released resource and the operation resource belonging to the resource type, and sends a first notification to the system so as to notify the system that enough operation resource has been released.
In another possible implementation manner, the computer device sends a second notification to the system through the process of the second application when the running resource occupied by the data is released and the current released resource amount does not reach the to-be-released resource amount, so as to notify the system that the running resource occupied by the data in the second application is released and the current released resource amount does not reach the to-be-released resource amount; the computer equipment receives the second notification through the system and displays the prompt information.
In one possible implementation, the computer device determines, by a process of the second application, a priority of data in the second application in response to the second application switching from a foreground operation to a background operation.
In one possible implementation manner, in the process that the computer device releases the running resource through the process of the second application, the computer device generates a release record through the process of the second application, so that when the second application is switched to the foreground running, the computer device quickly recovers the released data based on the release record through the process of the second application.
In one possible implementation manner, the computer device can close a process of the background running application through the system, close other data managed by the process of the background application while closing the process of the background running application, and further close the application running in the background.
According to the scheme provided by the embodiment of the application, through the bidirectional interaction of the application process and the system, under the condition of insufficient idle running resources, the application process is informed to release corresponding running resources through the interaction protocol, the application process releases occupied running resources according to the required released resource amount based on the priority of data in the application, and the application process can be guaranteed to normally run in the background while the system is ensured to have enough idle resource use. Therefore, when the subsequent user switches the application running in the background to the foreground, the core process and the core data of the application are in normal running, and only partial data released in the background running are needed to be loaded, so that the second application running in the foreground can be quickly recovered. Through flexible adjustment, the experience of using the application by the user is improved.
In the embodiment of the application, a bidirectional interaction channel between a system and a process of a background running application is established. The interactive channel system can inform the process of the background running application of releasing resources, the process of the background running application can synchronize the resource release result to the system, and through bidirectional cooperation, the system is ensured to have enough running resources to run other applications in the foreground when the process of the background running application runs in the background.
And by establishing a hierarchical release and loading mechanism, the process of the background running application releases occupied running resources according to the priority of the data, namely, the process of the background running application prioritizes the data according to the influence of the data on user experience and loading speed, so that the experience on the user can be smaller after the running resources occupied by the data are released. When the user reenters the background running application, that is, the background running application is switched to the foreground running again, the user can realize quick loading again based on the release record, so that the user experience is ensured to be lossless.
And the system cooperates with the process of the background running application to release the running resources, so that the process of the foreground running application is ensured to have enough running resources. When the idle running resources are insufficient, the system accurately informs the background running application of the resource quantity required to be released based on the resource quantity of the lacking running resources, so that the process of the background running application can be released as required, and the data required to restore to be released can be smaller when the user reenters the background running application, namely, the background running application is switched to the foreground running again.
Based on the embodiment shown above, when the second application running in the foreground is switched to the background running, the embodiment of the application can also display the reminding information of the background running. Taking the second application as an example of the game application, when the game application is switched to the background operation, the terminal displays a desktop, and displays reminding information of the background operation on the desktop, as shown in fig. 6, the reminding information is "the game will be operated in the background", and at the moment, the terminal starts a background keep-alive function, that is, when the idle operation resources of the terminal are insufficient, the operation resources can be released according to the scheme provided by the embodiment of the application according to the priority of the data in the game application, and the game application is ensured to be operated in the background while enough operation resources are released as much as possible. When a subsequent user runs a first application in the foreground through the terminal, if the idle running resources are insufficient, the running resources are released through the system informing the process of the game application, and under the condition that the process of the game application can not release enough running resources, the terminal displays prompt information through the system, as shown in fig. 7, the prompt information is 'insufficient system resources, namely, the game process is about to be ended', so as to prompt the user to close the game application running in the background. And meanwhile, the management process is popped up, and after clicking the management process button, the user can check and end all processes running in the background. If the user does not operate or still releases insufficient resources after finishing other processes, the process of the game application is closed, and the user is informed that the game process is stopped.
Based on the above-mentioned embodiments, the present application further provides a flowchart for releasing the running resources, taking the second application as an example of the game application, when the game application proceeds and receives the resource release request sent by the system, the running resources are released according to the order of the priority of the data in the game application from low to high until enough running resources are released. If the system needs the operation resources of the calculation type and the operation resources of the memory type, the process of the game application releases the operation resources of the calculation type firstly, in the process of releasing the operation resources of the calculation type, some operation resources of the memory type are released synchronously, if the released operation resources of the memory type can meet the system requirement, the operation resources of the memory type are not required to be released later, the process of releasing the operation resources is finished, and otherwise, the process of the game application continues to release the operation resources of the memory type. As shown in fig. 8, the following process of releasing the running resources is implemented by the progress of the game application, and the process of releasing the running resources includes:
step 1, determining which resource type of operation resource is released firstly based on the resource type to be released, if the operation resource of the calculation type is involved, preferentially releasing the operation resource occupied by the thread, and if the operation resource of the calculation type is not involved, only releasing the operation resource of the memory type.
And 2, for releasing the operation resources of the calculation type, releasing the operation resources occupied by the threads according to the sequence of the priority of the threads from low to high. That is, the release is started from the level 1 thread, and if all of the level 1 threads are released and the system requirement on the operation resources of the computing type is not met, the level 2 threads are continuously released. If the system's demand for compute type execution resources is met, or all threads have been released, step 3 is performed.
Step 3, judging whether enough operation resources of the calculation type are released, if so, informing the system to normally finish the resource release flow; if sufficient computing type of operating resources are not released, the system is notified to initiate an exception handling flow.
And 4, for the operation resources of the released memory type, releasing the operation resources occupied by the cache data according to the order of the priority of the cache data from low to high. That is, according to the operation resources of the memory type to be released, the cache resources with priority of 1 and 2 are sequentially released until the operation resource requirement of the system on the memory type is met, or until all the cache resources are released.
And 5, judging whether the running resources of the memory type required by the system are released, and if so, informing the system of normally completing the release of the resources.
And 6, if the running resources of the enough memory types are not released yet. And starting a process of releasing the operation resources occupied by the state/process data, namely releasing the operation resources occupied by the state/process data according to the order of the operation resources of the current required memory type and the priority of the state/process data from low to high. If the system's operating resource requirements for the memory type are met, or the state/process data has been fully released, step 7 is performed.
And 7, continuously judging whether the operating resource requirement of the system on the memory type is met, and if so, notifying the system that the operating resource of the required memory type is released. If not, step 8 is performed.
And 8, judging whether the running resources of all the memory types are released, if so, executing the step 9, otherwise, returning to the step 6, and continuing to release the running resources of the memory types.
And 9, since the thread also occupies the running resources of a certain memory type, releasing the running resources occupied by the thread according to the sequence of the priority of the thread from low to high until the running resources of the sufficient memory type are released or all threads are released.
Step 10, continuously judging whether the running resource requirement of the system on the memory type is met, and if so, notifying the system that the running resource of the required memory type is released; if not, the system is informed to start the abnormal processing flow.
And step 11, under the condition that the system starts an abnormal processing flow, the system can inform the user of freely selecting and closing the process of the background running application in a mode of displaying prompt information, and if the user does not execute the operation or can not provide enough running resources after executing the operation, the system forcibly stops the background running application.
Based on the above-described embodiments, the embodiments of the present application further provide a flowchart of an application running method, as shown in fig. 9, where the method is implemented by a terminal as an example, and a second application is taken as a game application as an example, and the terminal only runs the game application in the background, then the method includes:
1. the user switches the game application to background operation through the terminal, and the terminal sorts the current running thread, cache data and state/process data of the game application through the process of the game application, marks priority, so that the user can respond more quickly after receiving a resource release request sent by the system.
2. After finishing data arrangement through the process of the game application, the game application keeps running in the background, and the terminal detects the resource release request sent by the system in real time through the process of the game application.
3. The terminal responds to a foreground running instruction of the first application through the system, and determines the resource quantity of running resources of a plurality of resource types required by running the first application in the foreground.
In the embodiment of the application, when determining the resource amount of the running resources of multiple resource types required for running the first application in the foreground, determining the required calculation type, the corresponding resource amount, the memory type and the corresponding resource amount.
4. The terminal judges whether the current idle running resource meets the requirement of running the first application in the foreground through the system, if the current idle running resource meets the requirement of running the first application in the foreground, the terminal directly allocates the required resource, and runs the first application in the foreground based on the current idle running resource; if the current idle running resource cannot meet the requirement of running the first application in the foreground, determining the resource type and the corresponding resource quantity of the running resource which are lack, starting a resource release flow, and sending a resource release request to a process of the game application, wherein the resource release request carries the resource type and the corresponding resource quantity which need to be released.
5. The terminal responds to the resource release request through the progress of the game application, and releases the running resource according to the embodiment shown in the above figure.
6. After the terminal finishes releasing the running resources through the process of the game application, feeding back a resource release result to the system; the terminal receives a resource release result through the system, judges whether enough operation resources are released, and if so, directly enters a resource allocation flow, and operates the first application in the foreground based on the current idle operation resources.
7. The terminal determines that enough running resources are not released through the system, informs a user of intervention in a mode of displaying prompt information, and confirms whether the running resources are released by stopping a process of running the application in the background.
8. The user can choose to ignore the prompt information and also choose to end the process of running the application in the background by checking the displayed prompt information through the terminal, the user does not execute the selection operation on the prompt information through the terminal, and after a certain time is exceeded, the terminal automatically ends the process of running the application in the background through the system.
9. After the terminal judges and reminds the user through the system, whether enough operation resources are released or not. If enough running resources are released, the resource allocation flow is directly entered, and the first application is run in the foreground based on the current idle running resources.
10. And the terminal directly and automatically ends the process of the game application running in the background or other processes running in the background under the condition that enough running resources are not released through the system, until enough running resources are released or all the processes of the game application running in the background are ended.
11. And the terminal continuously judges whether enough operation resources are released through the system, if so, enters a normal resource allocation flow, and operates the first application in the foreground based on the current idle operation resources.
12. And the terminal normally performs operation resource allocation under the condition of enough operation resources through the system, so as to keep the normal operation of the system.
13. The terminal enters a processing flow with insufficient resources under the condition that enough operation resources are not released through the system, and provides a lossy service for a user when a first application is operated at a foreground; or reminding the user terminal that the first application cannot be normally operated.
Fig. 10 is a schematic structural diagram of an application running device according to an embodiment of the present application, as shown in fig. 10, where the device includes:
a receiving module 1001, configured to receive a foreground running instruction for a first application;
a determining module 1002, configured to determine, in response to a foreground operation instruction, a second application when an idle operation resource of the current device cannot meet a requirement of operating the first application in the foreground, where the second application is an application that the current device operates in the background;
And the releasing module 1003 is configured to release the running resources occupied by the data according to the order of the priority of the data in the second application from low to high, where the data is the data occupying the running resources of the current device in the second application.
In one possible implementation manner, the determining module 1002 is configured to determine, in response to the foreground running instruction, the second application and the amount of resources to be released in a case where the idle running resources cannot satisfy the first application running in the foreground;
and the releasing module 1003 is configured to release the running resources occupied by the data according to the order of the priority of the data in the second application from low to high, so as to release the running resources of the amount of resources to be released.
In another possible implementation manner, the releasing module 1003 is configured to release, according to the order of the priority of the data from low to high, the running resource occupied by the first data in the second application, where the first data is the data with the lowest priority in the data currently occupying the running resource; and under the condition that the current released resource quantity does not reach the resource quantity to be released, releasing the operation resources occupied by the second data according to the order of the priority of the data from low to high, wherein the priority of the second data is the upper level of the priority of the first data.
In another possible implementation manner, the determining module 1002 is configured to determine, in response to the foreground running instruction, the second application, the amount of resources to be released, and the type of resources, where the idle running resource cannot satisfy running the first application in the foreground, and the type of resources indicates a type to which the running resource to be released belongs;
and the releasing module 1003 is configured to release the operation resources occupied by the third data according to the priority of the third data in the second application, so as to release the operation resources that are to be released in the amount of resources and belong to the resource type, where the third data occupies the operation resources of the resource type.
In another possible implementation manner, the resource type includes a calculation type and a memory type, the amount of resources to be released includes a first amount of resources and a second amount of resources, the first amount of resources corresponds to the calculation type, and the second amount of resources corresponds to the memory type; a releasing module 1003, configured to release, according to the priority of the fourth data in the second application, the operation resource occupied by the fourth data, so as to release the operation resource that is of the first resource amount and belongs to the calculation type, where the fourth data occupies the operation resource of the calculation type; determining a third resource amount which is released currently, wherein the third resource amount is the resource amount of the operation resource of the memory type in the process of releasing the operation resource of the calculation type; and under the condition that the third resource amount is smaller than the second resource amount, releasing the operation resources occupied by the fifth data according to the priority of the fifth data in the second application so as to release the operation resources which are of the second resource amount and belong to the memory type, wherein the fifth data occupies the operation resources of the memory type.
In another possible implementation manner, the resource type includes a memory type, and the amount of the resources to be released is the amount of resources of the operation resources of the memory type to be released; the fifth data in the second application comprises first type data or second type data, wherein the first type data is data loaded from the outside of the second application in the process of running the second application, the second type data is data generated in the process of running the second application, and the fifth data occupies running resources of a memory type;
a releasing module 1003, configured to release the operation resources occupied by the first type of data according to the priority of the first type of data; and under the condition that the first type of data is released completely and the current released resource quantity does not reach the to-be-released resource quantity, releasing the operation resources occupied by the second type of data according to the priority of the second type of data so as to release the to-be-released resource quantity and the operation resources belonging to the memory type.
In another possible implementation, as shown in fig. 11, the apparatus further includes:
and an operation module 1004, configured to operate the first application in the foreground based on the current idle operation resource when the current released resource reaches the to-be-released resource.
In another possible implementation, the determining module 1002 is further configured to determine the priority of the data in response to the second application being switched from the foreground operation to the background operation.
In another possible implementation manner, the data includes fourth data or fifth data, the fourth data occupies operation resources of a computing type, and the fifth data occupies operation resources of a memory type; a determining module 1002, configured to determine a priority of each fourth data based on attribute information of the fourth data, where the attribute information includes at least one of a loading speed or an importance; alternatively, the priority of each fifth data is determined based on the attribute information of the fifth data.
In another possible implementation manner, the fifth data includes first type data and second type data, the first type data is data loaded from outside the second application in the process of running the second application, and the second type data is data generated in the process of running the second application; the determining module 1002 is configured to determine, based on the attribute information of the first type data and the attribute information of the second type data, a priority of each first type data and a priority of each second type data, respectively, where the priority of the first type data is lower than the priority of the second type data.
In another possible implementation manner, the determining module 1002 is configured to determine, in response to the foreground running instruction, the second application and the amount of resources to be released, where the idle running resource cannot satisfy the requirement of running the first application in the foreground, and the amount of resources to be released is the amount of resources to be released;
as shown in fig. 11, the apparatus further includes:
the display module 1005 is configured to display a prompt message when the operation resource occupied by the data is released, and the current released resource amount does not reach the to-be-released resource amount, where the prompt message indicates that the operation resource occupied by the data in the second application is released, so that the first application cannot be operated in the foreground.
In another possible implementation, as shown in fig. 11, the apparatus further includes:
a closing module 1006, configured to display an application running in the background in response to a confirmation operation on the prompt information; closing the application running in the background in response to the closing operation of the application running in the background; or,
and a closing module 1006, configured to close the application running in the background in response to the timing duration reaching the duration threshold, where the timing duration starts to be timed from displaying the prompt information.
In another possible implementation, as shown in fig. 11, the apparatus further includes:
The generating module 1007 is configured to generate a release record in a process of releasing the operation resource occupied by the data, where the release record indicates the released data;
and a recovery module 1008, configured to recover the released data based on the release record in response to the second application switching from the background operation to the foreground operation.
In another possible implementation manner, the generating module 1007 is configured to generate, during a process of releasing the operation resources occupied by the data, a release record based on the released fourth data or second type data, where the fourth data occupies the operation resources of the computing type, and the second type data is data generated during the process of operating the second application.
It should be noted that: the application running device provided in the above embodiment is only exemplified by the division of the above functional modules, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the application running device and the application running method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the application running device and the application running method are detailed in the method embodiments, which are not repeated herein.
The present application also provides a computer device, where the computer device includes a processor and a memory, and at least one computer program is stored in the memory, where the at least one computer program is loaded and executed by the processor to implement the operations performed by the application running method of the above embodiment.
Optionally, the computer device is provided as a terminal. Fig. 12 shows a block diagram of a terminal 1200 according to an exemplary embodiment of the present application. The terminal 1200 includes: a processor 1201 and a memory 1202.
Processor 1201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. The processor 1201 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 1201 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1201 may be integrated with a GPU (Graphics Processing Unit, image processor) for taking care of rendering and rendering of content that the display screen is required to display. In some embodiments, the processor 1201 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 1202 may include one or more computer-readable storage media, which may be non-transitory. Memory 1202 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1202 is used to store at least one computer program for execution by processor 1201 to implement the application execution methods provided by the method embodiments in the present application.
In some embodiments, the terminal 1200 may further optionally include: a peripheral interface 1203, and at least one peripheral. The processor 1201, the memory 1202, and the peripheral interface 1203 may be connected by a bus or signal lines. The individual peripheral devices may be connected to the peripheral device interface 1203 via buses, signal lines, or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1204, a display 1205, a camera assembly 1206, audio circuitry 1207, and a power supply 1208.
The peripheral interface 1203 may be used to connect at least one peripheral device associated with an I/O (Input/Output) to the processor 1201 and the memory 1202. In some embodiments, the processor 1201, the memory 1202, and the peripheral interface 1203 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 1201, the memory 1202, and the peripheral interface 1203 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 1204 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuit 1204 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 1204 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1204 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuit 1204 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the world wide web, metropolitan area networks, intranets, generation mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuit 1204 may also include NFC (Near Field Communication ) related circuits, which are not limited in this application.
The display 1205 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 1205 is a touch display, the display 1205 also has the ability to collect touch signals at or above the surface of the display 1205. The touch signal may be input as a control signal to the processor 1201 for processing. At this time, the display 1205 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 1205 may be one and disposed on a front panel of the terminal 1200; in other embodiments, the display 1205 may be at least two, respectively disposed on different surfaces of the terminal 1200 or in a folded design; in other embodiments, the display 1205 may be a flexible display disposed on a curved surface or a folded surface of the terminal 1200. Even more, the display 1205 may be arranged in an irregular pattern that is not rectangular, i.e., a shaped screen. The display 1205 can be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 1206 is used to capture images or video. Optionally, camera assembly 1206 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 1206 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuitry 1207 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 1201 for processing, or inputting the electric signals to the radio frequency circuit 1204 for voice communication. For purposes of stereo acquisition or noise reduction, a plurality of microphones may be respectively disposed at different portions of the terminal 1200. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 1201 or the radio frequency circuit 1204 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuitry 1207 may also include a headphone jack.
The power supply 1208 is used to power the various components in the terminal 1200. The power source 1208 may be alternating current, direct current, disposable battery, or rechargeable battery. When the power source 1208 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is not limiting and that more or fewer components than shown may be included or certain components may be combined or a different arrangement of components may be employed.
Optionally, the computer device is provided as a server. Fig. 13 is a schematic structural diagram of a server provided in the embodiments of the present application, where the server 1300 may have a relatively large difference due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1301 and one or more memories 1302, where at least one computer program is stored in the memories 1302, and the at least one computer program is loaded by the processor 1301 and executed to implement the methods provided in the above-mentioned method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
The present application also provides a computer-readable storage medium having at least one computer program stored therein, the at least one computer program being loaded and executed by a processor to implement the operations performed by the application running method of the above embodiments.
The present application also provides a computer program product, which includes a computer program, where the computer program is executed by a processor to implement the operations performed by the application running method of the above embodiment.
Those of ordinary skill in the art will appreciate that all or a portion of the steps implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the above storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the embodiments is merely an optional embodiment and is not intended to limit the embodiments, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application are intended to be included in the scope of the present application.

Claims (18)

1. An application running method, characterized in that the method comprises:
Receiving a foreground operation instruction of a first application;
responding to the foreground operation instruction, and determining a second application when idle operation resources of the current equipment cannot meet the condition that the first application is operated in the foreground, wherein the second application is an application operated in the background by the current equipment;
and releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high, wherein the data is the data occupying the operation resources of the current equipment in the second application.
2. The method of claim 1, wherein the determining, in response to the foreground run instruction, a second application if idle run resources of a current device cannot satisfy running the first application in the foreground comprises:
responding to the foreground operation instruction, and determining the second application and the amount of resources to be released under the condition that the idle operation resources cannot meet the requirement of operating the first application in the foreground;
the releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high comprises the following steps:
and releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high so as to release the operation resources of the resource quantity to be released.
3. The method according to claim 2, wherein the releasing the running resources occupied by the data in order of low priority to high priority of the data in the second application to release the running resources of the amount of resources to be released includes:
releasing operation resources occupied by first data in the second application according to the sequence of the priority of the data from low to high, wherein the first data is the data with the lowest priority in the data currently occupying the operation resources;
and under the condition that the current released resource quantity does not reach the resource quantity to be released, releasing the operation resources occupied by second data according to the sequence from low priority to high priority of the data, wherein the priority of the second data is the upper level of the priority of the first data.
4. The method of claim 2, wherein the determining the second application and the amount of resources to be released in response to the foreground run instruction if the idle run resource fails to satisfy running the first application in the foreground comprises:
responding to the foreground operation instruction, and determining the second application, the resource quantity to be released and the resource type under the condition that the idle operation resource cannot meet the requirement of operating the first application in the foreground, wherein the resource type indicates the type of the operation resource to be released;
The step of releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high to release the operation resources of the resource quantity to be released comprises the following steps:
and releasing the operation resources occupied by the third data according to the priority of the third data in the second application so as to release the operation resources which are to be released in the resource quantity and belong to the resource type, wherein the third data occupies the operation resources of the resource type.
5. The method of claim 4, wherein the resource type comprises a computation type and a memory type, the amount of resources to be released comprises a first amount of resources corresponding to the computation type and a second amount of resources corresponding to the memory type; the step of releasing the operation resources occupied by the third data according to the priority of the third data in the second application to release the operation resources which are to be released in the resource amount and belong to the resource type, includes:
releasing the operation resources occupied by the fourth data according to the priority of the fourth data in the second application to release the operation resources which are of the first resource amount and belong to the calculation type, wherein the fourth data occupies the operation resources of the calculation type;
Determining a third resource amount which is released currently, wherein the third resource amount is the resource amount of the running resource of the memory type in the process of releasing the running resource of the calculation type;
and under the condition that the third resource amount is smaller than the second resource amount, releasing the operation resources occupied by the fifth data according to the priority of the fifth data in the second application so as to release the operation resources which are of the second resource amount and belong to the memory type, wherein the fifth data occupies the operation resources of the memory type.
6. The method of claim 4, wherein the resource type comprises a memory type, and the amount of resources to be released is an amount of resources of a running resource of the memory type to be released; the fifth data in the second application comprises first type data or second type data, the first type data is data loaded from the outside of the second application in the process of running the second application, the second type data is data generated in the process of running the second application, and the fifth data occupies the running resources of the memory type;
the step of releasing the operation resources occupied by the third data according to the priority of the third data in the second application to release the operation resources which are to be released in the resource amount and belong to the resource type, includes:
Releasing the operation resources occupied by the first type of data according to the priority of the first type of data;
and under the condition that the first type of data is released completely and the current released resource quantity does not reach the to-be-released resource quantity, releasing the operation resources occupied by the second type of data according to the priority of the second type of data so as to release the to-be-released resource quantity and the operation resources belonging to the memory type.
7. The method of claim 2, wherein after the releasing the running resources occupied by the data in the order of low priority to high priority of the data in the second application, the method further comprises:
and running the first application in the foreground based on the current idle running resources under the condition that the current released resource quantity reaches the resource quantity to be released.
8. The method according to claim 1, wherein the method further comprises:
and determining the priority of the data in response to the second application being switched from the foreground operation to the background operation.
9. The method of claim 8, wherein the data comprises fourth data or fifth data, the fourth data occupying a computational type of operating resource, the fifth data occupying a memory type of operating resource; the determining the priority of the data in response to the second application switching from the foreground operation to the background operation comprises:
Determining a priority of each fourth data based on attribute information of the fourth data, the attribute information including at least one of a loading speed or importance; or,
and determining the priority of each fifth data based on the attribute information of the fifth data.
10. The method of claim 9, wherein the fifth data comprises a first type of data and a second type of data, the first type of data being data that is externally loaded from the second application during the running of the second application, the second type of data being data that is generated during the running of the second application; the determining the priority of each fifth data based on the attribute information of the fifth data includes:
and respectively determining the priority of each first type of data and the priority of each second type of data based on the attribute information of the first type of data and the attribute information of the second type of data, wherein the priority of the first type of data is lower than the priority of the second type of data.
11. The method of claim 1, wherein the determining, in response to the foreground run instruction, a second application if idle run resources of a current device cannot satisfy running the first application in the foreground comprises:
Responding to the foreground operation instruction, and determining the second application and the resource quantity to be released under the condition that the idle operation resource cannot meet the requirement of operating the first application in the foreground, wherein the resource quantity to be released is the resource quantity to be released;
after the operation resources occupied by the data are released according to the order of the priority of the data in the second application from low to high, the method further comprises:
and displaying prompt information when the operation resources occupied by the data are released and the current released resource quantity does not reach the to-be-released resource quantity, wherein the prompt information indicates that the operation of the first application in the foreground can not be met by releasing the operation resources occupied by the data in the second application.
12. The method according to claim 11, wherein, after displaying the hint information in a case where the running resources occupied by the data have been released, and the currently released amount of resources does not reach the amount of resources to be released, the method further comprises:
responding to the confirmation operation of the prompt information, and displaying the application running in the background; closing the application running in the background in response to closing operation of the application running in the background; or,
And closing the application running in the background in response to the timing duration reaching a duration threshold, wherein the timing duration starts timing after the prompt information is displayed.
13. The method of claim 1, wherein in response to the foreground run instruction, after determining a second application if idle run resources of a current device cannot satisfy running the first application in the foreground, the method further comprises:
in the process of releasing the operation resources occupied by the data, generating a release record, wherein the release record indicates the released data;
and responding to the second application to switch from the background operation to the foreground operation, and recovering the released data based on the release record.
14. The method of claim 13, wherein generating a release record during the release of the operating resources occupied by the data comprises:
and in the process of releasing the operation resources occupied by the data, generating the release record based on released fourth data or second class data, wherein the fourth data occupies the operation resources of a calculation type, and the second class data is data generated in the process of operating the second application.
15. An application running apparatus, the apparatus comprising:
the receiving module is used for receiving a foreground operation instruction of the first application;
the determining module is used for responding to the foreground operation instruction, and determining a second application when idle operation resources of the current equipment cannot meet the condition that the first application is operated in the foreground, wherein the second application is an application operated in the background by the current equipment;
and the releasing module is used for releasing the operation resources occupied by the data according to the order of the priority of the data in the second application from low to high, wherein the data is the data occupying the operation resources of the current equipment in the second application.
16. A computer device comprising a processor and a memory, wherein the memory has stored therein at least one computer program that is loaded and executed by the processor to perform the operations performed by the application running method of any one of claims 1 to 14.
17. A computer readable storage medium having stored therein at least one computer program loaded and executed by a processor to implement the operations performed by the application running method of any one of claims 1 to 14.
18. A computer program product comprising a computer program which, when executed by a processor, performs the operations performed by the application running method of any one of claims 1 to 14.
CN202311271714.1A 2023-09-26 2023-09-26 Application running method, device, computer equipment and storage medium Pending CN117311938A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311271714.1A CN117311938A (en) 2023-09-26 2023-09-26 Application running method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311271714.1A CN117311938A (en) 2023-09-26 2023-09-26 Application running method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117311938A true CN117311938A (en) 2023-12-29

Family

ID=89286197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311271714.1A Pending CN117311938A (en) 2023-09-26 2023-09-26 Application running method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117311938A (en)

Similar Documents

Publication Publication Date Title
CN114467297B (en) Video call display method and related device applied to electronic equipment
CN110569220B (en) Game resource file display method and device, terminal and storage medium
CN112860145B (en) Application control method and electronic equipment
WO2022262434A1 (en) Power optimization method and electronic device
CN111061550A (en) Task processing method, device, equipment and storage medium
CN110673944A (en) Method and device for executing task
CN110381155B (en) Task management method, device, storage medium and terminal
CN111862972A (en) Voice interaction service method, device, equipment and storage medium
CN116578422A (en) Resource allocation method and electronic equipment
CN113672071A (en) Operating system running method and device, storage medium and terminal
CN116708958A (en) Motor control method and electronic equipment
CN117311938A (en) Application running method, device, computer equipment and storage medium
CN111294470B (en) Call processing method, device, equipment and storage medium
CN111726848B (en) Equipment binding method, target starting device, fixed terminal and storage medium
CN115904297A (en) Screen display detection method, electronic device and storage medium
CN112561107A (en) Resource management method, device, equipment and computer readable storage medium
CN111245629A (en) Conference control method, device, equipment and storage medium
CN111475363B (en) Card death recognition method and electronic equipment
CN117093278B (en) Kernel shutdown method, electronic device and storage medium
CN112241353B (en) Method, device, terminal and storage medium for checking running state
CN116643810A (en) Application starting method, device and equipment
CN109981310B (en) Resource management method, device and storage medium
CN113014792A (en) Terminal equipment and camera resource sharing method
CN117956555A (en) Method and device for managing processes
CN116703375A (en) Resource transfer method, device, computer equipment and storage medium

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40099875

Country of ref document: HK