Process processing method and device, electronic equipment and computer readable medium

By detecting the duration of the running scenario to determine the process management strategy, the problem of high resource consumption caused by a single process strategy is solved, thus improving the user experience.

CN121833145APending Publication Date: 2026-04-10SHENZHEN HEYTAP TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing process strategy settings are too simplistic and cannot adapt to the operating conditions of electronic devices, resulting in high resource consumption and negatively impacting user experience.

Method used

By detecting when a specified process is triggered to execute, the duration type corresponding to the current operating scenario of the electronic device is obtained. Based on the duration type, a control strategy is determined, and an appropriate processing core or freeze duration is selected to execute the process.

Benefits of technology

It achieves matching of process strategies with the operating scenarios of electronic devices, reduces resource consumption, improves user experience, and avoids lag and overheating.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833145A_ABST
    Figure CN121833145A_ABST
Patent Text Reader

Abstract

The invention discloses a process processing method and device, electronic equipment and a computer readable medium, and relates to the technical field of computers.The method comprises the steps that under the condition that it is detected that a specified process is triggered to be executed, a duration type corresponding to a current running scene of the electronic equipment is obtained, the duration type is determined based on the duration of the operation scene; based on the duration type, determining a management and control strategy corresponding to the specified process, the management and control strategy being used for determining a processing core or freezing duration for executing the specified process; and executing the specified process according to the management and control strategy. Therefore, under the condition that the control strategy is set for the specified process to execute the specified process, the control strategy can be set based on the duration type of the running scene in combination with the duration type of the current running scene of the electronic equipment, so that the strategy setting of the specified process is related to the running duration of the running scene; and the current operation condition of the electronic equipment can be better fit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a process processing method, apparatus, electronic device, and computer-readable medium. Background Technology

[0002] Currently, with the development of the internet and terminal technology, people are increasingly reliant on terminals, especially mobile terminals, to handle all aspects of daily life, including clothing, food, housing, and transportation. Various functions and types of applications have emerged to provide services to users. Consequently, the number of applications installed on user terminals is increasing, leading to a greater number of programs and processes running simultaneously on mobile terminals. Currently, different strategies can be specified for process execution, allowing for settings such as the processor and execution time period. However, current process strategy settings are too simplistic and cannot adapt to the changing operating conditions of electronic devices. Summary of the Invention

[0003] This application discloses a process processing method, apparatus, electronic device, and computer-readable medium.

[0004] In a first aspect, embodiments of this application provide a process processing method, comprising: upon detecting that a specified process is triggered for execution, obtaining a duration type corresponding to the current operating scenario of the electronic device, wherein the duration type is determined based on the duration of the operating scenario; determining a control strategy corresponding to the specified process based on the duration type, wherein the control strategy is used to determine the processing core or freeze duration for executing the specified process; and executing the specified process according to the control strategy.

[0005] Secondly, embodiments of this application also provide a process processing apparatus, comprising: an acquisition unit, a determination unit, and a processing unit. The acquisition unit is configured to, upon detecting that a specified process has been triggered for execution, acquire the duration type corresponding to the current operating scenario of the electronic device, wherein the duration type is determined based on the duration of the operating scenario. The determination unit is configured to determine a control strategy corresponding to the specified process based on the duration type, wherein the control strategy is used to determine the processing core or freeze duration for executing the specified process. The processing unit is configured to execute the specified process according to the control strategy.

[0006] Thirdly, embodiments of this application also provide an electronic device, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more application programs are configured to perform the methods described above.

[0007] Fourthly, embodiments of this application also provide a computer-readable medium storing processor-executable program code, which, when executed by the processor, causes the processor to perform the above-described method.

[0008] The process processing method, apparatus, electronic device, and computer-readable medium provided in this application, upon detecting that a specified process has been triggered for execution, obtain the duration type corresponding to the current operating scenario of the electronic device, wherein the duration type is determined based on the duration of the operating scenario; determine a control strategy corresponding to the specified process based on the duration type, wherein the control strategy is used to determine the processing core or freeze duration for executing the specified process; and execute the specified process according to the control strategy. Therefore, when setting a control strategy for a specified process to execute it, the control strategy can be set based on the duration type of the current operating scenario of the electronic device, making the strategy setting for the specified process related to the runtime of the operating scenario, thus better aligning with the current operating status of the electronic device.

[0009] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 A flowchart of a process processing method provided in an embodiment of this application is shown;

[0012] Figure 2 This paper shows the overall architecture diagram corresponding to the process processing method provided in the embodiments of this application;

[0013] Figure 3 A flowchart of a process processing method provided in another embodiment of this application is shown;

[0014] Figure 4 A flowchart illustrating the processing of a long-duration scenario according to an embodiment of this application is shown;

[0015] Figure 5 This illustration shows a schematic diagram of the load detection operation prior to core binding provided in an embodiment of this application;

[0016] Figure 6 A schematic diagram of a load detection operation after core binding is shown in an embodiment of this application;

[0017] Figure 7 A flowchart of a process processing method provided in another embodiment of this application is shown;

[0018] Figure 8 A flowchart illustrating the processing of a short-term scenario according to an embodiment of this application is shown;

[0019] Figure 9 A block diagram of a process processing apparatus provided in one embodiment of this application is shown;

[0020] Figure 10 A structural block diagram of the electronic device provided in an embodiment of this application is shown;

[0021] Figure 11 An embodiment of the present application shows a storage unit for storing or carrying program code that implements the method according to the embodiment of the present application. Detailed Implementation

[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. The components of the embodiments of the present application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without inventive effort are within the scope of protection of the present application.

[0023] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0024] Currently, with the development of the internet and terminal technology, people are increasingly reliant on terminals, especially mobile terminals, to handle all aspects of daily life, including clothing, food, housing, and transportation. Various functions and types of applications have emerged to provide services to users. Consequently, the number of applications installed on user terminals is increasing, leading to a greater number of programs and processes running simultaneously on mobile terminals.

[0025] Then, the inventors discovered in their research that for some processes, the resources they consume during operation may affect the current operating scenario of electronic devices, leading to higher load, lag, overheating, and a negative impact on user experience.

[0026] Therefore, in order to overcome the above-mentioned defects, embodiments of this application provide a process processing method, which is applied to electronic devices, such as... Figure 1 As shown, the method includes: S101 to S103.

[0027] S101: When a specified process is detected to be triggered for execution, the duration type corresponding to the current operating scenario of the electronic device is obtained, and the duration type is determined based on the duration of the operating scenario.

[0028] As one implementation, the specified process can be any process capable of running on an electronic device. Exemplarily, this specified process can be a pre-compilation process used to convert bytecode into machine code, namely the dex2oat process. dex2oat is a process in the Android operating system used to convert Dalvik Executable files into optimized ART files. The primary purpose of dex2oat is to convert Dalvik Executable files in Android applications into machine code for more efficient execution on Android devices. This conversion is part of Ahead-of-Time (AOT) compilation, meaning compilation occurs during application installation or updates, rather than at runtime (Just-in-Time, JIT compilation).

[0029] It should be noted that "a specified process being triggered" means that the specified process is executed due to certain triggering scenarios. These triggering scenarios correspond to specific business functions, and these functions will use the specified process, thus triggering its execution. For example, if the specified process is a dex2oat process, its corresponding triggering scenarios include boot scenarios, application installation scenarios, OTA upgrade scenarios, screen-off idle scenarios, and data migration scenarios.

[0030] The boot scenario refers to the series of operations and states a device undergoes during startup, typically involving the complete process from shutdown to the loading and running of the operating system. In the boot scenario, for example, during device startup, the Android system needs to load and launch core components and system applications. Therefore, the system pre-compiles some critical applications and libraries to shorten startup time. The `dex2oat` process is called during this process to convert necessary files into machine code, ensuring rapid loading and execution at startup. In the application installation scenario, when a user installs an application for the first time, the system runs the `dex2oat` process to convert the application's dex file into native code. This process is automatically triggered during application installation to ensure faster application startup on subsequent launches. If the application version is updated, the new dex file may contain different code or optimizations. In this case, the system re-runs the `dex2oat` process to compile the new bytecode, ensuring the user receives the latest performance optimizations.

[0031] In OTA (Over-The-Air) upgrade scenarios, when the system version is updated, new or updated applications and libraries may be introduced. The dex2oat process is invoked to compile the dex files of these new applications, ensuring their compatibility with the new Android version. Additionally, system upgrades may involve updates to already installed applications; the dex2oat process handles these update files to ensure optimal performance in the new environment. In idle scenarios, when the electronic device is in an idle state, the Android system can utilize the dex2oat process for background compilation to improve performance. This allows the system to pre-compile new or updated applications when the user is not using the device, thus reducing startup time the next time the user uses the device. In data migration scenarios, when migrating data from an old device to a new device, the system needs to recompile the application's dex files to ensure smooth operation in the new environment. By invoking the dex2oat process during the migration process, it ensures that all applications run at optimal performance on the new device, especially when the Android version of the new device differs from that of the old device.

[0032] Therefore, the implementation of detecting that a specified process has been triggered can be as follows: if the above-mentioned triggering scenario is detected to be running, determine that the specified process has been triggered; or if the triggering scenario is detected to be running, determine whether a triggering request of the specified process has been detected, and if the triggering request is detected, determine that the specified process has been triggered.

[0033] When a specified process is detected to be triggered for execution, the system needs to determine whether to execute the specified process and what strategy to use to execute it. In this embodiment, the system determines the control strategy for the specified process by referring to the current operating scenario duration type of the electronic device. Specifically, the duration type is determined based on the duration of the operating scenario. For example, the electronic device can pre-determine the duration of each specified scenario based on historical data of each specified scenario of the electronic device, and set different categories based on the duration of each specified scenario. For example, the duration type can be set to include a first type and a second type, wherein the duration of the first type scenario is longer than a preset duration, and the duration of the second type scenario is less than or equal to the preset duration. That is, the first type can be a long-duration scenario, and the second type can be a short-duration scenario. The designated scenario is a scenario that the system may select to participate in the classification of this duration type. In the embodiments of this application, the designated scenario may be a user interaction scenario. A user interaction scenario refers to a scenario in which a user interacts with the interface and functions of a system, application or device. For example, the user interaction scenario may include a video playback scenario, a game scenario, an audio playback scenario, a navigation scenario, a voice and video call scenario, a face unlock scenario, an application launch scenario, a fingerprint unlock scenario, a camera scenario and a swiping scenario. Among them, the camera scenario refers to the scenario of taking photos, and the video recording operation belongs to the video playback scenario.

[0034] As one implementation method, such as Figure 2 As shown, the aforementioned duration refers to the time interval from the start time to the end time of a scene. Video playback scenes, game scenes, audio playback scenes, navigation scenes, and voice / video call scenes belong to the first type, i.e., long-duration scenes. Face unlock scenes, application launch scenes, fingerprint unlock scenes, camera scenes, and swipe scenes belong to the second type, i.e., short-duration scenes.

[0035] Therefore, one implementation method for obtaining the duration type corresponding to the current operating scenario of the electronic device is to determine whether the current operating scenario belongs to the aforementioned specified scenario. If it does, the duration type corresponding to the operating scenario is determined based on the aforementioned correspondence between each specified scenario and duration type.

[0036] S102: Determine the control policy corresponding to the specified process based on the duration type, wherein the control policy is used to determine the processing core or freeze duration for executing the specified process.

[0037] It is understandable that the control policy serves as the execution strategy for a specified process, and the electronic device executes the specified process based on this control policy. Specifically, the control policy is used to set the processing core of the specified process, i.e., which processing core executes the specified process; or, the control policy is used to determine the freeze duration of the specified process, so that a freeze operation can be performed on the specified process based on this freeze duration. In other words, such as... Figure 2 As shown, the control strategy includes two strategies: freezing and core binding. The freezing duration is applied to the freezing strategy, and the strategy for determining the processing core that executes the specified process is applied to the core binding strategy.

[0038] It should be noted that there is a pre-defined correspondence between the duration type and the control policy. Based on this correspondence, the control policy corresponding to the specified duration can be determined. For example, if the duration type includes a first type and a second type, the control policy corresponding to the first type is to allocate processing cores to the specified process, and the control policy corresponding to the second type is to set the freeze duration of the specified process. This will be described in detail in subsequent embodiments.

[0039] S103: Execute the specified process according to the control policy.

[0040] As mentioned above, the control strategy is used to determine the processing core or freeze duration for executing the specified process. The processing core is used to characterize the processor executing the specified process, and the freeze duration can characterize the duration during which the specified process is frozen, i.e., suspended from execution. Therefore, the implementation method of executing the specified process based on the control strategy is to execute the specified process based on the determined core processor or based on the determined freeze duration.

[0041] In other words, after determining the control policy based on the duration type, the specified process can be executed based on that policy. Therefore, when a specified process is detected as being triggered, the current operating scenario can be obtained, and the control policy for the specified process can be determined based on the duration type of that scenario, thus executing the process accordingly. Therefore, when setting a control policy for a specified process to execute it, the control policy can be set based on the duration type of the current operating scenario of the electronic device, making the policy setting for the specified process relevant to the duration of the operating scenario and more closely aligned with the current operating status of the electronic device.

[0042] Please see Figure 3 , Figure 3 This application illustrates a process processing method, which includes steps S301 to S304.

[0043] S301: When a specified process is detected to be triggered for execution, the duration type corresponding to the current operating scenario of the electronic device is obtained, and the duration type is determined based on the duration of the operating scenario.

[0044] S302: If the duration type is the first type, determine the current triggering scenario of the specified process, wherein the duration of the running scenario of the first type is greater than the preset duration.

[0045] As mentioned earlier, the running scenarios are categorized by duration. If the duration exceeds a preset duration, the duration type is classified as Type 1. It's important to clarify that the duration of this running scenario refers to the duration calculated based on historical data, not the duration of the current running scenario. The preset duration can be set based on actual usage requirements; for example, it could be 5 seconds.

[0046] It is understandable that the meaning of this triggering scenario can be referred to the aforementioned content, and will not be repeated here. If the duration type corresponding to the current operating scenario of the electronic device is the first type, that is, it belongs to the long-term scenario, then in the case of the long-term scenario, the core binding operation is performed on the specified process. Therefore, the core binding operation needs to determine the processing core that executes the specified process, that is, to execute the S303 operation.

[0047] S303: Based on the triggering scenario, determine at least one target processing core among the multiple processing cores of the electronic device for executing the specified process.

[0048] As one implementation method, a grouping strategy can be predefined, that is, multiple processing core groups are determined, each processing core group includes at least one processing core, and then at least one processing core group corresponding to different trigger scenarios is set.

[0049] like Figure 4 As shown in Table 1, different grouping strategies can be preset.

[0050] Table 1

[0051] Grouping tags Grouping strategy L_BACKGROUND(0) CPU cores: 0~1 BACKGROUND(1) CPU cores: 0-4 H_BACKGROUND(2) CPU cores: 0-1, 5-6 FORGROUND(3) CPU cores: 0-7

[0052] As shown in Table 1, there are multiple grouping strategies, each including at least one processing core group. The group label serves as the identifier for its corresponding grouping strategy; the numbers within parentheses (0, 1, 2, 3) can be considered as the identifiers for each grouping strategy. For example, 0 represents the first grouping strategy. Furthermore, the processing core group within a grouping strategy acts as a single core group for executing a specified process. For instance, if the grouping strategy assigned to a specified process is the first grouping strategy, then the processing core group corresponding to that specified process is CPU cores 0 to 1, meaning the specified process is executed on CPU cores 0 and 1.

[0053] Please refer to it again. Figure 4 As can be seen, each triggering scenario corresponds to a grouping policy usage range, namely the range defined by maxPolicy and minPolicy. Here, minPolicy represents the minimum index of the grouping policy that can be used, and maxPolicy represents the maximum index of the grouping policy that can be used. Therefore, as... Figure 4 As shown, the Boot scenario (maxPolicy: 3minPolicy: 3) refers to the grouping policy corresponding to FORGROUND (3), that is, at least one target processing core of the dex2oat process triggered by the Boot scenario is CPU core: 0 to 7. Similarly, the installation scenario (maxPolicy: 2minPolicy: 0) indicates that the grouping policies that can be used are the first to third in the table above. That is, the corresponding core binding policies are L_BACKGROUND (0), BACKGROUND (1), and H_BACKGROUND (2). You can choose any one of the three policies to perform the core binding operation. For example, you can allow the dex2oat process to run on core 0-1, or core 0-4, or core 0-1, 5-6. Therefore, the grouping method divides CPU capabilities into different levels. The cores, such as 0 to 4, mean that a process can run on one of the five CPU cores: CPU0, CPU1, CPU2, CPU3, and CPU4. Which one it runs on depends on the CPU scheduling policy, but the process will definitely not run on any of these five cores, such as CPU7.

[0054] Therefore, through Figure 4 By identifying the correspondence between different scenarios and grouping strategies of the dex2oat process in the system, the grouping strategy corresponding to the dex2oat process that the electronic device is about to execute can be determined. This allows for the identification of at least one target processing core for executing the specified process, enabling the execution of a core binding operation. The core binding operation described in this application refers to the operation of identifying at least one target processing core for the specified process and executing the specified process based on the at least one target processing core.

[0055] It's important to note that when the trigger scenario corresponding to a specified process is running in the foreground of the electronic device, meaning the user is waiting for the trigger scenario to complete, core binding to the specified process should be avoided. This is because core binding requires more CPU resources, meaning the system must handle multiple tasks simultaneously during the execution of the trigger scenario. This resource contention can affect the execution of the trigger scenario, thus prolonging the waiting time. Furthermore, core binding can lead to frequent context switching, wasting CPU time executing different tasks and further impacting the processing speed of the scenario. Therefore, if core binding of the specified process causes the trigger scenario to execute slowly when it's running in the foreground, it will result in excessively long waiting times for the user.

[0056] Therefore, if the triggering scenario is not running in the foreground, at least one target processing core for executing the specified process is determined among the multiple processing cores of the electronic device, i.e., a core binding operation is performed. If the triggering scenario is running in the foreground, the core binding operation is canceled, and the specified process will select the processing core to execute the specified process according to the CPU's default scheduling policy, i.e., the specified process is executed on the default processing core, which is usually a large core processor.

[0057] It should be noted that "big core" and "small core" are used to describe the processing (CPU) in a multi-core processor architecture, especially in heterogeneous computing architectures. The "big" and "small" in "big core" and "small core" mainly refer to the differences in processing power, performance, and power consumption.

[0058] For example, "high-performance cores" typically refer to processors characterized by relatively high performance, high power consumption, and high complexity. High performance means that high-performance cores have higher clock speeds, larger caches, more complex execution units, and higher processing power, enabling them to handle complex computational tasks and high-load applications. High power consumption means that high-performance processors typically consume more power due to their high-performance design. High complexity means that high-performance processors often employ more complex architectures, such as superscalar architectures and deep pipelines, to achieve higher performance. Furthermore, electronic devices can use high-performance processors to perform tasks requiring high computational power, such as high-load computing, graphics processing, and video encoding / decoding.

[0059] For example, compared to large cores, high-efficiency cores typically feature relatively low power consumption, low performance, and low complexity. For example, low power consumption means that high-efficiency cores are designed with power efficiency in mind, resulting in lower power consumption and better energy utilization, making them suitable for power-constrained environments. For example, low performance means that while the processing power of high-efficiency cores is lower than that of large cores, it is still sufficient for handling light-load tasks and routine operations. For example, low complexity means that high-efficiency cores employ a simpler design, typically with fewer execution units and caches, aiming to provide better power efficiency. Electronic devices using high-efficiency cores often handle light-load tasks, such as background tasks, lightweight applications, some sensor control, or routine operations, which can help extend battery life or reduce system power consumption.

[0060] Therefore, when the triggered scenario is running in the foreground, core binding is not performed, and the specified process is processed on a large core, which allows the triggered scenario to be executed quickly and reduces the user's waiting time in the foreground. Furthermore, the foreground status of a specific triggered scenario is only considered. This specific triggered scenario is named a preset scenario, which typically has the potential to run in the foreground; that is, it can run in the foreground or background. In this embodiment, the preset scenarios are electronic device data migration and application installation scenarios. Therefore, if the triggered scenario is an electronic device data migration or application installation scenario, it is determined whether the triggered scenario is running in the foreground. If the triggered scenario is not running in the foreground, at least one target processing core for executing the specified process is determined from among the multiple processing cores of the electronic device. In other words, for user phone migration scenarios (i.e., electronic device data migration scenarios) and application store installation scenarios, if these scenarios are in the foreground, core binding is not performed.

[0061] S304: Execute the specified process based on the at least one target processing core.

[0062] In one implementation, the number of the at least one target processing core can be multiple, and the multiple target processing cores can correspond to different grouping strategies. Taking the application installation scenario as an example, if the triggering scenario of the specified process is the application installation scenario, then the corresponding at least one target processing core includes CPU cores 0 to 6, and the specified process can be run based on CPU cores 0 to 6.

[0063] In addition, to prevent the dex2oat process from being restricted to small cores and causing small core congestion, the embodiments of this application can combine CPU load detection to perform load detection on different CPU cores, and perform verification in two parts (before core binding / after core binding).

[0064] Before core binding, that is, after determining at least one target processing core corresponding to the specified process, it is necessary to detect the load status of the at least one target processing core to avoid using a processing core with excessive load to execute the specified process. Specifically, the load status of the at least one target processing core is detected; if not every target processing core has a high load status, the specified process is executed based on the non-high-load target processing core.

[0065] For example, the load status of a processing core can be determined based on its CPU utilization. For instance, a first threshold can be set. If the utilization is greater than the first threshold, the processing core is determined to be under high load; otherwise, it is not under high load. Alternatively, the high load status can be determined based on the number of processes running on the processing core. For instance, the number of processes running on the processing core can be obtained. If the number is greater than a second threshold, the processing core is determined to be under high load; otherwise, it is not under high load.

[0066] As one implementation method, the execution of the specified process based on a non-high-load target processing core can be managed in a hierarchical manner according to CPU load. Specifically, multiple processing cores of an electronic device are labeled, for example, CPU cores 0 to 7 as mentioned above. Therefore, after determining at least one target processing core corresponding to the specified process, the label corresponding to the at least one target processing core can also be determined. The specified process is then executed one by one on non-high-load target processing cores in ascending order of the labels (of course, it can also be from largest to smallest, which is not limited).

[0067] Understandably, in combination Figure 4 As can be determined from Table 1, the multiple target processing cores can be divided into multiple groups, i.e., core groups. Taking the application installation scenario as an example, the groups corresponding to the multiple target processing cores of the specified process are as follows: Group 0: CPU cores 0-1, Group 1: CPU cores 0-4, Group 2: CPU cores 0-1, 5-6, a total of three groups. Therefore, the multiple target processing cores determined based on the specified process include Group 0, Group 1 and Group 2.

[0068] Therefore, the implementation method of executing the specified process based on at least one target processing core can be to execute the specified process based on multiple core groups corresponding to the at least one target processing core. Specifically, the execution method is to determine the load status of each core group, select a non-high-load core group according to the group number to execute the specified process, and cancel the core binding operation if all core groups, i.e. all target processing cores, are in a high-load state.

[0069] like Figure 5As shown, it should be noted that... Figure 5 Corresponding to Figure 4 The execution flow for "CPU not busy" is as follows. Specifically, after determining the multiple core groups corresponding to the specified process, the core group with the smallest sequence number is named minGroup, and the core group with the largest sequence number is named maxGroup. Taking the application installation scenario as an example, the minGroup is group 0, i.e., group L_BACKGROUND(0): CPU cores: 0~1, and the maxGroup is group 2, i.e., group H_BACKGROUND(2): CPU cores: 0~1, 5~6. The way to execute the specified process based on these multiple core groups is to select a non-high-load core group to execute the specified process in the order of group 0, group 1, and group 2.

[0070] like Figure 5 As shown, it is determined whether the minGroup is under high load. If it is not under high load, since multiple core groups are used to execute various tasks of the electronic device in order from the smallest to the largest sequence number, the minGroup is not under high load. Therefore, this means that none of the multiple core groups corresponding to the specified process are under high load, and the specified process can be executed using the multiple core groups corresponding to the specified process. Based on the aforementioned description, the specified process is usually executed by selecting a core group in ascending order of core group sequence number. Therefore, since the minGroup is not under high load, the specified process can be executed directly using the minGroup.

[0071] If the minGroup is under high load, then determine if the maxGroup is under high load. If it is not under high load, then select a non-high-load core group from the multiple core groups corresponding to the specified process to execute the specified process. If the maxGroup is under high load, then it means that the multiple core groups configured for the specified process are all under high load, and then abandon the core binding operation.

[0072] like Figure 6After core binding, the load status of the at least one target processing core is detected. If the load status of each target processing core is high, the operation of executing the specified process through the at least one target processing core is canceled. After the aforementioned core binding operation, at least one target processing core for executing the specified process has been determined. After executing the specified process based on the at least one target processing core, the load status of the at least one target processing core is determined. If the target processing core currently executing the specified process is in a high load state, a low-load target processing core can be determined among the multiple target processing cores to execute the specified process. If all target processing cores are in a high load state, the operation of executing the specified process based on the determined at least one target core processor is canceled. Instead, the specified process is executed using the default group. The default group can refer to the processing core that executes the specified process by default when the core binding operation is not performed on the specified process. For example, the core group corresponding to FORGROUND(3) can be used as the default group.

[0073] For example, taking the application installation scenario as the triggering scenario for the specified process, the multiple target processing cores corresponding to the specified process can be divided into three groups, namely L_BACKGROUND(0), BACKGROUND(1), and H_BACKGROUND(2), where minGroup is L_BACKGROUND(0) and maxGroup is H_BACKGROUND(2). Assuming that before core binding, it is determined that the minGroup is not under high load, the specified process is executed based on the minGroup. When the specified process is executed, if the minGroup is detected to be under high load, the specified process is executed using maxGroup, that is, the specified process is migrated to H_BACKGROUND(2) for execution. In other words, when binding cores, it is planned to use CPU cores 0 to 1 to execute the specified process. However, after binding cores, if CPU cores 0 to 1 are detected to be under high load, the data is migrated to maxGroup, i.e., CPU cores 5 to 6, to execute the specified process. If the maxGroup is also under high load, the specified process will be executed directly using the default group, which is usually the core of the electronic device.

[0074] It should be noted that the processing cores of electronic devices include large cores and small cores. Generally, for cores numbered 0 to 7, the cores with lower core numbers are small cores, and the cores with higher core numbers are large cores. As can be seen from Table 1, the core groups with lower group numbers also have lower core numbers. Assuming that cores 0 to 7 include one super-large core, three large cores, and four small cores, then the core numbers of the four small cores are 0 to 3, the core numbers of the three large cores are 4 to 6, and the core number of the super-large core is 7.

[0075] Therefore, as can be seen from Table 1, among the determined grouping strategies, the grouping strategy with the smaller number corresponds to the small core, and the smaller the number, the higher the proportion of small cores among the multiple processing cores. Therefore, after determining the multiple target processing cores corresponding to a specified process, these multiple target processing cores can be grouped into different core groups according to the grouping strategy in Table 1. That is, by determining the multiple grouping strategies corresponding to the specified process, the multiple processing cores corresponding to each grouping strategy constitute a core group. Thus, the multiple core groups corresponding to the specified process can be obtained. It can be seen that the smaller the sequence number of the multiple core groups, the higher the proportion of the corresponding small cores. For example, for the dex2oat process in the application installation scenario, the core group corresponding to minGroup includes cores 0 to 1, both of which are small cores. The core group corresponding to maxGroup includes cores 0 to 1 and 5 to 6, including two small cores and two large cores. Therefore, following the order from minGroup to maxGroup, the specified process can be tried to run on small cores first. If the above load judgment method is used, and it is determined that the small cores are under high load, the specified process can be tried to run on large cores. In this way, the specified process can be avoided from running on small cores, which may cause the small cores to lag. Therefore, after binding cores, if a high load is detected in the currently used core group, the specified process can be migrated to the maxGroup. This is because the maxGroup usually contains large cores, and it is more reasonable to use large cores to handle the specified process when the small cores are under high load.

[0076] In other words, before core binding: Due to numerous background tasks, the smaller cores are already quite busy. Therefore, based on the previous maxpolicy and minpolicy, a new strategy is selected, adjusting step by step to choose the less busy cores. After core binding: After dex2oat binds to the smaller cores, which are already close to their busy limit, the binding exacerbates the situation. At this point, CPU load monitoring is used, and if the CPU is still busy, the dex2oat binding will be canceled.

[0077] It should be noted that the at least one target processing core corresponding to the specified process typically includes at least some large cores and at least some small cores. In other words, the aforementioned grouping strategy includes at least some large cores and at least some small cores in each trigger scenario. This allows the system to first attempt to run the specified process using small cores; if the small cores are under high load, then it will attempt to run the specified process using large cores.

[0078] Please see Figure 7 , Figure 7 This application illustrates a process processing method, which includes steps S701 to S304.

[0079] S701: When a specified process is detected to be triggered for execution, the duration type corresponding to the current operating scenario of the electronic device is obtained, and the duration type is determined based on the duration of the operating scenario.

[0080] S702: If the duration type is the second type, determine the freeze duration, wherein the duration of the second type of running scenario is less than or equal to the preset duration.

[0081] S703: During the freeze duration, suspend the execution of the specified process.

[0082] S704: After the freeze duration ends, execute the specified process.

[0083] like Figure 8 As shown, process freezing, as one implementation method, refers to suspending the execution of a process through the operating system, thereby stopping its operation for a period of time. The freezing process prevents the process from consuming CPU resources and responding to any input or events until it is unfrozen. Therefore, for short-duration scenarios with a duration less than or equal to a preset duration, freezing can be used. This involves setting a freeze duration, suspending the execution of the specified process during that duration, and resuming execution after the freeze ends. Thus, for short-duration scenarios, it avoids the running of a specified process from preempting the scenario's execution resources, allowing the scenario to complete quickly.

[0084] As one implementation, the freeze duration can be a default value, such as 3 seconds. Alternatively, if the duration type is the second type, the freeze duration can be determined based on the duration of the running scenario. In other words, the freeze duration is ensured to be greater than or equal to the duration, thereby maximizing the benefit of the scenario's duration and keeping the freeze duration consistent with the scenario's time consumption. This ensures that when the scenario runs, the specified process is paused, but the pause duration does not cause excessive user waiting time.

[0085] As one implementation method, the running scenario can include two types: duration type and business type. The duration type is related to the duration of the running scenario, and the business type refers to the business to be performed by the running scenario. For example, the duration type of a game scenario is a long-duration scenario, i.e., the first type, and the business type is a game type. That is, the business type expresses the function of the scenario.

[0086] If the duration type of the running scenario is determined to be the second type, the business type of the running scenario is obtained. If the business type is a specified type, the application corresponding to the running scenario is determined. If the application is the specified application, the freeze duration determination and subsequent freeze operations are not performed. If the application is not the specified application, the freeze duration determination and subsequent freeze operations are performed. In the specified application, the frequency of the running scenario of the specified type is higher than the specified frequency. That is to say, the running scenario of the specified type will be frequently triggered in the specified application. Therefore, for this scenario, the freeze operation can be omitted. Because such short-term scenarios will be frequently triggered, the specified process will be frequently frozen and unable to be executed smoothly. Therefore, if the freeze operation is not performed, the aforementioned core binding operation can be performed, or the default group can be used to execute the specified process.

[0087] For example, if the specified type is a swipe type, that is, assuming the current operating scenario of the electronic device is a swipe scenario, then the application corresponding to the swipe scenario is determined. If it is a specified application that frequently triggers swipes, such as a game application, then the freeze operation is not performed.

[0088] Therefore, taking the dex2oat process as an example, in this embodiment, since restricting the dex2oat process can affect the speed of some scenarios, such as OTA upgrade speed, leading to slower application installation, this solution selects an appropriate control technology based on the interaction duration of the user's highly perceived scenarios. If the duration is short, freezing is selected for control; if the duration is long, cpuset core binding is selected. When the scenario is triggered, the freezing and core binding capabilities of dex2oat are executed, thereby alleviating resource pressure, allowing the foreground application to obtain sufficient resources, and reducing phenomena such as lag and overheating.

[0089] Please see Figure 9 The diagram illustrates a structural block diagram of a process processing device provided in an embodiment of this application. The device may include: an acquisition unit 901, a determination unit 902, and a processing unit 903.

[0090] The acquisition unit 901 is used to acquire the duration type corresponding to the current running scenario of the electronic device when a specified process is detected to be triggered for execution. The duration type is determined based on the duration of the running scenario.

[0091] The determining unit 902 is used to determine the control policy corresponding to the specified process based on the duration type, wherein the control policy is used to determine the processing core or freeze duration for executing the specified process.

[0092] Furthermore, the determining unit 902 is also configured to determine the current triggering scenario of the specified process if the duration type is a first type, wherein the duration of the running scenario of the first type is longer than a preset duration; and based on the triggering scenario, determine at least one target processing core for executing the specified process among the multiple processing cores of the electronic device.

[0093] Furthermore, the determining unit 902 is also configured to determine at least one target processing core among the multiple processing cores of the electronic device for executing the specified process if the triggering scenario is not running in the foreground.

[0094] Furthermore, the determining unit 902 is also configured to determine whether the triggering scenario is running in the foreground if the triggering scenario is an electronic device data migration scenario or an application installation scenario; if the triggering scenario is not running in the foreground, then determine at least one target processing core among the multiple processing cores of the electronic device for executing the specified process.

[0095] Furthermore, the determining unit 902 is also used to determine the freeze duration if the duration type is the second type, wherein the duration of the second type of running scenario is less than or equal to the preset duration.

[0096] Furthermore, the determining unit 902 is also used to determine the freeze duration based on the duration of the running scenario if the duration type is the second type.

[0097] Processing unit 903 is used to execute the specified process according to the control policy.

[0098] Furthermore, the processing unit 903 is also used to execute the specified process based on the at least one target processing core.

[0099] Furthermore, the processing unit 903 is also used to detect the load status of the at least one target processing core; if not every target processing core is under high load, the specified process is executed based on the non-high load target processing core.

[0100] Furthermore, the processing unit 903 is also used to detect the load status of the at least one target processing core; if the load status of each target processing core is high load, the operation of executing the specified process through the at least one target processing core is canceled.

[0101] Furthermore, the processing unit 903 is also configured to suspend the execution of the specified process during the freeze duration; and to execute the specified process after the freeze duration ends.

[0102] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0103] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.

[0104] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0105] Please refer to Figure 10 This document illustrates a structural block diagram of an electronic device according to an embodiment of this application. The electronic device 100 can be a smartphone, tablet computer, e-reader, or other electronic device capable of running applications. The electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications can be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more applications are configured to perform the methods described in the foregoing method embodiments.

[0106] Processor 110 may include one or more processing cores. Processor 110 connects to various parts within the electronic device 100 using various interfaces and lines, and performs various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets, or instruction sets stored in memory 120, and by calling data stored in memory 120. Optionally, processor 110 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 110 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 110 and may be implemented separately using a communication chip.

[0107] The memory 120 may include random access memory (RAM) or read-only memory (ROM). The memory 120 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the terminal 100 during use (such as phonebook data, audio and video data, chat log data, etc.).

[0108] Please refer to Figure 11 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 1100 stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0109] The computer-readable storage medium 1100 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 1100 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 1100 has storage space for program code 1110 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 1110 may, for example, be compressed in a suitable form.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A process processing method, characterized in that, Applied to electronic devices, the method includes: When a specified process is detected to be triggered for execution, the duration type corresponding to the current operating scenario of the electronic device is obtained, and the duration type is determined based on the duration of the operating scenario. The control policy corresponding to the specified process is determined based on the duration type, wherein the control policy is used to determine the processing core or freeze duration for executing the specified process; The specified process is executed according to the control policy.

2. The method according to claim 1, characterized in that, The step of determining the control policy corresponding to the specified process based on the duration type, and executing the specified process according to the control policy, includes: If the duration type is the first type, determine the current triggering scenario of the specified process, wherein the duration of the running scenario of the first type is greater than the preset duration; Based on the triggering scenario, at least one target processing core for executing the specified process is determined from among the multiple processing cores of the electronic device; The specified process is executed based on at least one target processing core.

3. The method according to claim 2, characterized in that, The execution of the specified process based on the at least one target processing core includes: Detect the load status of the at least one target processing core; If not every target processing core is under high load, the specified process is executed based on the non-high-load target processing cores.

4. The method according to claim 2, characterized in that, After executing the specified process based on the at least one target processing core, the process further includes: Detect the load status of the at least one target processing core; If the load status of each of the target processing cores is high, then the operation of executing the specified process through the at least one target processing core is cancelled.

5. The method according to claim 2, characterized in that, The step of determining at least one target processing core for executing the specified process from multiple processing cores of the electronic device based on the triggering scenario includes: If the triggering scenario is not running in the foreground, then at least one target processing core is determined from among the multiple processing cores of the electronic device to execute the specified process.

6. The method according to claim 5, characterized in that, If the triggering scenario is not running in the foreground, then at least one target processing core for executing the specified process is determined from among the multiple processing cores of the electronic device, including: If the triggering scenario is an electronic device data migration scenario or an application installation scenario, determine whether the triggering scenario is running in the foreground; If the triggering scenario is not running in the foreground, then at least one target processing core is determined from among the multiple processing cores of the electronic device to execute the specified process.

7. The method according to claim 1, characterized in that, The step of determining the control policy corresponding to the specified process based on the duration type, and executing the specified process according to the control policy, includes: If the duration type is the second type, determine the freeze duration, wherein the duration of the second type of running scenario is less than or equal to the preset duration; During the specified freeze duration, the execution of the designated process is suspended. After the freeze period ends, the specified process is executed.

8. The method according to claim 7, characterized in that, If the duration type is the second type, determining the freeze duration includes: If the duration type is the second type, the freeze duration is determined based on the duration of the running scenario.

9. The method according to any one of claims 1-8, characterized in that, The specified process is a pre-compilation process used to convert bytecode into machine code.

10. A process processing apparatus, characterized in that, Applied to electronic devices, the device includes: The acquisition unit is used to acquire the duration type corresponding to the current running scenario of the electronic device when a specified process is detected to be triggered for execution. The duration type is determined based on the duration of the running scenario. A determining unit is configured to determine the control strategy corresponding to the specified process based on the duration type, wherein the control strategy is used to determine the processing core or freeze duration for executing the specified process; The processing unit is used to execute the specified process according to the control policy.

11. An electronic device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1-9.

12. A computer-readable medium, characterized in that, The readable medium stores processor-executable program code, which, when executed by the processor, causes the processor to perform the method according to any one of claims 1-9.