CN117632460A - Load adjusting method and terminal equipment - Google Patents

Load adjusting method and terminal equipment Download PDF

Info

Publication number
CN117632460A
CN117632460A CN202210991019.1A CN202210991019A CN117632460A CN 117632460 A CN117632460 A CN 117632460A CN 202210991019 A CN202210991019 A CN 202210991019A CN 117632460 A CN117632460 A CN 117632460A
Authority
CN
China
Prior art keywords
type
load
application
preset
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210991019.1A
Other languages
Chinese (zh)
Inventor
路雪
阚彬
唐发明
周正兴
魏嘉仪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210991019.1A priority Critical patent/CN117632460A/en
Publication of CN117632460A publication Critical patent/CN117632460A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application relates to the field of terminal equipment, and discloses a load adjusting method and terminal equipment, which are used for providing a load adjusting method aiming at the high load condition of a terminal equipment system, so that intelligent load reduction can be realized according to the use condition of system resources, and further user experience is improved. In the method, terminal equipment acquires use information of at least one type of system resource; determining one or more types of system resources meeting preset use conditions as system resources of a type to be regulated according to the at least one type of use information; for each type of system resource to be regulated: acquiring the target number of application processes according to the occupation condition of the application processes; and carrying out load reduction operation according to a preset strategy based on the application processes of the target number.

Description

Load adjusting method and terminal equipment
Technical Field
The embodiment of the application relates to the field of terminal equipment, in particular to a load adjusting method and terminal equipment.
Background
As application scenes of terminal devices in daily life of users are increasingly wide and important, performance requirements for the terminal devices are increasingly high. At present, due to the energy efficiency limitation of the terminal device chip, the problem of easy heat generation exists, and in order to reduce the heat generation, the frequency point limitation (also called as 'heat frequency limitation') of the central processing unit (central processing unit, CPU) is usually performed, so that the problems of clamping, blocking and the like are caused.
The energy efficiency of the terminal device chip generally depends on the system load of the terminal device. It can be appreciated that problems such as jamming, seizing, etc. are more likely to occur when the system is under high load. In the related art, there is an implementation manner of suspending some target threads to improve the system load condition if the CPU occupancy rate reaches a certain preset threshold. However, this implementation may cause the overall system function corresponding to the target thread to fail, resulting in poor user experience.
Disclosure of Invention
The embodiment of the application provides a load adjusting method and terminal equipment, which are used for providing the load adjusting method aiming at the high load condition of a terminal equipment system, so that intelligent load reduction can be realized according to the use condition of system resources, and further user experience is improved.
In a first aspect, embodiments of the present application provide a load adjustment method. The method can be applied to the terminal equipment and comprises the following steps: acquiring use information of at least one type of system resource; determining one or more types of system resources meeting preset use conditions as system resources of a type to be regulated according to the at least one type of use information; for each type of system resource to be regulated: acquiring the target number of application processes according to the occupation condition of the application processes; and carrying out load reduction operation according to a preset strategy based on the application processes of the target number.
In the method, according to the current use state of system resources, load reduction processing is performed on related application programs when the system is under high load. Therefore, the basic function of the application process can be ensured, and the load reduction of the system resource can be realized, so that the problems of blocking, no response and the like caused by high system load can be avoided. In this way, compared with the implementation mode of directly suspending the application process in the related technology, the basic function of the application process can be reserved, and bad experience brought to the user is avoided.
In one possible design, the load shedding operation includes one or a combination of the following: the method comprises the steps of specification reduction processing, peak staggering execution and function clipping operation.
In the design, several possible means for realizing load reduction operation are provided, on one hand, the basic functions of the application process can be ensured, and on the other hand, the high load of the system can be reduced, and the occupation of system resources is reduced.
In one possible design, the determining, according to the at least one usage information, one or more types of system resources that meet a preset usage condition as the system resources of the type to be adjusted includes: if the use information of the system resources of the first type is determined to be higher than or equal to a first preset use threshold, determining that the first type belongs to the type to be regulated; and if the use information of the system resources of the second type is determined to be lower than a second preset use threshold, determining that the second type does not belong to the type to be regulated.
In the design, whether the system is in a high-load scene can be judged by pre-configuring a preset use threshold value of whether the system resource is in a use tension state, so that abnormal use conditions of the system resource can be timely detected, problems such as jamming or blocking of terminal equipment are avoided, and user experience can be improved.
In one possible design, the load reduction operation according to a preset policy based on the target number of application processes includes: dividing the target number of application processes into one or more tiers; and carrying out load reduction operation layer by layer until the preset use condition is determined not to be met according to the use information updated by the system resource of the type to be regulated.
In the design, the load reduction operation is performed in a grading manner, the updating use condition of the system resources can be detected while the step-by-step execution is performed, and the load reduction processing can be stopped from being continuously performed after the high load condition of the system resources is relieved, so that the application process of the terminal equipment can be protected as much as possible while the pressure of the system resources is relieved.
In one possible design, the method further comprises: distributing corresponding weight factors to each application process according to a preset distribution rule; the partitioning the target number of application processes into one or more tiers includes: and distributing corresponding weight factors for each application process according to the weight factors of each application process.
In this design, when performing the load shedding operation on the application process, the order of performing the load shedding operation on the application process may also be determined in consideration of various factors of the application process (such as occupation priority, whether the load shedding operation can be performed, etc.). In this way, the application process can be protected while relieving the load pressure of the system resources. Moreover, by distributing the weight factors, the application process with higher priority can be protected preferentially, and user experience can be further ensured.
In one possible design, the method further comprises: and when the use information of the system resource update of the type to be regulated is determined to no longer meet the preset use condition, carrying out one-by-one or hierarchical service recovery on the application process executing the load reduction operation.
In the design, the load-reducing service of the application process executing the load-reducing operation is gradually recovered, so that the system resource is prevented from rising again due to one-time recovery, ping-pong recovery can be prevented, and the load performance of the terminal equipment can be ensured.
In one possible design, the load reduction operation according to a preset policy based on the target number of application processes includes: different load shedding operations are performed for different application processes.
In the design, the personalized load reduction operation is performed on different application programs, so that the functions of each application process can be better adapted, the basic functions of each application process can be better protected, and the user experience is ensured.
In one possible design, the method further comprises: a stress level of the system resource of the type to be regulated is determined. The load reduction operation is carried out according to a preset strategy by the application process based on the target number, and the load reduction operation comprises the following steps: and carrying out load reduction operation according to a preset strategy based on the application processes of the target number according to the tension level.
In the design, the load reducing operation can be executed according to different preset strategies under different tension degrees of a high-load scene, so that the functions of an application process can be better ensured while the load pressure of system resources is relieved, and excessive interference to the functions of the running application process is avoided.
In one possible design, the types of system resources include: CPU resources, GPU resources, memory resources, input/output I/O resources.
In a second aspect, the present application provides a terminal device, the terminal device including a plurality of functional modules; the plurality of functional modules interact to implement the method executed by the terminal device in any of the above aspects and embodiments thereof. The plurality of functional modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules may be arbitrarily combined or divided based on the specific implementation.
In a third aspect, the present application provides a terminal device comprising at least one processor and at least one memory, the at least one memory storing computer program instructions, the at least one processor executing the method performed by the terminal device in any of the above aspects and embodiments thereof, when the terminal device is in operation.
In a fourth aspect, the present application further provides a computer readable storage medium having stored therein a computer program which, when executed by a computer, causes the computer to perform the method performed by any of the above aspects and each of its possible design terminal devices.
In a fifth aspect, the present application provides a computer program product comprising: a computer program (which may also be referred to as code, or instructions) which, when executed, causes a computer to perform the method of any of the aspects described above and the possible designs of the terminal device.
In a sixth aspect, embodiments of the present application also provide a graphical user interface on a terminal device with a display screen, one or more memories, and one or more processors to execute one or more computer programs stored in the one or more memories, the graphical user interface comprising a graphical user interface displayed by the terminal device when performing any of the above aspects and their respective possible designs.
In a seventh aspect, the present application further provides a chip for reading a computer program stored in a memory, performing the method performed by any of the above aspects and each of the possible design terminal devices.
In an eighth aspect, the present application further provides a chip system, which includes a processor for supporting a computer device to implement the method performed by any one of the above aspects and each of the possible design terminal devices. In one possible design, the chip system further includes a memory for storing programs and data necessary for the computer device. The chip system may be formed of a chip or may include a chip and other discrete devices.
The advantages of any one of the second aspect to the eighth aspect and the possible designs thereof are specifically referred to the advantages of the various possible designs of the first aspect, and are not described herein.
Drawings
FIG. 1 is a flow chart of a control method of process CPU occupancy rate;
fig. 2 is a schematic hardware structure of a possible terminal device according to an embodiment of the present application;
fig. 3 is a software system architecture block diagram of a terminal device according to an embodiment of the present application;
Fig. 4 is a schematic flow chart of a load adjustment method according to an embodiment of the present application;
FIG. 5 is a second flow chart of a load adjustment method according to the embodiment of the present disclosure;
FIG. 6 is a third flow chart of a load adjustment method according to the embodiment of the present disclosure;
FIG. 7 is a flowchart of a load adjustment method according to an embodiment of the present disclosure;
fig. 8 is a fifth flow chart of a load adjustment method according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
The technical scheme provided by the embodiment of the application can be applied to the field of terminal equipment, and particularly can be applied to a processing unit such as a chip contained in the terminal equipment. The chip has very important function for the use of the terminal equipment, and can support the normal operation of the system of the terminal equipment, so that the terminal equipment can provide various service functions for users, such as communication, game, reading, browsing, social, music and other services.
Because the CPU in the chip has certain performance limit, if the use condition of the system resource is in the normal range, the performance of the CPU is stable, and the service operation of the terminal equipment is normal. It can be understood that if the usage of system resources exceeds the normal range (can be understood as being in a high-load scenario), the performance of the CPU becomes worse, and the problems of jamming, jamming and the like are easy to occur, so that the user experience is reduced.
In an alternative implementation, it may be determined from the process CPU information whether a fixed threshold is exceeded, which suspends the low priority thread. Referring to fig. 1, the implementation may include the steps of:
step 101, determining a target thread.
Step 102, obtaining a first CPU occupancy rate of a target process at a first moment.
And step 103, judging whether the first CPU occupancy rate reaches a second preset threshold value.
And 104, suspending the target thread when the first CPU occupancy rate reaches a second preset threshold value.
However, in this implementation, after the target thread is suspended, the service function corresponding to the target thread may be totally disabled, which results in poor user experience. For example, the target thread corresponds to a service function of implementing game software, and after the target thread is suspended, the user cannot continue to use the game software, and may even interrupt the game progress being used by the user, so that the user experience is poor.
In another alternative implementation manner, the memory can be adjusted by acquiring a plurality of resource pressures, so as to realize optimal performance. However, the implementation can only realize memory optimization, and cannot realize optimization of other types of system resources.
In view of this, the embodiment of the application provides a load adjustment method. Acquiring a plurality of application processes occupying the system resources of the type to be regulated on the terminal equipment aiming at the system resources of the type to be regulated, the acquired utilization rate of which exceeds the corresponding preset utilization threshold value, through the collection of the utilization information of at least one type of system resources; and then, load adjustment is performed according to a predefined load reduction operation based on the plurality of application processes, so that not only basic operation functions of each application process can be ensured, but also high load relief of system resources can be realized.
It is understood that the terminal device of the embodiments of the present application may be a device such as a mobile phone, a wearable device (e.g., a bracelet, a watch, a helmet, a foot ring, etc.), an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a tablet, a notebook, an ultra-mobile personal computer, a UMPC, a netbook, a smart home device (e.g., a smart television, a smart screen, a smart speaker, etc.), a personal digital assistant (personal digital assistant, PDA), etc. It will be appreciated that the embodiment of the present application does not impose any limitation on the specific type of terminal device.
The embodiment of the present application may be applied to a terminal device, and exemplary embodiments include, but are not limited to, piggybacking Or other operating system terminal devices.
Fig. 2 shows a schematic hardware structure of one possible terminal device. Wherein the terminal device 200 comprises: radio Frequency (RF) circuitry 210, power supply 220, processor 230, memory 240, input unit 250, display unit 260, audio circuitry 270, communication interface 280, and wireless-fidelity (Wi-Fi) module 290. It will be appreciated by those skilled in the art that the hardware structure of the terminal device 200 shown in fig. 2 does not constitute a limitation of the terminal device 200, and the terminal device 200 provided in the embodiment of the present application may include more or less components than those illustrated, may combine two or more components, or may have different component configurations. The various components shown in fig. 2 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes the respective constituent elements of the terminal device 200 in detail with reference to fig. 2:
the RF circuitry 210 may be used for receiving and transmitting data during a communication or session. Specifically, the RF circuit 210 receives downlink data of a base station and then sends the downlink data to the processor 230 for processing; in addition, uplink data to be transmitted is transmitted to the base station. Typically, the RF circuitry 210 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (low noise amplifier, LNA), a duplexer, and the like.
In addition, RF circuit 210 may also communicate with other devices via a wireless communication network. The wireless communication may use any communication standard or protocol including, but not limited to, global system for mobile communications (global system of mobile communication, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), long term evolution (long term evolution, LTE), email, short message service (short messaging service, SMS), and the like.
The Wi-Fi technology belongs to a short-distance wireless transmission technology, and the terminal device 200 can be connected with an Access Point (AP) through a Wi-Fi module 290, so as to realize access to a data network. The Wi-Fi module 290 may be used for receiving and transmitting data during communication.
The terminal device 200 may be physically connected to other devices through the communication interface 280. Optionally, the communication interface 280 is connected with the communication interfaces of the other devices through a cable, so as to realize data transmission between the terminal device 200 and the other devices.
The terminal device 200 can also implement a communication service, and interact with a service side device, or other terminal devices, so that the terminal device 200 needs to have a data transmission function, that is, the terminal device 200 needs to include a communication module inside. Although fig. 2 shows the RF circuit 210, the Wi-Fi module 290, and the communication interface 280, it is understood that at least one of the above components or other communication modules (such as a bluetooth module) for implementing communication are present in the terminal device 200 for data transmission.
For example, when the terminal device 200 is a mobile phone, the terminal device 200 may include the RF circuit 210, may further include the Wi-Fi module 290, or may include a bluetooth module (not shown in fig. 2); when the terminal device 200 is a computer, the terminal device 200 may include the communication interface 280, may further include the Wi-Fi module 290, or may include a bluetooth module (not shown in fig. 2); when the terminal device 200 is a tablet computer, the terminal device 200 may include the Wi-Fi module, or may include a bluetooth module (not shown in fig. 2).
The memory 240 may be used to store software programs and modules. The processor 230 executes various functional applications and data processing of the terminal device 200 by running software programs and modules stored in the memory 240. Alternatively, the memory 240 may mainly include a storage program area and a storage data area. The storage program area may store an operating system (mainly including a kernel layer, a system layer, an application program framework layer, an application program layer, and other software programs or modules corresponding to each other).
In addition, the memory 240 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. In this embodiment of the present application, the memory 240 may store relevant stored data for determining a correspondence between system resource shortage levels of each type, or respective system resource types of each foreground service, etc. for implementing the method provided in this application.
The input unit 250 may be used to receive editing operations of a plurality of different types of data objects such as numeric or character information inputted by a user, and to generate key signal inputs related to user settings and function control of the terminal device 200. Alternatively, the input unit 250 may include a touch panel 251 and other input devices 252.
The touch panel 251, which is also referred to as a touch screen, may collect touch operations thereon or thereabout (such as operations of a user using any suitable object or accessory such as a finger, a stylus, etc. on the touch panel 251 or thereabout) and drive the corresponding connection device according to a preset program. In this embodiment, the touch panel 251 may collect user operations on or near the touch panel 251, where the user operations are used to provide a foreground service for the user by using the terminal device 200, for example, the user operations may be various operations when the user plays a game, and so on.
Alternatively, the other input devices 252 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 260 may be used to display information input by a user or information provided to the user and various menus of the terminal device 200. The display unit 260 is a display system of the terminal device 200, and is used for presenting an interface to implement man-machine interaction. The display unit 260 may include a display panel 261. Alternatively, the display panel 261 may be configured in the form of a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), or the like. In this embodiment of the present application, the display unit 260 may be configured to display a display interface related to a foreground service for a user.
The processor 230 is a control center of the terminal device 200, connects respective components using various interfaces and lines, and performs various functions of the terminal device 200 and processes data by running or executing software programs and/or modules stored in the memory 240 and calling data stored in the memory 240, thereby realizing various services based on the terminal device 200. In the embodiment of the present application, the processor 230 may be configured to implement the method provided in the embodiment of the present application.
The terminal device 200 further comprises a power source 220, such as a battery, for powering the various components. Optionally, the power supply 220 may be logically connected to the processor 230 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
As shown in fig. 2, the terminal device 200 further includes an audio circuit 270, a microphone 271 and a speaker 272, which can provide an audio interface between a user and the terminal device 200. The audio circuit 270 may be configured to convert audio data into a signal recognizable by the speaker 272, and transmit the signal to the speaker 272 for conversion by the speaker 272 into a sound signal output. The microphone 271 is used for collecting external sound signals (such as the voice of a person speaking, or other sounds, etc.), converting the collected external sound signals into signals recognizable by the audio circuit 270, and transmitting the signals to the audio circuit 270. The audio circuit 270 may also be used to convert the signal sent by the microphone 271 into audio data, which is then output to the RF circuit 210 for transmission to, for example, another terminal device, or to the memory 240 for subsequent further processing.
Although not shown, the terminal device 200 may further include a camera, at least one sensor, etc., which will not be described herein. The at least one sensor may include, but is not limited to, a pressure sensor, a barometric pressure sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a touch sensor, a temperature sensor, and the like.
An Operating System (OS) according to the embodiment of the present application is the most basic system software that runs on the terminal device 200. The software system of the terminal device 200 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application exemplifies the software structure of the terminal device 200 by taking an operating system adopting a hierarchical architecture as an example.
Fig. 3 is a software structural block diagram of a terminal device according to an embodiment of the present application. As shown in fig. 3, the software structure of the terminal device may be a hierarchical architecture, for example, the software may be divided into several layers, each layer having a clear role and division of work. The layers communicate with each other through a software interface. In some embodiments, the operating system is divided into five layers, from top to bottom, an application layer, an application framework layer (FWK), runtime and system libraries, a kernel layer, and a hardware layer, respectively.
The application layer may include a series of application packages. As shown in fig. 3, the application layer may include a camera, settings, skin modules, user Interfaces (UIs), third party applications, and the like. Among other things, third party applications may include wireless local area networks (wireless local area network, WLAN), music, conversations, bluetooth, video, etc.
In one possible implementation, the application may be developed using the java language, by calling an application programming interface (application programming interface, API) provided by the application framework layer, through which the developer may interact with the underlying layers of the operating system (e.g., hardware layer, kernel layer, etc.) to develop its own application. The application framework layer is essentially a series of services and management systems for the operating system.
The application framework layer provides an application programming interface and programming framework for the application of the application layer. The application framework layer includes some predefined functions. As shown in FIG. 3, the application framework layer may include an activity manager, a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The activity manager is used for managing the life cycle of each application program and providing a common navigation rollback function, and provides an interactive interface for windows of all programs.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is arranged to provide communication functions for the terminal device. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the terminal equipment vibrates, and an indicator light blinks.
The runtime includes a core library and a virtual machine. The runtime is responsible for the scheduling and management of the operating system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of an operating system. The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media frame (media frame), three-dimensional graphics processing library (e.g., openGL ES), two-dimensional graphics engine (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of two-dimensional and 3D layers for multiple applications.
Media frames support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media framework may support a variety of audio video coding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
A two-dimensional graphics engine is a drawing engine that draws two-dimensional drawings.
In some embodiments, a three-dimensional graphics processing library may be used to render three-dimensional motion trail images and a two-dimensional graphics engine may be used to render two-dimensional motion trail images.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The hardware layer may include various types of sensors, such as acceleration sensors, gravity sensors, touch sensors, and the like.
Typically, the terminal device 200 may run multiple applications simultaneously. More simply, an application may correspond to one process, and more complex, an application may correspond to multiple processes. Each process is provided with a process number (process ID).
It should be understood that in embodiments of the present application, "at least one (item) below" or the like, refers to any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b and c can be single or multiple. "plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship.
In addition, it should be understood that in the description of this application, the words "first," "second," and the like are used merely for distinguishing between the descriptions and not for indicating or implying any relative importance or order.
It should be understood that the hardware structure of the terminal device may be shown in fig. 2, the software system architecture may be shown in fig. 3, where a software program and/or a module corresponding to the software system architecture in the terminal device may be stored in the memory 240, and the processor 230 may execute the software program and the application stored in the memory 240 to perform a flow of a load adjustment method provided in an embodiment of the present application.
In order to facilitate understanding of a load adjustment method provided in the present application, an implementation procedure of the method provided in the present application is described below in conjunction with what is shown in fig. 4 to 8.
The embodiment of the application is suitable for a scene of high load of the terminal equipment system. Application scenarios to which the embodiments of the present application are applicable will be described first by the following examples. It is understood that the application is not limited to the following application scenario.
In one possible scenario, the game may be used as a CPU consumption class scenario, where the primary type of resources used are CPU resources, while some other type of resources may be needed, such as graphics processor (graphics processing unit, GPU) resources, memory (memory) resources, or input/output (I/O) resources, etc. Referring to fig. 4, a flow chart of a load adjustment method provided in an embodiment of the present application may be applicable to a game scenario. The method can comprise the following steps:
S401, the terminal equipment detects that the temperature of the terminal equipment is higher than or equal to a preset temperature threshold.
Optionally, one way to determine that the system is under high load is to detect the temperature of the terminal device through a temperature sensor included in the terminal device, and if the temperature of the terminal device is higher than or equal to a preset temperature threshold, trigger to execute the method provided in the present application. It can be appreciated that the heating of the terminal device is usually caused by the system being in a high load scenario, so that the temperature detection of the terminal device can be used as a basis for judging whether the system is in a high load scenario. It should be noted that the preset temperature threshold may be preconfigured, or may also be automatically generated by analyzing according to a historical use condition of the terminal device, etc. And, different terminal equipment can adopt different determination strategies of preset temperature thresholds, and the specific adopted determination strategies can be determined according to the types of the terminal equipment, the self-configuration of the terminal equipment and the like.
S402, the terminal equipment acquires the use information of at least one type of system resource. For example, the usage information may be the number of uses or the usage rate (or referred to as occupancy rate) of the resource, or the like.
Alternatively, the terminal device may periodically acquire the usage information of the at least one type of system resource. Alternatively, the terminal device may further receive and respond to a preset event, and trigger to acquire usage information of the at least one type of system resource; the preset event may be, for example, an event that the terminal device detects that the temperature is higher than or equal to a preset temperature threshold, or may also be an event that an application program does not respond (application not response, ANR) is detected, or the like.
Wherein the system resources may include, but are not limited to, one or a combination of the following types: CPU resources, GPU resources, memory resources, or I/O resources. The terminal device may determine the type of the system resource to be acquired according to factors such as the type of the terminal device, the type of the application program to be installed, and the like, for example, may acquire a CPU resource, may acquire a memory resource, and may also acquire both the CPU resource and the memory resource.
S403, the terminal equipment determines one or more system resources to be regulated based on the use information of the system resources of various types. Wherein the system resources of the type to be regulated represent one or more types of system resources with a high degree of use (which can also be understood as under-use).
Optionally, the usage information is represented by a usage rate of the resource, and if the usage rate of the resource is greater than or equal to a preset usage threshold, it can be determined that the usage tension of the system resource of the type is higher (i.e. tension); similarly, if the usage rate of the resource is smaller than the preset usage threshold, it can be determined that the usage tension of the system resource of the type is normal.
Alternatively, when determining the shortage degree of the various types of resources, the method may be further divided into more levels, and may be implemented in such a manner that if the usage rate of the resources is greater than or equal to the first preset usage threshold, it may be determined that the shortage degree of the usage of the system resources of the type is a collapse level (i.e., the system resources are severely deficient). And if the utilization rate of the resource is smaller than the first preset utilization threshold value and is larger than or equal to the second preset utilization threshold value, determining that the utilization tension of the system resource of the type is an alarm level. And if the utilization rate of the resources is smaller than the second preset utilization threshold value, determining that the utilization tension of the system resources of the type is normal. Thus, a more accurate judgment result can be obtained, and more accurate and timely response processing can be obtained.
Illustratively, as shown in table 1 below, taking at least one type of system resource acquired as a CPU resource, a memory resource, and an I/O resource as an example, the usage information may be as follows:
TABLE 1
Type(s) Usage information Presetting a use threshold Tension level
CPU resource 90% 80% Tension is intense
Memory resources 50% 90% Normal state
I/O resources 10% 80% Normal state
As shown in table 1 above, assuming that the preset usage threshold for determining the shortage degree of CPU resources is set to 80%, and the current usage information of the CPU resources by the system is obtained to be 90%, it can be determined that the shortage degree of CPU resources is higher, that is, the shortage of resource usage. Assuming that the preset use threshold value for judging the tension degree of the memory resource is set to 90%, and the current use information of the memory resource by the system is obtained to be 50%, the tension degree of the memory resource can be determined to be normal, namely, the use of the resource is normal. Assuming that the preset use threshold value for judging the tension degree of the I/O resources is set to 80 percent and the current use information of the system on the I/O resources is obtained to be 10 percent, the I/O resource tension degree can be determined to be normal, namely the resource use is normal. Thus, by acquiring the usage information of the system resources of each type and judging the tension, it is possible to determine which type or types of load shedding operation is required. For example, in the scenario shown in table 1, it is desirable to load down CPU resources, and not memory resources and I/O resources.
It can be understood that, as shown in table 1, different types of system resources may be correspondingly set with different preset usage thresholds; and the preset use threshold value correspondingly set by different types of system resources can be adaptively adjusted according to different use scenes of the terminal equipment. Therefore, the performance condition of the terminal equipment can be more accurately attached, and better user experience is achieved.
S404, aiming at the system resources of each type to be regulated, the terminal equipment respectively acquires a plurality of application processes according to the process occupation condition. It should be noted that the type to be adjusted may be one or more types, and in the following embodiments, a type to be adjusted is taken as an example, and if the terminal device detects multiple types of system resources to be adjusted, load adjustment on other types of system resources may refer to the following implementation process, and will not be described herein again.
For example, as shown in table 1, for using the intense CPU resources in the above game scenario example, application processes occupying TOP (TOP) to TOP10 of the CPU resources may be acquired, as shown in the following table 2-1:
TABLE 2-1
Order of occupation Application process Whether or not it is a foreground service
top1 Game machine Is that
top2 Video frequency Whether or not
top3 Navigation system Whether or not
top4 Music Whether or not
top5 Downloading Whether or not
top6 Social contact Whether or not
top7 Reading Whether or not
top8 Camera with camera body Whether or not
top9 Table top Whether or not
top10 Notification bar Whether or not
As shown in table 2-1, the terminal device may obtain, from the occupation condition of each application process on the CPU resource, a plurality of application processes with occupation degrees from high to low. For example, the terminal device may obtain a plurality of application processes as shown in table 2-1 from the log information.
S405, the terminal equipment performs load reduction operation according to a preset strategy based on the plurality of application processes.
In an alternative embodiment, for the system resource of the type to be regulated, the terminal device may perform the load shedding operation based on the acquired application process occupation sequence. For example, the load reduction operation may be sequentially performed in order from TOP1 to TOP 10.
Alternatively, in order to better protect the foreground service, the terminal device may also acquire the foreground service (e.g., in a game scenario, the foreground service is a game application process) before performing the load-shedding operation. Based on this, when the load-down operation is performed, the load-down operation on the foreground traffic can be excluded. If the application process is judged to be the foreground service, the load reducing operation is continuously executed on the next application process occupying the sequence. For example, as shown in connection with table 2-1, since the game application process at TOP1 belongs to the foreground service, the terminal device can perform the load-shedding operation from the video at TOP 2.
Based on the above embodiment, the terminal device may perform the load operation one by one or layer by layer; wherein each hierarchy may include one or more application processes. For example, the terminal device may first select an application process of TOP2 to TOP4 as a first level to perform load reduction operation, and continuously monitor the stress level of the system resource; if the tension degree of the system resources is still higher than or equal to the preset use threshold, continuing to select the application processes of the TOP 5-TOP 6 as a second level to carry out load reduction operation until the tension degree of the system resources is lower than the preset use threshold; if the tension degree of the system resources is lower than the preset use threshold, the load reduction operation is not carried out on the application processes of the TOP 5-TOP 6. It should be noted that the number of application processes selected by different levels may be different; alternatively, the number of application processes at different levels may be determined according to the level of tension of the CPU resources. For example, if the stress level is a crash level, a greater number of application processes may be selected per level to reduce the load of system resources faster; for another example, if the stress level is an alarm level, a smaller number of application processes may be selected to achieve load reduction of system resources without affecting more application processes.
The load-shedding operation may include, but is not limited to, one or a combination of the following operations: downscaling (e.g., reducing resolution, reducing frame rate, etc.), off-peak execution (e.g., idle processing or deferred processing, etc.), function clipping operations (e.g., clipping unnecessary foreground traffic functions, retaining only core traffic functions). It will be appreciated that, in implementation, different load shedding operations may be performed on different application processes, for example, load shedding operations of a down-specification process may be performed on a game application process, and load shedding operations of a peak-shifting execution may be performed on a download application process.
In another alternative embodiment, the terminal device may also assign a weight factor to each application process for the system resource of the type to be regulated. Alternatively, the terminal device may assign a weight factor to each application process according to the priority (or importance/urgency) of the application process. It can be appreciated that the higher the priority of an application process, the more necessary it is to represent its occupation of system resources; based on the above, a larger weight factor can be allocated to a process with a lower priority, and a smaller weight factor can be allocated to a process with a higher priority, even no weight factor is allocated, and the like; for example, some application processes cannot perform load shedding operation, so that the terminal device is not allowed to perform load shedding operation on the application process, and at this time, a weight factor may not be allocated to the application process. Alternatively, the terminal device may also allocate a weight factor to each application process according to multiple information, such as occupancy, priority, and the like. The distribution method of the weight factors is not limited in this application. Illustratively, an example of the assignment of weight factors is shown in Table 2-2 below:
TABLE 2-2
Order of occupation Application process Weighting factor Weight factor order
top1 Game machine 0.3 6
top2 Video frequency 0.55 2
top3 Navigation system 0.45 3
top4 Music 0.4 4
top5 Downloading 0.6 1
top6 Social contact 0.35 5
top7 Reading 0.2 7
top8 Camera with camera body 0.15 8
top9 Table top 0.1 9
top10 Notification bar 0.05 10
As can be obtained from table 2-2, the order of the weight factors may not completely coincide with the order of occupation of CPU resources by each application process, so by allocating the corresponding weight factors to each application process, not only the CPU resource load can be reduced, but also the influence on the application process can be reduced as much as possible.
For example, since the game is a foreground service, although the occupation order of the CPU is TOP1, a smaller weight factor may be assigned thereto in order to avoid an influence on the game application process. In this way, the load-reducing operation on other application processes can be preferentially executed, and if the load pressure of the system resource still cannot be relieved, the load-reducing operation on the foreground service can be executed after the load-reducing operation is executed on a plurality of (e.g. 5 application processes shown in table 2-2).
For another example, since the downloaded application process belongs to the background service and the priority is generally low, the downloaded application process may be preferentially assigned a higher weight factor to preferentially perform the load-shedding operation. For example, the load-shedding operation performed for the downloaded application process may be performed in a peak-shifting manner, so that the CPU resource may be avoided being occupied in the game scenario.
Based on the above embodiment, the terminal device may sequentially perform load reduction operations according to the weight factors allocated to each application process, so as to reduce the stress level of the CPU resources. In combination with table 2-2, the terminal device may first perform load reduction operations on the downloading, video and navigation application processes with the weight factors of 1-3 in order, for example, instruct peak-shifting execution of the downloading application process, instruct the video application process, and instruct the navigation application process to perform specification reduction processing. If the tension degree of the system resource is still higher than or equal to the preset use threshold, the load-reducing operation can be continuously carried out on the music and the social application process with the weight factors of which the order is 4-5. Optionally, if the detected tension of the system resource is still higher than or equal to the preset use threshold, the load-reducing operation can be continuously performed on the game application process; the down-specification processing of the game application process may be implemented to reduce the resolution of the game, from the high-definition resolution to the standard-definition resolution, and may also be implemented to reduce the frame rate of the game, for example, from the high-frame rate to the normal frame rate.
By introducing the implementation process of load regulation of the game scene, the method provided by the application can be obtained, and the stress degree of the system resource can be released by carrying out load reduction operation on the application process occupying the system resource of the type to be regulated, so that the normal operation of the foreground service can be ensured. In addition, during implementation, the load reduction operation can be performed on the application program of the background service, so that the use experience of the foreground service is further ensured on the aspect of relieving the tension of system resources.
In another possible application scenario, taking a foreground service as an example of an application program including multiple service functions, for example, a gallery, when the application is implemented, the load-reducing operation performed on the foreground service may also be a function clipping operation. Referring to fig. 5, another flow chart of load adjustment according to an embodiment of the present application is shown. At least the following procedures can be included:
an exemplary solution, in which the system resource tension is classified into three levels, can be understood as: normal level, alarm level, and crash level.
S500, judging whether the use information of the system resource is lower than a first preset use threshold (namely, normal level); if yes, S501 is continued, otherwise S502 is continued.
S501, if the use information of the system resource is lower than a first preset use threshold, maintaining the normal operation of the service. It will be appreciated that the use of system resources is now normal.
S502, if the usage information of the system resource is not lower than a first preset usage threshold, continuously judging whether the usage information of the system resource is higher than or equal to the first preset usage threshold and lower than a second preset usage threshold (namely, alarm level); if yes, S503 is continued, otherwise S504 is continued.
S503, if the usage information of the system resource is higher than or equal to the first preset usage threshold and lower than the second preset usage threshold, unnecessary background service is reduced. Taking the foreground service as a gallery function as an example, unnecessary background scanning, uploading and downloading and other services can be reduced.
S504, if the usage information of the system resource is higher than or equal to the second preset usage threshold (i.e. the collapse level), only the basic service function is reserved. Still taking the foreground service as an example of a gallery function, only the browsing and editing capabilities of the basic pictures (or videos) can be reserved.
By introducing the load adjustment implementation process of the scene, the method provided by the embodiment of the application can be obtained, and the load pressure of the system resources can be relieved by various reduction of the occupation mode of the system resources to be adjusted, so that the operation of the basic functions of the foreground service can be ensured, faults such as jamming and blocking of terminal equipment caused by high system load can be avoided, the foreground service is unresponsive, and the user experience is reduced.
In another possible application scenario, in a scenario where the terminal device is under high load, if an ANR event occurs, further increase in load pressure of system resources may be avoided by optimizing a response manner to the ANR event; namely, after load reduction operation is performed on background service and foreground service which are started by a user, load reduction operation can be performed on contents such as service which is automatically triggered by the terminal equipment. Referring to fig. 6, a further flowchart of a load adjustment method according to an embodiment of the present application is shown. At least the following procedures can be included:
S600, the terminal equipment detects the ANR event.
S601, judging whether the frequency point is smaller than or equal to a preset frequency point threshold value. If yes, continue to execute S603; otherwise, S602 is continued. It should be noted that, if the system frequency point is limited to be within the preset frequency point threshold, load reduction processing based on the ANR scene may be directly performed, so as to avoid increasing load pressure of the system resource; if the system frequency point is not limited to be within the preset frequency point threshold value, whether the system is in a high-load scene or not can be determined continuously by judging the use information of the system resources, and load reduction processing in the ANR scene is executed when the system is determined to be in the high-load scene.
The load reduction operation based on the ANR scene can be implemented as the stack grabbing and specification reduction processing when the system is in a high load scene, so that the occupancy rate of the system resources can be reduced when the system resources are tense, and the increase of the load pressure of the system resources is avoided.
S602, if the frequency point is determined to be larger than the preset frequency point threshold value, continuously judging whether the use information of the system resource is higher than or equal to the preset use threshold value. If yes, continue to execute S603; otherwise, S604 is continued.
S603, if the frequency point is determined to be smaller than or equal to a preset frequency point threshold value, or if the use information of the system resource is determined to be higher than or equal to a preset use threshold value, the terminal equipment only grabs an application process stack. Then, S605 is continued to be executed. It can be understood that whether the system is in high load can be judged by whether the frequency points are limited, the system is in high load can be judged by using the information of the system resources, the system is in a high load scene can be obtained by any mode, and the load reduction operation based on the ANR scene can be triggered.
S604, if the use information of the system resource is determined to be lower than a preset use threshold, the application process stack and the system stack are grasped. Then, S605 is continued to be executed. It can be understood that if it is determined that the system frequency point is not limited and that the usage information of the system resource is not tense, then normal stack grabbing processing can be performed, that is, not only the application process stack but also the system stack can be grabbed.
S605, generating an ANR log. Wherein, the fault reason of the ANR event can be analyzed through the ANR log.
The application scenario to which the embodiments of the present application may be applied is described based on the foregoing embodiments, and the design idea of the method provided by the embodiments of the present application may be that the tension level of the system resource is determined based on the usage information of various types of system resources. Aiming at the system resources of the type to be regulated which meet the use shortage condition, the intelligent load reduction operation can be carried out based on the application process, the system process and the like which occupy the system resources of the type to be regulated, so that the load pressure of the system resources can be relieved.
Referring to fig. 7, a flow chart of a load adjustment method according to an embodiment of the present application is shown. The method can be applied to the terminal equipment and at least comprises the following procedures:
Step 701, obtaining usage information of at least one type of system resource. Wherein the system resources may include, but are not limited to, one or a combination of the following types: CPU resources, GPU resources, memory resources, or I/O resources.
In an alternative embodiment, the terminal device may periodically perform the acquiring of the usage information of at least one type of system resource. Alternatively, different periods may be set for different types of system resources, for example, usage information of CPU resources may be acquired every ten minutes, and usage information of memory resources may be acquired every hour.
In another alternative embodiment, the terminal device may further detect and trigger to acquire usage information of at least one type of system resource in response to a preset event. The preset event may be, for example, an event that the terminal device detects that the temperature is higher than or equal to a preset temperature threshold, or may also be an event that an ANR is detected, etc.
Step 702, determining one or more types of system resources meeting preset use conditions as system resources of a type to be regulated according to the at least one type of use information. The preset use condition may indicate that the use degree of the system resource is out of a normal range.
For example, the preset usage condition may be a preset usage threshold; the method can be implemented, if the terminal equipment determines that the use information of the first type of system resources is higher than or equal to a preset use threshold, the first type is determined to be the type to be regulated; for example, the first type of system resource may be a CPU resource as in Table 1. In another example, if the terminal device determines that the usage information of the second type of system resource is lower than a preset usage threshold, it is determined that the second type does not belong to the type to be adjusted; for example, the second type of system resource may be a memory resource, or an I/O resource, as in table 1. In addition, in the implementation of the present application, different preset usage thresholds may be configured for different types of system resources, for example, a first preset usage threshold may be configured for a first type of system resource, and a second preset usage threshold may be configured for a second type of system resource.
Step 703, for each system resource to be adjusted: acquiring the target number of application processes according to the occupation condition of the application processes; and carrying out load reduction operation according to a preset strategy based on the application processes of the target number.
Taking a system resource of a type to be regulated as a CPU resource as an example, acquiring a plurality of application processes occupying the CPU resource on the terminal equipment, wherein the target number can be 10; the target number of application processes acquired may be 10 application processes as shown in table 2-1. It should be noted that the target number may be predefined or summarized according to a load adjustment history, for example, after load reduction operations are performed on application processes less than 5 in the load adjustment history, the high load pressure of the terminal device may be relieved.
Wherein the load reduction operation is used for indicating that the occupation amount of system resources is reduced while the basic functions of the application process are guaranteed, and can include one or a combination of the following operations: downscaling (e.g., reducing resolution, reducing frame rate, etc.), off-peak execution (e.g., idle processing or deferred processing, etc.), function clipping operations (e.g., clipping unnecessary foreground traffic functions, retaining only core traffic functions). In addition, when the application is implemented, different load reduction operations can be performed for different application processes.
In an alternative embodiment, the preset policy may divide the target number of application processes into different levels, and then perform the load-reducing operation level by level. Alternatively, the target number of application processes may be partitioned into different tiers in an order of occupation as shown in Table 2-1. Alternatively, the different levels may be partitioned by the target number of application processes in the order of weight factors as shown in Table 2-2. The number of targets contained in different levels may be the same or different, for example, a first level may contain 3 application processes and a second level may contain 2 application processes. In addition, the present application is not limited to the number of divided levels, and may be divided into one or more levels, for example, 10 application processes as shown in table 2-2 may be divided into 1 level at least, or may be understood as not dividing the levels, and at most 10 levels, or may be understood as performing load reduction operation by application process one by one. Taking the example that the division hierarchy includes the first hierarchy and the second hierarchy, referring to fig. 8, another flow chart of a method for load adjustment according to an embodiment of the present application is provided. The method can comprise the following steps:
Step 703a, performing load shedding operation on the application processes included in the first hierarchy. For example, in the scenario of protecting foreground services, the first hierarchy may include video, navigation, and music application processes as shown in table 2-1, then a load-down operation that can perform a down-specification process on the video, a load-down operation that can perform a function clipping on the navigation, and a load-down operation that also performs a down-specification process on the music. For another example, in some embodiments (e.g., a scenario where the stress level of the system resources is a crash level), the load of the system resources may be prioritized for rapid reduction, only the necessary traffic functions to protect the foreground traffic may be considered, at which time the first level may contain gaming, video, and navigation application processes as shown in Table 2-1.
Step 703b, whether the updated usage information of the system resource is still higher than or equal to the preset usage threshold. If yes, go on to step 703c; otherwise, no load-reducing operation is performed. It should be noted that, while step 703a is performed, the updated usage information of the system resource of the type to be regulated may be detected simultaneously in real time or periodically by other processes to determine whether the system resource is recovered to normal usage. It will be appreciated that if the high load pressure has been relieved, no load shedding operation may be required to be continued; otherwise, the load-shedding operation on other application processes needs to be continuously performed.
And step 703c, respectively executing load reduction operation on the application processes contained in the second hierarchy. For example, assuming the second hierarchy contains downloads, social application processes as shown in Table 2-1, load shedding operations that perform peak-shifting on downloads, and load shedding operations that perform functional clipping on social connections may be performed.
In step 703d, whether the updated usage information of the system resource is still higher than or equal to the preset usage threshold. If yes, go on to step 703e; otherwise, no load-reducing operation is performed.
And 703e, carrying out load reduction operation on the foreground service. It can be understood that if the problem of high load still exists after the load-shedding operation is performed on the application process that mainly occupies the system resource of the type to be regulated, the load-shedding operation may be performed on the foreground service, so as to preferentially ensure the normal operation of the foreground service.
In another alternative embodiment, in addition to dividing the target number of application processes into different levels, the present application may determine different stress levels of the system resource, where, for example, the stress level of the system resource may include: crash level, alarm level, and normal level. For example, different preset strategies may also be set for different stress levels. For example, if the stress level is a crash level, a greater number of application processes may be selected per level to reduce the load of system resources faster; for another example, if the stress level is an alarm level, a smaller number of application processes may be selected to achieve load reduction of system resources without affecting more application processes.
In addition, after the use of the system resources is normal for a preset time period, the application process for executing the load reduction operation can be recovered; for example, updated usage information of the system resource of the type to be adjusted is determined, and if it is determined that the updated usage information no longer meets a preset usage condition corresponding to the system resource of the type to be adjusted. In an alternative embodiment, in order to avoid that all application processes performing the load-reducing operation are restored simultaneously, so that the system resources are again under high load, the embodiment of the application may adopt a one-by-one or hierarchical restoration implementation. Illustratively, the restoration may be performed in reverse hierarchical order of load reduction; as shown in fig. 8, load recovery may be performed on the foreground service first; if the use information of the system resource is still lower than the preset use threshold, load recovery is continued to be carried out on the application processes contained in the second hierarchy until all the application processes executing the load reduction operation are recovered. It should be noted that, if it is detected that the usage information of the system resource is higher than or equal to the preset usage threshold in the recovery process, the load recovery process of the execution hierarchy may be cancelled. Therefore, by gradually recovering the load-reducing service, ping-pong recovery can be prevented, so that the processing efficiency of load regulation can be ensured, and the user experience is further improved.
Based on the above embodiments, the present application further provides a terminal device, where the terminal device includes a plurality of functional modules; the functional modules interact to realize functions executed by the terminal device in the methods described in the embodiments of the present application. The plurality of functional modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules may be arbitrarily combined or divided based on the specific implementation. Such as performing steps 401 to 405 performed by the terminal device in the embodiment shown in fig. 4, or performing steps 500 to 504 performed by the terminal device in the embodiment shown in fig. 5, or performing steps 600 to 605 performed by the terminal device in the embodiment shown in fig. 6, or performing steps 701 to 703 performed by the terminal device in the embodiment shown in fig. 7.
Based on the above embodiments, the present application further provides a terminal device, where the terminal device includes at least one processor and at least one memory, where the at least one memory stores computer program instructions, and when the terminal device is running, the at least one processor executes functions executed by the terminal device in the methods described in the embodiments of the present application. Such as performing steps 401 to 405 performed by the terminal device in the embodiment shown in fig. 4, or performing steps 500 to 504 performed by the terminal device in the embodiment shown in fig. 5, or performing steps 600 to 605 performed by the terminal device in the embodiment shown in fig. 6, or performing steps 701 to 703 performed by the terminal device in the embodiment shown in fig. 7.
Based on the above embodiments, the present application also provides a computer program product comprising: a computer program (which may also be referred to as code, or instructions), when executed, causes a computer to perform the methods described in the embodiments of the present application.
Based on the above embodiments, the present application also provides a computer-readable storage medium having stored therein a computer program which, when executed by a computer, causes the computer to perform the methods described in the embodiments of the present application.
Based on the above embodiments, the present application further provides a chip, where the chip is configured to read a computer program stored in a memory, and implement the methods described in the embodiments of the present application.
Based on the above embodiments, the present application provides a chip system including a processor for supporting a computer device to implement the methods described in the embodiments of the present application. In one possible design, the chip system further includes a memory for storing programs and data necessary for the computer device. The chip system can be composed of chips, and can also comprise chips and other discrete devices. It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (12)

1. A load adjustment method, applied to a terminal device, comprising:
acquiring use information of at least one type of system resource;
determining one or more types of system resources meeting preset use conditions as system resources of a type to be regulated according to the at least one type of use information;
for each type of system resource to be regulated: acquiring the target number of application processes according to the occupation condition of the application processes; and carrying out load reduction operation according to a preset strategy based on the application processes of the target number.
2. The method of claim 1, wherein the load-shedding operation comprises one or a combination of: the method comprises the steps of specification reduction processing, peak staggering execution and function clipping operation.
3. The method according to claim 1 or 2, wherein determining, based on the at least one usage information, one or more types of system resources satisfying a preset usage condition as the system resources of the type to be adjusted, comprises:
if the use information of the system resources of the first type is determined to be higher than or equal to a first preset use threshold, determining that the first type belongs to the type to be regulated;
and if the use information of the system resources of the second type is determined to be lower than a second preset use threshold, determining that the second type does not belong to the type to be regulated.
4. A method according to any one of claims 1 to 3, wherein the load shedding operation according to a preset policy based on the target number of application processes comprises:
dividing the target number of application processes into one or more tiers;
and carrying out load reduction operation layer by layer until the preset use condition is determined not to be met according to the use information updated by the system resource of the type to be regulated.
5. The method according to claim 4, wherein the method further comprises:
distributing corresponding weight factors to each application process according to a preset distribution rule;
the partitioning the target number of application processes into one or more tiers includes: and distributing corresponding weight factors for each application process according to the weight factors of each application process.
6. The method according to any one of claims 1 to 5, further comprising:
and when the use information of the system resource update of the type to be regulated is determined to no longer meet the preset use condition, carrying out one-by-one or hierarchical service recovery on the application process executing the load reduction operation.
7. The method according to any one of claims 1 to 6, wherein the performing load shedding operation according to a preset policy based on the target number of application processes includes:
different load shedding operations are performed for different application processes.
8. The method according to any one of claims 1 to 7, further comprising:
determining the tension level of the system resource of the type to be regulated;
the load reduction operation is carried out according to a preset strategy by the application process based on the target number, and the load reduction operation comprises the following steps:
And carrying out load reduction operation according to a preset strategy based on the application processes of the target number according to the tension level.
9. The method according to any one of claims 1 to 8, wherein the type of system resource comprises: central processing unit CPU resource, graphic processing unit GPU resource, memory resource, input/output I/O resource.
10. A terminal device comprising at least one processor coupled to at least one memory, the at least one processor configured to read a computer program stored by the at least one memory to perform the method of any one of claims 1 to 9.
11. A computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any of claims 1 to 9.
12. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any of claims 1 to 9.
CN202210991019.1A 2022-08-18 2022-08-18 Load adjusting method and terminal equipment Pending CN117632460A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210991019.1A CN117632460A (en) 2022-08-18 2022-08-18 Load adjusting method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210991019.1A CN117632460A (en) 2022-08-18 2022-08-18 Load adjusting method and terminal equipment

Publications (1)

Publication Number Publication Date
CN117632460A true CN117632460A (en) 2024-03-01

Family

ID=90029214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210991019.1A Pending CN117632460A (en) 2022-08-18 2022-08-18 Load adjusting method and terminal equipment

Country Status (1)

Country Link
CN (1) CN117632460A (en)

Similar Documents

Publication Publication Date Title
CN109213539B (en) Memory recovery method and device
EP3531290B1 (en) Data backup method, apparatus, electronic device, storage medium, and system
CN111966492B (en) Memory recycling method and device, electronic equipment and computer readable storage medium
KR102501240B1 (en) Method for scheduling task and electronic device for the same
KR20150066083A (en) Multi tasking method of electronic apparatus and electronic apparatus thereof
CN111078172B (en) Display fluency adjusting method and device, electronic equipment and storage medium
US10922193B2 (en) Data backup method, storage medium, and terminal
CN112231077B (en) Application scheduling method and electronic equipment
CN107670276B (en) Game application control method and equipment
EP4206864A1 (en) Process scheduling method and terminal device
CN117632460A (en) Load adjusting method and terminal equipment
CN117632400A (en) Task scheduling method, electronic device and computer readable storage medium
CN116069209A (en) Focus window processing method, device, equipment and storage medium
CN110018888A (en) Method for managing resource, device, mobile terminal and computer readable storage medium
CN110209491B (en) Resource management method, device, server and storage medium
CN116088955B (en) Process processing method and terminal equipment
WO2022222872A1 (en) Interface display method, related apparatus, device, and readable storage medium
CN116095230B (en) Application program recommendation method, terminal device and readable storage medium
CN113760540B (en) Task processing method and related device
CN116320727B (en) Algorithm scheduling method and electronic equipment
CN116028207B (en) Scheduling policy determination method, device, equipment and storage medium
CN117707718A (en) Process management method, electronic device and readable storage medium
CN117707719A (en) Process management method, electronic device and readable storage medium
CN117376830B (en) Geofence matching method, electronic device and computer readable storage medium
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination