CN115904723A - Application program running method and device, electronic equipment and storage medium - Google Patents

Application program running method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115904723A
CN115904723A CN202211611776.8A CN202211611776A CN115904723A CN 115904723 A CN115904723 A CN 115904723A CN 202211611776 A CN202211611776 A CN 202211611776A CN 115904723 A CN115904723 A CN 115904723A
Authority
CN
China
Prior art keywords
target
thread
processing unit
performance
binding
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
CN202211611776.8A
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202211611776.8A priority Critical patent/CN115904723A/en
Publication of CN115904723A publication Critical patent/CN115904723A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses an application program running method, an application program running device, electronic equipment and a storage medium; the method comprises the steps of obtaining a processing unit group and a performance requirement group, wherein the processing unit group comprises a plurality of processing units, and the performance requirement group comprises a plurality of performance requirements of an application program; acquiring a mapping relation group between a processing unit group and a performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of a processing unit and the performance requirement; determining a target processing unit from the processing unit group; determining a target performance requirement corresponding to the target processing unit according to the mapping relation group; the target processing unit is bound to the target performance requirement such that the target processing unit is employed to run the application under the target performance requirement. In the embodiment of the application, the processing unit suitable for performance requirements can be used for running the application program, so that the application program can run smoothly, and the utilization rate of the processing unit is improved.

Description

Application program running method and device, electronic equipment and storage medium
Technical Field
The application relates to the field of computers, in particular to an application program running method and device, electronic equipment and a storage medium.
Background
In recent years, a terminal device may run a plurality of applications simultaneously, and thus, there may be a plurality of threads of the applications in a ready state waiting for a CPU, and an operating system of the terminal device may dynamically schedule the threads of the applications to run in a Processing Unit on a processor (CPU).
However, in order to balance the load among multiple processing units, the CPU will frequently schedule the same thread among multiple processing units, and there is a possibility that a task thread with a heavy task and a long time consumption may run in a processing unit with low performance, which is not beneficial to running a program, and also causes a waste of the performance of the processing unit.
Disclosure of Invention
The embodiment of the application provides an application program running method and device, an electronic device and a storage medium, which can facilitate smooth running of the application program and improve the utilization rate of a processing unit.
The embodiment of the application provides an application program running method, which comprises the following steps:
acquiring a processing unit group and a performance requirement group, wherein the processing unit group comprises a plurality of processing units, and the performance requirement group comprises a plurality of performance requirements of an application program;
acquiring a mapping relation group between a processing unit group and a performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of a processing unit and the performance requirement;
determining a target processing unit from the processing unit group;
determining a target performance requirement corresponding to the target processing unit according to the mapping relation group;
the target processing unit is bound to the target performance requirement such that the target processing unit is employed to run the application under the target performance requirement.
An embodiment of the present application further provides an application running apparatus, including:
the system comprises a first acquisition unit, a second acquisition unit and a processing unit group, wherein the processing unit group comprises a plurality of processing units, and the performance requirement group comprises a plurality of performance requirements of an application program;
the second obtaining unit is used for obtaining a mapping relation group between the processing unit group and the performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of the processing unit and the performance requirement;
a determination unit configured to determine a target processing unit from the processing unit group;
the searching unit is used for determining a target performance requirement corresponding to the target processing unit according to the mapping relation group;
and the binding unit is used for binding the target processing unit with the target performance requirement so as to adopt the target processing unit to run the application program under the target performance requirement.
The embodiment of the application also provides an electronic device, which comprises a memory and a control unit, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in any application program running method provided by the embodiment of the application program.
The embodiment of the present application further provides a computer-readable storage medium, where a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to perform the steps in any application program running method provided in the embodiment of the present application.
The method and the device for processing the application programs can obtain a processing unit group and a performance requirement group, wherein the processing unit group comprises a plurality of processing units, and the performance requirement group comprises a plurality of performance requirements of the application programs; acquiring a mapping relation group between a processing unit group and a performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of a processing unit and the performance requirement; determining a target processing unit from the processing unit group; determining a target performance requirement corresponding to the target processing unit according to the mapping relation group; the target processing unit is bound to the target performance requirement such that the target processing unit is employed to run the application under the target performance requirement.
In the application, each performance of the application program can be bound with the processing unit respectively, so that the processing unit bound with the performance requirement can be used for running the application program after one performance requirement in the application program is started, and if the performance requirement of the application program is changed, the processing unit running the application program can be adjusted.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a schematic view of a scenario of an application running method provided in an embodiment of the present application;
fig. 1b is a schematic flowchart of an application running method provided in an embodiment of the present application;
FIG. 2a is a flow chart of a binding provided by an embodiment of the present application;
FIG. 2b is a schematic illustration of a binding provided by an embodiment of the present application;
fig. 2c is a flowchart of an application running method applied in a game application according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of an application running apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides an application program running method and device, electronic equipment and a storage medium.
The application running device may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices. The terminal can be a mobile phone, a tablet Computer, an intelligent bluetooth device, a notebook Computer, or a Personal Computer (PC); the server may be a single server or a server cluster composed of a plurality of servers.
In some embodiments, the application execution device may also be integrated into a plurality of electronic devices, for example, the application execution device may be integrated into a plurality of servers, and the application execution method of the present application is implemented by the plurality of servers.
In some embodiments, the server may also be implemented in the form of a terminal.
At present, in order to reduce the frequency that a CPU will schedule the same thread in multiple processing units, a core binding technology is often adopted, and the core binding technology refers to binding the thread to the processing unit on a fixed CPU. However, the current core binding technology has the following problems:
(1) When part of the application programs are developed, the application program developers make customization and modification, so that the internal scheduling during the running of the application programs covers the core binding operation set by users, and the application programs cannot support the core binding of terminal equipment;
(2) Different application programs are developed, and different core binding technologies are set, so that different core binding technologies are used by the terminal equipment for binding different application programs, and the terminal equipment can succeed only by carrying out multiple core binding operations when the application programs are bound by the terminal equipment;
as can be seen from the above, the existing core binding technology is difficult to bind the threads of the application program with the processing units, so that the CPU can frequently schedule the same thread in a plurality of processing units according to the threads, which is not beneficial to running the program, and meanwhile, the advantage of the terminal device cannot be embodied, that is, the CPU utilization rate of the terminal device is not high.
For example, referring to fig. 1a, the electronic device may obtain a processing unit group and a performance requirement group, where the processing unit group includes a plurality of processing units, and the performance requirement group includes a plurality of performance requirements of the application program; acquiring a mapping relation group between a processing unit group and a performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of a processing unit and the performance requirement; determining a target processing unit from the processing unit group; determining a target performance requirement corresponding to the target processing unit according to the mapping relation group; the target processing unit is bound to the target performance requirement such that the target processing unit is employed to run the application under the target performance requirement.
Each performance of the application program can be bound with the processing unit respectively, so that after one performance requirement in the application program is started, the processing unit bound with the performance requirement is used for running the application program, and if the performance requirement of the application program is changed, the processing unit for running the application program is adjusted.
The following are detailed below. The numbers in the following examples are not intended to limit the order of preference of the examples.
In this embodiment, an application program running method is provided, as shown in fig. 1b, a specific flow of the application program running method may be as follows:
110. a processing unit group and a performance requirement group are obtained, the processing unit group comprises a plurality of processing units, and the performance requirement group comprises a plurality of performance requirements of the application program.
Wherein, the processing unit group is all calculation components on the CPU. For example, the processing unit group is all core chips on the CPU, and all computations, receiving/storing commands, and processing data of the CPU are executed by the cores. For example, the processing unit group may include two processing units, four processing units, six processing units, eight processing units, twelve processing units, and the like.
The performance requirements in the set of performance requirements are related to the amount of computation at which the application runs. For example, the set of performance requirements includes a high performance requirement, a normal performance requirement, and a low performance requirement. For example, the performance requirement group may change the image quality displayed when the application runs, and specifically may change the resolution, the code rate, the frame rate, the color depth and the color sample, the coding and the packaging of the image quality, and the like. For example, the normal performance requirement may refer to normal image quality, the low performance requirement may refer to energy-saving image quality, the high performance requirement may refer to high-definition image quality, and the like. In some embodiments, the CPU may be mounted in the mobile terminal device, may also be mounted on a physical server, and so on.
For example, the application program may be a game application, a video application, a reading application, and the like.
120. And acquiring a mapping relation group between the processing unit group and the performance requirement group, wherein the mapping relation group comprises the mapping relation between the performance of the processing unit and the performance requirement.
Wherein the mapping relation group records a mapping relation between each processing unit in the processing unit group and each performance requirement in the performance requirement group.
The processing unit capabilities are used to indicate the computing power of the processing unit. For example, processing unit performance may include high performance, low performance, or may include high performance, medium performance, low performance, and so on.
The mapping relationship between the processing unit performance and the performance requirement may be that one performance requirement corresponds to multiple processing unit performances, or that one performance requirement corresponds to one processing unit performance. For example, high performance and medium performance may correspond to high definition image quality, medium performance and low performance may correspond to normal image quality, low performance may correspond to energy saving image quality, high performance may correspond to high definition image quality, medium performance may correspond to normal image quality, low performance may correspond to energy saving image quality, and so on.
130. A target processing unit is determined from the group of processing units.
Wherein the target processing unit is any one of the processing units in the processing unit group. For example, the target processing unit may be any one of a high-performance processing unit, a medium-performance processing unit, and a low-performance processing unit.
In some embodiments, the processing elements in the set of processing elements carry a reference number, the reference number being used to indicate the location of the processing element on the CPU.
For example, the processing unit group includes 8 processing units, where reference numerals 1 to 2 are high-performance processing units, reference numerals 3 to 4 are medium-performance processing units, reference numerals 5 to 8 are low-performance processing units, and the target processing unit is any one of the 8 processing units.
140. And determining a target performance requirement corresponding to the target processing unit according to the mapping relation group.
And the target performance requirement is the performance requirement which is recorded in the mapping relation group and corresponds to the target processing unit. For example, the performance attribute specifically refers to image quality, the mapping relationship group records high-definition image quality corresponding to high performance and medium performance, the medium performance and low performance correspond to normal image quality, and the low performance corresponds to energy-saving image quality.
150. The target processing unit is bound to the target performance requirement such that the target processing unit is employed to run the application under the target performance requirement.
In some embodiments, binding the target processing unit with the target performance requirement includes:
determining binding information, wherein the binding information records that a target processing unit is bound with a target performance requirement;
and under the target performance requirement, the target processing unit is adopted to run the application program according to the binding information.
For example, the binding information may be recorded in a memory of the terminal device, or may be stored in a server or a cloud server that is accessible through the application program, or the like. The binding information may be read at startup of the application to run the application with the target processing unit according to the binding information.
In some embodiments, after the application is started, the terminal device may bind the target processing unit with the target performance requirement according to the mapping relationship group.
In some embodiments, the terminal device may read, in the background, the plurality of processing units of the CPU and the plurality of performance requirements in the application program, and bind the target processing unit with the target performance requirement according to the mapping relationship group.
In some embodiments, when the application is started in the terminal device, the operating system in the terminal device creates at least one process, and the process may be further refined into a thread, which is an execution path inside the program, and in order to avoid frequently scheduling the same thread in multiple processing units to reduce the waste of the performance of the processing units, the determining the target processing unit from the processing unit group includes:
creating a plurality of threads;
determining a target processing unit from a plurality of processing units according to a target thread, wherein the target thread is any one thread;
binding the target processing unit with the target performance requirement, comprising:
and binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread, so that the application program is operated by adopting the bound thread in the target processing unit under the target performance requirement.
The thread is created by an operating system when the application program runs, and is used for executing tasks when the application program runs. For example, if the same number of threads as the number of processing units in the processing unit group including 8 processing units is created, 8 threads are created.
The target thread is any one of the threads. For example, if 8 threads are created, the target thread is any one of the 8 threads.
The target processing unit is a processing unit connected with the target thread.
For example, since the target processing unit is connected to both the target thread and the target performance requirement, the target thread may be bound to the target performance requirement, and thus, the application program may be run by using the bound thread in the target processing unit under the target performance requirement.
In some embodiments, considering that the performance requirement of the application program changes when the application program runs, for example, a user may actively select the performance requirement, or the performance requirement is passively regulated by a network speed of the terminal device, in order to run a task in the application program using a thread corresponding to a current performance requirement, the application program includes a preset binding thread, the preset binding thread is bound with a default requirement in a performance requirement group, the default requirement is the performance requirement that is used by default when the application program runs, after the target thread is bound with a target performance requirement according to a target processing unit, and a bound thread is obtained, the method further includes:
acquiring the current performance requirement of an application program;
determining a current operating thread from a binding thread and a preset binding thread according to the current performance requirement;
and running the application program through the current running thread.
The preset binding thread is bound with default requirements in the performance requirement group, and the default requirements are performance requirements used by default when the application program runs.
The current performance requirements are those currently employed by the application. For example, the current performance requirement may be a performance requirement actively selected by the user at present, and the current performance requirement may also be a performance requirement passively regulated by the network of the terminal device at present.
The currently running thread is a thread corresponding to the current performance requirement. For example, the currently running thread may be a binding thread bound with the target performance requirement, and the currently running thread may also be a preset binding thread bound with the default requirement. In some embodiments, considering that there are multiple performance requirements in the performance requirement group, in order to enable each performance requirement to use the corresponding thread to run the task in the application, the performance requirement further includes multiple non-default requirements, and determining a currently running thread from the bound thread and the program thread of the application according to the current performance requirement includes:
when the current performance requirement is a default requirement, taking a preset binding thread as a current running thread;
and when the current performance requirement is a non-default requirement, determining the current running thread from the bound threads.
Wherein the non-default requirements are performance requirements regulated and controlled by external environment influence. For example, the non-default requirement is that the user actively selects the performance requirement, or the performance requirement is passively regulated by the network speed of the terminal device. For example, the default requirement is a normal image quality, the non-default requirements include a high definition image quality and an energy saving image quality, the definition of the high definition image quality is higher than that of the normal image quality, and the definition of the energy saving image quality is lower than that of the normal image quality.
For example, if the current performance requirement is a common image quality, all processing units of the CPU are used by the application program during running through the preset binding thread.
For example, the binding threads include threads bound to the high definition image quality and threads bound to the energy saving image quality, and if the current image quality is the high definition image quality, the threads bound to the high definition image quality are determined from the binding threads, and if the current image quality is the energy saving image quality, the threads bound to the energy saving image quality are determined from the binding threads. In some embodiments, in order to enable the user to actively select the performance requirement of the application, before acquiring the current performance requirement of the application, the method further includes:
displaying a user interface of the application program, wherein the user interface comprises a requirement control related to the performance requirement;
acquiring current performance requirements of an application program, including:
and responding to the triggering of a user on a target demand control, and acquiring the current performance demand associated with the target demand control, wherein the target demand control is a demand control associated with any performance demand.
The user interface is displayed on the terminal device when the application program runs.
The demand controls are controls associated with performance demands. For example, the user interface may simultaneously display control buttons such as high definition image quality, normal image quality, and energy saving image quality, or may display the image quality control first, and then display the control buttons such as high definition image quality, normal image quality, and energy saving image quality after the user touches or clicks the image quality control.
The target requirements control may be a requirements control selected by a user at a user interface. For example, the user may select any one of control buttons such as high definition image quality, normal image quality, and energy saving image quality. In some embodiments, in order to obtain a currently running thread corresponding to the current performance requirement quickly so as to run the application program, before determining the currently running thread from the bound thread and the program thread of the application program according to the current performance requirement, the method further includes:
acquiring a mapping relation between a preset identifier and a thread to be marked and a mapping relation between the preset identifier and a performance requirement, wherein the thread to be marked comprises a binding thread and a preset binding thread;
determining a thread identifier corresponding to the target thread to be marked according to the target thread to be marked and the mapping relation between the preset identifier and the thread to be marked, wherein the target thread to be marked is any one of the threads to be marked;
determining a performance requirement corresponding to the thread identifier according to the thread identifier and a mapping relation between a preset identifier and the performance requirement;
determining a current running thread from a binding thread and a preset binding thread according to the current performance requirement, wherein the method comprises the following steps:
determining a target thread identifier corresponding to the current performance requirement according to the performance requirement corresponding to the thread identifier;
and determining the current running thread from the threads to be marked according to the target thread identification.
The preset identification is a preset identification used for marking the thread to be marked.
The thread to be marked is a binding thread which is not marked with an identifier and a preset binding thread. For example, bound threads may include threads bound to high performance requirements, threads bound to low performance requirements, and so forth.
And the mapping relation between the preset identifier and the thread to be marked is used for indicating the corresponding relation between the preset identifier and the thread to be marked. For example, the preset identifier includes a first identifier (default identifier), a second identifier (high-performance identifier), a third identifier (low-performance identifier), the first identifier may correspond to a preset bound thread, the second identifier may correspond to a thread bound by a high-performance requirement, the third identifier may correspond to a thread bound by a low-performance requirement, and so on.
The mapping relation between the preset identification and the performance requirement is used for indicating the corresponding relation between the preset identification and the performance requirement. For example, the preset identifier includes a first identifier, a second identifier, a third identifier, and so on, for example, the first identifier corresponds to a normal performance requirement, the second identifier corresponds to a high performance requirement, the third identifier corresponds to a low performance requirement, and so on.
The target thread to be marked is any one of the threads to be marked. For example, the target thread to be marked may be a preset binding thread, and may also be a thread bound with high performance and a thread bound with low performance.
The thread identifier may be a preset identifier corresponding to the target thread to be marked.
The performance requirement corresponding to the thread identifier is the performance requirement corresponding to the thread identifier in the mapping relation between the preset identifier and the performance requirement.
The target thread identification is a preset identification corresponding to the current performance requirement obtained according to the performance requirement corresponding to the thread identification. In some embodiments, to make the main task of the application run smoothly, multiple threads are created, including:
determining a first processing unit and a second processing unit from the plurality of processing units based on the processing unit capabilities;
according to the first processing unit, creating a first thread, wherein the first thread is used for running a main task of an application program;
and creating a second thread with the number of units according to the number of the units of the second processing unit, wherein the second thread is used for running tasks except the main task in the application program.
The main task of the application program may be a task corresponding to the main logic of the application program. For example, when the application is a game, the main task does not affect the normal operation of the game.
Tasks other than the main task do not affect the normal operation of the application. For example, tasks other than the main task may be associated with performance requirements of the application, and if the application is a game, the tasks other than the main task may control the image quality of the game.
The first processing unit is a processing unit that runs a primary task of an application. For example, the first processing unit may be any one of a plurality of processing units.
The second processing unit is a processing unit other than the first processing unit among the plurality of processing units. For example, if the plurality of processing units include a high-performance processing unit numbered 1-2, a medium-performance processing unit numbered 3-4, a low-performance processing unit numbered 5-8, and a first processing unit is a high-performance processing unit numbered 1, the second processing unit includes a high-performance processing unit numbered 2, a medium-performance processing unit numbered 3-4, and a low-performance processing unit numbered 5-8.
The first thread is a thread which is created to run a main task when the application program runs.
The second thread is used for running tasks in the application program except the main task.
In some embodiments, in order for each thread to be bindable with a corresponding processing unit, in view of the fact that the thread may have a capability, creating a unit-number second thread according to a unit number of the second processing unit, includes:
creating a second thread with a sub-number of target performances, wherein the sub-number is the number of second processing units with the target performances, and the target performances are any one of the processing unit performances;
a target processing unit from a plurality of processing units according to a target thread, comprising:
a target processing unit from the plurality of processing units is targeted based on the second thread of target performance, the target processing unit having the target performance.
Wherein the target performance is any one of the processing unit performances. For example, if the processing unit performance includes high performance, medium performance, and low performance, and so on, the target performance is any one of high performance, medium performance, and low performance.
The sub-number is the number of second processing units of the target performance. For example, if the second processing units include a high-performance processing unit numbered 2, a medium-performance processing unit numbered 3-4, and a low-performance processing unit numbered 5-8, then 1 high-performance second thread, 2 medium-performance second threads, and 3 low-performance second threads are created, and so on.
For example, the target processing unit is a high-performance processing unit for the high-performance second thread, the target processing unit is a medium-performance processing unit for the medium-performance second thread, and the target processing unit is a low-performance processing unit for the low-performance second thread. In some embodiments, after the target processing unit from the plurality of processing units according to the second thread of the target performance, in order that the thread may be bound to the performance requirement, further comprising:
binding a second thread of the target performance with the target processing unit;
if the second thread of the target performance is not successfully bound with the target processing unit, the target processing unit is newly selected from the plurality of processing units;
binding a second thread of the target performance with the new target processing unit;
according to the target processing unit, binding the target thread with the target performance requirement to obtain a bound thread, comprising:
and if the second thread of the target performance is successfully bound with the target processing unit, binding the second thread of the target performance with the target performance requirement according to the target processing unit.
For example, the new target processing unit is a processing unit corresponding to the second thread of the target performance, except for the target processing unit. For example, if the performance-neutral second thread does not bind the performance processing unit No. 3 successfully, other performance processing units can be searched from the multiple performance processing units.
If the second thread of the target performance is successfully bound with the target processing unit, the second thread of the target performance can run on the target processing unit, so that the second thread of the target performance is bound with the target performance requirement.
In particular, the high-performance second thread and the neutral-performance second thread may be bound to the high-performance processing unit. A low performance second thread may be bound to the low performance processing unit.
In some embodiments, considering that the second thread of the target performance cannot be successfully bound with the target processing unit, in order to enable the second thread of the target performance to be bound with the processing unit, if the second thread of the target performance does not successfully bind with the target processing unit, the re-updating the target processing unit from the plurality of processing units includes:
if the second thread of the target performance is not successfully bound with the target processing unit and is not greater than the preset performance, determining a new target processing unit with the target performance from the plurality of processing units again;
and if the second thread of the target performance is not successfully bound with the target processing unit and is not less than the preset performance, re-determining a new target processing unit which is not less than the preset performance from the plurality of processing units.
The preset performance is used for screening the processing unit corresponding to the second thread of the target performance. For example, the preset capability may be any one of the processing unit capabilities.
For example, if the predetermined performance is low performance, the new target processing unit may have low performance if the second thread of target performance is a second thread of low performance, and the new target processing unit may have high performance or medium performance if the second thread of target performance is a second thread of medium performance.
In some embodiments, the binding the second thread of the target performance with the new target processing unit, considering that the second thread is bound without limitation and is easy to cause resource waste, comprises:
acquiring the binding times, wherein the binding times are the times that the second thread of each target performance does not successfully bind the new target processing unit;
when the binding times are more than the preset times, stopping binding the second thread of the target performance with the new target processing unit;
a plurality of processing units are adopted to run preset binding threads in the application program.
And the binding times are the times of unsuccessfully binding the new target processing unit by the second thread of each target performance.
The preset times are used for measuring the times of binding all the second threads with the new target processing unit.
For example, if the number of times of binding exceeds a preset number of times, the application program is run by using a preset binding thread.
In some embodiments, considering that the terminal device has a plurality of applications, in order to be able to bind each application, the binding of the thread of the target performance with the target processing unit includes:
creating an auxiliary thread;
binding a second thread of the target performance with the target processing unit through the auxiliary thread;
binding a second thread of the target performance with the new target processing unit, comprising:
a second thread of the target performance is bound with the new target processing unit by the helper thread.
The auxiliary thread is used for binding the second thread of the target performance with the corresponding processing unit.
In some embodiments, the helper thread and the second thread may be created simultaneously, the helper thread may be created first and the second thread may be created second, or the second thread may be created first and the helper thread may be created second.
As can be seen from the above, in the embodiment of the present application, a processing unit group and a performance requirement group may be obtained, where the processing unit group includes a plurality of processing units, and the performance requirement group includes a plurality of performance requirements of an application program; acquiring a mapping relation group between a processing unit group and a performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of a processing unit and the performance requirement; determining a target processing unit from the processing unit group; determining a target performance requirement corresponding to the target processing unit according to the mapping relation group; the target processing unit is bound to the target performance requirement such that the target processing unit is employed to run the application under the target performance requirement.
Therefore, each performance of the application program can be bound with the processing unit respectively, after one performance requirement in the application program is started, the processing unit bound with the performance requirement is used for running the application program, and if the performance requirement of the application program is changed, the processing unit running the application program is adjusted.
The method described in the above embodiments is further detailed below.
In this embodiment, the method of the embodiment of the present application will be described in detail by taking an application program as an example of a game application.
The game application runs:
the method comprises the steps of (I) obtaining a plurality of processing units of the current Android device when a game application is started.
For example, the total number of the multiple processing units of the Android device is x, x =8 processing units, and the processing unit may include 2 high-performance processing units, 2 medium-performance processing units, and 4 low-performance processing units.
And (II) determining 1 first processing unit and n second processing units from the plurality of processing units, and distributing the game main thread (namely the first thread) to the first processing unit.
And (III) applying for n second threads, wherein one auxiliary thread is used for binding the n-1 second threads with the target processing unit in limited times (within preset times) of attempts until the binding of the n-1 second threads is successful or fails and the times are used up.
For example, as shown in fig. 2a, when the binding is started, it is determined whether the binding has failed, and if the binding has failed, it is determined whether the number of times is used up, and if the binding has not been used up, the binding is continued. Wherein, a log service (logHub) is adopted to record the binding process.
In some embodiments, each second thread has a target processing unit bound to it.
In some embodiments, each second thread is bound with a target processing unit in the hatching tank.
For example, as shown in fig. 2b, the hatching cell includes a predetermined binding thread, a second thread and an assistant thread, and the assistant thread binds the second thread 1-7 for a limited number of times. If the thread is a small core thread (a second thread with low performance), only a small core (a processing unit with low performance) is bound, if the thread is a large core thread (a second thread with high performance)/a middle core thread (a second thread with middle performance), the corresponding processing unit is bound preferentially, and if the thread fails, the core which is successful in binding is tried from the bindable large and middle processing units. The large kernel thread preferentially binds the high-performance processing unit, and binds other high-performance/medium-performance processing units if the binding fails. And the middle core thread preferentially binds the processing unit with the middle performance, and binds other processing units with high performance/middle performance if the binding fails.
In some embodiments, the second thread is recorded with the target processing unit bound.
And fourthly, when the user selects the image quality (namely the target requirement control), judging whether the n-1 second threads of the hatching pond meet all binding success, and if all binding success is achieved, awakening the corresponding thread to run the application program according to the selected target performance requirement.
For example, as shown in fig. 2c, the user may select a high definition/extremely smooth image quality, or select an image quality in an energy saving mode, or a default image quality, if the user selects the energy saving mode, determine whether the device terminal is ultra high performance (scoring system), if yes, determine whether the binding is successful, if the binding is successful, run a task (JobSystem) of the application program using a second thread bound by the low performance processing unit, and if the terminal device is not ultra high performance, run a JobSystem of the application program using a preset binding program. And if the user selects the image quality of the high-definition/extreme flow, determining whether the binding is successful, and if the binding is successful, operating the JobSystems of the application programs by adopting the second thread bound by the processing unit with high and medium performance. And if the user selects the default image quality, adopting a preset binding thread to run the JobSysteme of the application program.
For example, the game application includes a preset binding thread, the preset binding thread is marked as a first identifier (default), a second thread bound on the large processing unit and the middle processing unit is marked as a second identifier (bigAndMid), and the second thread bound on the small processing unit is marked as a third identifier (little). ) When the player selects the image quality, the current mark is set, and the thread corresponding to the thread is awakened.
According to the invention, aiming at the problem of CPU binding of the existing Android equipment, the invention can be used for binding and scheduling, and can cover more Android equipment.
In order to implement the foregoing method better, an embodiment of the present application further provides an application running apparatus, where the application running apparatus may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and other devices; the server may be a single server or a server cluster composed of a plurality of servers.
For example, in this embodiment, the method in this embodiment will be described in detail by taking an example in which an application running device is specifically integrated in a terminal device.
For example, as shown in fig. 3, the application execution device may include a first obtaining unit 310, a second obtaining unit 320, a determining unit 330, a searching unit 340, and a binding unit 350, as follows:
first, a first obtaining unit 310.
The first obtaining unit 310 is configured to obtain a processing unit group and a performance requirement group, where the processing unit group includes a plurality of processing units, and the performance requirement group includes a plurality of performance requirements of an application.
(II) a second obtaining unit 320.
A second obtaining unit 320, configured to obtain a mapping relationship group between the processing unit group and the performance requirement group, where the mapping relationship group includes a mapping relationship between the performance of the processing unit and the performance requirement.
(III), a determination unit 330.
A determining unit 330 for determining a target processing unit from the group of processing units.
And (IV) a searching unit 340.
And the searching unit 340 is configured to determine a target performance requirement corresponding to the target processing unit according to the mapping relationship group.
And (V) a binding unit 350.
A binding unit 350, configured to bind the target processing unit with the target performance requirement, so as to run the application program with the target processing unit under the target performance requirement.
In some embodiments, determining the target processing unit from the set of processing units comprises:
creating a plurality of threads;
determining a target processing unit from a plurality of processing units according to a target thread, wherein the target thread is any one thread;
binding the target processing unit with the target performance requirement, comprising:
and binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread, so that the application program is operated by adopting the bound thread in the target processing unit under the target performance requirement.
In some embodiments, the method further includes, after the application program includes a preset binding thread, where the preset binding thread is a thread preset in the application program and connected to each processing unit, and the preset binding thread is bound to a default requirement in a performance requirement group, and the target thread is bound to a target performance requirement according to a target processing unit, and the binding thread is obtained:
acquiring the current performance requirement of an application program;
determining a current running thread from a binding thread and a preset binding thread according to the current performance requirement;
and running the application program through the current running thread.
In some embodiments, the performance requirements further include a plurality of non-default requirements, determining a currently running thread from among the bound threads and the program threads of the application based on the current performance requirements, including:
when the current performance requirement is a default requirement, taking a preset binding thread as a current running thread;
and when the current performance requirement is a non-default requirement, determining the current running thread from the bound threads.
In some embodiments, before obtaining the current performance requirement of the application program, the method further comprises:
displaying a user interface of the application program, wherein the user interface comprises a requirement control related to the performance requirement;
acquiring current performance requirements of an application program, including:
and responding to the trigger of a user on a target requirement control, and acquiring the current performance requirement associated with the target requirement control, wherein the target requirement control is any requirement control associated with the performance requirement.
In some embodiments, before determining the currently running thread from the binding thread and the program threads of the application according to the current performance requirement, the method further comprises:
acquiring a mapping relation between a preset identifier and a thread to be marked and a mapping relation between the preset identifier and a performance requirement, wherein the thread to be marked comprises a binding thread and a preset binding thread;
determining a thread identifier corresponding to the target thread to be marked according to the target thread to be marked and the mapping relation between the preset identifier and the thread to be marked, wherein the target thread to be marked is any one of the threads to be marked;
determining a performance requirement corresponding to the thread identifier according to the thread identifier and a mapping relation between a preset identifier and the performance requirement;
determining a current running thread from a binding thread and a preset binding thread according to the current performance requirement, wherein the method comprises the following steps:
determining a target thread identifier corresponding to the current performance requirement according to the performance requirement corresponding to the thread identifier;
and determining the current running thread from the threads to be marked according to the target thread identification.
In some embodiments, creating a plurality of threads comprises:
determining a first processing unit and a second processing unit from the plurality of processing units based on the processing unit capabilities;
creating a first thread according to the first processing unit, wherein the first thread is used for running a main task of the application program in the first processing unit;
and creating a second thread with the number of the units according to the number of the units of the second processing unit, wherein the second thread is used for running tasks except the main task in the application program.
In some embodiments, creating the unit number of second threads according to the unit number of the second processing unit includes:
creating a second thread with a sub-number of target performances, wherein the sub-number is the number of the second processing units with the target performances, and the target performances are any one of the processing unit performances;
the target processing unit from the plurality of processing units according to the target thread comprises:
a target processing unit from the plurality of processing units, the target processing unit having the target performance, according to a second thread of the target performance.
In some embodiments, after the second thread according to the target performance targets a processing unit from the plurality of processing units, the method further comprises:
binding a second thread of the target performance with the target processing unit;
if the second thread of the target performance does not successfully bind the target processing unit, the target processing unit is newly selected from the plurality of processing units;
binding a second thread of the target performance with the new target processing unit;
the binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread includes:
and if the second thread of the target performance is successfully bound with the target processing unit, binding the second thread of the target performance with the target performance requirement according to the target processing unit.
In some embodiments, if the second thread of the target performance fails to bind the target processing unit, re-updating the target processing unit from the plurality of processing units comprises:
if the second thread of the target performance is not successfully bound with the target processing unit and is not greater than the preset performance, determining a new target processing unit with the target performance from the plurality of processing units again;
and if the second thread of the target performance is not successfully bound with the target processing unit and is not less than the preset performance, re-determining a new target processing unit which is not less than the preset performance from the plurality of processing units.
In some embodiments, binding the second thread of the target performance with the new target processing unit comprises:
acquiring the binding times, wherein the binding times are the times that the second thread of each target performance does not successfully bind the new target processing unit;
when the binding times are larger than the preset times, stopping binding the second thread of the target performance with the new target processing unit;
and running a preset binding thread in the application program by adopting the plurality of processing units.
In some embodiments, binding a second thread of the target performance with the target processing unit includes:
creating an auxiliary thread;
binding a second thread of the target performance with the target processing unit through the auxiliary thread;
binding a second thread of the target performance with the new target processing unit, comprising:
a second thread of the target performance is bound with the new target processing unit by the helper thread.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, in the application program running apparatus of this embodiment, the first obtaining unit obtains the processing unit group and the performance requirement group, where the processing unit group includes multiple processing units, and the performance requirement group includes multiple performance requirements of the application program; a second obtaining unit obtains a mapping relation group between the processing unit group and the performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of the processing unit and the performance requirement; determining, by a determination unit, a target processing unit from the set of processing units; determining a target performance requirement corresponding to the target processing unit by the searching unit according to the mapping relation group; the target processing unit is bound to the target performance requirement by the binding unit to run the application with the target processing unit under the target performance requirement.
Therefore, the application program can run smoothly, and the utilization rate of the processing unit is improved.
Correspondingly, the embodiment of the present application further provides an electronic device, where the electronic device may be a terminal or a server, and the terminal may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a Personal computer, and a Personal Digital Assistant (PDA).
As shown in fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 400 includes a processor 410 having one or more processing cores, a memory 420 having one or more computer-readable storage media, and a computer program stored in the memory 420 and running on the processor. The processor 410 is electrically connected to the memory 420. Those skilled in the art will appreciate that the electronic device configurations shown in the figures do not constitute limitations of the electronic device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
The processor 410 is a control center of the electronic device 400, connects various parts of the entire electronic device 400 using various interfaces and lines, performs various functions of the electronic device 400 and processes data by running or loading software programs and/or modules stored in the memory 420 and calling data stored in the memory 420, thereby monitoring the electronic device 400 as a whole.
In this embodiment, the processor 410 in the electronic device 400 loads instructions corresponding to processes of one or more application programs into the memory 420, and the processor 410 executes the application programs stored in the memory 420 according to the following steps, so as to implement various functions:
an application program running method includes:
acquiring a processing unit group and a performance requirement group, wherein the processing unit group comprises a plurality of processing units, and the performance requirement group comprises a plurality of performance requirements of an application program;
acquiring a mapping relation group between a processing unit group and a performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of a processing unit and the performance requirement;
determining a target processing unit from the processing unit group;
determining a target performance requirement corresponding to the target processing unit according to the mapping relation group;
the target processing unit is bound to the target performance requirement such that the target processing unit is employed to run the application under the target performance requirement.
In some embodiments, determining the target processing unit from the set of processing units comprises:
creating a plurality of threads;
determining a target processing unit from a plurality of processing units according to a target thread, wherein the target thread is any one thread;
binding the target processing unit with the target performance requirement, comprising:
and binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread, so that the application program is operated by adopting the bound thread in the target processing unit under the target performance requirement.
In some embodiments, the method further includes, after the application program includes a preset binding thread, the preset binding thread is bound with a default requirement in a performance requirement group, the default requirement is a performance requirement that is used by default when the application program runs, and the target thread is bound with a target performance requirement according to the target processing unit, and the bound thread is obtained:
acquiring the current performance requirement of an application program;
determining a current running thread from a binding thread and a preset binding thread according to the current performance requirement;
and running the application program through the current running thread.
In some embodiments, the performance requirements further include a plurality of non-default requirements, determining a currently running thread from among the bound threads and the program threads of the application based on the current performance requirements, including:
when the current performance requirement is a default requirement, taking a preset binding thread as a current running thread;
and when the current performance requirement is a non-default requirement, determining the current running thread from the bound threads.
In some embodiments, before obtaining the current performance requirement of the application program, the method further comprises:
displaying a user interface of the application program, wherein the user interface comprises a requirement control related to the performance requirement;
obtaining current performance requirements of an application, including:
and responding to the triggering of a user on a target demand control, and acquiring the current performance demand associated with the target demand control, wherein the target demand control is a demand control associated with any performance demand.
In some embodiments, before determining the currently running thread from the binding thread and the program threads of the application according to the current performance requirement, the method further comprises:
acquiring a mapping relation between a preset identifier and a thread to be marked and a mapping relation between the preset identifier and a performance requirement, wherein the thread to be marked comprises a binding thread and a preset binding thread;
determining a thread identifier corresponding to the target thread to be marked according to the target thread to be marked and the mapping relation between the preset identifier and the thread to be marked, wherein the target thread to be marked is any one of the threads to be marked;
determining a performance requirement corresponding to the thread identifier according to the thread identifier and a mapping relation between a preset identifier and the performance requirement;
determining a current operating thread from a binding thread and a preset binding thread according to the current performance requirement, wherein the determining comprises the following steps:
determining a target thread identifier corresponding to the current performance requirement according to the performance requirement corresponding to the thread identifier;
and determining the current running thread from the threads to be marked according to the target thread identification.
In some embodiments, creating a plurality of threads comprises:
determining a first processing unit and a second processing unit from the plurality of processing units based on the processing unit capabilities;
creating a first thread according to the first processing unit, wherein the first thread is used for running a main task of the application program in the first processing unit;
and creating a second thread with the number of the units according to the number of the units of the second processing unit, wherein the second thread is used for running tasks except the main task in the application program.
In some embodiments, creating the unit number of second threads according to the unit number of the second processing unit includes:
creating a second thread with a sub-number of target performances, wherein the sub-number is the number of the second processing units with the target performances, and the target performances are any one of the processing unit performances;
the target processing unit from the plurality of processing units according to the target thread comprises:
a target processing unit from the plurality of processing units, the target processing unit having the target performance, according to a second thread of the target performance.
In some embodiments, after the second thread according to the target performance targets a processing unit from the plurality of processing units, the method further comprises:
binding a second thread of the target performance with the target processing unit;
if the second thread of the target performance does not successfully bind the target processing unit, the target processing unit is newly selected from the plurality of processing units;
binding a second thread of the target performance with the new target processing unit;
the binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread includes:
and if the second thread of the target performance is successfully bound with the target processing unit, binding the second thread of the target performance with the target performance requirement according to the target processing unit.
In some embodiments, if the second thread of the target performance fails to bind the target processing unit, re-updating the target processing unit from the plurality of processing units comprises:
if the second thread of the target performance is not successfully bound with the target processing unit and is not greater than the preset performance, determining a new target processing unit with the target performance from the plurality of processing units again;
and if the second thread of the target performance is not successfully bound with the target processing unit and is not less than the preset performance, re-determining a new target processing unit which is not less than the preset performance from the plurality of processing units.
In some embodiments, binding the second thread of the target performance with the new target processing unit comprises:
acquiring the binding times, wherein the binding times are the times of unsuccessfully binding a new target processing unit by a second thread of each target performance;
when the binding times are larger than the preset times, stopping binding the second thread of the target performance with the new target processing unit;
and running a preset binding thread in the application program by adopting the plurality of processing units.
In some embodiments, binding a second thread of the target performance with the target processing unit includes:
creating an auxiliary thread;
binding a second thread of the target performance with the target processing unit through the auxiliary thread;
binding a second thread of the target performance with the new target processing unit, comprising:
the second thread of the target performance is bound to the new target processing unit by the helper thread.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 4, the electronic device 400 further includes: touch display 430, radio frequency circuit 440, audio circuit 450, input unit 460 and power supply 470. The processor 410 is electrically connected to the touch display 430, the radio frequency circuit 440, the audio circuit 450, the input unit 460 and the power supply 470, respectively. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The touch display screen 430 can be used for displaying a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface. The touch display screen 430 may include a display panel and a touch panel. Among other things, the display panel may be used to display information input by or provided to a user as well as various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 410, and can receive and execute commands sent by the processor 410. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 410 to determine the type of the touch event, and then the processor 410 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 430 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display 430 may also be used as a part of the input unit 460 to implement an input function.
The rf circuit 440 may be configured to transmit and receive rf signals to establish wireless communication with a network device or other electronic devices through wireless communication, and transmit and receive signals to and from the network device or other electronic devices.
The audio circuit 450 may be used to provide an audio interface between a user and an electronic device through a speaker, microphone. The audio circuit 450 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 450 and converted into audio data, and the audio data is processed by the audio data output processor 410, and then sent to another electronic device through the rf circuit 440, or the audio data is output to the memory 420 for further processing. The audio circuit 450 may also include an earbud jack to provide communication of a peripheral headset with the electronic device.
The input unit 460 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 470 is used to power the various components of the electronic device 400. Optionally, the power supply 470 may be logically connected to the processor 410 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The power supply 470 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 4, the electronic device 400 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Therefore, the electronic device provided by the embodiment can use the processing unit suitable for performance requirements to run the application program, so that the application program can run smoothly, and the utilization rate of the processing unit is improved.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, where the computer programs can be loaded by a processor to execute the steps in any application program running method provided in the present application. For example, the computer program may perform the steps of:
an application program running method includes:
acquiring a processing unit group and a performance requirement group, wherein the processing unit group comprises a plurality of processing units, and the performance requirement group comprises a plurality of performance requirements of an application program;
acquiring a mapping relation group between a processing unit group and a performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of a processing unit and the performance requirement;
determining a target processing unit from the processing unit group;
determining a target performance requirement corresponding to the target processing unit according to the mapping relation group;
the target processing unit is bound to the target performance requirement such that the target processing unit is employed to run the application under the target performance requirement.
In some embodiments, determining the target processing unit from the set of processing units comprises:
creating a plurality of threads;
determining a target processing unit from a plurality of processing units according to a target thread, wherein the target thread is any one thread;
binding the target processing unit with the target performance requirement, comprising:
and binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread, so that the application program is operated by adopting the bound thread in the target processing unit under the target performance requirement.
In some embodiments, the method further includes, after the application program includes a preset binding thread, the preset binding thread is bound with a default requirement in a performance requirement group, the default requirement is a performance requirement that is used by default when the application program runs, and the target thread is bound with a target performance requirement according to the target processing unit, and the bound thread is obtained:
acquiring the current performance requirement of an application program;
determining a current running thread from a binding thread and a preset binding thread according to the current performance requirement;
and running the application program through the current running thread.
In some embodiments, the performance requirements further include a plurality of non-default requirements, determining a currently running thread from among the bound threads and the program threads of the application based on the current performance requirements, including:
when the current performance requirement is a default requirement, taking a preset binding thread as a current running thread;
and when the current performance requirement is a non-default requirement, determining the current running thread from the bound threads.
In some embodiments, before obtaining the current performance requirement of the application program, the method further comprises:
displaying a user interface of the application program, wherein the user interface comprises a requirement control related to the performance requirement;
obtaining current performance requirements of an application, including:
and responding to the trigger of a user on a target requirement control, and acquiring the current performance requirement associated with the target requirement control, wherein the target requirement control is any requirement control associated with the performance requirement.
In some embodiments, before determining the currently running thread from the binding thread and the program threads of the application according to the current performance requirement, the method further comprises:
acquiring a mapping relation between a preset identifier and a thread to be marked and a mapping relation between the preset identifier and a performance requirement, wherein the thread to be marked comprises a binding thread and a preset binding thread;
determining a thread identifier corresponding to the target thread to be marked according to the target thread to be marked and the mapping relation between the preset identifier and the thread to be marked, wherein the target thread to be marked is any one of the threads to be marked;
determining a performance requirement corresponding to the thread identifier according to the thread identifier and a mapping relation between a preset identifier and the performance requirement;
determining a current running thread from a binding thread and a preset binding thread according to the current performance requirement, wherein the method comprises the following steps:
determining a target thread identifier corresponding to the current performance requirement according to the performance requirement corresponding to the thread identifier;
and determining the current running thread from the threads to be marked according to the target thread identification.
In some embodiments, creating a plurality of threads comprises:
determining a first processing unit and a second processing unit from the plurality of processing units based on the processing unit capabilities;
according to the first processing unit, creating a first thread, wherein the first thread is used for running a main task of the application program in the first processing unit;
and creating a second thread with the number of the units according to the number of the units of the second processing unit, wherein the second thread is used for running tasks except the main task in the application program.
In some embodiments, creating the unit number of second threads according to the unit number of the second processing unit includes:
creating a second thread with a sub-number of target performances, wherein the sub-number is the number of the second processing units with the target performances, and the target performances are any one of the processing unit performances;
the target processing unit from the plurality of processing units according to the target thread comprises:
a target processing unit from the plurality of processing units, the target processing unit having the target performance, according to a second thread of the target performance.
In some embodiments, after the second thread according to the target performance targets a processing unit from the plurality of processing units, the method further comprises:
binding a second thread of the target performance with the target processing unit;
if the second thread of the target performance does not successfully bind the target processing unit, the target processing unit is newly selected from the plurality of processing units;
binding a second thread of the target performance with the new target processing unit;
the binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread includes:
and if the second thread of the target performance is successfully bound with the target processing unit, binding the second thread of the target performance with the target performance requirement according to the target processing unit.
In some embodiments, if the second thread of the target performance fails to bind the target processing unit, re-updating the target processing unit from the plurality of processing units comprises:
if the second thread of the target performance is not successfully bound with the target processing unit and is not greater than the preset performance, determining a new target processing unit with the target performance from the plurality of processing units again;
and if the second thread of the target performance is not successfully bound with the target processing unit and is not less than the preset performance, re-determining a new target processing unit which is not less than the preset performance from the plurality of processing units.
In some embodiments, said binding said thread of target performance to said remaining processing unit comprises:
acquiring the binding times, wherein the binding times are the times of unsuccessfully binding a new target processing unit by a second thread of each target performance;
when the binding times are larger than preset times, stopping binding the second thread with the target performance with the new target processing unit;
and running a preset binding thread in the application program by adopting the plurality of processing units.
In some embodiments, binding the second thread of the target performance with the target processing unit comprises:
creating an auxiliary thread;
binding a second thread of the target performance with the target processing unit through the auxiliary thread;
binding a second thread of the target performance with the new target processing unit, comprising:
the second thread of the target performance is bound to the new target processing unit by the helper thread.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any application program running method provided in the embodiments of the present application, the beneficial effects that can be achieved by any application program running method provided in the embodiments of the present application can be achieved, and detailed descriptions are omitted here for the foregoing embodiments.
The foregoing detailed description is directed to an application program operating method, an apparatus, an electronic device, and a storage medium provided in the embodiments of the present application, and specific examples are applied in the present application to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (15)

1. An application program running method, comprising:
acquiring a processing unit group and a performance requirement group, wherein the processing unit group comprises a plurality of processing units, and the performance requirement group comprises a plurality of performance requirements of an application program;
acquiring a mapping relation group between the processing unit group and the performance requirement group, wherein the mapping relation group comprises a mapping relation between the performance of the processing unit and the performance requirement;
determining a target processing unit from the group of processing units;
determining a target performance requirement corresponding to the target processing unit according to the mapping relation group;
and binding the target processing unit with the target performance requirement so as to run the application program by adopting the target processing unit under the target performance requirement.
2. The application execution method of claim 1, wherein the determining a target processing unit from the set of processing units comprises:
creating a plurality of threads;
determining a target processing unit from the plurality of processing units according to a target thread, wherein the target thread is any one thread;
said binding said target processing unit to said target performance requirement comprises:
and binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread, and running the application program by adopting the bound thread in the target processing unit under the target performance requirement.
3. The method for operating an application program according to claim 2, wherein the application program includes a preset binding thread, the preset binding thread is bound with a default requirement in the performance requirement group, the default requirement is a performance requirement that is used by default when the application program is operated, and after the target thread is bound with the target performance requirement according to the target processing unit to obtain a binding thread, the method further includes:
acquiring the current performance requirement of the application program;
determining a current operating thread from the binding thread and the preset binding thread according to the current performance requirement;
and running the application program through the current running thread.
4. The method of claim 3, wherein the performance requirements further include a plurality of non-default requirements, and wherein determining a currently running thread from the bound thread and the pre-defined bound thread based on the current performance requirements comprises:
when the current performance requirement is the default requirement, taking the preset binding thread as a current running thread;
and when the current performance requirement is the non-default requirement, determining a current running thread from the bound threads.
5. The application program execution method of claim 3, further comprising, prior to said obtaining the current performance requirements of the application program:
displaying a user interface of the application, the user interface including a requirement control associated with the performance requirement;
the acquiring the current performance requirement of the application program comprises the following steps:
and responding to the triggering of a target demand control by a user, and acquiring the current performance demand associated with the target demand control, wherein the target demand control is any demand control associated with the performance demand.
6. The method of application program execution according to claim 3, further comprising, prior to said determining a currently executing thread from among the bound thread and the program threads of the application program based on the current performance requirement:
acquiring a mapping relation between a preset identifier and a thread to be marked and a mapping relation between the preset identifier and the performance requirement, wherein the thread to be marked comprises the binding thread and the preset binding thread;
determining a thread identifier corresponding to a target thread to be marked according to the target thread to be marked and a mapping relation between the preset identifier and the thread to be marked, wherein the target thread to be marked is any one of the threads to be marked;
determining a performance requirement corresponding to the thread identifier according to the thread identifier and a mapping relation between the preset identifier and the performance requirement;
determining a current operating thread from the binding thread and the preset binding thread according to the current performance requirement, wherein the determining comprises the following steps:
determining a target thread identifier corresponding to the current performance requirement according to the performance requirement corresponding to the thread identifier;
and determining the current running thread from the threads to be marked according to the target thread identification.
7. The application execution method of claim 2, wherein the creating a plurality of threads comprises:
determining a first processing unit and a second processing unit from the plurality of processing units based on the processing unit capabilities;
creating a first thread according to the first processing unit, wherein the first thread is used for running a main task of the application program in the first processing unit;
and creating a second thread with the number of the units according to the number of the units of the second processing unit, wherein the second thread is used for running tasks except the main task in the application program.
8. The application program execution method of claim 7, wherein the creating the unit number of second threads according to the unit number of the second processing unit comprises:
creating a second thread with a sub-number of target performances, wherein the sub-number is the number of the second processing units with the target performances, and the target performances are any one of the processing unit performances;
the target processing unit from the plurality of processing units according to the target thread comprises:
a target processing unit from the plurality of processing units, the target processing unit having the target performance, according to a second thread of the target performance.
9. The application execution method of claim 8, further comprising, after the second thread according to the target performance targets a processing unit from among the plurality of processing units:
binding a second thread of the target performance with the target processing unit;
if the target processing unit is not successfully bound by the second thread of the target performance, a new target processing unit is selected from the plurality of processing units;
binding a second thread of the target performance with the new target processing unit;
the binding the target thread with the target performance requirement according to the target processing unit to obtain a bound thread includes:
and if the second thread of the target performance is successfully bound with the target processing unit, binding the second thread of the target performance with the target performance requirement according to the target processing unit.
10. The method of claim 9, wherein said re-updating the target processing unit from the plurality of processing units if the target performance second thread fails to bind the target processing unit comprises:
if the second thread with the target performance is not successfully bound with the target processing unit and is not greater than the preset performance, determining a new target processing unit with the target performance from the plurality of processing units again;
and if the second thread of the target performance is not successfully bound with the target processing unit and is not less than the preset performance, re-determining a new target processing unit which is not less than the preset performance from the plurality of processing units.
11. The application execution method of claim 9, wherein said binding the second thread of the target performance with the new target processing unit comprises:
acquiring the binding times, wherein the binding times are the times that the second thread of each target performance does not successfully bind the new target processing unit;
when the binding times are larger than preset times, stopping binding the second thread with the target performance with the new target processing unit;
and running the preset binding thread in the application program by adopting the plurality of processing units.
12. The method of claim 9, wherein said binding the second thread of the target performance with the target processing unit comprises:
creating an auxiliary thread;
binding, by the assist thread, a second thread of the target performance with the target processing unit;
said binding the second thread of the target performance with the new target processing unit comprises:
binding, by the assist thread, a second thread of the target performance with the new target processing unit.
13. An application execution apparatus, comprising:
a first obtaining unit, configured to obtain a processing unit group and a performance requirement group, where the processing unit group includes multiple processing units, and the performance requirement group includes multiple performance requirements of an application program;
a second obtaining unit, configured to obtain a mapping relationship group between the processing unit group and the performance requirement group, where the mapping relationship group includes a mapping relationship between processing unit performance and performance requirements;
a determination unit configured to determine a target processing unit from the processing unit group;
the searching unit is used for determining a target performance requirement corresponding to the target processing unit according to the mapping relation group;
and the binding unit is used for binding the target processing unit with the target performance requirement so as to adopt the target processing unit to run the application program under the target performance requirement.
14. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the application program execution method of any one of claims 1 to 12.
15. A computer readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the application execution method according to any one of claims 1 to 12.
CN202211611776.8A 2022-12-14 2022-12-14 Application program running method and device, electronic equipment and storage medium Pending CN115904723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211611776.8A CN115904723A (en) 2022-12-14 2022-12-14 Application program running method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211611776.8A CN115904723A (en) 2022-12-14 2022-12-14 Application program running method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115904723A true CN115904723A (en) 2023-04-04

Family

ID=86480548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211611776.8A Pending CN115904723A (en) 2022-12-14 2022-12-14 Application program running method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115904723A (en)

Similar Documents

Publication Publication Date Title
CN110888746B (en) Memory management method and device, storage medium and electronic equipment
US10884817B2 (en) Method and apparatus for parallel execution in terminal database using data partitions
CN113110938B (en) Resource allocation method and device, computer equipment and storage medium
US20210208935A1 (en) Method for Scheduling Multi-Core Processor, Terminal, and Storage Medium
CN109062468B (en) Split screen display method and device, storage medium and electronic equipment
US20150163280A1 (en) Method and device for downloading file
CN111338745B (en) Deployment method and device of virtual machine and intelligent device
CN108932057A (en) Method of controlling operation thereof, device, storage medium and electronic equipment
CN115460469B (en) Processing method and device for multi-video playing, computer equipment and storage medium
CN114237743B (en) Interface loading method and device, electronic equipment and storage medium
CN114327087A (en) Input event processing method and device, electronic equipment and storage medium
CN109062469B (en) Split screen display method and device, storage medium and electronic equipment
WO2024119823A1 (en) Gpu computing resource management method and apparatus, electronic device and readable storage medium
CN115904723A (en) Application program running method and device, electronic equipment and storage medium
CN115469937A (en) Plug-in operation method and device, electronic equipment and storage medium
CN114995970A (en) Task processing method and device, storage medium and electronic equipment
CN109673043B (en) Control method and device of split type electronic equipment, storage medium and electronic equipment
CN116027878B (en) Power consumption adjustment method and electronic equipment
CN114416234B (en) Page switching method and device, computer equipment and storage medium
CN114489858B (en) Application software information setting method and device, terminal equipment and storage medium
CN117542134B (en) Communication method and device of passive device, electronic device and readable storage medium
CN114489445B (en) Screen adjustment method and device, intelligent equipment and storage medium
CN116382800A (en) Data processing method, device, electronic equipment and storage medium
CN118152770A (en) Task processing method and device, electronic equipment and storage medium
CN117032540A (en) Interactive operation response 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