Application starting method and electronic equipment

CN120283223APending Publication Date: 2025-07-08HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380081350.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

When an electronic device starts an application, if the device has other applications running, the operation of the background application may affect the startup time of the foreground application, causing the user to wait too long.

Method used

By allocating fixed-sized storage space for preset types in the shared cache of electronic devices, avoiding competition with other applications to share cache, thereby improving application startup speed.

Benefits of technology

It effectively shortens the application startup time, reduces the user waiting time, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120283223A_ABST
    Figure CN120283223A_ABST
Patent Text Reader

Abstract

The invention provides an application starting method and electronic equipment, and relates to the technical field of terminals. And after the electronic equipment receives a starting operation of a user on the first application, the electronic equipment starts the first application in response to the starting operation. In the starting period of the first application, the electronic equipment can determine the target occupancy amount corresponding to the first application through a sensitive curve corresponding to the first application, and the sensitive curve corresponding to the first application identifies the mapping relation between the occupancy amount of the L3 cache by the first application and the IPC of the first application. The target occupancy represents the minimum occupancy of the L3 cache corresponding to the highest IPC. Afterwards, the first application can allocate the L3 cache of the corresponding size to the first application according to the target occupancy, so that the first application continues to be started according to the L3 cache allocated to the first application, it is guaranteed that the occupancy of the L3 cache by the first application is large enough, and therefore the starting duration of the first application is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Application startup method and electronic device Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an application startup method and an electronic device. Background Art

[0002] With the development of electronic devices, more and more types of applications are installed on electronic devices. When a user needs to use an application on an electronic device, such as application A, the electronic device needs to be triggered to start application A first. However, while the electronic device is starting application A, if other applications (such as background applications) are also running on the electronic device, the running of the background applications may affect the startup time of the foreground application (i.e., application A), resulting in a longer startup time for the foreground application, causing the user to wait for a long time for the application to start, and a poor user experience.

[0003] Summary of the Invention

[0004] In view of this, the present application provides an application startup method and an electronic device, which can avoid the application startup time being too long, thereby preventing the user from waiting for too long.

[0005] In a first aspect, the present application provides an application startup method, which is applied to an electronic device including a shared cache. After receiving a first operation (or referred to as a startup operation) for a first application, indicating a need to start the first application, the electronic device can allocate storage space for the first application in the shared cache. The first application is an application of a preset type.

[0006] Afterwards, the electronic device may access the target storage space to obtain the startup data of the first application. Afterwards, the electronic device may start the first application based on the startup data of the first application.

[0007] After receiving the first operation for the second application, indicating that the second application needs to be started, the electronic device does not allocate a fixed shared cache for the second application, and accesses the shared cache to obtain startup data of the second application.

[0008] Afterwards, the electronic device starts the second application based on the startup data of the second application.

[0009] In this application, for an application of a specific type (i.e., a preset type) (e.g., a first application), when the first application needs to be started, the electronic device can allocate a fixed-size shared cache to the first application, so that the first application does not need to preempt the shared cache, that is, it does not need to compete with other applications running on the electronic device for the shared cache, thereby reducing the impact of other applications on the startup of the first application, thereby avoiding the first application from taking too long to start up, and thus avoiding the user from waiting for a long time, thereby ensuring the user experience. For non-specific types of applications (e.g., a second application), the electronic device can start the second application normally without allocating a fixed-size shared cache to the first application.

[0010] In one possible design, for the aforementioned preset type of application, when the application's occupancy of the shared cache is a first amount, the application's startup time is a first time. When the application's occupancy of the shared cache is a second amount, the application's startup time is a second time. The first occupancy and the second occupancy are different, and the first time and the second time are different.

[0011] Optionally, the first occupancy and the second occupancy are both within a preset occupancy range, and different occupancy within the preset occupancy range correspond to different start-up times.

[0012] In one possible design, the electronic device may use a whitelist to determine whether the first application belongs to a preset type of application. The preset whitelist includes an identifier of at least one application, each of which belongs to a preset type of application. If the preset whitelist includes the identifier of the first application, the electronic device may determine that the first application belongs to the preset type of application. If the preset whitelist does not include the identifier of the first application, the electronic device may determine that the first application does not belong to the preset type of application.

[0013] Optionally, the electronic device may regularly maintain a preset whitelist and update the identifiers of the applications in the preset whitelist.

[0014] Alternatively, the electronic device may determine whether the first application belongs to a preset type of application based on whether the first application has a preset tag. If the first application has a corresponding preset tag, the electronic device may determine that the first application is an application of the preset type. If the first application does not have a corresponding preset tag, the electronic device may determine that the first application is not an application of the preset type.

[0015] In the present application, the electronic device quickly determines the type of the first application by presetting a whitelist or checking whether the first application has a preset mark.

[0016] In one possible design, the first application may be a short video application or a question-and-answer application.

[0017] In one possible design, the process of starting the second application may include:

[0018] The electronic device seizes the storage space corresponding to the second application from the shared cache, that is, the second application needs to compete with other applications other than the second application running on the electronic device for the shared cache.

[0019] Afterwards, the electronic device accesses the storage space corresponding to the second application to obtain the startup data of the second application.

[0020] In a possible design, starting the first application may include:

[0021] The electronic device displays the startup interface of the first application in full screen, displays the startup interface of the first application in floating mode, or displays the startup interface of the first application in split screen mode.

[0022] In a second aspect, the present application provides an application startup method, which is applied to an electronic device including a shared cache. After receiving a first operation directed to a first application, indicating a need to start the first application, the electronic device can allocate storage space for the first application in the shared cache based on a mapping relationship corresponding to the first application. The mapping relationship corresponding to the first application represents a mapping relationship between the first application's occupancy of the shared cache and the startup time of the first application, and the first application is an application of a preset type.

[0023] Afterwards, the electronic device may access the storage space allocated for the first application to obtain the startup data of the first application, and start the first application based on the startup data of the first application.

[0024] In the present application, for an application of a specific type (i.e., a preset type) (such as a first application), when the first application needs to be started, the electronic device can flexibly allocate a fixed-size shared cache to the first application based on the mapping relationship between the first application's occupancy of the shared cache and the startup time of the first application, so that the first application does not need to preempt the shared cache, that is, it does not need to compete with other applications running on the electronic device for the shared cache, thereby reducing the impact of other applications on the startup of the first application and shortening the startup time of the first application, thereby avoiding the startup time of the first application being too long, and thus avoiding the user from waiting for a long time, thereby ensuring the user experience.

[0025] In one possible design, the process of allocating storage space to the first application by the electronic device according to the mapping relationship corresponding to the first application may include:

[0026] The electronic device may determine a target occupancy corresponding to the first application based on the mapping relationship corresponding to the first application. The target occupancy represents the occupancy of the shared cache by the first application when the first application's startup time is the shortest. The electronic device may then allocate target storage space in the shared cache for the first application based on the target occupancy, that is, allocate a fixed-size shared cache to the first application based on the target occupancy.

[0027] In this application, the electronic device uses the mapping relationship corresponding to the first application to allocate a shared cache to the first application corresponding to the occupancy when the first application's startup time is shortest, ensuring that the first application's occupancy of the shared cache meets the startup requirements of the first application, so that the startup time of the first application is shortened, avoiding users from waiting for a long time, and ensuring the user experience.

[0028] In a possible design, the aforementioned preset type of application indicates that the startup time of the application is related to the amount of shared cache occupied by the application.

[0029] In one possible design, the process of detecting the type of the first application may include:

[0030] The electronic device may allocate storage space of corresponding sizes to the first application in the shared cache based on different occupancy amounts, wherein different occupancy amounts correspond to different storage space sizes. Subsequently, the electronic device determines that the first application is an application of a preset type based on the startup performance values ​​of the first application corresponding to the different storage space sizes, thereby accurately determining the type of the first application.

[0031] In a possible design, the process of allocating storage space of a corresponding size to the first application in the shared cache based on the occupancy may include:

[0032] For each first preset occupancy, the electronic device may allocate a first storage space for the first application in the shared cache based on the first preset occupancy. Accordingly, the process of determining that the first application is a preset type of application based on the startup performance values ​​of the first application corresponding to the different sizes of storage space may include:

[0033] Obtaining a startup performance value corresponding to a first preset occupancy; the startup performance value corresponding to the first preset occupancy represents a startup performance value of the first application when the storage space of the first application in the shared cache is the first storage space corresponding to the first preset occupancy; determining a difference between startup performance values ​​corresponding to different first preset occupancy amounts;

[0034] In a case where the difference is greater than a first preset difference, it is determined that the first application is an application of a preset type.

[0035] In addition, when the differences are all less than or equal to the first preset difference, it is determined that the first application is an application of a non-preset type.

[0036] In one possible design, the electronic device may use a whitelist to determine whether the first application belongs to a preset type of application. The preset whitelist includes an identifier of at least one application, each of which is an application of the preset type. If the preset whitelist includes the identifier of the first application, the electronic device may determine that the first application is an application of the preset type. If the preset whitelist does not include the identifier of the first application, the electronic device may determine that the first application is not an application of the preset type, that is, determine that the first application is an application of a non-preset type.

[0037] Optionally, the electronic device may regularly maintain a preset whitelist and update the identifiers of the applications in the preset whitelist.

[0038] Alternatively, the electronic device may determine whether the first application belongs to a preset type of application based on whether the first application has a preset tag. If the first application has a corresponding preset tag, the electronic device may determine that the first application is an application of the preset type. If the first application does not have a corresponding preset tag, the electronic device may determine that the first application is not an application of the preset type.

[0039] In the present application, the electronic device quickly determines the type of the first application by presetting a whitelist or checking whether the first application has a preset mark.

[0040] In one possible design, the mapping relationship corresponding to the first application represents the mapping relationship between the first application's occupancy of the shared cache and the first application's startup performance value. The higher the first application's startup performance value, the shorter the first application's startup time.

[0041] The process of determining the mapping relationship corresponding to the first application may include:

[0042] The electronic device may allocate different sizes of storage space in the shared cache to the first application based on different occupancy amounts. Based on the different sizes of storage space and the startup performance values ​​of the first application corresponding to the different sizes of storage space, a mapping relationship corresponding to the first application is determined, thereby accurately determining the mapping relationship between the first application's occupancy amount in the shared cache and the startup time of the first application, thereby ensuring the accuracy of the determined target occupancy amount.

[0043] In a possible design, the mapping relationship corresponding to the first application may be a mapping curve. Accordingly, the process of determining the mapping curve corresponding to the first application may include:

[0044] For each second preset occupancy, the electronic device may allocate a second storage space for the first application in the shared cache based on the second preset occupancy.

[0045] Afterwards, the electronic device can obtain the startup performance value corresponding to the second preset occupancy, which represents the startup performance value of the first application when the storage space of the first application in the shared cache is the second storage space corresponding to the second preset occupancy.

[0046] Afterwards, the electronic device can determine the mapping relationship based on each second preset occupancy and the startup performance value corresponding to each second preset occupancy, so as to accurately determine the mapping relationship between the occupancy of the shared cache by the first application and the startup performance value of the first application, that is, the startup time.

[0047] In a possible design, the target occupancy represents the minimum occupancy of the shared cache by the first application when the startup time is the shortest.

[0048] In a possible design, the shared cache includes multiple partitions. The process of allocating target storage space for the first application in the shared cache based on the target occupancy may include:

[0049] The electronic device may set a flag bit of the target register based on the target occupancy to allocate a corresponding number of partitions in the shared cache to the first application, thereby allocating a fixed storage space to the first application.

[0050] In one possible design, the target register includes a flag bit corresponding to each of the multiple partitions; when the flag bit corresponding to the partition is set to a first flag, it indicates that the partition is not assigned to the first application; when the flag bit corresponding to the partition is set to a second flag, it indicates that the partition is assigned to the first application.

[0051] In one possible design, the startup performance value includes the number of instructions executed per clock cycle (IPC) or the hit rate. The higher the IPC, the shorter the startup time of the first application.

[0052] The hit rate (or shared cache hit rate) is used to indicate the probability of accessing the startup data of the first application in the shared cache. The higher the hit rate, the shorter the startup time of the first application.

[0053] In one possible design, the shared cache may include an L3 cache.

[0054] In a possible design, the electronic device receives a first operation for the second application, that is, a start operation.

[0055] If the second application is a non-preset type of application, the electronic device may access the shared cache to obtain the startup data of the second application; wherein, other applications other than the second application running on the electronic device compete with the second application for access to the shared cache. Non-preset type of application means that the startup time of the application is not related to the amount of shared cache occupied by the application;

[0056] The electronic device starts the second application based on the startup data of the second application.

[0057] In this application, for applications of non-preset types (such as the second application), since the startup time of the second application is not related to the amount of shared cache occupied by the second application, the electronic device starts the second application normally without allocating a fixed shared cache to the second application. The second application needs to compete with other applications for the shared cache, that is, the electronic device needs to seize the storage space corresponding to the second application from the shared cache to avoid unnecessary shared cache allocation.

[0058] In a third aspect, the present application provides an electronic device, comprising a display screen, a memory, and one or more processors; the display screen, the memory, and the processor are coupled; the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, wherein the computer program code comprises computer instructions; when the processor executes the computer instructions, the electronic device executes a method as described in any one of the above-mentioned first aspects.

[0059] In a fourth aspect, the present application provides an electronic device, comprising a display screen, a memory, and one or more processors; the display screen, the memory, and the processor are coupled; the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, wherein the computer program code comprises computer instructions; when the processor executes the computer instructions, the electronic device executes a method as described in any one of the above-mentioned second aspects.

[0060] In a fifth aspect, the present application provides a computer-readable storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method as described in any one of the above-mentioned first aspects.

[0061] In a sixth aspect, the present application provides a computer-readable storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method as described in any one of the above-mentioned second aspects.

[0062] In a seventh aspect, the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the method as described in any one of the above-mentioned first aspects.

[0063] In an eighth aspect, the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the method as described in any one of the above-mentioned second aspects.

[0064] It can be understood that the beneficial effects that can be achieved by the electronic device described in the third and fourth aspects, the computer-readable storage medium described in the fifth and sixth aspects, and the computer program products described in the seventh and eighth aspects provided above can refer to the beneficial effects in the first or second aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] FIG1A is a first diagram of an interface for starting a game application provided by an embodiment of the present application;

[0066] FIG1B is a second schematic diagram of an interface for starting a game application provided in an embodiment of the present application;

[0067] FIG1C is a third schematic diagram of an interface for starting a game application provided in an embodiment of the present application;

[0068] FIG1D is a fourth schematic diagram of an interface for starting a game application provided in an embodiment of the present application;

[0069] FIG1E is a schematic diagram of an interface of a background application provided in an embodiment of the present application;

[0070] FIG2 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0071] FIG3 is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0072] FIG4 is a flow chart of a method for starting an application according to an embodiment of the present application;

[0073] FIG5A is a first schematic diagram of a mapping curve provided in an embodiment of the present application;

[0074] FIG5B is a second schematic diagram of a mapping curve provided in an embodiment of the present application;

[0075] FIG5C is a third schematic diagram of a mapping curve provided in an embodiment of the present application;

[0076] FIG5D is a fourth schematic diagram of a mapping curve provided in an embodiment of the present application;

[0077] FIG6A is a schematic diagram of a split-screen interface provided in an embodiment of the present application;

[0078] FIG6B is a schematic diagram of an L3 cache allocation provided in an embodiment of the present application;

[0079] FIG6C is a schematic diagram of an application-shared L3 cache provided in an embodiment of the present application;

[0080] FIG7 is a second flow chart of a method for starting an application according to an embodiment of the present application;

[0081] FIG8 is a schematic diagram of an L3 cache structure provided in an embodiment of the present application;

[0082] FIG9 is a third flow chart of a method for starting an application according to an embodiment of the present application;

[0083] FIG10A is a first schematic diagram of a multi-window interface provided by an embodiment of the present application;

[0084] FIG10B is a second schematic diagram of a multi-window interface provided in an embodiment of the present application;

[0085] FIG10C is a third schematic diagram of a multi-window interface provided in an embodiment of the present application.

[0086] FIG10D is a schematic diagram of a single-window interface provided in an embodiment of the present application. DETAILED DESCRIPTION

[0087] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0088] The following is an introduction to the nouns involved in this application.

[0089] Central Processing Unit (CPU) Cores: A CPU core is the physical or logical processing unit of a CPU. A CPU can contain one or more CPU cores, each of which can independently execute instructions and process data.

[0090] L3 cache: This is a shared cache that all CPU cores can access. When a CPU core needs to access data, it first queries the L1 cache to see if the data it needs exists. If the L1 cache doesn't contain the data the CPU core needs, the CPU continues to query the L2 cache to see if the data exists. If the L2 cache doesn't contain the data the CPU core needs, the CPU continues to query the L3 cache to see if the data exists. If the data the CPU core needs exists, it's called a cache hit in the L3 cache. Otherwise, it's called a cache miss, and the CPU core needs to load the data from main memory (or random access memory (RAM)). Both the L1 cache and the L2 cache are high-speed caches used by the CPU to speed up data access.

[0091] The above introduces the terms involved in this application, and the following will begin to introduce the technical solution of this application.

[0092] When an electronic device (such as a mobile phone) launches an application, if other applications (such as background applications) are also running on the phone, and the foreground application (including the launched application) and the background application are running concurrently, competition for shared resources, such as the L3 cache, may occur between the foreground and background applications. Because these applications compete for the L3 cache, the foreground application's L3 cache occupancy is uncertain. When the foreground application's L3 cache occupancy is small, the phone's success rate in accessing the data required to launch the foreground application (i.e., the foreground application's startup data) from the L3 cache is low. This is known as a low L3 cache hit rate (or a low L3 cache hit rate for the foreground application). Consequently, the phone must access the data required for the foreground application's startup from main memory. However, the speed at which the phone accesses main memory is slower than the speed at which it accesses caches (such as the L3 cache), slowing data access. This slows the time it takes to launch the foreground application, increasing the time users have to wait for the application to launch and resulting in a poor user experience. Furthermore, because the L3 cache occupancy varies from application to application, the application startup time is variable and fluctuates.

[0093] It should be noted that the L3 cache size occupied by the aforementioned application (such as the foreground application) can be understood as the size of the L3 cache that only the application is allowed to access, that is, the size of the L3 cache that the mobile phone can access when starting or running the application. When the L3 cache size occupied by the foreground application is small, the size of the L3 cache that the mobile phone can access when starting the foreground application is also small, resulting in a lower probability that the mobile phone can successfully access the foreground application's startup data from the L3 cache, thereby causing a lower L3 cache hit rate. The probability that the mobile phone needs to access the foreground application's startup data from main memory is higher, which in turn reduces the speed at which the mobile phone can access the foreground application's startup data.

[0094] For example, since different CPU cores in a mobile phone can access the L3 cache, when one CPU core (such as CPU core 1) starts an application (such as application A), other CPU cores may be running background applications. Therefore, CPU core 1 and other CPU cores will access the L3 cache. Since the amount of L3 cache occupied by application A and background applications is uncertain, when application A occupies less L3 cache, the L3 cache hit rate of application A is low, causing the CPU core to need to read the data required to start application A from the main memory multiple times, resulting in a longer time required for CPU core 1 to complete the startup of application A. In addition, since the amount of L3 cache occupied by application A is uncertain each time it is started, the time required for the CPU core in the mobile phone to complete the startup of application A is fluctuating, which may cause users to wonder why application A sometimes starts faster and sometimes starts slower, affecting the user experience.

[0095] For example, as shown in Figure 1A, the user clicks on the icon 10 of the first game application on the mobile phone desktop. In response to the click operation on the icon 10 of the first game application, the mobile phone starts the first game application. In the process of starting the first game application, the mobile phone needs to load the startup content first. As shown in Figure 1B, the mobile phone can first display the startup animation 11, and then display the loading interface 12 (as shown in Figure 1C). The startup animation and the loading interface do not have any controls that can be operated by the user. After the startup content (or startup interface) is loaded, the mobile phone displays the initial operable interface 13 as shown in Figure 1D. The initial operable interface 13 is the first interface displayed when the first game application is loaded, and it has controls that can be operated by the user (such as the start game button). The startup of the first game application is complete.

[0096] However, during the startup of the first game application, the mobile phone also runs background applications (as shown in Figure 1E, the background applications of the mobile phone include short video applications). Since the L3 cache includes the data required for application startup and operation, the mobile phone needs to access the L3 cache when starting the first game application and running the background application, causing the first game application and the background application to occupy the L3 cache, which may extend the startup time of the first game application.

[0097] Therefore, in response to the above problems, the present application proposes an application startup method, taking into account that the processor (such as an ARM processor) supports the MPAM hardware feature, which allows the L3 cache of a specified size (that is, the partition of the specified L3 cache) to be allocated to a specific application, that is, to limit the occupancy of the L3 cache by other applications. Therefore, the electronic device can allocate the L3 cache of a specified size to the foreground application in the startup state, so that the occupancy of the L3 cache by the foreground application is stable each time it is started, thereby reducing the degree of fluctuation in the startup time of the foreground application, and avoiding the long startup time of the foreground application due to the small occupancy of the foreground application on the L3 cache. Specifically, when the foreground application is in the startup scenario, the electronic device can obtain the mapping relationship between the startup performance value of the foreground application and the occupancy of the L3 cache by the foreground application. The startup performance value represents the startup time of the foreground application. For example, the startup performance value is IPC. The higher the IPC, the shorter the startup time of the foreground application, and the lower the IPC, the longer the startup time of the foreground application. The electronic device can then determine, based on this mapping relationship, the minimum L3 cache occupancy of the foreground application when the startup performance value is the highest, and use this as the target occupancy to determine the L3 cache partition that the foreground application needs to exclusively occupy. The electronic device can then set a target register in the processor based on the target occupancy and allocate the L3 cache to the foreground application, so that the foreground application can occupy the L3 cache at the target occupancy.

[0098] Because the target L3 cache occupancy for the foreground application at startup is the minimum L3 cache occupancy achieved when the startup performance value is highest, and therefore the minimum occupancy achieved when the foreground application's startup time is shortest, this shortens the startup time of the foreground application, preventing excessive startup times and overallocating L3 cache to the foreground application. Furthermore, since a specified L3 cache size is allocated to the foreground application each time it starts, the stability of the foreground application's L3 cache occupancy is ensured, reducing fluctuations in the foreground application's startup time. This avoids users wondering why the foreground application sometimes takes too long to start up, while other times it takes very little, thereby ensuring a better user experience.

[0099] For example, the electronic device in the embodiments of the present application can be a mobile phone, a tablet computer, a wearable device (such as a smart watch), a personal digital assistant (PDA), a laptop computer, a desktop computer, a vehicle-mounted device, an Internet of Things device, and other devices that can install application programs. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.

[0100] For example, FIG2 shows a schematic structural diagram of an electronic device 200. As shown in FIG2, the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 211, a power management module 212, a battery 213, an antenna 1, an antenna 2, a mobile communication module 240, a wireless communication module 250, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display 294, and a subscriber identification module (SIM) card interface 295.

[0101] It should be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0102] The processor 210 may include one or more processing units, for example, an application processor (AP), a modem processor, a GPU, an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0103] The controller may be the nerve center and command center of the electronic device 200. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0104] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

[0105] In some embodiments, the processor 210 may include a CPU. The CPU may include at least one CPU core. For example, the number of the CPU cores may be 8.

[0106] Optionally, each of the at least one CPU core may include an L1 cache and an L2 cache. The L3 cache may be located on the processor, and each CPU core may share the L3 cache.

[0107] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0108] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0109] The charging management module 211 is configured to receive charging input from a charger. In some wireless charging embodiments, the charging management module 211 may receive wireless charging input via a wireless charging coil of the electronic device 200. While the charging management module 211 is charging the battery 213, it may also provide power to the electronic device through the power management module 212.

[0110] The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 240, the wireless communication module 250, the modem processor and the baseband processor.

[0111] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0112] The mobile communication module 240 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 200. The mobile communication module 240 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 240 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 240 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 240 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 240 can be set in the same device as at least some of the modules of the processor 210.

[0113] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 270A, the receiver 270B, etc.) or displays an image or video through the display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 240 or other functional modules.

[0114] The wireless communication module 250 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 200. The wireless communication module 250 can be one or more devices integrating at least one communication processing module. The wireless communication module 250 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 250 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0115] Electronic device 200 implements display functionality through a GPU, display screen 294, and an application processor. A GPU is a microprocessor for image processing that connects display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.

[0116] Display screen 294 is used to display images, videos, and the like. Display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 200 may include one or N display screens 294, where N is a positive integer greater than one.

[0117] The electronic device 200 can implement a shooting function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, and an application processor.

[0118] The ISP is used to process data fed back by the camera 293. In some embodiments, the electronic device 200 may include 1 or N cameras 293, where N is a positive integer greater than 1.

[0119] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 200 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0120] Video codecs are used to compress or decompress digital video. Electronic device 200 may support one or more video codecs. This allows electronic device 200 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0121] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 200, such as image recognition, face recognition, speech recognition, and text comprehension.

[0122] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.

[0123] The internal memory 221 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 200 (such as sound, a phone book, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0124] The electronic device 200 can implement audio functions such as music playback and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.

[0125] The buttons 290 include a power button, a volume button, etc. The buttons 290 can be mechanical buttons or touch buttons.

[0126] The indicator 292 may be an indicator light, which may be used to indicate the charging status, power level change, messages, missed calls, notifications, etc.

[0127] The sensor module 280 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0128] The software system of the electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 200.

[0129] FIG3 is a block diagram of the software structure of the electronic device 200 according to an embodiment of the present invention.

[0130] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0131] The application layer can include a series of application packages.

[0132] As shown in FIG3 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

[0133] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0134] As shown in FIG3 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a perception module, a notification manager, and the like.

[0135] A window manager is used to manage window programs.

[0136] Content providers are used to store and retrieve data and make this data accessible to applications.

[0137] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc.

[0138] The phone manager is used to provide the communication function of the electronic device 200 .

[0139] The resource manager provides various resources to applications.

[0140] The notification manager enables applications to display notification information in the status bar, which can be used to convey informational messages and disappear automatically after a short stay without user interaction.

[0141] The perception module perceives the state of the foreground application to determine whether the foreground application is in the startup phase. It should be understood that the perception module perceives the state of the foreground application is only an example, and the state of the foreground application can also be determined by other modules in the application framework layer, and this application is not limited thereto.

[0142] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0143] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0144] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0145] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0146] A 2D graphics engine is a drawing engine for 2D drawings.

[0147] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, and first driver.

[0148] In some embodiments, the kernel layer can determine whether to call the first driver (or CPU driver) based on the type of the foreground application to allocate a fixed L3 cache for the foreground application.

[0149] It should be understood that the structure of the software layer introduced above is only an example, and this application does not limit the structure of the software layer. That is, the software layer may include the above-mentioned application layer, application framework layer, Android runtime and system library, and one or more of the kernel layer, or the software layer may also include other layers.

[0150] In an embodiment of the present application, when the first application is in the startup phase, the electronic device may first determine the type of the first application. The type of the first application indicates whether the size of the L3 cache occupied by the first application will affect the startup time of the first application. In the case where the type of the first application is a sensitive type, it indicates that the size of the L3 cache occupied by the first application will affect the startup time of the first application, and the electronic device may determine the sensitivity of the first application to the L3 cache occupied. Afterwards, the electronic device may determine the size of the L3 cache that the foreground application needs to exclusively occupy, that is, the target occupancy, based on the sensitivity of the first application to the L3 cache occupied, to accurately determine the size of the L3 cache allocated to the first application. Afterwards, the electronic device may use the MPAM feature of the processor to set the corresponding register to allocate the L3 cache of the corresponding size to the first application, thereby ensuring the first application's occupancy of the L3 cache and avoiding the first application's startup time being too long.

[0151] The following will take the electronic device being a mobile phone as an example to introduce the application startup method provided by the present application. As shown in FIG4 , the resource scheduling method may include S301 - S308 .

[0152] S301: A mobile phone receives a first operation of a user on a first application.

[0153] S302: In response to the first operation, start a first application.

[0154] The first operation is used to trigger the mobile phone to launch a first application, which can be any application on the mobile phone. For example, the first operation can be an operation in which a user clicks on the icon of the first application on the desktop displayed on the mobile phone. For example, the first operation is an operation in which a user clicks on the icon 10 of the first game application shown in FIG. 1A above. Here, the first game application is the first application. In response to the first operation, the mobile phone needs to launch the first application and create a process corresponding to the first application. In other words, the first application can be cold started.

[0155] Alternatively, the first operation may be another operation that triggers the launch of the first application. For example, the first operation may be a user clicking on an application in the background applications displayed on the phone, or a user clicking on the interface of the short video application shown in FIG1E . In response to the first operation, the phone needs to restart the short video application, but does not need to recreate the process corresponding to the first application. In other words, the first application can be hot-started.

[0156] S303: During the startup of the first application, the mobile phone determines the type of the first application, wherein the type of the first application includes a sensitive type and a non-sensitive type.

[0157] Among them, a sensitive type application indicates that the startup time of the application is related to the application's occupancy of the L3 cache. That is, if the type of the first application is sensitive, it means that the startup time of the first application is sensitive to the occupancy of the L3 cache, that is, the size of the occupancy of the L3 cache by the first application has a significant impact on the startup time of the first application. When the first application occupies a large amount of the L3 cache, the startup time of the first application is shorter. When the first application occupies a small amount of the L3 cache, the startup time of the first application is longer.

[0158] A non-sensitive application type indicates that the application's startup time is unrelated to the application's L3 cache occupancy. Specifically, if the first application type is non-sensitive, the first application's startup time is insensitive to the L3 cache occupancy. This means that the L3 cache occupancy of the first application has little impact on the first application's startup time. Even if the first application occupies a large amount of L3 cache, the first application's startup time will not be shortened, or will be shortened only slightly.

[0159] In an embodiment of the present application, after the first application is started, the mobile phone triggers a shared resource allocation mechanism, that is, allocates a specified size of L3 cache to the first application to avoid the first application's startup time being too long. Since the mobile phone cannot measure the startup time of the first application before the first application is completely started, the mobile phone can characterize the startup time of the first application by the startup performance value of the first application. For example, the higher the startup performance value of the first application, the shorter the startup time of the first application, and the lower the startup performance value of the first application, the longer the startup time of the first application.

[0160] Accordingly, the mobile phone can use the startup performance value of the first application to determine whether the startup time of the first application is related to the first application's L3 cache occupancy, that is, to determine the type of the first application, thereby detecting (i.e., determining) the type of the first application. For example, for each of the multiple first preset occupancy amounts, the mobile phone can set the first application's L3 cache occupancy to be the first preset occupancy amount. The mobile phone can then obtain the startup performance value of the first application (e.g., obtained by a performance monitoring unit in the CPU) to obtain the startup performance value of the first application corresponding to the first preset occupancy amount. The mobile phone can then compare the startup performance values ​​of the first application corresponding to each of the first preset occupancy amounts, for example, by calculating the difference between the startup performance values ​​of the first application corresponding to each of the first preset occupancy amounts and the startup performance value of the first application corresponding to the smallest first preset occupancy amount. If the differences are all small (i.e., less than or equal to the first preset difference), it indicates that increasing the first application's L3 cache occupancy amount will have a small impact on the first application's startup performance value, i.e., on the first application's startup time. Therefore, the mobile phone can determine that the first application is of a non-sensitive type.

[0161] If there is a large difference (i.e., a difference greater than the first preset difference), it indicates that increasing the first application's occupancy of the L3 cache can improve the first application's startup performance, thereby shortening the first application's startup time. The first application's startup time is sensitive to the L3 cache occupancy. Therefore, the mobile phone can determine that the type of the first application is a sensitive type.

[0162] For example, the first preset occupancy can include 0% and 100%. The mobile phone can first set the L3 cache occupancy of the first application to 0, that is, no L3 cache is allocated to the first application. The mobile phone determines that the startup performance value of the first application is startup performance value 1 at this time. The mobile phone can then increase the L3 cache occupancy of the first application to 100%, that is, allocating the L3 cache to the first application. The mobile phone determines that the startup performance value of the first application is startup performance value 2 at this time. The mobile phone can then compare startup performance value 1 with startup performance value 2. If the difference between startup performance value 2 and startup performance value 1 is less than or equal to the first preset difference, it indicates that increasing the L3 cache occupancy of the first application has no impact on the startup performance of the first application. Therefore, the mobile phone can determine that the type of the first application is non-sensitive. If the difference between startup performance value 2 and startup performance value 1 is greater than the first preset difference, it indicates that increasing the L3 cache occupancy of the first application has an impact on the startup performance of the first application. The mobile phone can determine that the type of the first application is sensitive, thereby achieving rapid determination of the type of the first application.

[0163] It should be noted that determining the type of the first application using the above-mentioned 0% and 100% is merely an example. The above-mentioned first preset occupancy can also be set to other values, as long as the difference between the first preset occupancy of the first application in the L3 cache is large. Furthermore, determining the type of the first application using two first preset occupancy values ​​is merely an example. The number of first preset occupancy values ​​used to determine the type of the first application can also be other values. For example, the mobile phone determines the type of the first application using three first preset occupancy values, such as 0%, 50%, and 100%, respectively. The mobile phone determines that if the first application's L3 cache occupancy is 0%, the first application's startup performance value is startup performance value 1. If the first application's L3 cache occupancy is 100%, the first application's startup performance value is startup performance value 2. If the first application's L3 cache occupancy is 50%, the first application's startup performance value is startup performance value 3. The mobile phone can calculate the difference between startup performance value 2 and startup performance value 1, and the difference between startup performance value 3 and startup performance value 1. If the difference between startup performance value 2 and startup performance value 1 is greater than a first preset difference, or if the difference between startup performance value 3 and startup performance value 1 is greater than the first preset difference, the mobile phone may determine that the type of the first application is a sensitive type. If the difference between startup performance value 2 and startup performance value 1 is less than or equal to the first preset difference, and the difference between startup performance value 3 and startup performance value 1 is less than or equal to the first preset difference, the mobile phone may determine that the type of the first application is a non-sensitive type.

[0164] In some embodiments, the mobile phone can not only use the above-mentioned method to detect the type of the first application by starting the performance value, but also use a preset whitelist to determine the type of the first application, and the preset whitelist includes the identifier of at least one application, and each application in the at least one application is an application of a preset type. The mobile phone determines whether the preset whitelist contains the identifier of the first application. In the case that the preset whitelist contains the identifier of the first application, the mobile phone can determine that the type of the first application is a sensitive type (or a preset type). In the case that the preset whitelist does not contain the identifier of the first application, the mobile phone can determine that the type of the first application is a non-sensitive type, thereby quickly determining the type of the first application.

[0165] Alternatively, the mobile phone may determine the type of the first application by determining whether a preset mark exists for the first application. If the first application has a corresponding preset mark, the mobile phone may determine that the type of the first application is sensitive. If the first application does not have a corresponding preset mark, the mobile phone may determine that the type of the first application is non-sensitive.

[0166] Optionally, since the type of an application may change and is not always constant, if the preset whitelist does not contain the identifier of the first application, or if the first application does not have a corresponding preset tag, the mobile phone may further detect the type of the first application by starting the performance value to accurately determine the type of the first application.

[0167] In the embodiment of the present application, the sensitive type may also be referred to as a preset type, and the non-sensitive type may also be referred to as a non-preset type.

[0168] In an embodiment of the present application, the mobile phone can determine the type of the first application each time the first application is started (such as determining the type of the first application using the startup performance value of the first application according to the scheme described above), thereby accurately determining the type of the first application. Alternatively, the mobile phone can determine the type of the first application using the startup performance value of the first application when the first application is started for the first time, and save the identifier of the first application in a preset whitelist, or set a corresponding preset mark for the first application so that the first application has a corresponding preset mark (such as 1, or other characters). Afterwards, when the mobile phone starts the first application, it can directly use the preset whitelist or preset mark to obtain the type of the first application, without having to re-determine the type of the first application each time the first application is started, thereby achieving rapid determination of the type of the first application.

[0169] Optionally, the mobile phone may periodically update the identifiers of applications in a preset whitelist. For example, the mobile phone may detect the type of the currently launched application at a first preset interval. If the application is of a sensitive type, the identifier of the application may be added to the preset whitelist. Alternatively, if the application is of a non-sensitive type and the identifier of the application exists in the preset whitelist, the mobile phone may delete the identifier of the application from the preset whitelist.

[0170] Alternatively, after receiving a startup operation for the first application, the mobile phone can determine whether the time difference between the current time and the time when the type of the application was last detected is greater than a preset time difference. If it is greater than the preset time difference, it indicates that the type of the first application has not been detected for a long time, and the type of the first application may have changed. Therefore, the mobile phone can detect the type of the first application. In the case that the type of the first application is a sensitive type, the identifier of the first application can be added to a preset whitelist. In the case that the type of the first application is a non-sensitive type, if the identifier of the first application exists in the preset whitelist, the mobile phone can delete the identifier of the first application from the preset whitelist.

[0171] Similarly, the mobile phone can also regularly update the preset mark corresponding to the application. The updating process of the preset mark can be a parameter of the updating process of the preset whitelist.

[0172] In other embodiments, the mobile phone may not need to determine the type of the first application in the above manner. The type of the first application may be directly measured by the developer of the first application and written into the installation file, so that the mobile phone can directly obtain the type of the first application after installing the first application.

[0173] S304: When the type of the first application is a sensitive type, the mobile phone determines the sensitivity of the startup performance value of the first application to the occupancy of the L3 cache.

[0174] S305: The mobile phone determines a target L3 cache occupancy of the first application based on the sensitivity of the startup performance value of the first application to the L3 cache occupancy.

[0175] The target occupancy represents the L3 cache occupancy of the first application when the startup performance value is the highest. Since the startup performance value represents the startup time, the target occupancy represents the minimum L3 cache occupancy of the first application when the startup time is the shortest. Alternatively, the target occupancy may represent the minimum L3 cache occupancy of the first application when the startup performance value is the highest.

[0176] In the embodiment of the present application, when the type of the first application is a sensitive type, it indicates that the first application's occupancy of the L3 cache has an impact on the startup time of the first application. Therefore, the mobile phone can determine the sensitivity of the first application's startup performance value to the L3 cache occupancy. The sensitivity represents the mapping relationship between the first application's startup performance value (i.e., startup time) and the first application's occupancy of the L3 cache (briefly described as the mapping relationship between the first application's startup performance value and the L3 cache occupancy), which can reflect the first application's startup performance value when the first application's occupancy of the L3 cache is a certain value. Afterwards, the mobile phone can use the mapping relationship between the first application's startup performance value and the L3 cache occupancy to determine the minimum L3 cache occupancy when the first application's startup performance value is the highest, that is, to obtain the target occupancy of the L3 cache corresponding to the first application. In other words, when the first application's occupancy of the L3 cache is the target occupancy, the first application's startup performance value is the highest and the startup time is the shortest, thereby accurately determining the amount of L3 cache that the first application needs to exclusively occupy.

[0177] In some embodiments, the startup performance value can be represented by the execution speed of the first application on the processor, such as by the number of instructions per cycle (IPC). The higher the IPC of the first application, the shorter the startup time of the first application, and the lower the IPC of the first application, the longer the startup time of the first application.

[0178] In some embodiments, the sensitivity of the startup performance value of the first application to the L3 cache occupancy, that is, the mapping relationship between the startup performance value of the first application and the L3 cache occupancy, can be represented by a curve. The process of drawing this curve will be described in detail below.

[0179] For each of the multiple second preset occupancy amounts, the mobile phone can set the first application's occupancy amount of the L3 cache to be the second preset occupancy amount. Then, the mobile phone can obtain the startup performance value of the first application to obtain the startup performance value of the first application corresponding to the second preset occupancy amount. Afterwards, the mobile phone can draw a mapping curve (or a sensitivity curve) based on the different second preset occupancy amounts and the startup performance value of the first application corresponding to each second preset occupancy amount (or the startup performance value corresponding to the second preset occupancy amount). The mapping curve represents the sensitivity of the first application's startup performance value to the L3 cache occupancy amount. The horizontal axis of the mapping curve can be the occupancy amount, and the vertical axis can be the startup performance value.

[0180] It should be noted that, in this step, the process of setting the occupancy and obtaining the startup performance value and the above-mentioned setting the first occupancy and obtaining the startup performance value corresponding to the first occupancy can refer to the relevant description below.

[0181] For example, the startup performance value is IPC. The multiple second preset occupancy rates are 0%, 50%, 90%, and 100%. The mobile phone first allocates 0% of the L3 cache to the first application, that is, the first application's occupancy of the L3 cache is 0%. The mobile phone obtains that when the first application's occupancy of the preset occupancy is 0%, the IPC of the first application is IPC1. The mobile phone can then increase the first application's occupancy of the L3 cache, allocating 50% of the L3 cache to the first application. The mobile phone obtains that when the second preset occupancy is 50%, the IPC of the first application is IPC2. The mobile phone then further increases the first application's occupancy of the L3 cache, allocating 90% of the L3 cache to the first application. The mobile phone obtains that when the second preset occupancy is 90%, the IPC of the first application is IPC3. The mobile phone can then further increase the first application's occupancy of the L3 cache, allocating 100% of the L3 cache to the first application. The mobile phone obtains that when the second preset occupancy is 100%, the IPC of the first application is IPC4. Then, the mobile phone can use (0%, IPC1), (50%, IPC2), (90%, IPC3) and (100%, IPC4) as coordinate points to draw a mapping curve.

[0182] Optionally, the process of obtaining the above-mentioned IPC (such as IPC1, IPC2, IPC3, and IPC4) by the mobile phone may include: the mobile phone may obtain the number of instructions corresponding to the first application executed by the mobile phone within a preset duration to obtain the total number of instructions. The mobile phone may then calculate the ratio of the total number of instructions to the number of clock cycles included in the preset duration to obtain the IPC. For example, taking the calculation of the above-mentioned IPC3 by the mobile phone as an example, the preset duration is 100ms. The mobile phone obtains the number of instructions related to the launch of the first application executed by the mobile phone within 100ms, i.e., the number of instructions corresponding to the first application, to obtain the total number of instructions. If the clock cycle is 10ms, then 100ms includes 10 clock cycles. Therefore, IPC3 = total number of instructions a / 10. It should be understood that the specific values ​​of the preset duration and clock cycle here are merely examples, and the clock cycle of 10ms is only used as an example for ease of description. In reality, the clock cycle is much lower than 10ms. The clock cycle is related to the actual CPU in the mobile phone, and different CPUs may correspond to different clock cycles. The preset duration can also be set according to actual circumstances, and this application does not limit it.

[0183] The total number of instructions may be monitored by a performance monitoring unit (PMU) in the CPU, and the PMU is used to measure and record performance indicators of the processor.

[0184] It can be understood that if the above-mentioned second preset occupancy and the above-mentioned first preset occupancy have the same value, such as both have occupancy of 0% and 100%, then when the mobile phone needs to determine the mapping curve, it can directly use the IPC value corresponding to 0% and the IPC value corresponding to 100% determined to determine the type of the first application, without repeatedly setting the L3 cache to determine the IPC value corresponding to 0% and the IPC value corresponding to 100%, thereby improving the drawing speed of the mapping curve.

[0185] In some embodiments, after obtaining the mapping curve, the mobile phone can determine the L3 cache occupancy of the first application when the IPC is at its highest based on the mapping curve, and determine the target occupancy based on the L3 cache occupancy of the first application when the IPC is at its highest. For example, if the mapping curve determines that there are multiple L3 cache occupancy rates of the first application when the IPC is at its highest, the minimum L3 cache occupancy rate can be determined as the target occupancy rate. For another example, if there is only one L3 cache occupancy rate of the first application when the IPC is at its highest, that occupancy rate can be directly determined as the target occupancy rate.

[0186] The L3 cache is partitioned at the way level, meaning the L3 cache includes multiple ways. Each of the multiple ways can be used to store data. As shown in FIG5A , the L3 cache is divided into 8 parts, including 8 ways. The mobile phone determines the IPC of the first application when the first application occupies 1 way of the L3 cache, that is, the occupancy is 12.5%. The IPC of the first application when the first application occupies 2 ways of the L3 cache, that is, the occupancy is 25%. The IPC of the first application when the first application occupies 3 ways of the L3 cache, that is, the occupancy is 37.5%. And so on, until the mobile phone determines the IPC of the first application when the first application occupies 8 ways of the L3 cache, that is, the occupancy is 100%. The mobile phone can use the IPC of the first application when the first application occupies 1 way of the L3 cache, the IPC of the first application when the first application occupies 2 ways of the L3 cache, and so on, and the IPC of the first application when the first application occupies 8 ways of the L3 cache to determine a mapping curve (such as mapping curve 50 in Figure 5A) between the IPC of the first application and the occupancy of the L3 cache.

[0187] Among them, based on the mapping curve shown in Figure 5A, the mobile phone can determine that when the first application occupies 100% of the L3 cache, the IPC of the first application is the highest, and then the target occupancy can be 100%. For another example, the mobile phone obtains the mapping curve shown in Figure 5B. The mobile phone can determine that when the first application occupies less than or equal to 50% of the L3 cache, the IPC size is in an increasing state. After exceeding 50%, although the first application's occupancy of the L3 cache increases, the IPC decreases. In other words, the coordinate point corresponding to 50% is the inflection point. The mobile phone can determine that when the first application occupies 50% of the L3 cache, the IPC is the highest, and accordingly, the target occupancy is 50%. For another example, the mobile phone obtains the mapping curve shown in FIG5C . The mobile phone can determine that when the first application's occupancy of the L3 cache is less than or equal to 50%, the IPC size is in an increasing state. After exceeding 50%, although the first application's occupancy of the L3 cache increases, the IPC does not change. That is to say, after the first application's occupancy of the L3 cache exceeds 50%, even if the first application's occupancy of the L3 cache is increased, the startup performance of the first application may not increase, and the startup time of the first application may not continue to shorten. Therefore, there is no need for the mobile phone to continue to increase the first application's occupancy of the L3 cache. Accordingly, the target occupancy is 50%.

[0188] It should be noted that the aforementioned non-sensitive type can be considered to have a mapping curve corresponding to the first application that is a straight line with a slope equal to or close to zero (as shown in FIG5D ). Even if the L3 cache allocated to the first application changes, the IPC remains essentially unchanged. The aforementioned sensitive type can be considered to have a mapping curve corresponding to the first application that is curved (as shown in FIG5A , FIG5B , or FIG5C ). If the L3 cache allocated to the first application changes, the IPC will also change. In other words, at least a portion of the mapping curve corresponding to the sensitive type application satisfies the relationship that the application's startup performance value (or described as startup time) changes with changes in the application's L3 cache occupancy.

[0189] In addition, the shape of the mapping curve shown in Figure 5A, Figure 5B or Figure 5C above is only an example. The shape of the mapping curve corresponding to the first application may also be other shapes, and this application does not limit it. Alternatively, the mapping relationship between the first application's occupancy of the L3 cache and the first application's startup performance value may not be represented by a mapping curve, but by other forms, such as a file, which (such as a table) may include the first application's occupancy of the L3 cache and its corresponding startup performance value of the first application. In other words, the mobile phone can determine the target occupancy through the mapping relationship corresponding to the first application.

[0190] In some embodiments, the startup performance value can also be represented by the hit rate of the L3 cache. The higher the hit rate of the L3 cache, the higher the success rate of the mobile phone in obtaining the data required to start the first application from the L3 cache, the fewer times the mobile phone needs to access the main memory, and the shorter the startup time of the first application. The lower the hit rate of the L3 cache, the longer the startup time of the first application. The mobile phone can use the hit rate of the L3 cache to determine the mapping curve. The process of determining the mapping curve is similar to the process of determining the mapping curve using IPC by the mobile phone mentioned above, and will not be repeated here.

[0191] Wherein, optionally, the above-mentioned L3 cache hit rate can be directly obtained by the mobile phone. Alternatively, the above-mentioned L3 cache hit rate can be determined by the miss rate (i.e., miss rate) of the L3 cache. Exemplarily, the mobile phone can determine the miss rate of the L3 cache when the first application occupies a certain amount of the L3 cache. Afterwards, the mobile phone can subtract the miss rate of the L3 cache from 1 to calculate the hit rate of the L3 cache. Wherein, the hit rate or miss rate of the L3 cache is a performance indicator that can be monitored by the mobile phone. For example, the performance monitoring unit in the CPU can monitor the hit rate or miss rate of the L3 cache.

[0192] In some embodiments, after determining the target occupancy of the L3 cache by the first application, the mobile phone can allocate the remaining L3 cache to applications running on the mobile phone other than the first application in the startup state (hereinafter referred to as other applications), that is, determining the occupancy of the L3 cache by other applications. For example, if the processor type is the first type, indicating that the sum of the occupancy of the L3 cache by the foreground application and the non-foreground application needs to be 100%, then the occupancy of the L3 cache by the non-foreground application can be 1-target occupancy. If the processor type is the second type, indicating that the sum of the occupancy of the L3 cache by the foreground application and the non-foreground application can be different from 100%, and can be greater than 100%, the occupancy of the L3 cache by the foreground application is at most 100%, and the occupancy of the L3 cache by the non-foreground application is at most 10%. Therefore, if the target occupancy is less than 90%, the mobile phone can determine that the occupancy of the L3 cache by the non-foreground application is 1-target occupancy. If the target occupancy is 100%, the mobile phone can determine that the occupancy of the L3 cache by the non-foreground application is 10%. It should be understood that the sum of the L3 cache occupancy of the foreground application and the non-foreground application being greater than 100% means that there is overlap between the L3 cache allocated to the foreground application and the L3 cache allocated to the non-foreground application.

[0193] For example, the applications running on a mobile phone can be divided into multiple application groups, such as a foreground application group (foreground) and a non-foreground application group (non-foreground application group). The non-foreground application group may include a background application group (background) and a system application group (system). The system application group may include system applications, which are applications pre-installed in the mobile phone's operating system. These applications have higher permissions and can access system resources and perform system-level tasks to support the normal operation of the mobile phone.

[0194] The above-mentioned background application group may include background applications running on the mobile phone. Background applications are applications that are switched from foreground running to background running, that is, from foreground applications to background applications (such as the short video application shown in Figure 1E above).

[0195] Optionally, the above-mentioned application grouping may also include a focus application (top-APP) grouping, which includes the focus application running on the mobile phone. The focus application refers to the APP currently interacting with the user. The above-mentioned first application may be the focus application, or it may not be the focus application, but only the foreground application. In other words, the focus application and the foreground application may be the same or different. In one case, the mobile phone currently only displays the interface of the first application, then the foreground application may only include the first application, and the first application is the focus application. In another case, the mobile phone has enabled the multi-window service, and the mobile phone can run multiple foreground applications at the same time. The foreground application currently interacting with the user can be called the top-APP. For example, as shown in Figure 6A, the mobile phone simultaneously displays the interface 60 of the short video APP and the interface 61 of the shopping APP, wherein the interface 61 of the shopping APP displays the startup content, indicating that the shopping APP is starting up and the shopping APP is the above-mentioned first application. The window of the shopping APP is in a highlighted state (or selected state), and the shopping APP is the focus application, that is, the top-APP. It should be understood that the split-screen scenario shown in Figure 6A is only one example of a mobile phone running multiple foreground applications simultaneously. A mobile phone can also run multiple foreground applications simultaneously in other scenarios, such as a floating window scenario. That is, the interface of one application can be displayed full screen, and the interface of at least one of the other applications can be displayed in a floating window. The first application mentioned above can be an application displayed full screen or an application displayed in a floating window.

[0196] It should be noted that the first application is a foreground application in the startup state, which may belong to the foreground application group or the focus application group.

[0197] The above briefly introduces how the mobile phone allocates L3 cache to different application groups on the mobile phone. For the specific allocation process, please refer to the relevant description below.

[0198] In some embodiments, the mobile phone can determine the sensitivity curve corresponding to the first application each time the first application is launched, thereby improving the accuracy of the sensitivity curve determination. Alternatively, the mobile phone can determine the sensitivity curve corresponding to the first application when the first application is launched for the first time and save the sensitivity curve corresponding to the first application. Thereafter, the mobile phone can directly obtain the sensitivity curve corresponding to the first application each time the first application is launched, eliminating the need to re-determine the sensitivity curve corresponding to the first application each time the first application is launched. This allows for rapid determination of the sensitivity curve corresponding to the first application without incurring additional overhead and reducing the consumption of mobile phone resources.

[0199] S306: The mobile phone sets a target register based on the target occupancy of the L3 cache by the first application, and allocates an L3 cache of a corresponding size to the first application.

[0200] The target register is used to manage the size of the L3 cache accessible to the first application, that is, the size of the L3 cache allocated to the first application, that is, the number of partitions (or called the number of ways).

[0201] In an embodiment of the present application, the target register includes a flag bit corresponding to each way in the L3 cache. The flag bit corresponding to the way is used by the mobile phone to determine whether the way can be accessed when the first application is started, that is, to determine whether only the first application can access the way. The flag bit may include an identifier 1 (such as 0) and an identifier 2 (such as 1). When the flag bit is an identifier 1, such as 0, it indicates that the first application is not allowed to access the way. When the flag bit is an identifier 2, such as 1, it indicates that the first application is allowed to access the way, and other applications are not allowed to access the way.

[0202] Therefore, the mobile phone can calculate the product of the first application's target L3 cache occupancy and the total number of ways in the L3 cache to obtain the number of ways in the L3 cache that the first application is allowed to access, which is called the target number. The mobile phone can then set the flag corresponding to the target number of ways in the target register to flag 2, so that the first application's L3 cache occupancy reaches the target number.

[0203] For example, if flag 2 is 1, the L3 cache is divided into 10 parts, namely way0-way9. To achieve a target occupancy of 50%, the phone can set half of the ways in way0-way9 to 1, for example, by setting the flag bits corresponding to way0-way4 to 1, while setting the flag bits corresponding to the other ways to 0. The phone can then access the startup data of the first application from way0-way4, allocating a fixed amount of L3 cache to the first application, effectively shortening the startup time of the first application.

[0204] In some embodiments, the target register represents a register related to the MPAM feature, for example, the target register is the MPAM_PARTITION_REG register.

[0205] In some embodiments, the mobile phone may also allocate the remaining L3 cache to applications in other application groups, where other application groups refer to application groups other than the application group containing the first application. For example, application groups on the mobile phone may include a foreground application group, a focus application group, a background application group, and a system application group. The focus application in the focus application group is not in the startup phase, while the foreground application in the foreground application group is in the startup phase. The foreground application in the foreground application group is the first application, and the application group to which the first application belongs is the foreground application group. After determining the target L3 cache occupancy of the first application, the mobile phone may allocate the remaining L3 cache to other application groups (i.e., the focus application group, the background application group, and the system application group). Alternatively, it can be understood that other application groups compete for the remaining L3 cache. Since the focus application is the application currently interacting with the user, it is necessary to ensure the smooth operation of the focus application. Therefore, the mobile phone may allocate more L3 cache to the focus application group, and the L3 cache occupancy of other application groups may be less than that of the focus application group. For example, as shown in Figure 6B, the L3 cache may include 9 ways, the target occupancy corresponds to 3 ways, and 6 ways remain. Therefore, the phone can allocate 3 ways to the focus application group (i.e., focus applications), 1 way to the background application group (i.e., background applications), and 2 ways to the system application group (i.e., system applications). Of course, the phone can also allocate 1 way to the system application group and 2 ways to the background application group.

[0206] In some embodiments, after the first application is started, the mobile phone stops allocating the fixed L3 cache to the first application, and the first application and other applications compete normally for the L3 cache to avoid long-term impact on the operation of other applications.

[0207] In some embodiments, when the first application is in the startup phase, the mobile phone may not decide whether to allocate a specified size of L3 cache to the first application based on whether the type of the first application is a sensitive type. Instead, when the first application is in the startup phase, the mobile phone may directly determine the sensitivity curve corresponding to the first application, so as to use the sensitivity curve corresponding to the first application to determine the target occupancy of the L3 cache by the first application, thereby allocating a specified size of L3 cache to it.

[0208] It should be understood that the above allocation of L3 cache to the first application through the target register is only an example, and the L3 cache can also be allocated to the first application through other methods, which is not limited in this application.

[0209] S307 : The mobile phone continues to start the first application based on the L3 cache allocated to the first application.

[0210] In the embodiment of the present application, the mobile phone accesses the startup data of the first application (i.e., the data required to start the first application) from the L3 cache allocated to the first application to continue starting the first application. Because the first application occupies a large enough portion of the L3 cache, the hit rate of the L3 cache can be improved, thereby shortening the startup time of the first application. It should be understood that the data in the L3 cache is loaded by the mobile phone from the main memory.

[0211] It should be noted that the aforementioned allocation of a corresponding L3 cache size to the first application based on the target occupancy to enable the first application is merely exemplary. The mobile phone can also flexibly allocate a certain L3 cache size to the first application, without being constrained to allocate the L3 cache size corresponding to the target occupancy. As shown in Figure 5C , if the target occupancy is 50%, the mobile phone can allocate 50% of the L3 cache size corresponding to the first application, or 40% of the L3 cache size corresponding to the first application, achieving flexible L3 cache allocation.

[0212] S308: When the type of the first application is a non-sensitive type, the mobile phone continues to start the first application.

[0213] In the embodiment of the present application, if the type of the first application is non-sensitive, the amount of L3 cache occupied by the first application has little impact on the startup time of the first application. Even if the L3 cache allocated to the first application is increased, the startup time of the first application is shortened to a small extent. Therefore, the mobile phone does not need to allocate a specified size of L3 cache to it, that is, there is no need to execute the above S304-S306. The mobile phone can normally start the first application and display the startup content of the first application. The first application still needs to compete with other applications for the L3 cache. For example, as shown in Figure 6C, the foreground application (including the first application) needs to compete with the focus application, background applications, and system applications for the L3 cache.

[0214] It should be noted that after the first application is started, the mobile phone can release the L3 cache allocated for the first application, that is, no fixed-size L3 cache is allocated for the first application.

[0215] In the embodiment of the present application, the L3 cache in the mobile phone is a shared resource, so both the foreground application (such as the first application mentioned above) and the non-foreground application in the mobile phone can access the L3 cache. When the first application is in the startup phase, the mobile phone can determine whether the type of the first application is a sensitive type to determine whether the startup time of the first application is related to the amount of L3 cache occupied by the first application. When the type of the first application is a sensitive type, it indicates that the startup time of the first application is related to the amount of L3 cache occupied by the first application, but since the startup time of the first application cannot be measured before the startup of the first application is completed, the mobile phone can determine the mapping relationship between the startup performance value of the first application and the amount of L3 cache occupied by the first application. The startup performance value is a performance indicator that can be directly measured, which characterizes the startup time, thereby determining the mapping relationship between the startup time of the first application and the amount of L3 cache occupied by the first application.

[0216] In order to ensure that the startup time of the first application is short, the mobile phone can use the mapping relationship to determine the minimum occupancy corresponding to the highest startup performance value, that is, to determine the minimum occupancy corresponding to the shortest startup time, and use it as the target occupancy. Afterwards, the mobile phone can allocate part or all of the ways in the L3 cache to the first application by setting the flag corresponding to the way in the L3 cache in the target register, limit the size of the L3 cache that can be accessed by non-foreground applications, and ensure the occupancy of the L3 cache by the first application in the startup phase, thereby avoiding the startup time of the first application being too long due to the small occupancy of the L3 cache by the first application. In addition, the target occupancy of the L3 cache by the first application is determined based on the sensitivity of the first application itself to the L3 cache, so as to avoid too much or too little occupancy being allocated to the first application.

[0217] In some embodiments, the mobile phone can use a related driver (such as the first driver) to allocate an L3 cache of a specified size to a foreground application in the startup phase. The following will introduce the process of allocating L3 cache for foreground applications by the mobile phone in conjunction with the structure shown in Figure 3 above. The process may include S1-S16 as shown in Figure 7. Among them, S1-S4 introduce the implementation process of the mobile phone determining the stage of the foreground application. S5-S7 introduce the implementation process of the mobile phone determining the type of the foreground application. S8-S14 introduce the implementation process of the mobile phone starting the foreground application based on the case where the type of the foreground application is a sensitive type. S15-S16 introduce the process of the mobile phone starting the foreground application that is not a sensitive type.

[0218] S1. The application framework layer obtains the status information of the foreground application.

[0219] S2. The application framework layer determines whether the status information of the foreground application is startup status information.

[0220] In an embodiment of the present application, the application framework layer periodically or in real time obtains status information of the foreground application, and the status information indicates the stage of the foreground application. Exemplarily, the status information may include startup status information and non-startup status information, and the startup status information indicates that the foreground application is in a startup state, that is, in a startup stage. Non-startup status information indicates that the foreground application is in a non-startup state, that is, in a non-startup stage. For example, the non-startup state may include a running state and / or a paused state. After the startup is completed, the foreground application enters a running state. The paused state means that the foreground application is still visible to the user, but it cannot obtain focus and does not respond to user input operations.

[0221] After obtaining the status information of the foreground application, the application framework layer can determine whether the status information of the foreground application is startup status information, that is, whether the foreground application is in the startup phase. If it is in the non-startup phase, it indicates that there is no need to trigger the shared resource allocation mechanism. The application framework layer can continue to obtain the status information of the foreground application until a new foreground application is in the startup phase. In other words, the application framework layer can execute S3. If it is in the startup phase, to avoid the foreground application taking too long to start up, the application can execute S4 to trigger the shared resource allocation mechanism and allocate sufficient resources to the foreground application.

[0222] S3. The application framework layer executes the above S1.

[0223] S4. The application framework layer sends a notification message to the kernel layer, where the notification message indicates that the foreground application is in the startup phase.

[0224] S5. In response to the notification message, for each of the plurality of first preset occupancy amounts, the kernel layer, through the first driver, sets a flag bit of a target register in the CPU based on the first preset occupancy amount, thereby allocating an L3 cache of the corresponding size to the foreground application process. The flag bit is used to set the number of partitions in the L3 cache allocated to the foreground application.

[0225] In an embodiment of the present application, for each first preset occupancy, the kernel layer calculates the product of the first preset occupancy and the total number of ways in the L3 cache to obtain the number corresponding to the first preset occupancy, that is, the number for which the flag bit corresponding to the way needs to be set to 1. Afterwards, the mobile phone can set the flag bit corresponding to the number of ways corresponding to the first preset occupancy in the target register to 1, so that the occupancy of the L3 cache by the foreground application (that is, the process of the foreground application) is the first preset occupancy. Afterwards, the kernel layer can obtain the performance information of the CPU core that executes the startup task of the foreground application when the occupancy of the L3 cache by the foreground application is the first preset occupancy, that is, obtain the performance information of the foreground application (or the performance information of the foreground application described as corresponding to the first preset occupancy).

[0226] Exemplarily, the performance information of the foreground application may include IPC and / or miss rate. The kernel layer may determine the startup performance value of the foreground application based on the performance information of the foreground application. For example, if the performance information of the foreground application includes IPC, the kernel layer may directly use IPC as the startup performance value. For another example, if the performance information of the foreground application includes the miss rate of the L3 cache, the startup performance value of the foreground application may include the hit rate of the L3 cache, and the hit rate of the L3 cache = 1-the miss rate of the L3 cache. For another example, if the performance information of the foreground application includes miss rate and IPC, the kernel layer may use the IPC or the hit rate of the L3 cache as the startup performance value.

[0227] The following describes the process of determining the type of the foreground application, taking the above startup performance value of IPC as an example.

[0228] S6. The kernel layer determines the IPC corresponding to each first preset occupancy, wherein the IPC corresponding to the first preset occupancy represents the IPC of the foreground application when the occupancy of the L3 cache by the foreground application is the first preset occupancy.

[0229] S7. The kernel layer determines the type of the foreground application according to the difference between the IPCs corresponding to the first preset occupancy.

[0230] In an embodiment of the present application, the kernel layer may calculate the difference between the IPCs corresponding to the two first preset occupancy amounts. If the difference is less than or equal to the first preset difference, it indicates that changing the foreground application's occupancy amount of the L3 cache results in a small change in the startup performance of the foreground application. Therefore, the kernel layer may determine that the foreground application is of a non-sensitive type. If the difference is greater than the first preset difference, it indicates that changing the foreground application's occupancy amount of the L3 cache results in a large change in the startup performance of the foreground application. Therefore, the kernel layer may determine that the foreground application is of a sensitive type.

[0231] Of course, the kernel layer may also calculate the difference between the IPC corresponding to the maximum first preset occupancy and the IPC corresponding to the minimum first preset occupancy. If the difference is less than or equal to the first preset difference, it indicates that changing the foreground application's L3 cache occupancy has resulted in a minor change in the foreground application's startup performance. Therefore, the kernel layer may determine that the foreground application is of a non-sensitive type. If the difference is greater than the first preset difference, it indicates that changing the foreground application's L3 cache occupancy has resulted in a significant change in the foreground application's startup performance. Therefore, the kernel layer may determine that the foreground application is of a sensitive type. It should be understood that determining the foreground application type based on the difference between the IPCs corresponding to one first preset occupancy is merely an example. The foreground application type may also be determined based on the difference between the IPCs corresponding to multiple first preset occupancy. For example, if the number of first preset occupancy can be at least three, the electronic device may calculate the difference between the IPCs corresponding to any two first preset occupancy. If both differences are less than or equal to the first preset difference, the foreground application type may be determined to be non-sensitive. If any difference is greater than the first preset difference, the foreground application or application may be determined to be of a sensitive type. Alternatively, the difference between the IPC corresponding to each other first preset occupancy and the IPC corresponding to the minimum preset occupancy can be calculated. If the difference is less than or equal to the first preset difference, it can be determined that the type of the foreground application is a non-sensitive type. If there is a difference greater than the first preset difference, it can be determined that the foreground application is a sensitive type.

[0232] The above describes the specific process of the kernel layer determining the type of the foreground application. The following will continue to describe the process of the mobile phone allocating a fixed L3 cache to the foreground application and starting the foreground application when the foreground application type is a sensitive type.

[0233] S8. When the type of the foreground application is a sensitive type, the kernel layer adds the process ID corresponding to the foreground application to the sensitive group.

[0234] S9. For each second preset occupancy in the multiple second preset occupancy, the kernel layer sets the flag bit of the target register in the CPU based on the second preset occupancy through the first driver, and allocates the L3 cache of the corresponding size to the process corresponding to the process identifier in the sensitive group.

[0235] S10: The kernel layer determines the IPC corresponding to each second preset occupancy, wherein the IPC corresponding to the second preset occupancy represents the IPC of the foreground application when the occupancy of the L3 cache by the foreground application is the second preset occupancy.

[0236] The kernel layer determines the IPC corresponding to the second preset occupancy in a similar manner to the above-mentioned process of determining the IPC corresponding to the first preset occupancy, and will not be further elaborated here.

[0237] S11. The kernel layer draws a mapping curve corresponding to the process identifier based on each second preset occupancy and its corresponding IPC. The mapping curve represents a mapping relationship between the occupancy of the foreground application on the L3 cache and the IPC.

[0238] S12. The kernel layer determines a target occupancy corresponding to the process identifier based on a mapping curve corresponding to the process identifier. The target occupancy represents a minimum occupancy corresponding to the highest IPC.

[0239] In the embodiment of the present application, for each second preset occupancy, the kernel layer uses the second preset occupancy and the corresponding IPC as a coordinate point, thereby obtaining multiple coordinate points. The kernel layer can then plot the multiple coordinate points in a coordinate system with the occupancy on the horizontal axis and the IPC on the vertical axis. The kernel layer can then fit the multiple coordinate points in the coordinate system to obtain a mapping curve corresponding to the foreground application, that is, to obtain a mapping curve corresponding to the process identifier corresponding to the process of the application the day before yesterday.

[0240] S13. The kernel layer calls the first driver, sets the flag bit of the target register in the CPU according to the target occupancy, and allocates the L3 cache of the corresponding size to the process corresponding to the process identifier.

[0241] S14. The process corresponding to the above process identifier continues to load startup data based on the allocated L3 cache.

[0242] In this embodiment of the present application, the kernel layer allocates the L3 cache corresponding to the target occupancy, i.e., the way in the corresponding L3 cache, to the foreground application process. The foreground application process reads the startup data from the allocated L3 cache and loads the startup data to start the foreground application. It should be understood that when the foreground application process reads the startup data, it is actually the CPU core executing the foreground application startup task that reads the startup data from the allocated L3 cache.

[0243] In some embodiments, the kernel layer can allocate the L3 cache of the corresponding size to the process corresponding to the process identifier by calling the driver interface (such as the driver interface related to MPAM) and setting the flag bit of the target register.

[0244] In some embodiments, as shown in FIG8 , the L3 cache can be divided into several slices, each slice includes K cache sets, and each cache set in the K cache sets can include M ways. The above-mentioned way actually refers to each way in each cache set. For example, the above-mentioned assignment of way0 to the foreground application actually refers to assigning each way0 in each cache set to the foreground application. Each way can contain one or more cache lines and has its own tag to represent the memory address of the stored data. When data needs to be read or written from the L3 cache, the way to which it belongs is determined based on a part of the memory address (usually the tag), and the required cache line is searched in the way. A cache line is the smallest unit of cache and is used to store data read from main memory (i.e., main memory). Typically, the size of a cache line is a power of 2, such as 32 bytes, 64 bytes, etc.

[0245] Furthermore, as shown in Figure 8 above, when data needs to be read or written from the L3 cache, the phone can determine the way to which the data belongs based on the physical address and offset, thus implementing address mapping. Specifically, the hash in Figure 8 is used to determine the target slice to be accessed, and the cache tag is used to determine the target cache group to be accessed within the target slice. 11 bits are used to determine the target cache line to be accessed within the target cache group, and 6 bits are used to determine the data to be accessed within the target cache line.

[0246] The above describes the startup data of the foreground application when the foreground application type is sensitive. Of course, there is also the possibility that the foreground application type is non-sensitive. The following will continue to describe the startup process of the foreground application when the foreground application type is non-sensitive.

[0247] S15. When the type of the foreground application is a non-sensitive type, the kernel layer adds the process identifier corresponding to the foreground application to the non-sensitive group.

[0248] S16. The process corresponding to the process identifier continues to load the startup data.

[0249] In an embodiment of the present application, after determining that the type of the foreground application is a non-sensitive type, the kernel layer can add the process identifier corresponding to the process of the foreground application to the non-sensitive group, and the foreground application can load the startup data normally and start up. That is to say, the foreground application process still needs to compete with the processes of other applications for the L3 cache.

[0250] Exemplary sensitive applications may include short video applications and / or question-and-answer applications. The following uses the foreground application (i.e., the first application is a question-and-answer application) as an example, and describes the implementation of steps S1-S16 in conjunction with Figure 9 , specifically, the process of allocating L3 cache to the foreground application on the mobile phone. Figure 9 may include steps S401-S414.

[0251] S401: The application framework layer obtains status information of the foreground application.

[0252] S402: The application framework layer determines that the state information of the foreground application is startup state information.

[0253] S403: The application framework layer sends a notification message to the kernel layer, where the notification message indicates that the query application is in the startup phase.

[0254] S404. In response to the notification message, the kernel layer, through the first driver, sets a flag bit of a target register in the CPU based on each of the two first preset occupancy amounts, thereby allocating an L3 cache of a corresponding size to the process of the query application. The flag bit is used to set the number of partitions in the L3 cache allocated to the query application.

[0255] For example, in response to a user's first operation on a question-and-answer application, the mobile phone may launch the question-and-answer application. The application layer in the mobile phone may determine that the question-and-answer application is in the startup phase and may send a notification message to the kernel layer. The notification message may include information about the question-and-answer application, such as the question-and-answer application identifier or the process identifier corresponding to the question-and-answer application. After receiving the notification message, the kernel layer may determine, based on the notification message, that the question-and-answer application in the mobile phone is in the startup phase.

[0256] Among them, optionally, the startup scene of the above-mentioned question and answer application can be a multi-window scene, which means that the mobile phone foreground displays not only the interface of the question and answer application, but also the interfaces of other applications. For example, as shown in Figure 10A, the mobile phone displays the interface 90 of the question and answer application and the interface 91 of the short video application in split screen, and the startup scene of the question and answer application is a multi-window scene. For another example, as shown in Figure 10B, the mobile phone displays the interface 92 of the question and answer application in a floating manner, and the interface 92 of the question and answer application is suspended above the interface 93 of the short video application. For another example, as shown in Figure 10C, the mobile phone displays the interface 94 of the question and answer application in full screen, and the interface 95 of the short video application is displayed in a floating manner above the interface 94 of the question and answer application.

[0257] Alternatively, the startup scenario of the above-mentioned question-and-answer application can be a single-window scenario, which means that only the interface of the question-and-answer application is displayed in the foreground of the mobile phone, without displaying the interfaces of other applications at the same time. As shown in Figure 10D, the mobile phone displays the startup interface 96 of the question-and-answer application in full screen.

[0258] In some embodiments, the notification message may not include the information of the query application, but only informs the foreground application that it is in the startup phase. Accordingly, the kernel layer can respond to the notification message to obtain the foreground information in the startup phase and obtain the information of the query application.

[0259] S405: The kernel layer determines the IPC corresponding to each first preset occupancy, wherein the IPC corresponding to the first preset occupancy represents the IPC of the queried application when the occupancy of the L3 cache by the queried application is the first preset occupancy.

[0260] S406: The kernel layer calculates the difference between the IPCs corresponding to the two first preset occupancy amounts.

[0261] S407: When the difference is greater than the first preset difference, the kernel layer determines that the type of the question application is a sensitive type.

[0262] S408: The kernel layer adds the process ID corresponding to the question application to the sensitive group.

[0263] S409. For each second preset occupancy in the plurality of second preset occupancy, the kernel layer sets the flag bit of the target register in the CPU through the first driver based on the second preset occupancy, and allocates the L3 cache of the corresponding size to the process of the query application corresponding to the process identifier corresponding to the query application in the sensitive group.

[0264] In some embodiments, when there are multiple process identifiers corresponding to applications for which the mapping curves are not determined in the above-mentioned sensitive group, the mapping curve corresponding to the process identifier corresponding to each application for which the mapping curve is not determined in the sensitive group can be determined in turn, such as determining them in order from early to late in terms of addition time, or determining the mapping curve corresponding to the application most recently launched by the user first in order from late to early in terms of addition time.

[0265] Optionally, the kernel layer can use the sensitive group to determine the type of the question application. If a process identifier corresponding to the question application already exists in the sensitive group, the kernel layer can directly determine that the question application is of a sensitive type without further determining the type of the question application using the first preset occupancy. It should be understood that if the current startup of the question application is not the first startup, it indicates that the type of the question application has already been determined during the previous startup. If the type of the question application is a sensitive type, the sensitive group already has a process identifier corresponding to the question application.

[0266] S410: The kernel layer determines an IPC corresponding to each second preset occupancy, wherein the IPC corresponding to the second preset occupancy represents the IPC of the queried application when the occupancy of the L3 cache by the queried application is the second preset occupancy.

[0267] S411 : The kernel layer draws a mapping curve corresponding to the query application based on each second preset occupancy and its corresponding IPC. The mapping curve represents a mapping relationship between the occupancy of the query application on the L3 cache and the IPC.

[0268] S412: The kernel layer determines a target occupancy corresponding to the query application based on a mapping curve corresponding to the query application. The target occupancy represents a minimum occupancy corresponding to the highest IPC.

[0269] S413: The kernel layer calls the first driver, sets the flag of the target register in the CPU according to the target occupancy, and allocates the L3 cache of the corresponding size to the process of the query application.

[0270] S414: The process of the query application continues to load the startup data based on the allocated L3 cache.

[0271] In some embodiments, the operations performed by the above-mentioned software layers (such as the application framework layer and the kernel layer) may be performed by relevant modules in the software layer. For example, whether the above-mentioned foreground application is in the startup stage may be performed by the perception module in the application framework layer.

[0272] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.

[0273] An embodiment of the present application further provides a computer program product, including a computer program. When the computer program runs on an electronic device, the electronic device executes each function or step in the above method embodiment.

[0274] The present application provides a chip for executing instructions. When the chip is running, the technical solution of the above embodiment is executed. The implementation principle and technical effect are similar and will not be described here.

[0275] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.

[0276] It should be understood that the “embodiment” mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0277] It should also be understood that in this application, "when", "if" and "if" all mean that the UE or base station will take corresponding measures under certain objective circumstances. It does not limit the time, and does not require the UE or base station to take judgment actions when implementing it, nor does it mean that there are other limitations.

[0278] Those skilled in the art will understand that the various numerical numbers such as first and second involved in this application are only for the convenience of description and are not used to limit the scope of the embodiments of this application, and also indicate the order of precedence.

[0279] In this application, elements expressed in the singular are intended to mean "one or more" rather than "one and only one" unless otherwise specified. In this application, unless otherwise specified, "at least one" is intended to mean "one or more" and "a plurality" is intended to mean "two or more."

[0280] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. A can be singular or plural, and B can be singular or plural.

[0281] In this document, the term "at least one of..." or "at least one of..." means all or any combination of the listed items. For example, "at least one of A, B and C" may mean: A exists alone, B exists alone, C exists alone, A and B exist at the same time, B and C exist at the same time, and A, B and C exist at the same time. A may be singular or plural, B may be singular or plural, and C may be singular or plural.

[0282] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0283] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0284] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0285] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0286] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0287] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0288] The same or similar parts between the various embodiments in this application can refer to each other. In the various embodiments in this application, and the various implementation methods / implementation methods / implementation methods in each embodiment, if there is no special explanation and logical conflict, the terms and / or descriptions between different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment are consistent and can be referenced to each other. The technical features in different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment can be combined to form new embodiments, implementation methods, implementation methods, or implementation methods according to their inherent logical relationships. The above-described implementation methods of this application do not constitute a limitation on the scope of protection of this application.

[0289] The above is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, which should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims. In short, the above is only a preferred embodiment of the technical solution of the present application, and is not used to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for starting an application, characterized in that: Applied to an electronic device, the electronic device includes a shared cache; the method includes: Obtaining a first operation for a first application; In response to the first operation on the first application, allocating storage space for the first application in the shared cache; the first application is an application of a preset type; Accessing the storage space allocated for the first application to obtain startup data of the first application; Starting the first application based on the startup data of the first application; Obtaining a first operation for a second application; In response to the first operation on the second application, access the shared cache to obtain startup data of the second application; The second application is started based on the start-up data of the second application.

2. The method according to claim 1, characterized in that: The preset type of application indicates that the application's occupancy of the shared cache is a first occupancy, the application's startup time is a first time, the application's occupancy of the shared cache is a second occupancy, and the application's startup time is a second time; the first occupancy is different from the second occupancy, and the first time is different from the second time.

3. The method according to claim 1 or 2, characterized in that: The method further includes: if the preset whitelist includes the identifier of the first application, determining that the first application is an application of a preset type; Alternatively, when there is a corresponding preset mark for the first application, it is determined that the first application is an application of a preset type.

4. The method according to any one of claims 1 to 3, characterized in that The first application is a short video application or a question-and-answer application.

5. The method according to claim 1, characterized in that The accessing the shared cache to obtain the startup data of the second application includes: Seizing the storage space corresponding to the second application from the shared cache; Access the storage space corresponding to the second application to obtain the startup data of the second application.

6. A method for starting an application, characterized in that: Applied to an electronic device, the electronic device includes a shared cache; the method includes: Obtaining a first operation for a first application; In response to the first operation, storage space is allocated to the first application according to a mapping relationship corresponding to the first application; the first application is an application of a preset type; the mapping relationship represents a mapping relationship between the amount of the shared cache occupied by the first application and the startup time of the first application; the first application is an application of a preset type; Accessing the storage space allocated for the first application to obtain startup data of the first application; The first application is started based on the start-up data of the first application.

7. The method according to claim 6, characterized in that The preset type of application indicates that the startup time of the application is related to the amount of the shared cache occupied by the application.

8. The method according to claim 6 or 7, characterized in that: The method further comprises: Based on the occupancy, a storage space of a corresponding size is allocated to the first application in the shared cache; wherein, Different occupancy amounts correspond to different sizes of storage space; According to the startup performance values ​​of the first application corresponding to storage spaces of different sizes, it is determined that the first application is an application of a preset type.

9. The method according to claim 8, characterized in that The allocating a storage space of a corresponding size to the first application in the shared cache based on the occupancy includes: For each first preset occupancy, allocating a first storage space for the first application in the shared cache based on the first preset occupancy; The determining that the first application is an application of a preset type according to the startup performance values ​​of the first application corresponding to the storage spaces of different sizes respectively includes: Obtaining a startup performance value corresponding to the first preset occupancy; the startup performance value corresponding to the first preset occupancy represents a startup performance value of the first application when the storage space of the first application in the shared cache is the first storage space corresponding to the first preset occupancy; determining a difference between the starting performance values ​​corresponding to different first preset occupancy amounts; In a case where the difference is greater than a first preset difference, it is determined that the first application is an application of a preset type.

10. The method according to any one of claims 6 to 9, characterized in that The mapping relationship corresponding to the first application represents a mapping relationship between the amount of the shared cache occupied by the first application and the startup performance value of the first application; The higher the startup performance value of the first application is, the shorter the startup time of the first application is; The method further comprises: Based on the occupancy, a storage space of a corresponding size is allocated to the first application in the shared cache; wherein different occupancy amounts correspond to storage spaces of different sizes; A mapping relationship corresponding to the first application is determined according to storage spaces of different sizes and the startup performance values ​​of the first application respectively corresponding to the storage spaces of different sizes.

11. The method according to claim 10, characterized in that The mapping relationship corresponding to the first application is represented by a mapping curve; The allocating a storage space of a corresponding size to the first application in the shared cache based on the occupancy includes: For each second preset occupancy, allocating a second storage space for the first application in the shared cache based on the second preset occupancy; The determining, according to the storage spaces of different sizes and the startup performance values ​​of the first applications respectively corresponding to the storage spaces of different sizes, a mapping relationship corresponding to the first applications includes: Obtaining a startup performance value corresponding to the second preset occupancy; the startup performance value corresponding to the second preset occupancy represents a startup performance value of the first application when the storage space of the first application in the shared cache is the second storage space corresponding to the second preset occupancy; The mapping relationship is determined according to each second preset occupancy and the startup performance value corresponding to each second preset occupancy.

12. The method according to any one of claims 8 to 11, characterized in that The startup performance value includes the number of instructions executed per clock cycle (IPC) or hit rate; The higher the IPC is, the shorter the startup time of the first application is; The hit rate is used to indicate the probability of accessing the startup data of the first application in the shared cache. The higher the hit rate, the shorter the startup time of the first application.

13. The method according to any one of claims 6 to 12, characterized in that The allocating storage space to the first application according to the mapping relationship corresponding to the first application includes: Determine, according to the mapping relationship corresponding to the first application, a target occupancy corresponding to the first application, wherein the target occupancy represents the occupancy of the shared cache by the first application when the startup time of the first application is the shortest; Based on the target occupancy, a target storage space is allocated for the first application in the shared cache.

14. The method according to claim 13, characterized in that The target occupancy indicates the minimum occupancy of the shared cache by the first application when the startup time is the shortest.

15. The method according to claim 12 or 13, characterized in that The shared cache includes a plurality of partitions; The allocating target storage space for the first application in the shared cache based on the target occupancy includes: Based on the target occupancy, a flag bit of a target register is set to allocate a corresponding number of partitions in the shared cache to the first application.

16. An electronic device, characterized in that: The electronic device includes a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions; the memory includes a shared cache, and when the processor executes the computer instructions, the electronic device executes the method described in any one of claims 1 to 15.

17. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 15.