Resource supply method and electronic equipment
By identifying the differences in the user interaction relationship levels of threads and providing targeted resources, the heating problem of terminal devices under high load is solved, and the power consumption of the entire device is optimized and the user experience is improved.
Patent Information
- Application Number
- CN202410708142.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-05-31
AI Technical Summary
In the operating system of the terminal device, all threads are supplied with equal resources, resulting in heat generation exceeding 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 supply is provided based on the level difference, optimizing the power consumption of the entire machine and delaying temperature rise.
Rationally allocate system resources, optimize overall machine power consumption, slow down system temperature rise, and improve user experience.
Smart Images

Figure CN120670132A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of resource provisioning, and more specifically, to a resource provisioning method and electronic device. Background Art
[0002] Currently, in terminal device operating systems, when an application is running, all threads in the application process are provided with equal resources. Consequently, when the entire device is heavily loaded, the various physical components of the terminal device must operate at higher frequencies to meet the resource requirements of all tasks. This causes the heat generated by these components to far exceed the terminal device's heat dissipation capacity, causing the terminal device to rapidly heat up, impacting the user experience. Summary of the Invention
[0003] The present application provides a resource supply method and electronic device. Through this method and electronic device, during the application running process, the user interaction relationship level of each thread in the multiple threads in the application process can be identified, and targeted resource supply is performed for each thread according to the user interaction relationship level of each thread. This can reasonably allocate system resources, optimize the power consumption of the entire machine, and delay the temperature rise of the system.
[0004] In a first aspect, a method for resource provision is provided, the method comprising: during the running process of a first application, determining the user interaction relationship level of the first thread based on the service quality level of the first thread of the first application and the 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 providing resources to the first thread based on the user interaction relationship level of the first thread.
[0005] Among them, the user interaction relationship level can also be replaced by any one of the following nouns: user interaction level, user interaction intensity, user experience correlation coefficient, user experience correlation level, user experience correlation intensity, user experience correlation, and can also be simply referred to as interaction level, interaction intensity, etc.
[0006] The user interaction relationship level of a thread is used to indicate the degree of impact of the thread on the user experience, or is described as indicating the degree of relevance between a first thread and 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 significant impact on the user experience, so the frame drawing thread has a high user interaction relationship level. For another example, for a background download thread, the download speed is irrelevant from the user experience perspective, so the background download thread has a low user interaction relationship level. 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 descending order.
[0007] It can also be described as:
[0008] The user experience correlation coefficient corresponding to the first-level interaction relationship, the user experience correlation coefficient corresponding to the second-level interaction relationship, the user experience correlation coefficient corresponding to the third-level interaction relationship, the user experience correlation coefficient corresponding to the fourth-level interaction relationship, the user experience correlation coefficient corresponding to the fifth-level interaction relationship, and the user experience correlation coefficient corresponding to the sixth-level interaction relationship decrease in sequence.
[0009] In some embodiments, the first level of interaction corresponds to threads with user interaction, such as: the frame drawing thread running in the foreground; the second level of interaction corresponds to critical threads that are as fast as possible, such as: the page loading thread running in the foreground; the third level of interaction corresponds to threads triggered by the user and whose progress is visible, such as: the thread for opening a document; the fifth level of interaction corresponds to threads that do not require immediate response, such as background download threads; the sixth level of interaction corresponds to threads that are invisible to the user, such as: data synchronization, data backup; the fourth level of interaction corresponds to threads whose interaction level is between the third level and the fifth level, such as the system default interaction level.
[0010] In an embodiment of the present application, during the application running process, the user interaction relationship level of each thread in the multiple threads in the application process can be identified, and targeted resources can be supplied to each thread according to the user interaction relationship level of each thread. This can reasonably allocate system resources, optimize the power consumption of the entire machine, and delay the temperature rise of the system.
[0011] In combination with the first aspect, in a possible implementation, resources are supplied to the first thread according to the user interaction relationship level of the first thread, including: when the user interaction relationship level of the first thread is the fourth level interaction relationship, resources are supplied to the first thread according to the first resource supply level; or when the user interaction relationship level of the first thread is the first level interaction relationship, on the basis of the first resource supply level, 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 and output IO resource supply of the first thread are increased; or when the user interaction relationship level of the first thread is the second level interaction relationship, on the basis of the first resource supply level, the user interaction relationship level of the first thread is increased. When the user interaction relationship level of the first thread is the third level interaction relationship, based on the first resource supply level, the CPU resource supply to the first thread is increased; or when the user interaction relationship level of the first thread is the fifth level interaction relationship, based on the first resource supply level, the CPU resource supply, DDR resource supply and GPU resource supply to the first thread are reduced; or when the user interaction relationship level of the first thread is the sixth level interaction relationship, based on the first resource supply level, the CPU resource supply, DDR resource supply, GPU resource supply and IO resource supply to the first thread are reduced.
[0012] The first resource supply level may be a system default resource supply level, that is, a resource supply level at which the system adopts a default / general resource supply policy to supply resources to threads.
[0013] In some embodiments, the CPU resource supply to the first thread may be increased by reducing the target duty cycle of the first thread and / or adjusting the PID parameters of the frequency modulator calculation. Specifically:
[0014] After reducing the target duty cycle of the first thread, the frequency modulator will provide a higher frequency point to achieve a smaller duty cycle.
[0015] Adjust the PID parameters used in the frequency calculation of the frequency regulator so that tasks at low frequencies are more sensitive to load fluctuations and can be easily increased in frequency; at high frequencies, tasks are less sensitive to load fluctuations and can be maintained at a relatively high frequency point. PID is the abbreviation for proportional, integral, and derivative.
[0016] In some embodiments, the CPU resource supply to the first thread may be reduced by increasing the target duty cycle of the first thread and / or adjusting the PID parameters of the frequency calculation of the frequency modulator. Specifically:
[0017] After increasing the target duty cycle of the first thread, the frequency modulator will provide a lower frequency point to achieve a larger duty cycle.
[0018] Adjust the PID parameters of the frequency point calculation of the frequency regulator so that the task is less sensitive to load fluctuations at low frequencies and is not easy to increase the frequency; the task is more sensitive to load reduction at high frequencies and is not easy to maintain at the high frequency point.
[0019] In some embodiments, the method of increasing the DDR resource supply to the first thread may be to reduce the DDR frequency modulation threshold of the first thread and / or increase the DDR frequency. Specifically:
[0020] Lower the DDR frequency threshold of the first thread so that the task can be adjusted to a higher DDR frequency when the DDR demand is relatively high.
[0021] You can also multiply the original DDR factor frequency by a higher coefficient to amplify the DDR frequency.
[0022] In some embodiments, the DDR resource supply to the first thread may be reduced by increasing the DDR frequency modulation threshold of the first thread and / or reducing the DDR frequency. Specifically:
[0023] Increase the DDR frequency threshold of the first thread so that tasks can only be adjusted to a higher DDR frequency when the DDR demand is very high.
[0024] You can also multiply the original DDR factor frequency by a lower coefficient to suppress the DDR frequency.
[0025] In some embodiments, the GPU resource supply to the first thread may be increased by increasing the number of available GPU units and / or increasing the priority of the first thread in using the available GPU units. Specifically:
[0026] Allocate more available GPU units for GPU computing tasks submitted by the task.
[0027] The priority of computing tasks can also be increased so that computing tasks can obtain a large number of GPU units for computing earlier.
[0028] In some embodiments, reducing the GPU resource supply to the first thread may be done by reducing the number of available GPU units and / or lowering the priority of the first thread in using the available GPU units. Specifically:
[0029] Allocate fewer available GPU units for GPU computing tasks submitted by the task.
[0030] You can also lower the priority of the computing task so that the computing task has to wait until other high-priority GPU tasks are completed before it can obtain some GPU units for calculation.
[0031] In some embodiments, the method of improving the IO resource supply to the first thread may be to increase the priority of the first thread in obtaining the IO resource, specifically:
[0032] Assigning a higher bus access priority to the task allows the task to obtain IO bandwidth resources more quickly for IO read and write operations.
[0033] In some embodiments, the method of reducing the IO resource supply to the first thread may be to lower the priority of the first thread in obtaining the IO resource, specifically:
[0034] Assign a lower bus access priority to the task so that the task can only obtain IO bandwidth resources for IO read and write operations after other high-priority bus bandwidth tasks complete IO read and write operations.
[0035] In an embodiment of the present application, during the application running process, the user interaction relationship level of each thread in the multiple threads in the application process can be identified, and targeted resources can be supplied to each thread according to the user interaction relationship level of each thread. This can reasonably allocate system resources, optimize the power consumption of the entire machine, and delay the temperature rise of the system.
[0036] In combination with the first aspect, in a possible implementation, the method also includes: adjusting the resource supply of 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 temperature control scene information is used to indicate that the application scenario corresponding to the first thread is a scene that requires temperature control, or the temperature control scene information is used to indicate that the application scenario corresponding to the first thread is a scene that does not require temperature control, and the first application runs on the first device.
[0037] In some embodiments, resources may be supplied to the first thread directly based on the user interaction relationship of the first thread, the temperature control scenario information, and the temperature of the first device.
[0038] In combination with the first aspect, in one possible implementation method, the resource supply of the first thread is adjusted according to the user interaction relationship level of the first thread, the temperature control scenario information and the temperature of the first device, including: when the interaction relationship level of the user interaction relationship level of the first thread is less than the first level threshold, and the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scene requiring temperature control, determining whether the temperature of the first device is greater than the first temperature threshold; when the temperature of the first device is greater than the first temperature threshold, reducing the resource supply to the first thread.
[0039] In an embodiment of the present application, when the application scenario corresponding to the thread is a scenario that requires temperature control, 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 will not be reduced. In this way, the temperature can be prevented from rising further without affecting the user interaction experience, thereby improving the user interaction experience.
[0040] In combination with the first aspect, in one possible implementation method, the resource supply of the first thread is adjusted according to the user interaction relationship level of the first thread, the temperature control scenario information and the temperature of the first device, including: when 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, and the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario requiring temperature control, reducing the resource supply to the first thread.
[0041] In combination with the first aspect, in one possible implementation, reducing the resource supply to the first thread includes: determining whether the temperature of the first device is greater than a first temperature threshold; when the temperature of the first device is greater than the first temperature threshold, reducing the resource supply to the first thread.
[0042] In an embodiment of the present application, when the application scenario corresponding to the thread is a scenario that requires temperature control, 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. In this way, the temperature can be prevented from rising further without affecting the user interaction experience, thereby improving the user interaction experience.
[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, wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions, which, when executed by the one or more processors, enable the electronic device to perform the following operations: during the running of a first application, determine the user interaction relationship level of the first thread of the first application based on the service quality level of the first thread and the running scenario information of the first application, the running scenario information of the first application is used to indicate that the first application is in the foreground running state, or the running scenario information of the first application is used to indicate that the first application is in the background running state; and supply resources to the first thread based on the user interaction relationship level of the first thread.
[0044] Among them, the user interaction relationship level can also be replaced by any one of the following nouns: user interaction level, user interaction intensity, user experience correlation coefficient, user experience correlation level, user experience correlation intensity, user experience correlation, and can also be simply referred to as interaction level, interaction intensity, etc.
[0045] The user interaction relationship level of a thread is used to indicate the degree of influence of the thread on the user experience, or is described as indicating the degree of relevance between a first thread and the user experience. For example, the running performance of a frame drawing thread directly affects the display speed and quality of the interface displayed to the user, and thus has a significant impact on the user experience. Therefore, the user interaction relationship level of the frame drawing thread is high. For another example, the download speed of a background download thread is not important from the user experience perspective. Therefore, the user interaction relationship level of the background download thread is low.
[0046] In some embodiments, the user interaction relationship level of the first thread is one 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, 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 sequence.
[0047] It can also be described as:
[0048] The user experience correlation coefficient corresponding to the first-level interaction relationship, the user experience correlation coefficient corresponding to the second-level interaction relationship, the user experience correlation coefficient corresponding to the third-level interaction relationship, the user experience correlation coefficient corresponding to the fourth-level interaction relationship, the user experience correlation coefficient corresponding to the fifth-level interaction relationship, and the user experience correlation coefficient corresponding to the sixth-level interaction relationship decrease in sequence.
[0049] In some embodiments, the first level of interaction corresponds to threads with user interaction, such as: the frame drawing thread running in the foreground; the second level of interaction corresponds to critical threads that are as fast as possible, such as: the page loading thread running in the foreground; the third level of interaction corresponds to threads triggered by the user and whose progress is visible, such as: the thread for opening a document; the fifth level of interaction corresponds to threads that do not require immediate response, such as background download threads; the sixth level of interaction corresponds to threads that are invisible to the user, such as: data synchronization, data backup; the fourth level of interaction corresponds to threads whose interaction level is between the third level and the fifth level, such as the system default interaction level.
[0050] In an embodiment of the present application, during the application running process, the user interaction relationship level of each thread in the multiple threads in the application process can be identified, and targeted resources can be supplied to each thread according to the user interaction relationship level of each thread. This can reasonably allocate system resources, optimize the power consumption of the entire machine, and delay the temperature rise of the system.
[0051] In combination with the second aspect, in a possible implementation, the electronic device is specifically used to: when the user interaction relationship level of the first thread is the fourth level interaction relationship, provide resources to the first thread according to the first resource supply level; or when the user interaction relationship level of the first thread is the first level interaction relationship, on the basis of the first resource supply level, improve 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 and output IO resource supply to the first thread; or when the user interaction relationship level of the first thread is the second level interaction relationship, on the basis of the first resource supply level, provide Increase the CPU resource supply to the first thread; or when the user interaction relationship level of the first thread is the third level interaction relationship, 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 interaction relationship, reduce the CPU resource supply, DDR resource supply and 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 interaction relationship, reduce the CPU resource supply, DDR resource supply, GPU resource supply and IO resource supply to the first thread on the basis of the first resource supply level.
[0052] The first resource supply level may be a system default resource supply level, that is, a resource supply level at which the system adopts a default / general resource supply policy to supply resources to threads.
[0053] In some embodiments, the CPU resource supply to the first thread may be increased by reducing the target duty cycle of the first thread and / or adjusting the PID parameters of the frequency modulator calculation. Specifically:
[0054] After reducing the target duty cycle of the first thread, the frequency modulator will provide a higher frequency point to achieve a smaller duty cycle.
[0055] Adjust the PID parameters of the frequency point calculation of the frequency regulator so that the task at low frequency is more sensitive to load fluctuations and easier to increase the frequency; at high frequency, the task is less sensitive to load fluctuations and can be maintained at a relatively high frequency point.
[0056] In some embodiments, the CPU resource supply to the first thread may be reduced by increasing the target duty cycle of the first thread and / or adjusting the PID parameters of the frequency calculation of the frequency modulator. Specifically:
[0057] After increasing the target duty cycle of the first thread, the frequency modulator will provide a lower frequency point to achieve a larger duty cycle.
[0058] Adjust the PID parameters of the frequency point calculation of the frequency regulator so that the task is less sensitive to load fluctuations at low frequencies and is not easy to increase the frequency; the task is more sensitive to load reduction at high frequencies and is not easy to maintain at the high frequency point.
[0059] In some embodiments, the method of increasing the DDR resource supply to the first thread may be to reduce the DDR frequency modulation threshold of the first thread and / or increase the DDR frequency. Specifically:
[0060] Lower the DDR frequency threshold of the first thread so that the task can be adjusted to a higher DDR frequency when the DDR demand is relatively high.
[0061] You can also multiply the original DDR factor frequency by a higher coefficient to amplify the DDR frequency.
[0062] In some embodiments, the DDR resource supply to the first thread may be reduced by increasing the DDR frequency modulation threshold of the first thread and / or reducing the DDR frequency. Specifically:
[0063] Increase the DDR frequency threshold of the first thread so that tasks can only be adjusted to a higher DDR frequency when the DDR demand is very high.
[0064] You can also multiply the original DDR factor frequency by a lower coefficient to suppress the DDR frequency.
[0065] In some embodiments, the GPU resource supply to the first thread may be increased by increasing the number of available GPU units and / or increasing the priority of the first thread in using the available GPU units. Specifically:
[0066] Allocate more available GPU units for GPU computing tasks submitted by the task.
[0067] The priority of computing tasks can also be increased so that computing tasks can obtain a large number of GPU units for computing earlier.
[0068] In some embodiments, reducing the GPU resource supply to the first thread may be done by reducing the number of available GPU units and / or lowering the priority of the first thread in using the available GPU units. Specifically:
[0069] Allocate fewer available GPU units for GPU computing tasks submitted by the task.
[0070] You can also lower the priority of the computing task so that the computing task has to wait until other high-priority GPU tasks are completed before it can obtain some GPU units for calculation.
[0071] In some embodiments, the method of improving the IO resource supply to the first thread may be to increase the priority of the first thread in obtaining the IO resource, specifically:
[0072] Assigning a higher bus access priority to the task allows the task to obtain IO bandwidth resources more quickly for IO read and write operations.
[0073] In some embodiments, the method of reducing the IO resource supply to the first thread may be to lower the priority of the first thread in obtaining the IO resource, specifically:
[0074] Assign a lower bus access priority to the task so that the task can only obtain IO bandwidth resources for IO read and write operations after other high-priority bus bandwidth tasks complete IO read and write operations.
[0075] In an embodiment of the present application, during the application running process, the user interaction relationship level of each thread in the multiple threads in the application process can be identified, and targeted resources can be supplied to each thread according to the user interaction relationship level of each thread. This can reasonably allocate system resources, optimize the power consumption of the entire machine, and delay the temperature rise of the system.
[0076] In combination with the first aspect, in one possible implementation, the electronic device is further used to: adjust the resource supply of 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 temperature control scene information is used to indicate that the application scenario corresponding to the first thread is a scene that requires temperature control, or the temperature control scene information is used to indicate that the application scenario corresponding to the first thread is a scene that does not require temperature control, and the first application runs on the first device.
[0077] In some embodiments, the electronic device may directly provide resources to the first thread based on the user interaction relationship level of the first thread, the temperature control scenario information, and the temperature of the first device.
[0078] In combination with the first aspect, in a possible implementation method, the electronic device is specifically used to: when the interaction relationship level of the user interaction relationship level of the first thread is less than the 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 the first temperature threshold; when the temperature of the first device is greater than the first temperature threshold, reduce the resource supply to the first thread.
[0079] In an embodiment of the present application, when the application scenario corresponding to the thread is a scenario that requires temperature control, 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 will not be reduced. In this way, the temperature can be prevented from rising further without affecting the user interaction experience, thereby improving the user interaction experience.
[0080] In combination with the first aspect, in one possible implementation method, the electronic device is specifically used to: when 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, and the temperature control scene information indicates that the application scenario corresponding to the first thread is a scene requiring temperature control, reduce the resource supply to the first thread.
[0081] In combination with the first aspect, in a possible implementation, the electronic device is specifically used to: determine whether the temperature of the first device is greater than a first temperature threshold; when the temperature of the first device is greater than the first temperature threshold, reduce the resource supply to the first thread.
[0082] In an embodiment of the present application, when the application scenario corresponding to the thread is a scenario that requires temperature control, 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. In this way, the temperature can be prevented from rising further without affecting the user interaction experience, thereby improving the user interaction experience.
[0083] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer program code, and the processor is used to execute the computer program code stored in the memory to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0084] In a fourth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method in the above-mentioned first aspect or any possible implementation of the first aspect is implemented.
[0085] In a fifth aspect, a chip is provided, in which instructions are stored. When the chip is run on a device, the chip executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0086] In a sixth aspect, a computer program product is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method in the above-mentioned first aspect or any possible implementation of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 is a structural diagram of an electronic device provided in an embodiment of the present application;
[0088] Figure 2 This is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0089] Figure 3 This is a schematic flow chart of a resource provisioning method provided in an embodiment of the present application;
[0090] Figure 4 This is a schematic flow chart of another resource provisioning method provided in an embodiment of the present application;
[0091] Figure 5 This is a schematic flowchart of a method for providing resources to a thread based on the thread's user interaction relationship level, temperature control scenario information, and temperature, provided in an embodiment of the present application;
[0092] Figure 6 This is a schematic diagram of a framework of a system for resource provision provided in an embodiment of the present application. DETAILED DESCRIPTION
[0093] The technical solutions of this application will be described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, rather than all the embodiments.
[0094] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" or "multiple" refers to two or more than two.
[0095] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0096] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of this application and the appended claims, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0097] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "one embodiment," "some embodiments," "another embodiment," and "other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically stated. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically stated.
[0098] The method provided in the embodiments of the present application can be applied to electronic devices with a time display function or a time recognition function, for example, mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices and other electronic devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0099] For example, Figure 1: The figure shows a schematic structural diagram of an electronic device 100. The electronic device 100 may 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air 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 should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0101] The processor 110 may include one or more processing units. For example, the processor 110 may 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). The different processing units may be independent devices or integrated into one or more processors.
[0102] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0103] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0104] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0105] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0106] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0107] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0108] The power management module 141 is used 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, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set 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.
[0110] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0111] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may 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 from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0112] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0113] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating 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 sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0114] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may 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. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0115] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0116] Display screen 194 is used to display images, videos, and the like. 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 flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0117] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0118] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0119] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the 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, and then passes the electrical signal to the ISP for conversion 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 other format. In some embodiments, the electronic device 100 may include 1 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 processing 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.
[0121] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0122] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[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 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on 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 functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an App required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0125] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0126] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0127] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0128] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0129] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to 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, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0130] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0131] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0132] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0133] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0134] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. 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 memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an embedded SIM (eSIM) 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), and the like.
[0136] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0137] Figure 2This is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with 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: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.
[0138] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0139] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0140] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0141] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0142] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0143] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0144] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0145] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0146] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0147] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
[0148] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0149] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0150] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).
[0151] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0152] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0153] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0154] A 2D graphics engine is a drawing engine for 2D drawings.
[0155] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0156] It should be understood that the technical solutions in the embodiments of the present application can be used in Android, IOS, Hongmeng and other systems.
[0157] The technical solutions of the embodiments of the present application can be applied to resource provisioning scenarios during the running of applications on electronic devices.
[0158] Among them, the electronic device can be a television, a desktop computer, a laptop computer, or a portable electronic device such as a mobile phone, a folding screen, a tablet computer, a camera, a video camera, a video recorder, or a smart home device such as a refrigerator, a washing machine, a sweeper, or any other electronic device that can run an application program, or an electronic device in a 5G network or an electronic device in a future evolved public land mobile network (PLMN), etc.
[0159] With current resource provisioning methods, the operating system of a terminal device treats all threads in the application process equally when the application is running. This means that when the entire device is heavily loaded, the various physical components of the terminal device must operate at higher frequencies to meet the resource requirements of all tasks. This causes the heat generated by these components to far exceed the device's heat dissipation capacity, causing the device's temperature to rise rapidly, impacting the user experience.
[0160] To achieve temperature control of the operating system, some resource supply solutions provide high supply to all threads in non-temperature-controlled scenarios, resulting in high system power consumption and rapid temperature rise. In temperature-controlled scenarios, the frequency of all threads is suppressed, which prevents some critical threads with high resource requirements from completing on time, potentially affecting the user's interactive experience.
[0161] When an application is running, the user interaction levels of each thread within the application process vary. Threads with different user interaction levels have different resource requirements. For example, frame drawing threads have high user interaction levels and may have high requirements for the device's CPU and double data rate synchronous dynamic random access memory (DDR) resources, but low requirements for input / output (IO) resources. Network download threads have average user interaction levels and low CPU requirements, but high requirements for DDR, IO, and other resources. Some background processing threads have low user interaction levels and low resource requirements. Furthermore, when a thread switches between the foreground and background, its resource requirements also change. For example, frame drawing threads' requirements for CPU and DDR resources decrease when the application moves to the background.
[0162] In the existing resource supply method, each thread in the application process is uniformly supplied with high resources or uniformly supplied with low resources. The user interaction relationship level of the thread cannot be perceived. The user interaction relationship level of each thread is not taken into consideration when supplying resources, and the resource supply of threads with low user interaction relationship levels cannot be restricted in advance to slow down the temperature rise of the system. Moreover, in the existing resource supply method, when the temperature reaches the point where frequency limiting is required, the kernel directly restricts the resource supply of all threads, so that some threads with high user interaction relationship levels cannot be completed on time, affecting the user's interactive experience.
[0163] In view of this, an embodiment of the present application provides a method and electronic device for resource supply, in which, during the application running process, the user interaction relationship level of each thread in the application process can be identified, and targeted resource supply can be provided to each thread according to the user interaction relationship level of each thread. For example, lower resource supply can be provided to threads with low user interaction relationship level, and higher resource supply can be provided to threads with high user relationship level, so as to reasonably allocate system resources, optimize the power consumption of the whole machine, and achieve the effect of delaying the temperature rise of the system.
[0164] Moreover, through this method, temperature control scenarios can be identified. When in a temperature control scenario, when the temperature is higher than the temperature threshold, the resource supply of threads with low user interaction relationship levels can be suppressed, while the resource supply of threads with high user interaction relationship levels cannot be suppressed. This can prevent the system temperature from rising further without affecting the user's interactive experience.
[0165] For example, Figure 3 FIG. 4 is a schematic flow chart of a resource provision method 400 provided in an embodiment of the present application. Figure 3 As shown, the method 300 includes:
[0166] S301: Determine a user interaction relationship level of a first thread of a first application according to a quality of service (QoS) level of the first thread and running scenario information of the first application, and transmit the user interaction relationship level of the first thread to a kernel.
[0167] Among them, the user interaction relationship level can also be replaced by any one of the following nouns: user interaction level, user interaction intensity, user experience correlation coefficient, user experience correlation level, user experience correlation intensity, user experience correlation, and can also be simply referred to as interaction level, interaction intensity, etc.
[0168] The user interaction relationship level of a first thread is used to indicate the degree of impact of the first thread on the user experience, or is described as indicating the degree of relevance between the first thread and the user experience. For example, the running performance of a frame drawing thread directly affects the display speed and quality of the interface displayed to the user, and thus has a significant impact on the user experience. Therefore, the user interaction relationship level of the frame drawing thread is high. For another example, the download speed of a background download thread is not important from the user experience perspective. Therefore, the user interaction relationship level of the background download thread is low.
[0169] Quality of Service (QoS) aims to provide end-to-end quality of service (QoS) for each service, tailored to the varying needs of various processes. QoS allows for unequal competition for network resources among different processes. For example, voice, video, and critical data applications can receive priority service within network devices. QoS can assign a specific level of transmission priority to a particular data flow, indicating its relative importance.
[0170] In some embodiments, the QoS level of the first thread may be determined by the application according to a priority field in a message corresponding to the first thread.
[0171] In some embodiments, the QoS level of a thread can be divided into six levels, namely level 0, level 1, level 2, level 3, level 4, and level 5, where the higher the value, the more important the thread.
[0172] In some embodiments, the running scenario information of the first application is used to indicate whether the running status of the first application is foreground running or background running.
[0173] In some embodiments, the user interaction relationship levels of the threads may 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] Among them, 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 sequence. 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] Or it can be described as: 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 sequence.
[0176] In some embodiments:
[0177] The first level of interaction corresponds to the user interactive thread, for example, the frame drawing thread running in the foreground.
[0178] The second level of interaction corresponds to the critical thread (deadline request) that is as fast as possible, for example: the page loading thread running in the foreground;
[0179] The third level of interaction corresponds to user-initiated threads with visible progress, such as opening a document thread.
[0180] The fifth level of interaction corresponds to threads (utilities) that do not require immediate responses, such as background download threads;
[0181] The sixth level of interaction corresponds to threads that are invisible to the user (background), such as data synchronization and data backup.
[0182] The fourth-level interaction relationship corresponds to a thread whose interaction relationship level is between the third-level interaction relationship and the fifth-level interaction relationship (default).
[0183] Table 1 below shows, by way of example, a user interaction relationship level mapping table of a thread provided by an embodiment of the present application.
[0184] Table 1
[0185]
[0186] The user interface thread (UI) is a thread dedicated to handling user interface-related tasks. It is responsible for receiving and responding to messages from the operating system or the user, such as interface messages and mouse and keyboard messages. The UI thread, also known as the main thread, is created by the system when an application starts and is used to distribute events, including drawing events, to UI components.
[0187] Welink refers to Huawei Cloud Welink. Huawei Cloud Welink originates from Huawei's global digital office practice and is a full-scenario remote intelligent digital collaborative office platform.
[0188] As can be seen from Table 1, the user interaction relationship level of a thread can be determined according to the QoS level of the thread and the running scenario information of the application.
[0189] S302: Providing resources to the first thread according to the user interaction relationship level of the first thread.
[0190] Among them, the resource supply level for the thread is determined according to the user interaction relationship level. When the user interaction relationship level of the thread is the first level interaction relationship, the resource supply level for the thread is the highest, and when the user interaction relationship level of the thread is the sixth level interaction relationship, the resource supply level for the thread is the lowest.
[0191] In some embodiments:
[0192] When the user interaction relationship level of the first thread is the first level, the first thread is provided with comprehensive and high-supply resources. That is, on the basis of the default resource supply, the CPU resource supply, GPU resource supply, DDR resource supply, I / O resource supply, etc. of the first thread are increased. When the user interaction relationship level of the first thread is the second level, the first thread is provided with high-supply CPU resources. That is, on the basis of the 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 interaction relationship, a high supply of DDR resources is provided to the first thread, that is, the DDR resource supply to the first thread is increased on the basis of the default resource supply.
[0194] When the user interaction relationship level of the first thread is the fourth level interaction relationship, default resource supply is provided to the first thread.
[0195] When the user interaction relationship level of the first thread is the fifth level interaction relationship, the supply of resources other than the IO resources provided to the first thread is suppressed. That is, on the basis of the default resource supply, the default supply of IO resources is maintained, and the CPU resource supply, GPU resource supply, DDR resource supply, etc. to the first thread are reduced.
[0196] When the user interaction relationship level of the first thread is the sixth level interaction relationship, all resource supplies provided to the first thread are suppressed, that is, on the basis of the default resource supply, the CPU resource supply, GPU resource supply, DDR resource supply, IO resource supply, etc. provided to the first thread are reduced.
[0197] In some embodiments, the CPU resource supply to the first thread may be increased by reducing the target duty cycle of the first thread and / or adjusting the PID parameters of the frequency modulator calculation. Specifically:
[0198] After reducing the target duty cycle of the first thread, the frequency modulator will provide a higher frequency point to achieve a smaller duty cycle.
[0199] Adjust the PID parameters used in the frequency calculation of the frequency regulator so that tasks at low frequencies are more sensitive to load fluctuations and can be easily increased in frequency; at high frequencies, tasks are less sensitive to load fluctuations and can be maintained at a relatively high frequency point. PID is the abbreviation for proportional, integral, and derivative.
[0200] In some embodiments, the CPU resource supply to the first thread may be reduced by increasing the target duty cycle of the first thread and / or adjusting the PID parameters of the frequency calculation of the frequency modulator. Specifically:
[0201] After increasing the target duty cycle of the first thread, the frequency modulator will provide a lower frequency point to achieve a larger duty cycle.
[0202] Adjust the PID parameters of the frequency point calculation of the frequency regulator so that the task is less sensitive to load fluctuations at low frequencies and is not easy to increase the frequency; at high frequencies, the task is more sensitive to load reduction and is not easy to maintain at the high frequency point.
[0203] In some embodiments, the method of increasing the DDR resource supply to the first thread may be to reduce the DDR frequency modulation threshold of the first thread and / or increase the DDR frequency. Specifically:
[0204] Lower the DDR frequency threshold of the first thread so that the task can be adjusted to a higher DDR frequency when the DDR demand is relatively high.
[0205] You can also multiply the original DDR factor frequency by a higher coefficient to amplify the DDR frequency.
[0206] In some embodiments, the DDR resource supply to the first thread may be reduced by increasing the DDR frequency modulation threshold of the first thread and / or reducing the DDR frequency. Specifically:
[0207] Increase the DDR frequency threshold of the first thread so that tasks can only be adjusted to a higher DDR frequency when the DDR demand is very high.
[0208] You can also multiply the original DDR factor frequency by a lower coefficient to suppress the DDR frequency.
[0209] In some embodiments, the GPU resource supply to the first thread may be increased by increasing the number of available GPU units and / or increasing the priority of the first thread in using the available GPU units. Specifically:
[0210] Allocate more available GPU units for GPU computing tasks submitted by the task.
[0211] The priority of computing tasks can also be increased so that computing tasks can obtain a large number of GPU units for computing earlier.
[0212] In some embodiments, reducing the GPU resource supply to the first thread may be done by reducing the number of available GPU units and / or lowering the priority of the first thread in using the available GPU units. Specifically:
[0213] Allocate fewer available GPU units for GPU computing tasks submitted by the task.
[0214] You can also lower the priority of the computing task so that the computing task has to wait until other high-priority GPU tasks are completed before it can obtain some GPU units for calculation.
[0215] In some embodiments, the method of improving the IO resource supply to the first thread may be to increase the priority of the first thread in obtaining the IO resource, specifically:
[0216] Assigning a higher bus access priority to the task allows the task to obtain IO bandwidth resources more quickly for IO read and write operations.
[0217] In some embodiments, the method of reducing the IO resource supply to the first thread may be to lower the priority of the first thread in obtaining the IO resource, specifically:
[0218] Assign a lower bus access priority to the task so that the task can only obtain IO bandwidth resources for IO read and write operations after other high-priority bus bandwidth tasks complete IO read and write operations.
[0219] In an embodiment of the present application, during the application running process, the user interaction relationship level of each thread in the application process can be identified, and different user interaction relationship levels are mapped to different system resource supply levels. Targeted resource supply is provided to each thread according to the user interaction relationship level of each thread, which can reasonably allocate system resources, optimize the power consumption of the entire machine, and delay the temperature rise of the system.
[0220] For example, Figure 4 FIG. 4 is a schematic flow chart of another resource provision method 400 provided in an embodiment of the present application. Figure 4 As shown, the method 400 includes:
[0221] S401: A first application determines a quality of service level of a first thread of the first application, and transmits the quality of service level of the first thread to a quality of service management module (QoS Manager).
[0222] Optionally, the service quality level of the first thread of the first application may be determined by the operating system.
[0223] In some embodiments, the first application determines the quality of service level of the first thread, which may be that the first application marks the quality of service level of the first thread.
[0224] Among them, the description of service quality level is in Figure 3 S301 in the illustrated embodiment has been described in detail and will not be repeated here for the sake of brevity.
[0225] S402: The resource scheduling service module determines the running scenario information and the temperature control scenario information of the first application, and transmits the determined running scenario information and the temperature control scenario information of the first application to the service quality management module.
[0226] In some embodiments, the running scenario information of the first application is used to indicate whether the running status of the first application is foreground running or background running.
[0227] In some embodiments, the temperature control scenario information is used to indicate whether the application scenario corresponding to the first thread is a scenario that requires temperature control, wherein the scenario that requires temperature control may refer to an application scenario that is not sensitive to performance, and the scenario that does not require temperature control may refer to a scenario that is more sensitive to performance.
[0228] Among them, scenarios that are more sensitive to performance may include, for example, game scenarios and application startup scenarios.
[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 one after another in response to the running of the first application. This application does not limit the execution order of S401 and S402.
[0230] S403: After receiving the service quality level of the first thread, the running scenario information of the first application, and the temperature control scenario information, the service quality management module determines the user interaction relationship level of the first thread based on the service quality level of the first thread and the running scenario information of the first application, and passes the determined user interaction relationship level of the first thread and the temperature control scenario information to the kernel.
[0231] Among them, the explanation of determining the user interaction relationship level of the first thread according to the service quality level of the first thread and the running scenario information of the first application is the same as Figure 3 The explanation of S301 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.
[0232] S404: The kernel provides resources to 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, 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 based on the user interaction relationship level of the first thread. When the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that does not require temperature control, the kernel directly supplies resources to the first thread based on 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 shown in FIG. Figure 3 The description of S302 in the illustrated embodiment.
[0234] In some embodiments, the kernel first determines a first resource supply strategy for supplying resources to the first thread based on the user interaction relationship level of the first thread. When the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that requires temperature control, 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 so, when the temperature of the first device is greater than the first temperature threshold, on the basis of the first resource supply strategy, the resource supply level of the first thread is further suppressed, that is, the CPU resource supply, GPU resource supply, DDR resource supply, IO resource supply, etc. of the first thread are further reduced, so as to obtain a second resource supply strategy with a lower resource supply level. The kernel supplies resources to the first thread according to the second resource supply strategy.
[0235] Or it can be described as: the kernel first provides targeted resources to the first thread based on the user interaction relationship level of the first thread. When the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that requires temperature control, 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 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, GPU resource supply, DDR resource supply, IO resource supply, etc. 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 provided with targeted resources based on the user interaction relationship level of the first thread.
[0236] The first temperature threshold may be any temperature value within the range of 40° C. to 50° C., for example.
[0237] Among them, the kernel determines the first resource supply strategy for supplying resources to the first thread according to the user interaction relationship level of the first thread, which can be understood as: 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 may 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, the network IO resource supply level required by the first thread, etc.
[0238] Similarly, based on the embodiments provided in the present application, the kernel may map multiple threads of the first application to multiple resource provision level combinations, wherein the multiple threads correspond one-to-one to the multiple resource provision level combinations.
[0239] In one implementation, based on the resource supply level combination corresponding to the first thread, the resource supply decision module in the kernel sends the resource supply level corresponding to the first thread to the drivers of various physical devices (e.g., CPU, DDR, GPU, file IO, network IO, etc.), 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 achieving targeted resource supply for the first thread. In some embodiments, the first device includes the above-mentioned first application, a resource scheduling service module, a service quality management module, and a kernel.
[0240] In an embodiment of the present application, targeted resource supply is provided to threads based on 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 requires temperature control, the temperature is monitored in real time. When the temperature is greater than the temperature threshold, the resource supply to threads with low user interaction relationship levels is further reduced, and the resource supply to threads with high user interaction relationship levels is not reduced. In this way, the temperature can be prevented from rising further without affecting the user interaction experience, thereby improving the user interaction experience.
[0241] In order to more clearly understand the above S404, illustratively, Figure 5 A schematic flowchart of a method 500 for providing resources to a first thread according to a user interaction relationship level of the first thread, temperature control scenario information, and the temperature of a first device, provided by an embodiment of the present application, is shown.
[0242] like Figure 5 As shown, the method 500 includes:
[0243] S501: Providing targeted resources to the first thread according to the user interaction relationship level of the first thread.
[0244] The explanation of this step is as follows Figure 3 The explanation of S302 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.
[0245] S502: Determine whether the following conditions are met: the user interaction relationship level of the first thread is lower than the third level interaction relationship, and the application scenario corresponding to the first thread is a scenario requiring temperature control. If this condition is met, execute S503; if this condition is not met, terminate the resource adjustment process and continue to provide targeted resources to the first thread based on the user interaction relationship level of the first thread.
[0246] The user interaction relationship level of the first thread is lower than the third level interaction relationship, which may mean that the user 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. The fourth level interaction relationship, the fifth level interaction relationship, and the sixth level interaction relationship are explained in Figure 3 The illustrated embodiment has been described in detail and will not be repeated here for the sake of brevity.
[0247] S503: Determine whether the temperature of the first device is greater than a first temperature threshold. If so, proceed to S504; if less than or equal to the first temperature threshold, terminate the resource adjustment process and continue to provide targeted resources to the first thread based on the user interaction relationship level of the first thread.
[0248] S504: Suppressing the supply of system resources to the first thread.
[0249] In some embodiments, suppressing the system resource supply to the first thread may be a comprehensive reduction in the resource supply to the first thread, for example, reducing the CPU resource supply, DDR resource supply, GPU resource supply, file IO resource supply, network IO resource supply, etc. to the first thread.
[0250] In some embodiments, S503 is a step that is executed in a loop. While suppressing the system resource supply of the first thread, the temperature of the first device is monitored in a loop. When the temperature change of the first device is less than or equal to the first temperature threshold, the suppression of the system resource supply of the first thread can be canceled, and the targeted resource supply to the first thread based on the user interaction relationship level of the first thread can be restored; and, while suppressing the targeted resource supply to the first thread based on the user interaction relationship level of the first thread, the temperature of the first device can be monitored in a loop. When the temperature change of the first device is greater than the first temperature threshold, the system resource supply to the first thread can be suppressed.
[0251] In an embodiment of the present application, targeted resource supply is provided to threads based on 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 requires temperature control, the temperature is monitored in real time. When the temperature is greater than the temperature threshold, the resource supply to threads with low user interaction relationship levels is further reduced, and the resource supply to threads with high user interaction relationship levels is not reduced. In this way, the temperature can be prevented from rising further without affecting the user interaction experience, thereby improving the user's usage experience.
[0252] For example, Figure 6 A schematic diagram of a framework of a system 600 for resource provision provided in an embodiment of the present application is shown.
[0253] like Figure 6 As 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 service quality management module 630; the kernel layer includes a resource supply decision module 640 and multiple physical devices; the resource scheduling management module 620 may include a task state identification module 621 and a temperature control scenario identification module 622; the multiple physical devices may 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 service quality level of a first thread of a first application and transmit the service quality level of the first thread to the service quality management module 630 .
[0255] Among them, the description of service quality level is in Figure 3 S301 in the illustrated embodiment has been described in detail and will not be repeated here for the sake of brevity.
[0256] The resource scheduling service module 620 is configured to determine the running scenario information and the temperature control scenario information of the first application, and transmit the determined running scenario information and the temperature control scenario 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 used to determine the running scenario information of the first application; the temperature control scenario identification module 622 in the resource scheduling service module 620 is used to determine the temperature control scenario information.
[0258] In some embodiments, the running scenario information of the first application is used to indicate whether the running status of the first application is foreground running or background running.
[0259] In some embodiments, the temperature control scenario information is used to indicate whether the application scenario corresponding to the first thread is a scenario that requires temperature control, wherein the scenario that requires temperature control may refer to an application scenario that is not sensitive to performance, and the scenario that does not require temperature control may refer to a scenario that is more sensitive to performance.
[0260] Among them, scenarios that are more sensitive to performance may include, for example, game scenarios and application startup scenarios.
[0261] The service quality management module 630 is used to determine the user interaction relationship level of the first thread based on the service quality level of the first thread and the operating scenario information of the first application after receiving the service quality level of the first thread, the operating scenario information of the first application, and the temperature control scenario information, and pass the determined user interaction relationship level of the first thread and the temperature control scenario information to the resource supply decision module 640.
[0262] In some embodiments, the service quality management module 630 includes a QoS labeling management module, a state management module and a shell temperature management module, wherein the QoS labeling management module is used to receive and summarize the service quality level of the thread sent by the thread marking module 610, and to forward the service quality level of the thread to the resource supply decision module 640; the state management module is used to receive and summarize the application operation scenario information sent by the resource scheduling service module 620, and to forward the application operation scenario information to the resource supply decision module 640; the shell temperature management module is used to receive and summarize the temperature control scenario information sent by the resource scheduling service module 620, and to forward the temperature control scenario information to the resource supply decision module 640.
[0263] Among them, the explanation of determining the user interaction relationship of the first thread according to the service quality level of the first thread and the running scenario information of the first application is the same as Figure 3 The explanation of S301 in the illustrated embodiments is the same and will not be repeated here for the sake of 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 scenario 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 implement targeted resource supply to the first thread through the resource supply module according to the user interaction relationship level of the first thread, the temperature control scenario information, and the temperature of the first device.
[0266] In some embodiments, the resource supply decision module 640 first determines a first resource supply strategy for supplying resources to the first thread based on 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 scenario information indicates that the application scenario corresponding to the first thread is a scenario that does not require temperature control, the kernel directly performs targeted resource supply to the first thread through the resource supply module based on the first resource supply strategy.
[0267] In some embodiments, the resource supply decision module 640 first determines a first resource supply strategy for supplying resources to the first thread based on the user interaction relationship level of the first thread. When the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that requires temperature control, 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 so, when the temperature of the first device is greater than the first temperature threshold, on the basis of the first resource supply strategy, 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, network IO resource supply, etc. 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 through the resource supply module according to the second resource supply strategy.
[0268] Or it can be described as: the resource supply decision module 640 first performs targeted resource supply to the first thread through the resource supply module based on the user interaction relationship level of the first thread; when the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario that requires temperature control, 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 so, the temperature of the first device is monitored. 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, network IO resource supply, etc. 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 provided with targeted resources based on the user interaction relationship level of the first thread.
[0269] The first temperature threshold may be any temperature value within the range of 40° C. to 50° C., for example.
[0270] Among them, the resource supply decision module 640 determines the 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 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. The resource supply level combination may 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, the network IO resource supply level required by the first thread, etc.
[0271] Similarly, based on the embodiments provided in this application, the resource provisioning decision module 640 may map multiple threads of the first application to multiple resource provisioning level combinations, wherein the multiple threads correspond one-to-one to the multiple resource provisioning level combinations.
[0272] In one implementation, based on the resource supply level combination corresponding to the first thread, the resource supply decision module 640 sends the resource supply level corresponding to the first thread to the drivers of each physical device (for example: CPU642, DDR643, GPU644, file IO645, network IO646, etc.), so that CPU642 supplies resources to the first thread according to the CPU resource supply level required by the first thread, DDR643 supplies resources to the first thread according to the DDR resource supply level required by the first thread, GPU644 supplies resources to the first thread according to the GPU resource supply level required by the first thread, file IO645 supplies resources to the first thread according to the file IO resource supply level required by the first thread, and network IO646 supplies resources to the first thread according to the network IO resource supply level required by the first thread, thereby realizing targeted resource supply to the first thread.
[0273] Among them, the kernel layer can also include a core selection module 641, which is used to determine whether to use the small core or the large core of CPU642 to supply resources to the first thread based on the resource supply level sent by the resource supply decision module 640 to CPU642. For example: when the resource supply level sent by the resource supply decision module 640 to CPU642 is high (that is, high CPU supply needs to be provided to the first thread), the core selection module 641 determines to use the large core of CPU642 to supply resources to the first thread; when the resource supply level sent by the resource supply decision module 640 to CPU642 is low (that is, low CPU supply needs to be provided to the first thread), the core selection module 641 determines to use the small core of CPU642 to supply resources to the first thread.
[0274] It is understandable that: Figure 6 The system provided by the embodiment shown can be used with Figure 2 The illustrated embodiments provide systems for use in conjunction with, for example: Figure 6 The system provided by the embodiment shown can be Figure 2 The illustrated embodiment provides a functional extension of the system based on the above.
[0275] In an embodiment of the present application, targeted resource supply is provided to threads based on 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 requires temperature control, the temperature is monitored in real time. When the temperature is greater than the temperature threshold, the resource supply to threads with low user interaction relationship levels is further reduced, and the resource supply to threads with high user interaction relationship levels is not reduced. In this way, the temperature can be prevented from rising further without affecting the user interaction experience, thereby improving the user's usage experience.
[0276] One or more of the modules or units described herein can be implemented in software, hardware, or a combination of the two. When any of the above modules or units is implemented in software, the software exists 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 flow. The processor may 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 (MCU), or an artificial intelligence processor, etc., a computing device that runs software, each computing device may include one or more cores for executing software instructions to perform operations or processing. The processor may be built into an SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip. In addition to the core for executing software instructions to perform operations or processing within the processor, it may further include necessary hardware accelerators, such as a field programmable gate array (FPGA), a PLD (programmable logic device), or a logic circuit that implements dedicated logic operations.
[0277] When the modules or units described in this document are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator, or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.
[0278] When the modules or units described herein are implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. 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 a website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0279] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0280] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0281] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0282] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0283] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0284] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0285] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A resource supply method, characterized in that: The method comprises: During the execution of a first application, determining a user interaction relationship level of the first thread according to a quality of service level of a first thread of the first application and execution scenario information of the first application, wherein the execution scenario information of the first application is used to indicate that the first application is in a foreground execution state, or the execution scenario information of the first application is used to indicate that the first application is in a background execution state; Resources are provided to the first thread according to the user interaction relationship level of the first thread.
2. The method according to claim 1, characterized in that The user interaction relationship level of the first thread is one 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, wherein the interaction relationship level corresponding to the first-level interaction relationship, the interaction relationship level corresponding to the second-level interaction relationship, the interaction relationship level corresponding to the third-level interaction relationship, the interaction relationship level corresponding to the fourth-level interaction relationship, the interaction relationship level corresponding to the fifth-level interaction relationship, and the interaction relationship level corresponding to the sixth-level interaction relationship decrease in sequence.
3. The method according to claim 2, characterized in that The providing resources to the first thread according to the user interaction relationship level of the first thread includes: When the user interaction relationship level of the first thread is the fourth level interaction relationship, providing resources 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, based on the first resource supply level, increasing the CPU resource supply, DDR resource supply, GPU resource supply, and I / O resource supply to the first thread; When the user interaction relationship level of the first thread is the second level interaction relationship, increasing the CPU resource supply to the first thread based on the first resource supply level; When the user interaction relationship level of the first thread is the third level interaction relationship, increasing the DDR resource supply to the first thread based on the first resource supply level; When the user interaction relationship level of the first thread is the fifth level interaction relationship, reducing the CPU resource supply, DDR resource supply, and GPU resource supply to the first thread based on the first resource supply level; or When the user interaction relationship level of the first thread is the sixth level interaction relationship, based on the first resource supply level, the CPU resource supply, DDR resource supply, GPU resource supply and IO resource supply to the first thread are reduced.
4. The method according to claim 3, characterized in that The increasing the CPU resource supply to the first thread includes: reducing the target duty cycle of the first thread and / or adjusting the proportional parameter, integral parameter and differential parameter of the frequency calculation of the frequency modulator; The reducing the CPU resource supply to the first thread includes: Increasing the target duty cycle of the first thread and / or adjusting the proportional parameter, integral parameter and differential parameter of the frequency point calculation of the frequency modulator; The increasing the DDR resource supply to the first thread includes: Lowering the DDR frequency modulation threshold of the first thread and / or increasing the DDR frequency; The reducing the DDR resource supply to the first thread includes: Increasing the DDR frequency modulation threshold of the first thread and / or reducing the DDR frequency; Improving the GPU resource supply to the first thread includes: Increasing the number of available GPU units and / or increasing the priority of the first thread in using the available GPU units; The reducing the GPU resource supply to the first thread includes: Reducing the number of available GPU units and / or lowering the priority of the first thread in using the available GPU units; Improving the IO resource supply to the first thread includes: Raise the priority of the first thread in acquiring IO resources; or The reducing the IO resource supply to the first thread includes: Lower the priority of the first thread in acquiring IO resources.
5. The method according to any one of claims 2 to 4, characterized in that The method further comprises: Adjust resource supply for the first thread based on the user interaction relationship level of the first thread, temperature control scenario information, and the temperature of the first device, wherein the temperature control scenario information is used to indicate that the application scenario corresponding to the first thread is a scenario requiring temperature control, or the temperature control scenario information is used to indicate that the application scenario corresponding to the first thread is a scenario not requiring temperature control, and the first application runs on the first device.
6. The method according to claim 5, characterized in that The adjusting resource supply for 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 interaction relationship, the fifth-level interaction relationship, and the sixth-level interaction relationship, and the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario requiring temperature control, reduce the resource supply to the first thread.
7. The method according to claim 6, characterized in that The reducing the resource supply to the first thread includes: determining whether a temperature of the first device is greater than a first temperature threshold; When the temperature of the first device is greater than the first temperature threshold, reducing resource supply to the first thread.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; one or more memories; 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 execution of a first application, determining a user interaction relationship level of the first thread according to a quality of service level of a first thread of the first application and execution scenario information of the first application, wherein the execution scenario information of the first application is used to indicate that the first application is in a foreground execution state, or the execution scenario information of the first application is used to indicate that the first application is in a background execution state; Resources are provided to the first thread according to the user interaction relationship level of the first thread.
9. The electronic device according to claim 8, wherein: The user interaction relationship level of the first thread is one 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, wherein the interaction relationship level corresponding to the first-level interaction relationship, the interaction relationship level corresponding to the second-level interaction relationship, the interaction relationship level corresponding to the third-level interaction relationship, the interaction relationship level corresponding to the fourth-level interaction relationship, the interaction relationship level corresponding to the fifth-level interaction relationship, and the interaction relationship level corresponding to the sixth-level interaction relationship decrease in sequence.
10. The electronic device according to claim 9, characterized in that The electronic device is specifically used for: When the user interaction relationship level of the first thread is the fourth level interaction relationship, providing resources 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, based on the first resource supply level, increasing the CPU resource supply, DDR resource supply, GPU resource supply, and I / O resource supply to the first thread; When the user interaction relationship level of the first thread is the second level interaction relationship, increasing the CPU resource supply to the first thread based on the first resource supply level; When the user interaction relationship level of the first thread is the third level interaction relationship, increasing the DDR resource supply to the first thread based on the first resource supply level; When the user interaction relationship level of the first thread is the fifth level interaction relationship, reducing the CPU resource supply, DDR resource supply, and GPU resource supply to the first thread based on the first resource supply level; or When the user interaction relationship level of the first thread is the sixth level interaction relationship, based on the first resource supply level, the CPU resource supply, DDR resource supply, GPU resource supply and IO resource supply to the first thread are reduced.
11. The method according to claim 10, characterized in that The increasing the CPU resource supply to the first thread includes: reducing the target duty cycle of the first thread and / or adjusting the proportional parameter, integral parameter and differential parameter of the frequency calculation of the frequency modulator; The reducing the CPU resource supply to the first thread includes: Increasing the target duty cycle of the first thread and / or adjusting the proportional parameter, integral parameter and differential parameter of the frequency point calculation of the frequency modulator; The increasing the DDR resource supply to the first thread includes: Lowering the DDR frequency modulation threshold of the first thread and / or increasing the DDR frequency; The reducing the DDR resource supply to the first thread includes: Increasing the DDR frequency modulation threshold of the first thread and / or reducing the DDR frequency; Improving the GPU resource supply to the first thread includes: Increasing the number of available GPU units and / or increasing the priority of the first thread in using the available GPU units; The reducing the GPU resource supply to the first thread includes: Reducing the number of available GPU units and / or lowering the priority of the first thread in using the available GPU units; Improving the IO resource supply to the first thread includes: Raise the priority of the first thread in acquiring IO resources; or The reducing the IO resource supply to the first thread includes: Lower the priority of the first thread in acquiring IO resources.
12. The electronic device according to any one of claims 9 to 11, characterized in that: The electronic device is also used for: Adjust resource supply for the first thread based on the user interaction relationship level of the first thread, temperature control scenario information, and the temperature of the first device, wherein the temperature control scenario information is used to indicate that the application scenario corresponding to the first thread is a scenario requiring temperature control, or the temperature control scenario information is used to indicate that the application scenario corresponding to the first thread is a scenario not requiring temperature control, and the first application runs on the first device.
13. The electronic device according to claim 12, wherein: 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, and the sixth-level interaction relationship, and the temperature control scenario information indicates that the application scenario corresponding to the first thread is a scenario requiring temperature control, reduce the resource supply to the first thread.
14. The electronic device according to claim 13, wherein: The electronic device is specifically used for: determining whether a temperature of the first device is greater than a first temperature threshold; When the temperature of the first device is greater than the first temperature threshold, reducing resource supply to the first thread.
15. An electronic device, characterized in that: include: one or more processors; one or more memories; 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 method as described in any one of claims 1 to 7.
16. A computer-readable storage medium, characterized in that The storage medium stores a program or instruction, and when the program or instruction is executed, the method according to any one of claims 1 to 7 is implemented.
17. A chip, characterized in that: Instructions are stored in the chip, and when the instructions are executed, the method according to any one of claims 1 to 7 is implemented.
18. A computer program product, characterized in that The computer program product stores a program or instructions, and when the program or instructions are executed, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Resource allocation method, mobile terminal and computer readable storage medium
CN107402813A
Equipment management method and device, storage medium and electronic equipment
CN111831437A
Resource scheduling method and electronic equipment
CN112527476A
Resource scheduling method and related equipment
CN116048771A
Resource allocation method, cloud host, and computer-readable storage medium
WO2023035664A1