Method and electronic device for resource provisioning
By identifying and differentiating the user interaction relationship levels of threads, targeted resource allocation is provided, solving the overheating problem of terminal devices under high load, achieving optimized allocation of system resources and temperature control, and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2026-03-27
AI Technical Summary
In the operating system of terminal devices, existing technologies cannot effectively identify and distinguish the user interaction relationship levels of different threads, which causes the heat generated by the whole device to exceed the heat dissipation capacity under high load, affecting the user experience.
By identifying the user interaction relationship level of each thread in the application process, targeted resource allocation is provided based on the level differences to optimize system resource allocation, including adjusting the supply of CPU, DDR, GPU and IO resources, and dynamically adjusting in combination with temperature control scenario information and device temperature.
By rationally allocating system resources, optimizing overall power consumption, slowing down temperature rise, and improving the user experience, we can enhance the user interaction experience.
Smart Images

Figure CN120670132B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of resource supply, and more particularly, to a resource supply method and an electronic device. BACKGROUND
[0002] At present, in the operating system of a terminal device, all threads in an application process are equally supplied with resources when the application is running. In this way, when the overall machine load is heavy, various physical devices of the terminal device need to work at a high frequency to meet the resource requirements of all tasks, which can cause the heat generated by the various physical devices of the terminal device to far exceed the heat dissipation capacity of the terminal device, and further cause the temperature of the terminal device to rapidly rise, thereby affecting the user experience. SUMMARY
[0003] The present application provides a resource supply method and an electronic device. Through the method and the electronic device, the user interaction relationship level of each thread in multiple threads in an application process can be identified during application running, and each thread is respectively supplied with targeted resources according to the user interaction relationship level of each thread, so that system resources can be reasonably allocated, overall machine power consumption can be optimized, and the temperature rise of the system can be delayed.
[0004] In a first aspect, a resource supply method is provided. The method comprises: during running of a first application, determining a user interaction relationship level of a first thread of the first application according to a service quality level of the first thread and running scene information of the first application, the running scene information of the first application being used to indicate that the first application is in a foreground running state, or the running scene information of the first application being used to indicate that the first application is in a background running state; and supplying the first thread with resources according to the user interaction relationship level of the first thread.
[0005] The user interaction relationship level can also be replaced by any one of the following terms: user interaction level, user interaction intensity, user experience correlation coefficient, user experience correlation level, user experience correlation intensity, user experience correlation degree, and can also be referred to as interaction level, interaction intensity, etc.
[0006] The user interaction relationship level of the thread is used to represent the degree of influence of the thread on the user experience, or is described as being used to represent the degree of correlation of the first thread with the user experience, for example: for a frame drawing thread, the running performance thereof directly influences the display speed and display quality of the interface displayed to the user, and has a great influence on the user experience, so the user interaction relationship level of the frame drawing thread is high; for another example: a background download thread, the speed of the download thereof is irrelevant to the user experience, so the user interaction relationship level of the background download thread is low. In some embodiments, the user interaction relationship level of the first thread is one of a first-level interaction relationship, a second-level interaction relationship, a third-level interaction relationship, a fourth-level interaction relationship, a fifth-level interaction relationship, and a sixth-level interaction relationship, wherein the interaction relationship level of the first-level interaction relationship, the interaction relationship level of the second-level interaction relationship, the interaction relationship level of the third-level interaction relationship, the interaction relationship level of the fourth-level interaction relationship, the interaction relationship level of the fifth-level interaction relationship, and the interaction relationship level of the sixth-level interaction relationship decrease in turn.
[0007] It can also be described as:
[0008] The user experience correlation coefficients corresponding to the first-level interaction relationship, the user experience correlation coefficients corresponding to the second-level interaction relationship, the user experience correlation coefficients corresponding to the third-level interaction relationship, the user experience correlation coefficients corresponding to the fourth-level interaction relationship, the user experience correlation coefficients corresponding to the fifth-level interaction relationship, and the user experience correlation coefficients corresponding to the sixth-level interaction relationship decrease in turn.
[0009] In some embodiments, the first-level interaction relationship corresponds to a thread of user interaction, for example: a frame drawing thread running in the foreground; the second-level interaction relationship corresponds to a key thread that is better the faster, for example: a page loading thread running in the foreground; the third-level interaction relationship corresponds to a thread triggered by the user and the progress of which is visible, for example: a thread of opening a document; the fifth-level interaction relationship corresponds to a thread that does not need to see a response immediately, for example: a background download thread; the sixth-level interaction relationship corresponds to a thread that is invisible to the user, for example: data synchronization and data backup; the fourth-level interaction relationship corresponds to a thread whose interaction relationship level is between that of the third-level interaction relationship and that of the fifth-level interaction relationship, for example: a system default interaction relationship level.
[0010] In the embodiments of the present application, during the running of an application, the user interaction relationship level of each thread in a plurality of threads in the application process can be identified, and targeted resource supply can be performed on each thread according to the user interaction relationship level of each thread, so that system resources can be reasonably allocated, the overall machine power consumption can be optimized, and the temperature rise of the system can be delayed.
[0011] With reference to the first aspect, in a possible implementation manner, the resource supply for the first thread according to the user interaction relationship level of the first thread comprises: when the user interaction relationship level of the first thread is the fourth level of interaction relationship, the resource supply for the first thread is performed according to a first resource supply level; or when the user interaction relationship level of the first thread is the first level of interaction relationship, the central processing unit (CPU) resource supply, double data rate synchronous dynamic random access memory (DDR) resource supply, graphics processing unit (GPU) resource supply and input / output (IO) resource supply for the first thread are increased on the basis of the first resource supply level; or when the user interaction relationship level of the first thread is the second level of interaction relationship, the CPU resource supply for the first thread is increased on the basis of the first resource supply level; or when the user interaction relationship level of the first thread is the third level of interaction relationship, the DDR resource supply for the first thread is increased on the basis of the first resource supply level; or when the user interaction relationship level of the first thread is the fifth level of interaction relationship, the CPU resource supply, DDR resource supply and GPU resource supply for the first thread are reduced on the basis of the first resource supply level; or when the user interaction relationship level of the first thread is the sixth level of interaction relationship, the CPU resource supply, DDR resource supply, GPU resource supply and IO resource supply for the first thread are reduced on the basis of the first resource supply level.
[0012] The first resource supply level can be a system default resource supply level, that is, a supply level of a default / common resource supply strategy adopted by the system to supply resources for threads.
[0013] In some embodiments, the manner of increasing the CPU resource supply for the first thread can be reducing a target duty cycle of the first thread and / or adjusting PID parameters of frequency point calculation of a frequency regulator, specifically:
[0014] After the target duty cycle of the first thread is reduced, the frequency regulator provides a higher frequency point to achieve a smaller duty cycle.
[0015] The PID parameters of the frequency point calculation of the frequency regulator are adjusted, so that the task is more sensitive to load fluctuation at a low frequency and is easy to increase frequency; and the task is less sensitive to load fluctuation at a high frequency and can be maintained at a relatively high frequency, where PID is an abbreviation of proportional, integral and derivative.
[0016] In some embodiments, the manner of reducing the CPU resource supply for the first thread can be increasing a target duty cycle of the first thread and / or adjusting PID parameters of frequency point calculation of a frequency regulator, specifically:
[0017] After increasing the target duty cycle of the first thread, the frequency modulator will provide a lower frequency point in order to achieve a larger duty cycle.
[0018] Adjusting the PID parameters for frequency point calculation of the frequency modulator makes the task less sensitive to load fluctuations at low frequencies, making it less likely to increase the frequency; while at high frequencies, the task is more sensitive to load reduction, making it less likely to maintain the high frequency.
[0019] In some embodiments, increasing the DDR resource supply to the first thread can be achieved by lowering the DDR frequency modulation threshold of the first thread and / or increasing the DDR frequency point, specifically:
[0020] Lowering the DDR frequency threshold for the first thread allows tasks to reach higher DDR frequencies when DDR demand is relatively high.
[0021] You can also multiply the original DDR frequency point by a higher coefficient to amplify the DDR frequency point.
[0022] In some embodiments, reducing the DDR resource supply to the first thread can be achieved by increasing the DDR frequency modulation threshold of the first thread and / or decreasing the DDR frequency point, specifically:
[0023] Increase the DDR frequency threshold for the first thread so that the task can only be adjusted to a higher DDR frequency when the DDR demand is very high.
[0024] You can also multiply the original DDR frequency point by a lower coefficient to suppress the DDR frequency point.
[0025] In some embodiments, increasing the allocation of GPU resources to the first thread can be achieved by increasing the number of available GPU units and / or increasing the priority of the first thread in using available GPU units, specifically:
[0026] Allocate more available GPU units to the GPU computing tasks submitted for the task.
[0027] It can also increase the priority of computing tasks, enabling them to obtain a large number of GPU units for computation earlier.
[0028] In some embodiments, reducing the GPU resource allocation to the first thread can be achieved by reducing the number of available GPU units and / or lowering the priority of the first thread in using available GPU units, specifically:
[0029] Allocate fewer available GPU units to the GPU computing tasks submitted for the task.
[0030] It can also lower the priority of computing tasks, so that computing tasks can only obtain some GPU units for computation after other high-priority GPU tasks have been completed.
[0031] In some embodiments, the manner of increasing the IO resource supply to the first thread can be to increase the priority of the first thread in obtaining the IO resource, specifically:
[0032] allocating a higher bus access priority to the task, so that the task can obtain the IO bandwidth resource for IO read / write operation faster.
[0033] In some embodiments, the manner of reducing the IO resource supply to the first thread can be to reduce the priority of the first thread in obtaining the IO resource, specifically:
[0034] allocating a lower bus access priority to the task, so that the task can only obtain the IO bandwidth resource for IO read / write operation after other high-priority bus bandwidth tasks complete IO read / write.
[0035] In the embodiments of the present application, during the running of the application, the user interaction relationship level of each thread in the multiple threads in the application process can be identified, and the resource supply to each thread can be adjusted according to the user interaction relationship level of each thread, so that the system resources can be reasonably allocated, the overall machine power consumption can be optimized, and the temperature rise of the system can be delayed.
[0036] In combination with the first aspect, in a possible implementation manner, the method further includes: adjusting the resource supply to the first thread according to the user interaction relationship level of the first thread, temperature control scene information, and the temperature of the first device, wherein the temperature control scene information is used to indicate that the application scene corresponding to the first thread is a scene requiring temperature control, or the temperature control scene information is used to indicate that the application scene corresponding to the first thread is a scene not requiring temperature control, and the first application runs on the first device.
[0037] In some embodiments, the resource supply to the first thread can be directly adjusted according to the user interaction relationship of the first thread, the temperature control scene information, and the temperature of the first device.
[0038] In combination with the first aspect, in a possible implementation manner, adjusting the resource supply to the first thread according to the user interaction relationship level of the first thread, temperature control scene information, and the temperature of the first device includes: when the user interaction relationship level of the first thread is less than a first level threshold, and the temperature control scene information indicates that the application scene corresponding to the first thread is a scene requiring temperature control, determining whether the temperature of the first device is greater than a first temperature threshold; and when the temperature of the first device is greater than the first temperature threshold, reducing the resource supply to the first thread.
[0039] In the embodiments of the present application, when the application scenario corresponding to the thread is a temperature control required scenario, the resource supply of the thread with a low user interaction relationship level is further reduced, and the resource supply of the thread with a high user interaction relationship level is not reduced, so that the temperature can be prevented from further rising without affecting the user interaction experience, and the user interaction experience is improved.
[0040] With reference to the first aspect, in a possible implementation, the resource supply adjustment on the first thread according to the user interaction relationship level of the first thread, the temperature control scenario information, and the temperature of the first device includes: when the user interaction relationship level of the first thread belongs to one of the fourth level of interaction relationship, the fifth level of interaction relationship, and the sixth level of interaction relationship, and the temperature control scenario information indicates that the application scenario corresponding to the first thread is a temperature control required scenario, the resource supply of the first thread is reduced.
[0041] With reference to the first aspect, in a possible implementation, the resource supply adjustment on the first thread according to the user interaction relationship level of the first thread, the temperature control scenario information, and the temperature of the first device includes: when the user interaction relationship level of the first thread belongs to one of the fourth level of interaction relationship, the fifth level of interaction relationship, and the sixth level of interaction relationship, and the temperature control scenario information indicates that the application scenario corresponding to the first thread is a temperature control required scenario, the resource supply of the first thread is reduced.
[0042] In the embodiments of the present application, when the application scenario corresponding to the thread is a temperature control required scenario, the temperature is monitored in real time, and when the temperature is greater than a temperature threshold, the resource supply of the thread with a low user interaction relationship level is further reduced, and the resource supply of the thread with a high user interaction relationship level is not reduced, so that the temperature can be prevented from further rising without affecting the user interaction experience, and the user interaction experience is improved.
[0043] In a second aspect, an electronic device is provided, which includes one or more processors, one or more memories, and one or more computer programs. The one or more computer programs are stored in the one or more memories, and include instructions which, when executed by the one or more processors, cause the electronic device to perform the following operations: during the running of a first application, determining a user interaction relationship level of a first thread of the first application according to a quality of service level of the first thread and running scenario information of the first application, the running scenario information of the first application being used to indicate that the first application is in a foreground running state, or the running scenario information of the first application being used to indicate that the first application is in a background running state; and performing resource supply on the first thread according to the user interaction relationship level of the first thread.
[0044] The user interaction relationship level can also be replaced by any of the following terms: user interaction level, user interaction intensity, user experience correlation coefficient, user experience correlation level, user experience correlation intensity, user experience correlation degree, or simply interaction level, interaction intensity, etc.
[0045] The user interaction level of a thread is used to represent the degree of influence of a thread on the user experience, or to describe the degree of relevance between the first thread and the user experience. For example, for the frame rendering thread, its running performance directly affects the display speed and display quality of the interface presented to the user, which has a great impact on the user experience, so the user interaction level of the frame rendering thread is high. On the other hand, for the background download thread, from the perspective of user experience, the speed of download is irrelevant, so the user interaction level of the background download thread is low.
[0046] In some embodiments, the user interaction relationship level of the first thread is one of a first-level interaction relationship, a second-level interaction relationship, a third-level interaction relationship, a fourth-level interaction relationship, a fifth-level interaction relationship, and a sixth-level interaction relationship, wherein the interaction relationship level of the first-level interaction relationship, the second-level interaction relationship, the third-level interaction relationship, the fourth-level interaction relationship, the fifth-level interaction relationship, and the sixth-level interaction relationship decreases sequentially.
[0047] It can also be described as:
[0048] The user experience correlation coefficients corresponding to the first-level interaction relationship, the second-level interaction relationship, the third-level interaction relationship, the fourth-level interaction relationship, the fifth-level interaction relationship, and the sixth-level interaction relationship decrease sequentially.
[0049] In some embodiments, the first-level interaction relationship corresponds to the thread of user interaction, such as the frame drawing thread running in the foreground; the second-level interaction relationship corresponds to the critical thread that is as fast as possible, such as the page loading thread running in the foreground; the third-level interaction relationship corresponds to the thread that is triggered by the user and whose progress is visible, such as the thread that opens a document; the fifth-level interaction relationship corresponds to the thread that does not require an immediate response, such as the background download thread; the sixth-level interaction relationship corresponds to the thread that is not visible to the user, such as data synchronization and data backup; and the fourth-level interaction relationship corresponds to the thread whose interaction relationship level is between the third-level and fifth-level interaction relationship, such as the system default interaction relationship level.
[0050] In the embodiments of the application, during application running, the user interaction relationship level of each thread in the multiple threads in the application process can be identified, and each thread is provided with targeted resources according to the user interaction relationship level of each thread, so that system resources can be reasonably allocated, the whole machine power consumption can be optimized, and the temperature rise of the system can be delayed.
[0051] With reference to the second aspect, in a possible implementation, the electronic device is specifically configured to: when the user interaction relationship level of the first thread is the fourth level of interaction, provide the first thread with resources according to the first resource supply level; or when the user interaction relationship level of the first thread is the first level of interaction, increase the CPU resource supply, the DDR resource supply, the GPU resource supply and the IO resource supply to the first thread on the basis of the first resource supply level; or when the user interaction relationship level of the first thread is the second level of interaction, increase the CPU resource supply to the first thread on the basis of the first resource supply level; or when the user interaction relationship level of the first thread is the third level of interaction, increase the DDR resource supply to the first thread on the basis of the first resource supply level; or when the user interaction relationship level of the first thread is the fifth level of interaction, reduce the CPU resource supply, the DDR resource supply and the GPU resource supply to the first thread on the basis of the first resource supply level; or when the user interaction relationship level of the first thread is the sixth level of interaction, reduce the CPU resource supply, the DDR resource supply, the GPU resource supply and the IO resource supply to the first thread on the basis of the first resource supply level.
[0052] The first resource supply level can be a system default resource supply level, that is, a supply level at which the system provides threads with resources according to a default / common resource supply strategy.
[0053] In some embodiments, the way to increase the CPU resource supply to the first thread can be to reduce the target duty cycle of the first thread and / or adjust the PID parameters of the frequency converter frequency point calculation, specifically:
[0054] After the target duty cycle of the first thread is reduced, the frequency converter will provide a higher frequency point to achieve a smaller duty cycle.
[0055] Adjusting the PID parameters of the frequency converter frequency point calculation makes the task more sensitive to load fluctuations at low frequencies and easy to increase the frequency; at high frequencies, the task is less sensitive to load fluctuations and can be maintained at a relatively high frequency.
[0056] In some embodiments, the way to reduce the CPU resource supply to the first thread can be to increase the target duty cycle of the first thread and / or adjust the PID parameters of the frequency modulator calculation, specifically:
[0057] After increasing the target duty cycle of the first thread, the frequency modulator will provide a lower frequency point to achieve a greater duty cycle.
[0058] Adjusting the PID parameters of the frequency modulator calculation makes the task less sensitive to load fluctuations at low frequencies, and less likely to increase the frequency; at high frequencies, the task is more sensitive to load reduction, and is less likely to maintain a high frequency.
[0059] In some embodiments, the way to increase the DDR resource supply to the first thread can be to lower the DDR frequency modulation threshold of the first thread and / or increase the frequency of the DDR, specifically:
[0060] Lowering the DDR frequency modulation threshold of the first thread allows the task to adjust to a higher DDR frequency when the DDR demand is relatively high.
[0061] It can also multiply a higher coefficient on the original DDR factor frequency to amplify the DDR frequency.
[0062] In some embodiments, the way to reduce the DDR resource supply to the first thread can be to increase the DDR frequency modulation threshold of the first thread and / or reduce the frequency of the DDR, specifically:
[0063] Increasing the DDR frequency modulation threshold of the first thread allows the task to adjust to a higher DDR frequency only when the DDR demand is very high.
[0064] It can also multiply a lower coefficient on the original DDR factor frequency to suppress the DDR frequency.
[0065] In some embodiments, the way to increase the GPU resource supply to the first thread can be to increase the number of available GPU units and / or increase the priority of the first thread using available GPU units, specifically:
[0066] Assign more available GPU units to the GPU computing task submitted by the task.
[0067] It can also increase the priority of the computing task so that the computing task can obtain a large number of GPU units for computation earlier.
[0068] In some embodiments, the way to reduce the GPU resource supply to the first thread can be to reduce the number of available GPU units and / or reduce the priority of the first thread using available GPU units, specifically:
[0069] Allocate less available GPU units to the GPU computing task submitted by the task.
[0070] The priority of the computing task can also be reduced, so that the computing task has to wait until other high-priority GPU tasks are completed before it can obtain some GPU units for computation.
[0071] In some embodiments, the way to increase the IO resource supply to the first thread can be to increase the priority of the first thread in obtaining IO resources, specifically:
[0072] Allocate higher bus access priority to the task, so that the task can obtain IO bandwidth resources for IO read-write operation faster.
[0073] In some embodiments, the way to reduce the IO resource supply to the first thread can be to reduce the priority of the first thread in obtaining IO resources, specifically:
[0074] Allocate lower bus access priority to the task, so that the task needs to wait until other high-priority bus bandwidth tasks complete IO read-write before it can obtain IO bandwidth resources for IO read-write operation.
[0075] In the embodiments of the present application, during the running of an application, the user interaction relationship level of each thread in a plurality of threads in the application process can be identified, and the resource supply to each thread can be adjusted according to the user interaction relationship level of each thread, so that system resources can be reasonably allocated, the overall machine power consumption can be optimized, and the temperature rise of the system can be delayed.
[0076] In combination with the first aspect, in a possible implementation manner, the electronic device is further configured to: adjust the resource supply to the first thread according to the user interaction relationship level of the first thread, temperature control scene information, and the temperature of the first device, wherein the temperature control scene information is used to indicate that the application scenario corresponding to the first thread is a scene requiring temperature control, or the temperature control scene information is used to indicate that the application scenario corresponding to the first thread is a scene not requiring temperature control, and the first application runs on the first device.
[0077] In some embodiments, the electronic device can directly adjust the resource supply to the first thread according to the user interaction relationship level of the first thread, the temperature control scene information, and the temperature of the first device.
[0078] In combination with the first aspect, in a possible implementation manner, the electronic device is specifically configured to: when the user interaction relationship level of the first thread is less than a first level threshold, and the temperature control scene information indicates that the application scenario corresponding to the first thread is a scene requiring temperature control, determine whether the temperature of the first device is greater than a first temperature threshold; and when the temperature of the first device is greater than the first temperature threshold, reduce the resource supply to the first thread.
[0079] In the embodiments of the application, when the application scenario corresponding to the thread is a temperature control required scenario, the resource supply to the thread with a low user interaction relationship level is further reduced, and the resource supply to the thread with a high user interaction relationship level is not reduced, so that the temperature can be prevented from further rising without affecting the user interaction experience, and the user interaction experience is improved.
[0080] With reference to the first aspect, in a possible implementation, the electronic device is specifically configured to: when the user interaction relationship level of the first thread belongs to one of the fourth level of interaction relationship, the fifth level of interaction relationship, and the sixth level of interaction relationship, and the temperature control scene information indicates that the application scenario corresponding to the first thread is a temperature control required scenario, the resource supply to the first thread is reduced.
[0081] With reference to the first aspect, in a possible implementation, the electronic device is specifically configured to: determine whether the temperature of the first device is greater than a first temperature threshold; and when the temperature of the first device is greater than the first temperature threshold, the resource supply to the first thread is reduced.
[0082] In the embodiments of the application, when the application scenario corresponding to the thread is a temperature control required scenario, the temperature is monitored in real time, and when the temperature is greater than a temperature threshold, the resource supply to the thread with a low user interaction relationship level is further reduced, and the resource supply to the thread with a high user interaction relationship level is not reduced, so that the temperature can be prevented from further rising without affecting the user interaction experience, and the user interaction experience is improved.
[0083] In a third aspect, an electronic device is provided, which includes a memory and a processor, wherein the memory is configured to store computer program code, and the processor is configured to execute the computer program code stored in the memory to implement the method in the first aspect or any possible implementation manner of the first aspect.
[0084] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program or instructions, and when the computer program or instructions are executed, the method in the first aspect or any possible implementation manner of the first aspect is implemented.
[0085] In a fifth aspect, a chip is provided, which stores instructions, and when the instructions are executed on a device, the chip executes the method in the first aspect or any possible implementation manner of the first aspect.
[0086] In a sixth aspect, a computer program product is provided, which stores a computer program or instructions, and when the computer program or instructions are executed, the method in the first aspect or any possible implementation manner of the first aspect is implemented. Attached Figure Description
[0087] Figure 1 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0088] Figure 2 This is a software structure block diagram of an electronic device provided in an embodiment of this application;
[0089] Figure 3 This is a schematic flowchart illustrating a resource supply method provided in an embodiment of this application;
[0090] Figure 4 This is a schematic flowchart illustrating another method for resource supply provided in the embodiments of this application;
[0091] Figure 5 This is a schematic flowchart illustrating a method for allocating resources to threads based on the user interaction relationship level, temperature control scenario information, and temperature, as provided in an embodiment of this application.
[0092] Figure 6 This is a schematic diagram of the framework of a system for resource supply provided in an embodiment of this application. Detailed Implementation
[0093] The technical solutions of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments.
[0094] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "plural" or "multiple" refers to two or more than two.
[0095] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.
[0096] The terminology used in the following description merely for the purpose of describing particular embodiments and is not intended to limit the application. As used in this description and the accompanying claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "or" as used herein is used to denote exclusive, at least, or inclusive, at least, senses, depending on the context in which it is used. The term "based on" is used to denote the established cause and effect relationship between the two events and does not necessarily indicate a direct causal relationship unless explicitly stated to be a direct causal relationship. The term "coupled" as used herein refers to any direct or indirect communication between two or more elements, and can refer to an electrical, mechanical, electromagnetic, optical, or other contact between the elements. The term "coupled" can also refer to the association between two or more elements that are not directly in contact with each other but whose association can not be severed on a practical level by removal of any intervening elements.
[0097] Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "in another embodiment" or "in further embodiments" in various places throughout this specification are not necessarily referring to the same embodiment, unless otherwise expressly specified. The terms "including," "containing," "having," and variations thereof are meant to encompass the terms "including but not limited to."
[0098] The method provided by the embodiments of the present application can be applied to electronic devices with time display function or time recognition function, for example, can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices, and the like. The embodiments of the present application do not make any limitation on the specific type of electronic device.
[0099] Exemplary, Figure 1A structural diagram of the electronic device 100 is shown. The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0100] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0101] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (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), etc. Different processing units can be independent devices, or can be integrated in one or more processors.
[0102] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.
[0103] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has just used or is cycling through. If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. This avoids repeated access and reduces the latency of the processor 110, thus improving the efficiency of the system.
[0104] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can 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, etc.
[0105] The USB interface 130 is an interface that conforms to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect earphones to play audio through the earphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0106] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0107] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some embodiments with wired charging, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some embodiments with wireless charging, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 142 and power the electronic device through the power management module 141.
[0108] The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160, etc. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.
[0109] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.
[0110] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be configured to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0111] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transfer the same to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and radiate the same as electromagnetic waves through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.
[0112] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a 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. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the microphone 170B, etc.), or displays an image or a video through the display screen 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and disposed in the same device as the mobile communication module 150 or other functional modules.
[0113] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.
[0114] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).
[0115] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.
[0116] The display screen 194 is configured to display images, videos, and the like. The display screen 194 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 flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.
[0117] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.
[0118] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.
[0119] The camera 193 is configured to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.
[0120] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0121] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0122] The NPU is a neural-network (NN) calculation processor, which can quickly process input information by learning from the structure of biological neural networks, such as learning from the transmission mode between human brain neurons, and can also continuously self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition and other applications, such as: image recognition, face recognition, voice recognition, text understanding, etc.
[0123] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize data storage functions. For example, music, video, and other files are saved in the external memory card.
[0124] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various function applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one App required by a function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phonebook, etc.), etc. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0125] The electronic device 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.
[0126] The audio module 170 is configured to convert digital audio information into an analog audio signal output, and to convert an analog audio input into a digital audio signal. The audio module 170 can also be configured to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some of the functions of the audio module 170 can be disposed in the processor 110.
[0127] The speaker 170A, also referred to as a "loudspeaker", is configured to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0128] The receiver 170B, also referred to as a "earpiece", is configured to convert an audio electrical signal into a sound signal. When the electronic device 100 receives a call or a voice message, the user can listen to the voice through the receiver 170B by placing the receiver 170B close to the ear.
[0129] The microphone 170C, also referred to as a "microphone", "transducer", is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can make a sound through the mouth close to the microphone 170C, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, noise reduction functions can also be realized. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, in addition to collecting sound signals, noise reduction, and can also identify the source of the sound, realize the function of directional recording, etc.
[0130] The earphone interface 170D is configured to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0131] The keys 190 include a power-on key, a volume key, etc. The keys 190 can be mechanical keys. They can also be touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0132] The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompt, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations acting on different regions of the display screen 194. Different application scenarios (such as time reminders, received messages, alarms, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0133] The indicator 192 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, etc.
[0134] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or pulled out of the SIM card interface 195 to realize contact and separation with the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, and N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external storage cards. The electronic device 100 interacts with a network through a SIM card to realize functions such as calling and data communication. In some embodiments, the electronic device 100 uses an embedded SIM (eSIM) card, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0135] It should be understood that the phone card in the embodiments of the present application includes but is not limited to a SIM card, an eSIM card, a universal subscriber identity module (USIM), a universal integrated circuit card (UICC), etc.
[0136] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take an Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 100.
[0137] Figure 2is a software structure block diagram of the electronic device 100 of the embodiments of the present application. The layered architecture divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and the system library, and the kernel layer. The application layer can include a series of application packages.
[0138] As shown in Figure 2 , the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0139] The application framework layer provides the application layer with application programming interface (API) and programming framework for the application. The application framework layer includes some pre-defined functions.
[0140] As shown in Figure 2 , the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0141] The window manager is used to manage the window program. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and intercept the screen, etc.
[0142] The content provider is used to store and obtain data, and make the data accessible to the application. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc.
[0143] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build an application. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.
[0144] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call state (including connection, hang up, etc.).
[0145] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
[0146] The notification manager enables an application to display notification information in the status bar, which can be used to convey a message of the notification type, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloading, message reminders, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as a notification of a background running application, and can also be a notification in the form of a dialog window appearing on the screen. For example, the status bar prompts text information, emits a prompt sound, the electronic device vibrates, the indicator light flashes, etc.
[0147] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0148] The core library includes two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
[0149] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java file of the application layer and the application framework layer into a binary file. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, etc.
[0150] The system library can include multiple functional modules. For example: a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGL ES), a 2D graphics engine (for example: SGL), etc.
[0151] The surface manager is used to manage the display subsystem, and provides a fusion of 2D and 3D layers for multiple applications.
[0152] The media library supports multiple commonly used audio, video format playback and recording, and static image files, etc. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0153] The three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.
[0154] The 2D graphics engine is a drawing engine for 2D drawing.
[0155] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0156] It should be understood that the technical solutions in the embodiments of the present application can be used in Android, IOS, Harmony, etc.
[0157] The technical solutions of the embodiments of the present application can be applied to a resource supply scene in an application running process on an electronic device.
[0158] The electronic device can be a television, a desktop computer, a notebook computer, and can also be a portable electronic device such as a mobile phone, a folding screen, a tablet computer, a camera, a video camera, a video recorder, and can also be a smart home device such as a refrigerator, a washing machine, a sweeper, or any electronic device capable of running an application, and can also be an electronic device in a 5G network or an electronic device in a future evolved public land mobile network (PLMN) and the like.
[0159] For the current resource supply method, when an application runs in the operating system of the terminal device, resources are supplied to all threads in the application process without distinction. In this way, when the overall machine load is heavy, each physical device of the terminal device needs to work at a high frequency to meet the resource needs of all tasks, which can cause the heat dissipation of each physical device of the terminal device to far exceed the heat dissipation capacity of the terminal device, and further cause the temperature of the terminal device to rapidly rise, thereby affecting the user experience.
[0160] In order to control the temperature of the operating system, in some resource supply schemes, for a non-temperature control scene, high supply is provided to all threads, which makes the power consumption of the system high and the temperature rise fast; for a temperature control scene, frequency suppression is performed on all threads, which makes some key threads with high resource needs unable to be executed and completed on time, which can affect the user interaction experience.
[0161] When the application runs, the user interaction relationship levels of each thread under the application process are different, and the demands of the threads on resources are also different when the user interaction relationship levels of the threads are different. For example: frame drawing related threads belong to threads with a high user interaction relationship level, and the requirements of the threads on CPU resources and double data rate synchronous dynamic random access memory (DDR) resources of the device can be very high, and the requirements of the threads on input / output (IO) resources are not high; network download related threads belong to threads with a general user interaction relationship level, and the requirements of the threads on CPU resources of the device are not high, but the requirements of the threads on DDR and IO resources are high; some background processing task threads belong to threads with a low user interaction relationship level, and the demands of the threads on various resources are not high. Moreover, when the threads are switched between the foreground and the background, the demands of the threads on resources also change, for example, the demands of the frame drawing related threads on CPU resources and DDR resources will decrease when the application is switched to the background.
[0162] In the existing resource supply method, the resource supply for each thread in an application process is uniformly high or low, and the level of user interaction relationship of the thread cannot be perceived. When the resource supply is provided, the level of user interaction relationship of each thread is not considered, and the thread with a low level of user interaction relationship cannot be limited in advance to slow down the system temperature rise. In addition, in the existing resource supply method, when the temperature reaches the frequency limiting temperature, the kernel directly limits the resource supply of all threads, so that some threads with a high level of user interaction relationship cannot be completed on time, affecting the user's interactive experience.
[0163] Therefore, the embodiments of the present application provide a resource supply method and an electronic device. In the method, the level of user interaction relationship of each thread in an application process can be identified during the running of the application, and each thread can be supplied with targeted resources according to the level of user interaction relationship of each thread. For example, a thread with a low level of user interaction relationship is supplied with a lower resource supply, and a thread with a high level of user interaction relationship is supplied with a higher resource supply, so as to reasonably allocate system resources, optimize the overall power consumption, and delay the system temperature rise.
[0164] In addition, through the method, the temperature control scene can be identified. When in the temperature control scene, the resource supply of the thread with a low level of user interaction relationship can be suppressed when the temperature is higher than the temperature threshold, and the resource supply of the thread with a high level of user interaction relationship is not suppressed, so as to prevent the temperature of the system from further rising without affecting the user's interactive experience.
[0165] Exemplarily, Figure 3 A schematic flowchart of a resource supply method 400 provided by the embodiments of the present application is shown. As shown in the figure, Figure 3 The method 300 includes the following steps:
[0166] S301: determining the level of user interaction relationship of a first thread of a first application according to the quality of service (QoS) level of the first thread and the running scene information of the first application, and transmitting the level of user interaction relationship of the first thread to a kernel.
[0167] The level of user interaction relationship can also be replaced by any one of the following terms: user interaction level, user interaction intensity, user experience correlation coefficient, user experience correlation level, user experience correlation intensity, user experience correlation degree, and can also be referred to as interaction level, interaction intensity, etc.
[0168] The user interaction relationship level of the first thread is used to indicate the degree of influence of the first thread on the user experience, or is described as indicating the degree of correlation of the first thread with the user experience. For example, for a frame drawing thread, its running performance directly affects the display speed and display quality of the interface displayed to the user, and has a great influence on the user experience, so the user interaction relationship level of the frame drawing thread is high. For example, a background download thread, the speed of which is irrelevant to the user experience, so the user interaction relationship level of the background download thread is low.
[0169] The purpose of the quality of service QoS is to provide end-to-end quality of service guarantee for each service according to different needs of various threads. QoS allows different threads to unequally compete for network resources, for example, voice, video and important data applications can be preferentially served in network equipment. For a certain type of data flow, QoS can assign it a certain level of transmission priority to identify its relative importance.
[0170] In some embodiments, the QoS level of the first thread can be determined by the application according to the priority field in the message corresponding to the first thread.
[0171] In some embodiments, the QoS level of the thread can be divided into six levels, i.e., level 0, level 1, level 2, level 3, level 4, and level 5, wherein the higher the value, the higher the importance of the thread.
[0172] In some embodiments, the running scenario information of the first application is used to indicate whether the running state of the first application is foreground running or background running.
[0173] In some embodiments, the user interaction relationship level of the thread can include a first-level interaction relationship, a second-level interaction relationship, a third-level interaction relationship, a fourth-level interaction relationship, a fifth-level interaction relationship, and a sixth-level interaction relationship.
[0174] The user interaction levels corresponding to the first-level interaction relationship, the second-level interaction relationship, the third-level interaction relationship, the fourth-level interaction relationship, the fifth-level interaction relationship, and the sixth-level interaction relationship decrease in turn, and the interaction relationship level of the thread belonging to the first-level interaction relationship is the highest, and the interaction relationship level of the thread belonging to the sixth-level interaction relationship is the lowest.
[0175] Alternatively, it is described that the user experience correlation coefficients corresponding to the first-level interaction relationship, the second-level interaction relationship, the third-level interaction relationship, the fourth-level interaction relationship, the fifth-level interaction relationship, and the sixth-level interaction relationship decrease in turn.
[0176] In some embodiments:
[0177] The first level of interaction corresponds to the thread of user interaction (user interactive), for example, the foreground running frame drawing thread;
[0178] The second level of interaction corresponds to the thread of deadline request (deadline request), for example, the foreground running page loading thread;
[0179] The third level of interaction corresponds to the thread of user initiated and progress visible (user initiated), for example, the thread of opening a document;
[0180] The fifth level of interaction corresponds to the thread of utility (utility), for example, the background download thread;
[0181] The sixth level of interaction corresponds to the thread of background (background), for example, data synchronization and data backup;
[0182] The fourth level of interaction corresponds to the thread of default (default) whose level of interaction is between the third level of interaction and the fifth level of interaction.
[0183] Table 1 shows the mapping table of the level of user interaction of a thread according to an embodiment of the present application.
[0184] Table 1
[0185]
[0186] The user interface (UI) thread is a thread specially used for processing user interface related tasks, which is responsible for receiving and responding to messages issued by the operating system or the user, such as interface messages, mouse and keyboard messages, etc. The UI thread can also be called the main thread, which is created by the system when the application is started, and is used to distribute events to UI components, including drawing events.
[0187] Welink refers to Huawei Cloud welink, which is derived from Huawei's global digital office practice and is a full-scene remote intelligent digital collaborative office platform.
[0188] As shown in Table 1, the level of user interaction of a thread can be determined according to the QoS level of the thread and the running scene information of the application.
[0189] S302: According to the level of user interaction of the first thread, resources are supplied to the first thread.
[0190] The resource supply level of the thread is determined according to the user interaction relationship level, wherein when the user interaction relationship level of the thread is the first level of interaction relationship, the resource supply level of the thread is the highest, and when the user interaction relationship level of the thread is the sixth level of interaction relationship, the resource supply level of the thread is the lowest.
[0191] In some embodiments,
[0192] When the user interaction relationship level of the first thread is the first level of interaction relationship, the first thread is provided with full high-supply resources, that is, on the basis of default resource supply, the CPU resource supply, the GPU resource supply, the DDR resource supply, and the IO resource supply of the first thread are increased. When the user interaction relationship level of the first thread is the second level of interaction relationship, the first thread is provided with high-supply CPU resources, that is, on the basis of default resource supply, the CPU resource supply of the first thread is increased.
[0193] When the user interaction relationship level of the first thread is the third level of interaction relationship, the first thread is provided with high-supply DDR resources, that is, on the basis of default resource supply, the DDR resource supply of the first thread is increased.
[0194] When the user interaction relationship level of the first thread is the fourth level of interaction relationship, the first thread is provided with default resource supply.
[0195] When the user interaction relationship level of the first thread is the fifth level of interaction relationship, the supply of resources other than the IO resource supply provided to the first thread is suppressed, that is, on the basis of default resource supply, the default supply of the IO resource is maintained, and the CPU resource supply, the GPU resource supply, and the DDR resource supply of the first thread are reduced.
[0196] When the user interaction relationship level of the first thread is the sixth level of interaction relationship, the supply of all resources provided to the first thread is suppressed, that is, on the basis of default resource supply, the CPU resource supply, the GPU resource supply, the DDR resource supply, and the IO resource supply of the first thread are reduced.
[0197] In some embodiments, the way to increase the CPU resource supply of the first thread can be to reduce the target duty cycle of the first thread and / or adjust the PID parameters of the frequency tuner frequency point calculation, specifically:
[0198] After reducing the target duty cycle of the first thread, the frequency tuner will provide a higher frequency point to achieve a smaller duty cycle.
[0199] Adjust the PID parameter of the frequency point calculation of the frequency tuner, so that the task is more sensitive to load fluctuations at low frequencies and is easy to increase the frequency; at high frequencies, the task is less sensitive to load fluctuations and can be maintained at a relatively high frequency, where PID is the abbreviation of proportional, integral and derivative.
[0200] In some embodiments, the way to reduce the CPU resource supply to the first thread can be to increase the target duty cycle of the first thread and / or adjust the PID parameter of the frequency point calculation of the frequency tuner, specifically:
[0201] After increasing the target duty cycle of the first thread, the frequency tuner will provide a lower frequency point to achieve a greater duty cycle.
[0202] Adjust the PID parameter of the frequency point calculation of the frequency tuner, so that the task is more sensitive to load fluctuations at low frequencies and is easy to increase the frequency; at high frequencies, the task is less sensitive to load fluctuations and can be maintained at a relatively high frequency, where PID is the abbreviation of proportional, integral and derivative.
[0203] In some embodiments, the way to increase the DDR resource supply to the first thread can be to lower the DDR frequency tuning threshold of the first thread and / or increase the frequency of the DDR, specifically:
[0204] Lowering the DDR frequency tuning threshold of the first thread allows the task to be tuned to a higher DDR frequency point when the DDR demand is relatively high.
[0205] It can also multiply a higher coefficient on the original DDR factor frequency point to amplify the frequency of the DDR.
[0206] In some embodiments, the way to reduce the DDR resource supply to the first thread can be to increase the DDR frequency tuning threshold of the first thread and / or reduce the frequency of the DDR, specifically:
[0207] Increasing the DDR frequency tuning threshold of the first thread allows the task to be tuned to a higher DDR frequency point only when the DDR demand is very high.
[0208] It can also multiply a lower coefficient on the original DDR factor frequency point to suppress the frequency of the DDR.
[0209] In some embodiments, the way to increase the GPU resource supply to the first thread can be to increase the number of available GPU units and / or increase the priority of the first thread using available GPU units, specifically:
[0210] Assign more available GPU units to the GPU computing task submitted by the task.
[0211] The priority of the computing task can also be raised, so that the computing task can obtain a large number of GPU units for computation earlier.
[0212] In some embodiments, the manner of reducing the GPU resource supply to the first thread can be reducing the number of available GPU units and / or reducing the priority of the first thread in using the available GPU units, specifically:
[0213] The GPU computing task submitted by the task is allocated fewer available GPU units.
[0214] The priority of the computing task can also be reduced, so that the computing task has to wait until other high-priority GPU tasks are completed before obtaining some GPU units for computation.
[0215] In some embodiments, the manner of raising the IO resource supply to the first thread can be raising the priority of the first thread in obtaining IO resources, specifically:
[0216] The task is allocated a higher bus access priority, so that the task can obtain IO bandwidth resources for IO read / write operations more quickly.
[0217] In some embodiments, the manner of reducing the IO resource supply to the first thread can be reducing the priority of the first thread in obtaining IO resources, specifically:
[0218] The task is allocated a lower bus access priority, so that the task has to wait until other high-priority bus bandwidth tasks complete IO read / write before obtaining IO bandwidth resources for IO read / write operations.
[0219] In the embodiments of the present application, during the running of an application, the user interaction relationship level of each thread in the application process can be identified, different user interaction relationship levels are mapped to different system resource supply levels, and targeted resource supply is performed on each thread according to the user interaction relationship level of each thread, so that system resources can be reasonably allocated, the overall machine power consumption can be optimized, and the temperature rise of the system can be delayed.
[0220] Exemplarily, Figure 4 A schematic flowchart of another method 400 of resource supply provided by the embodiments of the present application is shown. As Figure 4 shown, the method 400 includes:
[0221] S401: The first application determines the service quality level of the first thread of the first application, and transmits the service quality level of the first thread to a service quality management module (Qos Manager).
[0222] Alternatively, the service quality level of the first thread of the first application can also be determined by an operating system.
[0223] In some embodiments, the first application determines the quality of service level of the first thread, which can be marked by the first application.
[0224] In some embodiments, the description of the quality of service level is described in Figure 3 The S301 in the illustrated embodiment has been described in detail, and will not be repeated here for brevity.
[0225] S402: The resource scheduling service module determines the running scene information and the temperature control scene information of the first application, and transmits the determined running scene information and the temperature control scene information of the first application to the quality of service management module.
[0226] In some embodiments, the running scene information of the first application is used to indicate whether the running state of the first application is foreground running or background running.
[0227] In some embodiments, the temperature control scene information is used to indicate whether the application scene corresponding to the first thread is a scene that needs temperature control, wherein the scene that needs temperature control can refer to an application scene that is not sensitive to performance, and the scene that does not need temperature control can refer to a scene that is relatively sensitive to performance.
[0228] For example, the scene that is relatively sensitive to performance can include a game scene, and can also include an application startup scene.
[0229] It can be understood that S401 and S402 can be executed simultaneously in response to the running of the first application, or can be executed in sequence in response to the running of the first application. The execution order of S401 and S402 is not limited in the present application.
[0230] S403: After receiving the quality of service level of the first thread, the running scene information and the temperature control scene information of the first application, the quality of service management module determines the user interaction relationship level of the first thread according to the quality of service level of the first thread and the running scene information of the first application, and transmits the determined user interaction relationship level of the first thread and the temperature control scene information to the kernel.
[0231] In some embodiments, the explanation of determining the user interaction relationship level of the first thread according to the quality of service level of the first thread and the running scene information of the first application is the same as the explanation of Figure 3 The explanation of S301 in the illustrated embodiment is the same as the explanation of S301, and will not be repeated here for brevity.
[0232] S404: The kernel supplies resources to the first thread according to the user interaction relationship level of the first thread, the temperature control scene information, and the temperature of the first device, wherein the first application runs on the first device.
[0233] In some embodiments, the kernel first determines a first resource supply strategy for supplying resources to the first thread according to the user interaction relationship level of the first thread, and when the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that does not need to be temperature controlled, the kernel directly supplies resources to the first thread according to the first resource supply strategy. The corresponding relationship between the user interaction relationship level of the first thread and the resource supply level (i.e., the first resource supply strategy) is described with reference to the description of S302 in the embodiment shown in Figure 3
[0234] In some embodiments, the kernel first determines a first resource supply strategy for supplying resources to the first thread according to the user interaction relationship level of the first thread, and when the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that needs to be temperature controlled, the kernel further determines whether the user interaction relationship level of the first thread belongs to one of the fourth level of interaction relationship, the fifth level of interaction relationship, and the sixth level of interaction relationship. If so, when the temperature of the first device is greater than the first temperature threshold, the resource supply level of the first thread is further suppressed on the basis of the first resource supply strategy, that is, the CPU resource supply, the GPU resource supply, the DDR resource supply, and the IO resource supply of the first thread are further reduced, to obtain a second resource supply strategy with a lower resource supply level, and the kernel supplies resources to the first thread according to the second resource supply strategy.
[0235] Alternatively, it can be described as follows: the kernel first supplies resources to the first thread according to the user interaction relationship level of the first thread, and when the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that needs to be temperature controlled, the kernel further determines whether the user interaction relationship level of the first thread belongs to one of the fourth level of interaction relationship, the fifth level of interaction relationship, and the sixth level of interaction relationship. If so, when the temperature of the first device is greater than the first temperature threshold, the resource supply level of the first thread is suppressed, that is, the CPU resource supply, the GPU resource supply, the DDR resource supply, and the IO resource supply of the first thread are further reduced on the basis of the current supply level; when the temperature of the first device is less than or equal to the first temperature threshold, the resource supply level of the first thread is not suppressed, that is, the kernel still supplies resources to the first thread according to the user interaction relationship level of the first thread.
[0236] For example, the first temperature threshold can be any temperature value in the range of 40°C to 50°C.
[0237] The kernel determines a first resource supply strategy for supplying resources to the first thread according to the user interaction relationship level of the first thread. It can be understood that the kernel maps the first thread to a resource supply level combination according to the user interaction relationship level of the first thread, and the resource supply level combination can include a CPU resource supply level required by the first thread, a DDR resource supply level required by the first thread, a GPU resource supply level required by the first thread, a file IO resource supply level required by the first thread, a network IO resource supply level required by the first thread, and the like.
[0238] Similarly, based on the embodiments provided in the present application, the kernel can map the multiple threads of the first application to multiple resource supply level combinations, where the multiple threads correspond to the multiple resource supply level combinations one by one.
[0239] In an implementation manner, based on the resource supply level combination corresponding to the first thread, a resource supply decision module in the kernel issues the resource supply level corresponding to the first thread to the drivers of various physical devices (for example, CPU, DDR, GPU, file IO, network IO, and the like), so that the CPU supplies resources to the first thread according to the CPU resource supply level required by the first thread, the DDR supplies resources to the first thread according to the DDR resource supply level required by the first thread, the GPU supplies resources to the first thread according to the GPU resource supply level required by the first thread, the file IO supplies resources to the first thread according to the file IO resource supply level required by the first thread, and the network IO supplies resources to the first thread according to the network IO resource supply level required by the first thread, thereby realizing the targeted resource supply to the first thread. In some embodiments, the first device includes the first application, the resource scheduling service module, the quality of service management module, and the kernel.
[0240] In the embodiments of the present application, the targeted resource supply is provided to the threads according to the user interaction relationship level of the threads, which can reduce the power consumption of the device and delay the temperature rise of the system. When the application scenario corresponding to the thread is a scenario that needs temperature control, the temperature is monitored in real time, and when the temperature is greater than a temperature threshold, the resource supply to the thread with a low user interaction relationship level is further reduced, and the resource supply to the thread with a high user interaction relationship level is not reduced. In this way, the temperature can be prevented from further rising without affecting the user interaction experience, and the user interaction experience can be improved.
[0241] To more clearly understand the above S404, an exemplary method is shown. Figure 5 A schematic flowchart of a method 500 for supplying resources to a first thread according to a user interaction relationship level of the first thread, temperature control scenario information, and a temperature of a first device is shown.
[0242] As Figure 5 shown, the method 500 includes:
[0243] S501: According to the user interaction relationship level of the first thread, providing targeted resource supply for the first thread.
[0244] The explanation of this step is the same as the explanation of S302 in the embodiment shown in Figure 3 , and for the sake of brevity, it will not be repeated here.
[0245] S502: Determine whether the condition is met: the user interaction relationship level of the first thread is lower than the third level of interaction relationship, and the application scenario corresponding to the first thread is a scene that needs temperature control. If the condition is met, execute S503; if the condition is not met, end the resource adjustment process and continue to provide targeted resource supply for the first thread according to the user interaction relationship level of the first thread.
[0246] The user interaction relationship level of the first thread being lower than the third level of interaction relationship can mean that the user relationship level of the first thread belongs to one of the fourth level of interaction relationship, the fifth level of interaction relationship, and the sixth level of interaction relationship. The explanation of the fourth level of interaction relationship, the fifth level of interaction relationship, and the sixth level of interaction relationship has been described in detail in the embodiment shown in Figure 3 , and for the sake of brevity, it will not be repeated here.
[0247] S503: Determine whether the temperature of the first device is greater than the first temperature threshold. If it is greater than the first temperature threshold, execute S504; if it is less than or equal to the first temperature threshold, end the resource adjustment process and continue to provide targeted resource supply for the first thread according to the user interaction relationship level of the first thread.
[0248] S504: Suppress the system resource supply for the first thread.
[0249] In some embodiments, suppressing the system resource supply for the first thread can mean reducing the resource supply for the first thread comprehensively, for example, it can mean reducing the CPU resource supply, DDR resource supply, GPU resource supply, file IO resource supply, network IO resource supply, etc. for the first thread.
[0250] In some embodiments, S503 is a step that is executed in a loop, in the state of suppressing the system resource supply of the first thread, the temperature of the first device is monitored in a loop, when the temperature of the first device changes to be less than or equal to the first temperature threshold, the suppression of the system resource supply of the first thread can be cancelled, and the first thread is supplied with the targeted resource according to the user interaction relationship level of the first thread; and in the state of supplying the first thread with the targeted resource according to the user interaction relationship level of the first thread, the temperature of the first device can be monitored in a loop, when the temperature of the first device changes to be greater than the first temperature threshold, the system resource supply of the first thread can be suppressed.
[0251] In the embodiments of the present application, the threads are provided with the targeted resource supply according to the user interaction relationship level of the threads, which can reduce the power consumption of the device and delay the temperature rise of the system; and when the application scenario corresponding to the thread is a scenario that needs to be temperature controlled, the temperature is monitored in real time, when the temperature is greater than the temperature threshold, the resource supply to the thread with a low user interaction relationship level is further reduced, and the resource supply to the thread with a high user interaction relationship level is not reduced, so that the temperature can be prevented from further rising without affecting the user interaction experience, and the use experience of the user is improved.
[0252] Exemplarily, Figure 6 A framework schematic diagram of a system 600 for resource supply provided by the embodiments of the present application is shown.
[0253] As Figure 6 shown, the system 600 includes an application layer, a system service layer and a kernel layer, wherein the application layer includes a thread marking module 610; the system service layer includes a resource scheduling management module 620 and a quality of service management module 630; the kernel layer includes a resource supply decision module 640 and a plurality of physical devices; the resource scheduling management module 620 can include a task state identification module 621 and a temperature control scenario identification module 622; the plurality of physical devices can include, for example, a core selection module 641, a CPU 642, a DDR 643, a GPU 644, a file IO 645 and a network IO 646; specifically:
[0254] The thread marking module 610 is configured to mark the quality of service level of the first thread of the first application, and deliver the quality of service level of the first thread to the quality of service management module 630.
[0255] The description of the quality of service level is described in detail in S301 in the embodiments shown in Figure 3 for the sake of brevity, which will not be described herein.
[0256] The resource scheduling service module 620 is configured to determine the running scene information and the temperature control scene information of the first application, and deliver the determined running scene information and the temperature control scene information of the first application to the service quality management module 630.
[0257] In some embodiments, the task state identification module 621 in the resource scheduling service module 620 is configured to determine the running scene information of the first application, and the temperature control scene identification module 622 in the resource scheduling service module 620 is configured to determine the temperature control scene information.
[0258] In some embodiments, the running scene information of the first application is used to indicate whether the running state of the first application is foreground running or background running.
[0259] In some embodiments, the temperature control scene information is used to indicate whether the application scene corresponding to the first thread is a scene requiring temperature control, wherein the scene requiring temperature control can refer to an application scene insensitive to performance, and the scene not requiring temperature control can refer to a scene sensitive to performance.
[0260] For example, the scene sensitive to performance can include a game scene, and can also include an application startup scene.
[0261] The service quality management module 630 is configured to, after receiving the service quality level of the first thread, the running scene information and the temperature control scene information of the first application, determine the user interaction relationship level of the first thread according to the service quality level of the first thread and the running scene information of the first application, and deliver the determined user interaction relationship level of the first thread and the temperature control scene information to the resource supply decision module 640.
[0262] In some embodiments, the service quality management module 630 includes a QoS marking management module, a state management module and a shell temperature management module, wherein the QoS marking management module is configured to receive and aggregate the service quality level of the thread sent by the thread marking module 610, and forward the service quality level of the thread to the resource supply decision module 640; the state management module is configured to receive and aggregate the running scene information of the application sent by the resource scheduling service module 620, and forward the running scene information of the application to the resource supply decision module 640; and the shell temperature management module is configured to receive and aggregate the temperature control scene information sent by the resource scheduling service module 620, and forward the temperature control scene information to the resource supply decision module 640.
[0263] The explanation about determining the user interaction relationship of the first thread according to the service quality level of the first thread and the running scene information of the first application is the same as that of the S301 in the embodiment shown in the above table, and is not repeated here for brevity. Figure 3 The explanation of S301 in the embodiment shown in the above table is the same as that of S301 in the embodiment shown in the above table, and is not repeated here for brevity.
[0264] The resource supply decision module 640 is configured to supply resources to the first thread according to the user interaction relationship level of the first thread, the temperature control scene information, and the temperature of the first device, wherein the first application runs on the first device.
[0265] Specifically, the resource supply decision module 640 is configured to supply resources to the first thread according to the user interaction relationship level of the first thread, the temperature control scene information, and the temperature of the first device, and realize targeted resource supply to the first thread through the resource supply module.
[0266] In some embodiments, the resource supply decision module 640 first determines a first resource supply strategy for supplying resources to the first thread according to the user interaction relationship level of the first thread, that is, determines the CPU resource supply level corresponding to the first thread, the DDR resource supply level corresponding to the first thread, the GPU resource supply level corresponding to the first thread, the file IO resource supply level corresponding to the first thread, and the network IO resource supply level corresponding to the first thread; when the temperature control scene information indicates that the application scene corresponding to the first thread is a scene that does not need to be temperature controlled, the kernel directly supplies resources to the first thread according to the first resource supply strategy through the resource supply module.
[0267] In some embodiments, the resource supply decision module 640 first determines a first resource supply strategy for supplying resources to the first thread according to the user interaction relationship level of the first thread, and when the temperature control scene information indicates that the application scene corresponding to the first thread is a scene that needs to be temperature controlled, further determines whether the user interaction relationship level of the first thread belongs to one of the fourth level of interaction relationship, the fifth level of interaction relationship, and the sixth level of interaction relationship. If yes, when the temperature of the first device is greater than a first temperature threshold, the resource supply level of the first thread is suppressed on the basis of the first resource supply strategy, that is, the CPU resource supply, the GPU resource supply, the DDR resource supply, the file IO resource supply, and the network IO resource supply of the first thread are further reduced, to obtain a second resource supply strategy with a lower resource supply level. The resource supply decision module 640 supplies resources to the first thread according to the second resource supply strategy through the resource supply module.
[0268] Or can be described as: the resource supply decision module 640 first according to the user interaction relationship level of the first thread, through the resource supply module to the first thread for targeted resource supply;When the temperature control scene information indicates that the application scenario corresponding to the first thread is a scene that needs to be temperature controlled, it is further determined whether the user interaction relationship level of the first thread belongs to one of the fourth level interaction relationship, the fifth level interaction relationship and the sixth level interaction relationship, if yes, the temperature of the first device is monitored, and when the temperature of the first device is greater than the first temperature threshold, the resource supply level of the first thread is suppressed, that is, the CPU resource supply, GPU resource supply, DDR resource supply, file IO resource supply and network IO resource supply of the first thread are further reduced on the basis of the current supply level;When the temperature of the first device is less than or equal to the first temperature threshold, the resource supply level of the first thread is not suppressed, that is, the first thread is still targeted for resource supply according to the user interaction relationship level of the first thread.
[0269] Among them, the first temperature threshold may be, for example, any temperature value in the range of 40℃ to 50℃.
[0270] Among them, the resource supply decision module 640 determines the first resource supply strategy for the first thread according to the user interaction relationship level of the first thread, which can be understood as: the resource supply decision module 640 maps the first thread to a resource supply level combination according to the user interaction relationship level of the first thread, which can include the CPU resource supply level required by the first thread, the DDR resource supply level required by the first thread, the GPU resource supply level required by the first thread, the file IO resource supply level required by the first thread, and the network IO resource supply level required by the first thread.
[0271] Similarly, based on the embodiments provided in the present application, the resource supply decision module 640 can map multiple threads of the first application to multiple resource supply level combinations, wherein the multiple threads correspond one by one to the multiple resource supply level combinations.
[0272] In an implementation manner, based on the resource supply level combination corresponding to the first thread, the resource supply decision module 640 issues the resource supply level corresponding to the first thread to the driver of each physical device (for example, CPU 642, DDR 643, GPU 644, file IO 645, network IO 646, etc.), so that the CPU 642 supplies resources to the first thread according to the CPU resource supply level required by the first thread, the DDR 643 supplies resources to the first thread according to the DDR resource supply level required by the first thread, the GPU 644 supplies resources to the first thread according to the GPU resource supply level required by the first thread, the file IO 645 supplies resources to the first thread according to the file IO resource supply level required by the first thread, and the network IO 646 supplies resources to the first thread according to the network IO resource supply level required by the first thread, thereby realizing targeted resource supply for the first thread.
[0273] The kernel layer can further include a core selection module 641 configured to determine whether to use a small core or a large core of the CPU 642 to supply resources to the first thread according to the resource supply level issued by the resource supply decision module 640 to the CPU 642, for example, when the resource supply level issued by the resource supply decision module 640 to the CPU 642 is high (i.e., high CPU supply is required for the first thread), the core selection module 641 determines to use the large core of the CPU 642 to supply resources to the first thread; when the resource supply level issued by the resource supply decision module 640 to the CPU 642 is low (i.e., low CPU supply is required for the first thread), the core selection module 641 determines to use the small core of the CPU 642 to supply resources to the first thread.
[0274] It can be understood that: Figure 6 The system provided by the embodiments shown can be combined with Figure 2 The system provided by the embodiments shown can be combined with Figure 6 The system provided by the embodiments shown can be combined with Figure 2 The system provided by the embodiments shown can be combined with
[0275] In the embodiments of the present application, the threads are provided with targeted resource supply according to the user interaction relationship level of the threads, which can reduce the power consumption of the device and delay the temperature rise of the system; and when the application scenario corresponding to the thread is a scenario that needs temperature control, the temperature is monitored in real time, and when the temperature is greater than the temperature threshold, the resource supply to the thread with a low user interaction relationship level is further reduced, and the resource supply to the thread with a high user interaction relationship level is not reduced, so that the temperature is prevented from further rising without affecting the user interaction experience, thereby improving the user experience.
[0276] One or more of the modules or units described herein can be implemented in software, hardware, or a combination thereof. When any of the modules or units are implemented in software, the software is in the form of computer program instructions and is stored in a memory, and a processor can be used to execute the program instructions and implement the above method flows. The processor can include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, and the like computing devices running software, each of which can include one or more cores for executing software instructions to perform computations or processing. The processor can be built-in to a SoC (system on chip) or an application specific integrated circuit (ASIC), or can be a separate semiconductor chip. In addition to the cores for executing software instructions to perform computations or processing, the processor can further include necessary hardware accelerators, such as a field programmable gate array (FPGA), a PLD (programmable logic device), or a logic circuit implementing a specialized logic operation.
[0277] When any of the modules or units described herein are implemented in hardware, the hardware can be any one or a combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a specialized digital circuit, a hardware accelerator, or a non-integrated discrete device, which can run necessary software or be independent of software to execute the above method flows.
[0278] When the modules or units described in the specification are implemented by using software, the modules or units can be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded on a computer, the whole or part of the flow or function described in the embodiments of the present application is produced. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, solid state disk (SSD)) and the like.
[0279] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0280] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0281] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0282] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0283] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit.
[0284] The functions, if realized in the form of software functional units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing 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: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0285] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for supplying resources, characterized in that, The method includes: During the operation of the first application, the user interaction relationship level of the first thread is determined based on the service quality level of the first thread of the first application and the operation scenario information of the first application. The operation scenario information of the first application is used to indicate that the first application is in the foreground running state, or the operation scenario information of the first application is used to indicate that the first application is in the background running state. Resource allocation is provided to the first thread based on the user interaction relationship level of the first thread; The user interaction relationship level of the first thread is one of the following: first-level interaction relationship, second-level interaction relationship, third-level interaction relationship, fourth-level interaction relationship, fifth-level interaction relationship, and sixth-level interaction relationship, wherein the interaction relationship level corresponding to the first-level interaction relationship, the second-level interaction relationship, the third-level interaction relationship, the fourth-level interaction relationship, the fifth-level interaction relationship, and the sixth-level interaction relationship decreases sequentially. The step of allocating resources to the first thread based on the user interaction relationship level of the first thread includes: When the user interaction relationship level of the first thread is the fourth level of interaction relationship, resources are supplied to the first thread according to the first resource supply level. When the user interaction relationship level of the first thread is the first level interaction relationship, the CPU resource supply, DDR resource supply, GPU resource supply and I / O resource supply of the first thread are increased on the basis of the first resource supply level. When the user interaction relationship level of the first thread is the second level interaction relationship, the CPU resource supply to the first thread is increased based on the first resource supply level. When the user interaction relationship level of the first thread is the third level of interaction relationship, the DDR resource supply to the first thread is increased based on the first resource supply level. When the user interaction level of the first thread is the fifth level, the CPU resource supply, DDR resource supply, and GPU resource supply to the first thread are reduced based on the first resource supply level; or When the user interaction relationship level of the first thread is the sixth level, the CPU resource supply, DDR resource supply, GPU resource supply and IO resource supply to the first thread are reduced based on the first resource supply level.
2. The method according to claim 1, characterized in that, The increase in CPU resource allocation to the first thread includes: Reduce the target duty cycle of the first thread and / or adjust the proportional, integral, and derivative parameters for the frequency modulator frequency calculation; The reduction of CPU resource allocation to the first thread includes: Increase the target duty cycle of the first thread and / or adjust the proportional, integral, and derivative parameters for calculating the frequency point of the frequency modulator; The improvement of DDR resource supply to the first thread includes: Lower the DDR frequency threshold of the first thread and / or increase the DDR frequency. The reduction of DDR resource supply to the first thread includes: Increase the DDR frequency modulation threshold of the first thread and / or decrease the DDR frequency point; The improvement of GPU resource allocation to the first thread includes: Increase the number of available GPU units and / or increase the priority of the first thread in using the available GPU units; The reduction of GPU resource allocation to the first thread includes: Reduce the number of available GPU units and / or lower the priority of the first thread using the available GPU units; The improvement of I / O resource supply to the first thread includes: Increase the priority of the first thread in acquiring I / O resources; or The reduction of IO resource supply to the first thread includes: Reduce the priority of the first thread in acquiring I / O resources.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Based on the user interaction relationship level of the first thread, the temperature control scenario information, and the temperature of the first device, the resource supply of the first thread is adjusted. The temperature control scenario information is used to indicate that the application scenario corresponding to the first thread is a scenario that requires temperature control, or the temperature control scenario information is used to indicate that the application scenario corresponding to the first thread is a scenario that does not require temperature control. The first application runs on the first device.
4. The method according to claim 3, characterized in that, The step of adjusting resource allocation for the first thread based on the user interaction level, temperature control scenario information, and the temperature of the first device includes: When the user interaction relationship level of the first thread belongs to one of the fourth-level interaction relationship, the fifth-level interaction relationship, or the sixth-level interaction relationship, and the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that requires temperature control, the resource supply to the first thread is reduced.
5. The method according to claim 4, characterized in that, The reduction of resource allocation to the first thread includes: Determine whether the temperature of the first device is greater than a first temperature threshold. When the temperature of the first device exceeds the first temperature threshold, the resource supply to the first thread is reduced.
6. An electronic device, characterized in that, The electronic device includes: One or more processors; One or more memory units; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the following operations: During the operation of the first application, the user interaction relationship level of the first thread is determined based on the service quality level of the first thread of the first application and the operation scenario information of the first application. The operation scenario information of the first application is used to indicate that the first application is in the foreground running state, or the operation scenario information of the first application is used to indicate that the first application is in the background running state. Resource allocation is provided to the first thread based on the user interaction relationship level of the first thread; The user interaction relationship level of the first thread is one of the following: first-level interaction relationship, second-level interaction relationship, third-level interaction relationship, fourth-level interaction relationship, fifth-level interaction relationship, and sixth-level interaction relationship, wherein the interaction relationship level corresponding to the first-level interaction relationship, the second-level interaction relationship, the third-level interaction relationship, the fourth-level interaction relationship, the fifth-level interaction relationship, and the sixth-level interaction relationship decreases sequentially. Specifically, the electronic device is used for: When the user interaction relationship level of the first thread is the fourth level of interaction relationship, resources are supplied to the first thread according to the first resource supply level. When the user interaction relationship level of the first thread is the first level interaction relationship, the CPU resource supply, DDR resource supply, GPU resource supply and I / O resource supply of the first thread are increased on the basis of the first resource supply level. When the user interaction relationship level of the first thread is the second level interaction relationship, the CPU resource supply to the first thread is increased based on the first resource supply level. When the user interaction relationship level of the first thread is the third level of interaction relationship, the DDR resource supply to the first thread is increased based on the first resource supply level. When the user interaction level of the first thread is the fifth level, the CPU resource supply, DDR resource supply, and GPU resource supply to the first thread are reduced based on the first resource supply level; or When the user interaction relationship level of the first thread is the sixth level, the CPU resource supply, DDR resource supply, GPU resource supply and IO resource supply to the first thread are reduced based on the first resource supply level.
7. The electronic device according to claim 6, characterized in that, The increase in CPU resource allocation to the first thread includes: Reduce the target duty cycle of the first thread and / or adjust the proportional, integral, and derivative parameters for the frequency modulator frequency calculation; The reduction of CPU resource allocation to the first thread includes: Increase the target duty cycle of the first thread and / or adjust the proportional, integral, and derivative parameters for calculating the frequency point of the frequency modulator; The improvement of DDR resource supply to the first thread includes: Lower the DDR frequency threshold of the first thread and / or increase the DDR frequency. The reduction of DDR resource supply to the first thread includes: Increase the DDR frequency modulation threshold of the first thread and / or decrease the DDR frequency point; The improvement of GPU resource allocation to the first thread includes: Increase the number of available GPU units and / or increase the priority of the first thread in using the available GPU units; The reduction of GPU resource allocation to the first thread includes: Reduce the number of available GPU units and / or lower the priority of the first thread using the available GPU units; The improvement of I / O resource supply to the first thread includes: Increase the priority of the first thread in acquiring I / O resources; or The reduction of IO resource supply to the first thread includes: Reduce the priority of the first thread in acquiring I / O resources.
8. The electronic device according to claim 6 or 7, characterized in that, The electronic device is also used for: Based on the user interaction relationship level of the first thread, the temperature control scenario information, and the temperature of the first device, the resource supply of the first thread is adjusted. The temperature control scenario information is used to indicate that the application scenario corresponding to the first thread is a scenario that requires temperature control, or the temperature control scenario information is used to indicate that the application scenario corresponding to the first thread is a scenario that does not require temperature control. The first application runs on the first device.
9. The electronic device according to claim 8, characterized in that, The electronic device is specifically used for: When the user interaction relationship level of the first thread belongs to one of the fourth-level interaction relationship, the fifth-level interaction relationship, or the sixth-level interaction relationship, and the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that requires temperature control, the resource supply to the first thread is reduced.
10. The electronic device according to claim 9, characterized in that, The electronic device is specifically used for: Determine whether the temperature of the first device is greater than a first temperature threshold. When the temperature of the first device exceeds the first temperature threshold, the resource supply to the first thread is reduced.
11. An electronic device, characterized in that, include: One or more processors; One or more memory units; And one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, The storage medium stores a program or instructions that, when executed, implement the method as described in any one of claims 1 to 5.
13. A chip, characterized in that, The chip stores instructions that, when executed, implement the method as described in any one of claims 1 to 5.
14. A computer program product, characterized in that, The computer program product stores a program or instructions that, when executed, implement the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Resource allocation method, mobile terminal and computer readable storage medium
CN107402813A
Resource scheduling method and electronic equipment
CN112527476A