CN111104209B - Task processing method and related equipment - Google Patents

Task processing method and related equipment Download PDF

Info

Publication number
CN111104209B
CN111104209B CN201911168997.0A CN201911168997A CN111104209B CN 111104209 B CN111104209 B CN 111104209B CN 201911168997 A CN201911168997 A CN 201911168997A CN 111104209 B CN111104209 B CN 111104209B
Authority
CN
China
Prior art keywords
task
period
processor
electronic device
threshold
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.)
Active
Application number
CN201911168997.0A
Other languages
Chinese (zh)
Other versions
CN111104209A (en
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 CN201911168997.0A priority Critical patent/CN111104209B/en
Publication of CN111104209A publication Critical patent/CN111104209A/en
Application granted granted Critical
Publication of CN111104209B publication Critical patent/CN111104209B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application discloses a method for processing tasks, which is applied to the technical field of electronics and comprises the following steps: the electronic device acquires a task list every other preset time period in a first period, the electronic device can acquire a plurality of task lists in the first period, the task list is a task which is currently running on each computing engine in a processor of the electronic device, the task which is more than a first threshold value in the plurality of task lists is determined to be a first task, then the task which is more than a second threshold value in the first task and is longer than a second threshold value in the second period is determined to be a second task, the second task can be determined to be a high-load task, and the electronic device outputs prompt information to prompt a user to process the second task, and can also automatically process the second task. According to the method and the device, firstly, the task with high load can be determined efficiently in a sampling statistics and targeted calculation load mode, so that the pressure of a processor is reduced in time, and the efficiency is improved.

Description

Task processing method and related equipment
Technical Field
The present disclosure relates to the field of electronic technologies, and in particular, to a method for processing tasks and related devices.
Background
In the field of system monitoring, task load is generally used as an important index for judging whether a task is normal or not. Currently, in order to efficiently utilize the processor resources of an electronic device, certain processing of high-load tasks is often required. For example: if a task is under 100% load condition or high load condition for a long time, the computing power of the current system may already reach the bottleneck of task execution, or the task itself has an abnormal execution path (such as entering a dead loop), for which further positioning actions and corresponding processing measures are usually required, otherwise, the system is usually under an abnormal state, which affects normal business. For high-load tasks, therefore, methods must be available for monitoring in order to perform the corresponding processing in a timely manner. How to monitor each task and determine a high load task is a matter of ongoing investigation by those skilled in the art.
In the prior art, for monitoring all tasks on the whole operating system, the loads of all tasks on the system are traversed, and then the results of all loads are sequenced to obtain the tasks with TOP loads and the loads thereof (such as a common TOP application program). However, since all tasks need to be traversed, the overhead per se is extremely high (taking the current common mobile phone terminal as an example, taking a second as a period to monitor, the single CPU overhead is more than 20%), and many scenes and fields are not suitable for using the scheme in consideration of the influence on the power consumption and the performance per se.
Therefore, how to efficiently monitor a high-load task and process the high-load task according to the result of the monitoring, so that reducing the pressure of the processor is a problem that those skilled in the art are studying.
Disclosure of Invention
The embodiment of the application provides a method for processing tasks and related equipment, which can efficiently monitor high-load tasks so as to reduce the pressure of a processor and save the operation resources of electronic equipment.
In a first aspect, the present application provides a method for processing a task, where the method includes:
the electronic device obtains a plurality of task lists in a first period, wherein the plurality of task lists comprise: the electronic equipment acquires a task list every other preset time; each task list comprises a task running on each computing engine in a processor of the electronic device when the task list is acquired;
the electronic device determines a first task, the first task comprising: tasks in the plurality of task lists that occur more than a first threshold;
the electronic device determines a second task, the second task comprising: in the first task, the running time in the second period is longer than the task of the second threshold value, or the average running time in the unit time in the second period is longer than the task of the third threshold value; the second period is located after the first period;
The electronic equipment outputs prompt information, wherein the prompt information is used for prompting a user to process the second task; or the electronic equipment processes the second task.
According to the method provided by the embodiment of the application, the electronic equipment acquires one task list every preset time period in the first period, the electronic equipment can acquire a plurality of task lists in the first period, the task lists are tasks running on each computing engine in a processor of the electronic equipment, the tasks which occur in the task lists and are more than a first threshold value are determined to be first tasks, then the tasks which occur in the task lists and are more than a second threshold value in the first tasks and are longer than a second threshold value in the running period in the second period are determined to be second tasks, the second tasks can be determined to be high-load tasks, the electronic equipment outputs prompt information, a user can be prompted to process the second tasks, and the electronic equipment can be prompted to process the second tasks; according to the implementation mode, firstly, the tasks with high loads can be determined efficiently through sampling statistics and a targeted calculation load mode, so that the pressure of a processor is reduced in time, and the efficiency is improved.
In one possible implementation manner, the processing the second task specifically includes: the electronic equipment controls the average running time of the second task in unit time not to exceed a fourth threshold value; or the electronic equipment controls the operation duration of the second task in the third period not to exceed a fifth threshold value; or the electronic equipment interrupts the second task and releases the processor resource occupied by the second task. The implementation mode can effectively reduce the pressure of the processor by limiting the operation time of the second task or directly interrupting the second task to release the occupied resources.
In one possible implementation, the ratio of the first period to the preset duration is associated with the first threshold; the larger the ratio, the larger the first threshold. The implementation mode describes the relation between the ratio of the first period to the preset duration and the first threshold, the larger the ratio is, the larger the obtained task list queue is, the larger the first threshold is correspondingly, and the flexibility and the practicability of the scheme are reflected.
In one possible implementation, the second period is associated with the second threshold; the longer the second period, the greater the second threshold. The implementation mode describes the relation between the second period and the second threshold value, the longer the second period is, the longer the accumulated execution time of the task is, and the correspondingly larger the second threshold value is, so that the flexibility and the practicability of the scheme are embodied.
In one possible implementation, the task is a thread or a process.
In a second aspect, the present application provides an apparatus for processing tasks, comprising:
an acquiring unit, configured to acquire a plurality of task lists in a first period, where the plurality of task lists includes: the electronic equipment acquires a task list every other preset time; each task list comprises a task running on each computing engine in a processor of the electronic device when the task list is acquired;
A first determining unit, configured to determine a first task, where the first task includes: tasks in the plurality of task lists that occur more than a first threshold;
a second determining unit, configured to determine a second task, where the second task includes: in the first task, the running time in the second period is longer than the task of the second threshold value, or the average running time in the unit time in the second period is longer than the task of the third threshold value; the second period is located after the first period;
the output unit is used for outputting prompt information which is used for prompting a user to process the second task; or a processing unit, configured to process the second task.
In one possible implementation manner, when the output unit is configured to process the second task, the method specifically includes: the control unit is used for controlling the average running duration of the second task in unit time not to exceed a fourth threshold value; or the control unit is further used for controlling the operation duration of the second task in the third period not to exceed a fifth threshold value; or an interrupt unit, configured to interrupt the second task and release a processor resource occupied by the second task.
In one possible implementation, the ratio of the first period to the preset duration is associated with the first threshold; the larger the ratio, the larger the first threshold.
In one possible implementation, the second period is associated with the second threshold; the longer the second period, the greater the second threshold.
In one possible implementation, the task is a thread or a process.
In a third aspect, the present application provides an electronic device, including a processor, a memory, and a communication interface, where the memory is configured to store information sending program code, and the processor is configured to invoke the data transmission program code to perform a method of processing a task provided by the first aspect or any implementation manner of the first aspect of the embodiments of the present application.
In a fourth aspect, embodiments of the present application provide a computer storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform a method of processing tasks provided by the first aspect or any implementation manner of the first aspect of embodiments of the present application.
In a fifth aspect, embodiments of the present application provide a computer program which, when run on an electronic device, causes the electronic device to perform the method of processing tasks provided by the first aspect or any implementation manner of the first aspect of embodiments of the present application.
In a sixth aspect, the present application provides a chip system comprising at least one processor and interface circuitry providing program instructions for the at least one processor for supporting an electronic device for performing the functions referred to in the first aspect, e.g. generating or processing the information referred to in the method of processing tasks referred to above, when the program instructions are executed by the at least one processor. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the data transmission device. The chip system can be composed of chips, and can also comprise chips and other discrete devices.
It will be appreciated that the apparatus provided in the second aspect, the electronic device provided in the third aspect, the computer storage medium provided in the fourth aspect, the computer program provided in the fifth aspect, and the system-on-chip provided in the sixth aspect are all used for executing the method of processing tasks provided in the first aspect, so that the benefits achieved by the apparatus provided in the second aspect may refer to the benefits in the method of processing tasks provided in the first aspect, and are not repeated herein.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a schematic diagram of a software architecture according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for processing tasks according to an embodiment of the present disclosure;
fig. 4 is a schematic view of a scenario provided in an embodiment of the present application;
fig. 5 is a schematic view of another scenario provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of an apparatus for processing tasks according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of another device for processing tasks according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a chip system according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and thoroughly described below with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the associated object, and indicates that three relations may exist, for example, a and/or B may indicate: the three cases where a exists alone, a and B exist together, and B exists alone, and in addition, in the description of the embodiments of the present application, "plural" means two or more than two.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The electronic device involved in the embodiments of the present application may be a mobile phone, tablet computer, desktop, laptop, notebook, ultra mobile personal computer (Ultra-mobile Personal Computer, UMPC), handheld computer, netbook, personal digital assistant (Personal Digital Assistant, PDA), wearable electronic device, virtual reality device, etc.
Next, an exemplary electronic device provided in the following embodiments of the present application is described.
Fig. 1 shows a schematic configuration of an electronic device 100.
The embodiment will be specifically described below taking the electronic device 100 as an example. It should be understood that electronic device 100 may have more or fewer components than shown, may combine two or more components, or may have a different configuration of components. The various components shown in the figures 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 electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge 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, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
Processors are typically multi-core, so-to speak, having multiple compute engines. A processor can run a plurality of different threads simultaneously, only one thread is in the running queue of a kernel at the same time, and a task list of the processor at one time comprises tasks at the time in all the running queues. In this embodiment of the present application, the processor may acquire a task list in a first period at intervals of a preset duration, where the task list includes tasks currently running on each computing engine in the processor, determine that a task that occurs in the task list for a number of times greater than a first threshold is a first task, and then determine that a task that occurs in the first task for a number of times greater than a second threshold in a second period is a second task, where the second task may be determined to be a high-load task, and the processor outputs a prompt message to prompt a user to process the second task, and may also automatically process the second task. Specific implementation steps and beneficial effects thereof can refer to descriptions of examples of the subsequent methods, which are not repeated herein.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, 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), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 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 change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1. Where the N cameras may be on different sides of the electronic device 100, e.g., the electronic device 100 may have one front camera and one rear camera, may also have one front camera and multiple rear cameras, may also have one front camera and one side camera, may also have one rear camera and one side camera, and so on.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A. In some embodiments, speaker 170A may be used to output prompts. The implementation of the prompt information may refer to the description of the following method examples, which are not repeated here.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location but with different touch operation intensities may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being larger than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100.
The air pressure sensor 180C is used to measure air pressure.
The magnetic sensor 180D includes a hall sensor.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode.
The ambient light sensor 180L is used to sense ambient light level.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J.
The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects by the touch operation on different areas of the display 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the invention, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 2 is a software configuration block diagram of the electronic device 100 according to the embodiment of the present invention.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, an event manager, and the like.
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 used to provide the communication functions of the electronic device 100. 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 electronic device vibrates, and an indicator light blinks, etc.
The event manager may be configured to determine whether a touch coordinate of a touch operation of the user is within the first area when the first control mode has been turned on. If yes, reporting the event of the touch operation to an application program layer; if not, the touch operation is not processed.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android 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 android.
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 Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding 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.
The 2D graphics engine is a drawing engine for 2D drawing. 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.
First, some terms in this application are explained for easy understanding by those skilled in the art.
(1) Process (Process): the method is a running activity of a program in a computer on a certain data set, is a basic unit for resource allocation and scheduling of a system, and is a basis of an operating system structure. The process is a basic execution entity of the program; in contemporary thread-oriented computer architectures, the process is a container for the threads. A program is a description of instructions, data, and their organization, and a process is an entity of a program. A process can be seen as a stand-alone program with its complete data space and code space in memory. The data and variables owned by a process are only of its own.
(2) Thread: is the minimum unit of execution of an operation in a process, i.e., the basic unit of execution of processor scheduling. If a process is understood to be a task that is logically completed by an operating system, then the thread represents one of many possible subtasks that complete the task. That is, the thread exists in the process. A process is made up of one or more threads, each sharing the same code and global data.
(3) Tasks: including the individual actions of the user upon operation of the computer and corresponding response events (e.g., mouse click, right click, opening a dialog box, closing a file, starting a program, etc.), the task is a generic term referring to an activity performed by software. In the embodiment of the present application, a task may be either a process or a thread. In short, it refers to a series of operations that collectively achieve a certain purpose. For example, the data is read and placed into memory. This task may be implemented as a process or as a thread (or as an interrupt task).
(4) Load of the task: the running time of the task in unit time or the running time proportion of the task in unit time. A task may be considered a high load task if the running time of the task exceeds a threshold, or the proportion of time the task runs per unit time exceeds a threshold.
Several embodiments related to the embodiments of the present application and User Interface (UI) embodiments in application scenarios of the embodiments are described below to describe in detail how the embodiments of the present application solve the technical problem of monitoring a task with a high load. As shown in fig. 3, the high-load task statistics method provided in the embodiment of the present application may include the following steps:
step S301: the electronic device obtains a plurality of task lists in a first period.
Specifically, the electronic device acquires a plurality of task lists in a first period, wherein the plurality of task lists comprise task lists acquired by the electronic device every other preset time, and each task list comprises tasks running on each computing engine in a processor of the electronic device when the task list is acquired. In brief, the processor of the electronic device may process a plurality of tasks simultaneously, and in a first period, tasks running on each computing engine in the processor are acquired once every preset time period, and a task list at one time of the processor includes tasks running on that time in a running queue on each computing engine of the processor. Taking the processor as an eight-core processor as an example, there may be eight running queues at one time of the processor, and each running queue has one running task, so that eight tasks are corresponding in the task list, for example, a preset first period is 1 second, a preset duration is 100 milliseconds, as shown in fig. 4, and at the 100 th millisecond after the first period begins (i.e., the first period 1_1 in fig. 4), the electronic device acquires the running task list 1 on the processor, where the task list 1 may be task1, task2, … …, task8; at 200 ms after the first period starts (i.e., the first period 1_2 in fig. 4), the electronic device obtains a task list 2 running on the processor, where the task list 2 may be task1, task10, … …, task16; at 300 ms after the first period starts, the electronic device acquires a task list 3 running on the processor, where the task list 3 may be task1, task18, … …, task32; … …; at 1 st second after the start of the first cycle (i.e., first cycle 1_10 in fig. 4), the electronic device obtains a task list 10 running on the processor, where the task list 10 may be task1, task74, … …, task80. At this time, the first period is over, and the electronic device acquires 10 task lists in the first period. In some of these embodiments, the first period may also be referred to as a statistical period.
Where a task may be a thread or a process, a process comprising one or more threads. When the task is a thread, a different thread is run at each time on each compute engine in the processor, that is, the same task is not present in the task list at the same time. As in the example of step S301, the first period is 1 second, and the preset duration is 100 ms, then the electronic device obtains task lists in operation on the processor as task1, task2, … …, task8 at the 100 th ms after the first period starts; at 200 ms after the first period starts, the electronic device acquires task lists running on the processor as task1, task10, … … and task16; at 300 milliseconds after the first period starts, the electronic device acquires task lists running on the processor as task1, task18, … … and task32; … …; at 1 st second after the first cycle begins, the electronic device obtains the running task list on the processor as task1, task74, … …, task80.
When a task is a process, each time on each compute engine in the processor may run a thread of the same process, that is, the same task may be in the task list at the same time. For example, assume that the task in step S301 is a process. For example, task1 is process 1, and process 1 includes thread 1, thread 2 and thread 3, so when the processor runs thread 1, task1 appears in the task list, when the processor runs thread 2, task1 also appears in the task list, and when the processor runs thread 3, task1 also appears in the task list. The first period is 1 second, the preset duration is 100 milliseconds, and then at the 100 th millisecond after the first period starts, the task list running on the electronic device acquiring processor can be task1, … … and task8; at 200 ms after the first period starts, the task list running on the electronic device acquiring processor may be task2, task1, … …, task16; at 300 ms after the first period starts, the task list running on the electronic device acquiring processor may be task1, … …, task32; … …; at 1 st second after the first cycle begins, the electronic device obtains the running task list on the processor as task1, task74, … …, task80.
Step S302: the electronic device determines a first task.
Specifically, after the electronic device acquires the plurality of task lists in the first period, determining a first task, wherein the first task comprises a task which occurs in the plurality of task lists for a number of times greater than a first threshold. In short, after the electronic device acquires the task lists in the first period, the frequency of occurrence of each task in the task lists is counted, and if the frequency of the task is greater than the first threshold, the task is determined to be the first task. For example, as shown in fig. 4, in the example of the above steps, the electronic device acquires 10 task lists in the first period, and the result in the statistical period is task1:10 times, task2:1 time, task3:1 time, … … and task80:1 time. Setting the first threshold to 3 times, if only the frequency of task1 is greater than the first threshold, determining that task1 is the first task, and if task1 is task_top1 in fig. 4, entering the second period.
In one embodiment, the preset duration may be predefined by a user, and the preset duration may also be automatically configured by the electronic device according to the first period. For example, if the first period is set to 1 second, the electronic device may configure the preset duration to be 100 milliseconds according to the duration of the first period, so as to ensure that the electronic device obtains a sufficient task list in the first period; if the first period is set to 2 seconds, the electronic device may configure the preset duration to be 200 milliseconds according to the duration of the first period, so as to ensure that the electronic device obtains a proper number of task lists in the first period.
In one embodiment, the first threshold may be predefined by a user, and the first threshold may also be automatically configured by the electronic device according to a first period and a preset duration, where a ratio of the first period to the preset duration is associated with the first threshold, and in a case where the first period is fixed, the longer the preset duration, the smaller the first threshold; in other words, the larger the ratio of the first period to the preset time period, the larger the first threshold value. For example, if the first period is set to be 1 second and the preset duration is set to be 100 ms, the electronic device may acquire 10 task lists in the first period, and at this time, the electronic device may configure the first threshold to be 3 according to the first period and the preset duration, and determine the tasks with the frequency greater than 3 in the 10 task lists as the first task, so as to ensure that the occurrence frequency of the first task is above a suitable value in the total frequency; if the first period is set to be 2 seconds and the preset duration is set to be 100 milliseconds, the electronic device can acquire 20 task lists in the first period, at this time, the electronic device can configure a first threshold to be 6 according to the first period and the preset duration, and the tasks with the frequency greater than 3 in the 10 task lists are determined to be the first tasks, so that the occurrence frequency of the first tasks is ensured to be above a proper value in the total frequency.
Step S303: the electronic device determines a second task.
Specifically, after determining the first task, the electronic device determines a second task, where the second task includes a task in the first task that has a running time length in a second period that is greater than a second threshold, or a task that has an average running time length in a unit time in the second period that is greater than a third threshold; the second period is located after the first period. That is, after the first period, the second period starts, the electronic device counts the running duration of the first task in the second period, and if the running duration of the first task in the second period is greater than the second threshold or the average running duration in unit time in the second period is greater than the third threshold, the electronic device determines that the first task is the second task. For example, after the second period is set to 1 second, the electronic device determines that the first task is task1, calculates the accumulated execution time of task1 to 2500 ms at the beginning of the second period, calculates the accumulated execution time of task1 to 3480 ms at the end of the second period, that is, after 1 second, where it may be obtained that the execution time of task1 in the second period is 980 ms (3480 ms minus 2500 ms), the running duration in unit time in the second period is 980 ms, the second threshold is 900 ms, and 980 ms is greater than the second threshold, and then the electronic device determines that task1 is the second task. The third threshold may also be set to 900 ms, 980 ms being greater than the third threshold, and the electronic device determines task1 as the second task. In some of these embodiments, the second period may also be referred to as a computation period.
In one embodiment, the second threshold may be predefined by the user, and the second threshold may also be automatically configured by the electronic device according to the second period; the second period is associated with a second threshold, the longer the second period, the greater the second threshold. For example, if the second period is set to be 1 second, the electronic device may configure the second threshold to be 900 ms according to the duration of the second period, and determine the first task that is running for more than 900 ms in 1 second as the second task, so as to ensure that the running duration of the second task reaches the running duration of the high-load task; if the second period is set to be 2 seconds, the electronic device may configure the second threshold to be 1800 milliseconds according to the duration of the second period, and determine the first task that runs for more than 1800 milliseconds in 2 seconds as the second task, so as to ensure that the running duration of the second task reaches the running duration of the high-load task.
Step S304: the electronic equipment outputs the prompt information or the electronic equipment processes the second task.
Specifically, after the electronic device determines the second task, there may be two processing cases, case one: outputting prompt information, wherein the prompt information is used for prompting a user to process a second task; because the electronic device determines that the second task is a high-load task, the electronic device can output prompt information to prompt the user to perform corresponding processing, wherein the prompt mode of the prompt information is not limited to modes such as voice, characters, vibration and the like. After the user makes corresponding processing, the electronic equipment receives processing operation of the user and processes the second task.
And in the second case, after the electronic equipment determines the second task, the electronic equipment can automatically process the second task. The specific processing mode can be as follows:
in one mode, the electronic device may set a fourth threshold, and control the average running duration of the second task in the unit time not to exceed the fourth threshold, that is, release more resources to allow the processor to process another task.
In a second mode, the electronic device may set a fifth threshold, and control the running duration of the second task in a third period to not exceed the fifth threshold, where the third period may be the next statistical period.
In the third mode, if the second task continues to maintain the high-load state in a continuous period of time, the electronic device may interrupt the second task and directly release the processor resource occupied by the second task.
According to the embodiment of the application, the electronic device acquires a task list every other preset time period in a first period, the electronic device can acquire a plurality of task lists in the first period, the task lists are tasks running on each computing engine in a processor of the electronic device, the tasks which occur in the task lists for times larger than a first threshold value are determined to be first tasks, then the tasks which occur in the first tasks and are longer than a second threshold value in the running time period in a second period are determined to be second tasks, the second tasks can be determined to be high-load tasks, the electronic device outputs prompt information to prompt a user to process the second tasks, and the electronic device can also automatically process the second tasks; as shown in fig. 5, after the second period 1 is shown in the first period 1, the electronic device counts the running tasks (task list) on the task list of the processor in the first period 1, so as to determine a first task, then monitors the first task in the second period 1, monitors the running time of the first task in the second period 1, and determines a second task, wherein in the process of monitoring the first task in the second period 1, another first period 2 can be started at the same time, statistics is performed on the task list of the processor in the first period 2, so as to determine the first task, then monitors the first task in the second period 2, monitors the running time of the first task in the second period 2, determines the second task, and can continuously perform statistics and monitoring.
The foregoing description of the solution provided in the embodiments of the present application has been mainly presented in terms of a method implemented by an electronic device. It is to be appreciated that each network element, e.g., electronic device, processor, etc., comprises corresponding hardware structures and/or software modules that perform the functions described above. Those of skill in the art will readily appreciate that the various illustrative network elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the present application may divide functional modules of an electronic device, an image capturing device, or the like according to the above-described method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
In the case of dividing each functional module by corresponding each function, please refer to fig. 6, fig. 6 is a schematic structural diagram of a processing task device 60 provided in the embodiment of the present application, where the processing task device 60 may include an obtaining unit 601, a first determining unit 602, a second determining unit 603, and an output unit 604, where detailed descriptions of each unit are as follows:
an obtaining unit 601, configured to obtain a plurality of task lists in a first period, where the plurality of task lists includes: the electronic equipment acquires a task list every other preset time; each task list comprises a task running on each computing engine in a processor of the electronic device when the task list is acquired;
a first determining unit 602, configured to determine a first task, where the first task includes: tasks in the plurality of task lists that occur more than a first threshold;
a second determining unit 603, configured to determine a second task, where the second task includes: in the first task, the running time in the second period is longer than the task of the second threshold value, or the average running time in the unit time in the second period is longer than the task of the third threshold value; the second period is located after the first period;
And the output unit 604 is configured to output prompt information, where the prompt information is used to prompt the user to process the second task.
Referring to fig. 7, fig. 7 is a schematic structural diagram of another processing task device 70 provided in an embodiment of the present application, where the processing task device 70 may include an acquisition unit 701, a first determining unit 702, a second determining unit 703, and a processing unit 704, where the detailed descriptions of the respective units are as follows:
an obtaining unit 701, configured to obtain a plurality of task lists in a first period, where the plurality of task lists includes: the electronic equipment acquires a task list every other preset time; each task list comprises a task running on each computing engine in a processor of the electronic device when the task list is acquired;
a first determining unit 702, configured to determine a first task, where the first task includes: tasks in the plurality of task lists that occur more than a first threshold;
a second determining unit 703, configured to determine a second task, where the second task includes: in the first task, the running time in the second period is longer than the task of the second threshold value, or the average running time in the unit time in the second period is longer than the task of the third threshold value; the second period is located after the first period;
And a processing unit 704, configured to process the second task.
For the above processing task device 60 and the processing task device 70, in one embodiment, when the processing unit 704 is configured to process the second task, the processing unit specifically includes: a control unit 605, configured to control the running duration of the second task in a unit time not to exceed a fourth threshold; or the control unit 605 is further configured to control the operation duration of the second task in the third period not to exceed a fifth threshold; or an interrupt unit 606, configured to interrupt the second task and release the processor resource occupied by the second task.
For the processing task device 60 and the processing task device 70, in one embodiment, a ratio of the first period to the preset duration is associated with the first threshold; the larger the ratio, the larger the first threshold.
For the processing task device 60 and the processing task device 70 described above, in one embodiment, the second period is associated with the second threshold; the longer the second period, the greater the second threshold.
For the processing task device 60 and the processing task device 70 described above, in one embodiment, the task is a thread or a process.
Referring to fig. 8, a chip system 800 is also provided in an embodiment of the present application, including one or more processors 801 and interface circuitry 802. Optionally, the system on chip 800 may further comprise a bus 803. Wherein:
the processor 801 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware in the processor 801 or by instructions in software. The processor 801 described above may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The methods and steps disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The interface circuit 802 may perform transmission or reception of data, instructions, or information, and the processor 801 may perform processing using the data, instructions, or other information received by the interface circuit 802, and may transmit processing completion information through the interface circuit 802.
Optionally, the system on a chip further comprises a memory, which may include read only memory and random access memory, and provides operating instructions and data to the processor. A portion of the memory may also include non-volatile random access memory (NVRAM).
Optionally, the memory stores executable software modules or data structures and the processor may perform corresponding operations by invoking operational instructions stored in the memory (which may be stored in an operating system).
Alternatively, the chip system may be used in a user equipment or a network device according to an embodiment of the present application. Optionally, an interface circuit 802 may be used to output the results of the execution of the processor 801. The resource reservation method provided in one or more embodiments of the present application may refer to the foregoing embodiments, and will not be described herein.
The functions corresponding to the processor 801 and the interface circuit 802 may be implemented by a hardware design, a software design, or a combination of hardware and software, which is not limited herein.
Embodiments of the present application also provide a computer-readable storage medium. All or part of the flow of the above method embodiments may be implemented by a computer program to instruct related hardware, where the program may be stored in the above computer storage medium, and when the program is executed, the program may include the flow of each method embodiment as described above. The computer-readable storage medium includes: a read-only memory (ROM) or a random access memory (random access memory, RAM), a magnetic disk or an optical disk, or the like.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. A method of processing tasks, the method comprising:
the electronic device obtains a plurality of task lists in a first period, wherein the plurality of task lists comprise: the electronic equipment acquires a task list every other preset time; each task list comprises a task running on each computing engine in a processor of the electronic device when the task list is acquired;
the electronic device determines a first task, the first task comprising: tasks in the plurality of task lists that occur more than a first threshold;
The electronic device determines a second task, the second task comprising: in the first task, the running time in the second period is longer than the task of the second threshold value, or the average running time in the unit time in the second period is longer than the task of the third threshold value; the second period is located after the first period;
the electronic equipment outputs prompt information, wherein the prompt information is used for prompting a user to process the second task; or the electronic equipment processes the second task.
2. The method according to claim 1, wherein the processing the second task specifically includes:
the electronic equipment controls the average running time of the second task in unit time not to exceed a fourth threshold value;
or the electronic equipment controls the operation duration of the second task in the third period not to exceed a fifth threshold value;
or the electronic equipment interrupts the second task and releases the processor resource occupied by the second task.
3. The method of claim 1, wherein a ratio of the first period to the preset duration is associated with the first threshold; the larger the ratio, the larger the first threshold.
4. The method of claim 1, wherein the second period is associated with the second threshold; the longer the second period, the greater the second threshold.
5. The method of claim 1, wherein the task is a thread or a process.
6. An apparatus for processing tasks, comprising:
an acquiring unit, configured to acquire a plurality of task lists in a first period, where the plurality of task lists includes: the electronic equipment acquires a task list every other preset time; each task list comprises a task running on each computing engine in a processor of the electronic device when the task list is acquired;
a first determining unit, configured to determine a first task, where the first task includes: tasks in the plurality of task lists that occur more than a first threshold;
a second determining unit, configured to determine a second task, where the second task includes: in the first task, the running time in the second period is longer than the task of the second threshold value, or the average running time in the unit time in the second period is longer than the task of the third threshold value; the second period is located after the first period;
The output unit is used for outputting prompt information which is used for prompting a user to process the second task; or a processing unit, configured to process the second task.
7. The device according to claim 6, characterized in that said processing unit comprises in particular:
the control unit is used for controlling the average running duration of the second task in unit time not to exceed a fourth threshold value;
or the control unit is further used for controlling the operation duration of the second task in the third period not to exceed a fifth threshold value;
or an interrupt unit, configured to interrupt the second task and release a processor resource occupied by the second task.
8. The apparatus of claim 6, wherein a ratio of the first period to the preset duration is associated with the first threshold; the larger the ratio, the larger the first threshold.
9. The apparatus of claim 6, wherein the second period is associated with the second threshold; the longer the second period, the greater the second threshold.
10. The apparatus of claim 6, wherein the task is a thread or a process.
11. A terminal device comprising a processor, a memory and a communication interface, wherein the memory is configured to store information transmission program code, and wherein the processor is configured to invoke the program code to perform the method of any of claims 1-5.
12. A chip system, comprising at least one processor, a memory and an interface circuit, wherein the memory, the interface circuit and the at least one processor are interconnected by a line, and wherein the at least one memory has instructions stored therein; when executed by the processor, the method of any of claims 1-5 is achieved.
13. A computer storage medium, characterized in that the computer storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-5.
CN201911168997.0A 2019-11-25 2019-11-25 Task processing method and related equipment Active CN111104209B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911168997.0A CN111104209B (en) 2019-11-25 2019-11-25 Task processing method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911168997.0A CN111104209B (en) 2019-11-25 2019-11-25 Task processing method and related equipment

Publications (2)

Publication Number Publication Date
CN111104209A CN111104209A (en) 2020-05-05
CN111104209B true CN111104209B (en) 2023-07-11

Family

ID=70421240

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911168997.0A Active CN111104209B (en) 2019-11-25 2019-11-25 Task processing method and related equipment

Country Status (1)

Country Link
CN (1) CN111104209B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116567132A (en) * 2022-01-28 2023-08-08 荣耀终端有限公司 Power consumption control method and device
CN117666755A (en) * 2022-08-29 2024-03-08 华为技术有限公司 Task scheduling method and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599027A (en) * 2009-06-30 2009-12-09 中兴通讯股份有限公司 A kind of thread pool management method and system thereof
CN102739775A (en) * 2012-05-29 2012-10-17 宁波东冠科技有限公司 Method for monitoring and managing Internet of Things data acquisition server cluster
CN104935523A (en) * 2014-03-21 2015-09-23 中国移动通信集团公司 Load balancing processing method and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10489189B2 (en) * 2017-02-17 2019-11-26 International Business Machines Corporation Selection of maintenance tasks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599027A (en) * 2009-06-30 2009-12-09 中兴通讯股份有限公司 A kind of thread pool management method and system thereof
CN102739775A (en) * 2012-05-29 2012-10-17 宁波东冠科技有限公司 Method for monitoring and managing Internet of Things data acquisition server cluster
CN104935523A (en) * 2014-03-21 2015-09-23 中国移动通信集团公司 Load balancing processing method and equipment

Also Published As

Publication number Publication date
CN111104209A (en) 2020-05-05

Similar Documents

Publication Publication Date Title
CN112789651B (en) Frequency adjustment method and device applied to terminal and electronic equipment
WO2021052070A1 (en) Frame rate identification method and electronic device
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
CN112527476B (en) Resource scheduling method and electronic equipment
WO2021052139A1 (en) Gesture input method and electronic device
CN115333941B (en) Method for acquiring application running condition and related equipment
CN111031492B (en) Call demand response method and device and electronic equipment
CN111104209B (en) Task processing method and related equipment
CN113641271A (en) Application window management method, terminal device and computer readable storage medium
CN115119048B (en) Video stream processing method and electronic equipment
CN114828098B (en) Data transmission method and electronic equipment
CN114079642B (en) Mail processing method and electronic equipment
CN116700913A (en) Scheduling method, equipment and storage medium of embedded file system
CN114911400A (en) Method for sharing pictures and electronic equipment
CN110737916A (en) Communication terminal and processing method
CN116048831B (en) Target signal processing method and electronic equipment
CN116703689B (en) Method and device for generating shader program and electronic equipment
CN116089057B (en) Resource scheduling method, device, storage medium and program product
CN116233599B (en) Video mode recommendation method and electronic equipment
CN116048629B (en) System service switching method, control device, electronic equipment and storage medium
CN116661984B (en) Load control method, electronic equipment and storage medium
CN116991274B (en) Upper sliding effect exception handling method and electronic equipment
CN116795604B (en) Processing method, device and equipment for application exception exit
CN114006969B (en) Window starting method and electronic equipment
CN117687814A (en) Exception handling method, system and 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
GR01 Patent grant
GR01 Patent grant