Task processing method, apparatus, device, and medium
Patent Information
- Application Number
- CN202210948929.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-08-09
AI Technical Summary
[0004]本申请的目的是提供一种任务处理方法、装置、设备及介质,用以解决任务队列拥塞,导致处理任务的速度缓慢的问题
本申请实施例通过在终端设备启动后,确定Handler线程的任务队列中存储任务的数量阈值,以及实时获取任务队列中存储的任务的实际数量;基于实时获取到的任务队列中存储的任务的实际数量、任务队列中存储任务的数量阈值、以及任务队列支持的各个任务类型的优先级信息,确定各个任务类型分别对应的入队速度;针对任意一个任务类型,根据任务类型对应的入队速度,对任务类型的任务进行入队处理。由此可以控制任务队列的入队速度,从而缓解了任务队列中任务的拥塞程度,极大的增加了对任务的处理速度,还节省了终端设备的资源以及极大的提升了终端设备的泰尔抗老化分数。
Smart Images

Figure CN115269232B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a task processing method, apparatus, device and medium. Background Technology
[0002] In Android's FUSE (Filesystem in Userspace), for flexible permission management and fast and accurate storage statistics, the fuse daemon and media service are placed in the media provider.
[0003] In existing technologies, file operations and task processing in FUSE belong to two different threads. Therefore, each file operation in fusedeamon and mediaservice generates a background task, which is added to the task queue of the Handler thread and finally processed one by one by the task processing thread. However, when performing batch file operations, the task queue of the Handler thread can become congested, resulting in a very slow task processing speed. Summary of the Invention
[0004] The purpose of this application is to provide a task processing method, apparatus, device, and medium to solve the problem of slow task processing speed caused by task queue congestion.
[0005] Firstly, this application provides a task processing method, the method comprising: After the terminal device starts up, determine the threshold number of tasks stored in the task queue of the Handler thread, and obtain the actual number of tasks stored in the task queue in real time. Based on the actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, the enqueue speed corresponding to each task type is determined. For any given task type, tasks of that task type are enqueued according to the enqueue speed corresponding to that task type.
[0006] In one possible implementation, determining the enqueue speed for each task type based on the actual number of tasks stored in the task queue (obtained in real time), the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue includes: Based on the actual number of tasks stored in the task queue obtained in real time and the threshold number of tasks stored in the task queue, the enqueue speed corresponding to the task queue is determined. Based on the priority information of each task type supported by the task queue and the enqueue speed corresponding to the task queue, a corresponding enqueue speed is assigned to each task type.
[0007] In one possible implementation, the quantity threshold includes a first quantity threshold and a second quantity threshold, wherein the first quantity threshold is smaller than the second quantity threshold; The step of determining the enqueue speed corresponding to the task queue based on the actual number of tasks stored in the task queue obtained in real time and the threshold number of tasks stored in the task queue includes: If the actual number of tasks stored in the task queue obtained in real time is not greater than the first number threshold, then the enqueue speed corresponding to the task queue is determined to be the first enqueue speed. If the actual number of tasks stored in the task queue obtained in real time is greater than the first number threshold and not greater than the second number threshold, then the enqueue speed corresponding to the task queue is determined to be the second enqueue speed. If the actual number of tasks stored in the task queue obtained in real time is greater than the second number threshold, then the enqueue speed corresponding to the task queue is determined to be the third enqueue speed. Wherein, the first queuing speed is greater than the second queuing speed, and the second queuing speed is greater than the third queuing speed.
[0008] In one possible implementation, determining the enqueue speed for each task type based on the actual number of tasks stored in the task queue (obtained in real time), the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue includes: Based on the priority information of each task type supported by the task queue and the number threshold of tasks stored in the task queue, the number threshold corresponding to each task type is determined respectively. Based on the actual number of tasks stored in the task queue obtained in real time and the number threshold corresponding to each task type, the enqueue speed corresponding to each task type is determined.
[0009] In one possible implementation, determining the enqueue speed for each task type based on the actual number of tasks stored in the task queue obtained in real time and the quantity threshold corresponding to each task type includes: For any task type supported by the task queue: When the actual number of tasks stored in the task queue obtained in real time is not greater than the number threshold, the enqueue speed corresponding to the task type is determined as the fourth enqueue speed. When the actual number of tasks stored in the task queue obtained in real time is greater than the number threshold, the enqueue speed corresponding to the task type is determined to be the fifth enqueue speed.
[0010] In one possible implementation, the step of obtaining the actual number of tasks stored in the task queue in real time includes: Perform a locking operation on the task queue; and after performing the locking operation, traverse the task queue to determine the actual number of tasks stored in the task queue; or... The system monitors the enqueue and dequeue operations of tasks of various task types supported by the task queue in real time; and counts the actual number of tasks stored in the task queue based on the number of enqueue and / or dequeue operations performed.
[0011] In one possible implementation, determining the threshold number of tasks stored in the task queue of the Handler thread includes: Obtain the remaining memory space of the process corresponding to the Handler thread; Based on the remaining memory space and the preset storage ratio, determine the memory space in the process for storing the task queue; Based on the memory space used to store the task queue in the process and the memory space occupied by a task in the task queue, a threshold for the number of tasks stored in the task queue is determined.
[0012] Secondly, this application provides a task processing apparatus, the apparatus comprising: The acquisition module is used to determine the threshold number of tasks stored in the task queue of the Handler thread after the terminal device is started, and to acquire the actual number of tasks stored in the task queue in real time. The speed determination module is used to determine the enqueue speed corresponding to each task type based on the actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue. The processing module is used to enqueue tasks of any given task type according to the enqueue speed corresponding to that task type.
[0013] Thirdly, this application provides a terminal device, including: Processor and memory; The memory is used to store the processor-executable instructions; The processor is configured to execute the instructions to implement the task processing method as described in any one of the first aspects above.
[0014] Fourthly, this application provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a terminal device, enables the terminal device to perform the task processing method as described in any one of the first aspects above.
[0015] Fifthly, this application provides a computer program product, including a computer program: When the computer program is executed by a processor, it implements the task processing method as described in any one of the first aspects above.
[0016] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects: This application embodiment determines the threshold number of tasks stored in the task queue of the Handler thread after the terminal device starts up, and obtains the actual number of tasks stored in the task queue in real time. Based on the real-time obtained actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, the enqueue speed corresponding to each task type is determined. For any task type, tasks of the task type are enqueued according to the enqueue speed corresponding to the task type. This controls the enqueue speed of the task queue, thereby alleviating the congestion of tasks in the task queue, greatly increasing the processing speed of tasks, saving terminal device resources, and greatly improving the terminal device's anti-aging score.
[0017] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This application provides an illustration of a task processing method according to an embodiment of the present application. Figure 2 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application; Figure 3 A software structure block diagram of a terminal device provided in an embodiment of this application; Figure 4 A flowchart illustrating a task processing method provided in an embodiment of this application; Figure 5 A flowchart illustrating a method for determining the data threshold for storing tasks in a task queue, provided in an embodiment of this application; Figure 6 A flowchart illustrating a method for determining enqueue speed provided in an embodiment of this application; Figure 7 A flowchart illustrating another method for determining the queuing speed provided in an embodiment of this application; Figure 8 A flowchart illustrating another method for determining the queuing speed provided in an embodiment of this application; Figure 9 A flowchart illustrating another method for determining the queuing speed provided in an embodiment of this application; Figure 10 A flowchart illustrating another method for determining the queuing speed provided in an embodiment of this application; Figure 11 A flowchart illustrating another method for determining the queuing speed provided in an embodiment of this application; Figure 12 A flowchart illustrating another method for determining the queuing speed provided in an embodiment of this application; Figure 13 A flowchart illustrating another method for determining the queuing speed provided in an embodiment of this application; Figure 14 This is a schematic diagram illustrating the entry of various task types into a task queue, provided as an embodiment of this application. Figure 15 A block diagram of the Android FUSE of a terminal device provided in the embodiments of this application; Figure 16 A schematic diagram of another terminal device provided in the embodiments of this application; Figure 17 A schematic diagram of a task processing device provided in an embodiment of this application; Figure 18 A schematic diagram of another task processing device provided in the embodiments of this application; Figure 19 A schematic diagram of another task processing device provided in the embodiments of this application; Figure 20 This is a schematic diagram of another task processing device provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. The described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0021] Furthermore, in the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0022] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined with "first" and "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0023] In Android's FUSE, for flexible permission management and fast, accurate storage statistics, the FUSE daemon and MediaService are placed within the MediaProvider. Currently, file operations and task processing in FUSE belong to two different threads. Therefore, each file operation in the FUSE daemon and MediaService generates a background task, which is added to the Handler thread's task queue and finally processed one by one. However, when performing batch file operations, the Handler thread's task queue can become congested, causing a significant slowdown in task processing. For example, when the speed of file operations and task processing are inconsistent, there might be 240,000 tasks waiting to be processed, leading to congestion in the Handler thread's task queue. The traversal of so many tasks during enqueueing alone consumes a lot of CPU. More seriously, 240,000 tasks consume a large amount of memory, leading to insufficient process memory. Task processing depends on sufficient memory, but this memory is precisely occupied by these non-released tasks, causing extremely slow task processing and creating an infinite loop.
[0024] In view of this, this application provides a task processing method, apparatus, device and medium to solve the problem of slow task processing speed caused by task queue congestion.
[0025] The inventive concept of this application can be summarized as follows: In the embodiments of this application, after the terminal device starts up, a threshold number of tasks stored in the task queue of the Handler thread is determined, and the actual number of tasks stored in the task queue is obtained in real time. Based on the actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, the enqueue speed corresponding to each task type is determined. For any task type, tasks of the task type are enqueued according to the enqueue speed corresponding to the task type. This allows control over the enqueue speed of the task queue, thereby alleviating the congestion of tasks in the task queue, greatly increasing the processing speed of tasks, saving terminal device resources, and significantly improving the terminal device's anti-aging score.
[0026] After introducing the main inventive ideas of the embodiments of this application, the following describes the application scenario of a task processing method provided by the embodiments of this application with reference to the accompanying drawings. Figure 1 It includes: user 101, terminal device 102, and database 103, among which: User 101 is used to start terminal device 102; Terminal device 102 is configured to, after starting up, determine the threshold number of tasks stored in the task queue of the Handler thread, and obtain the actual number of tasks stored in the task queue in real time; based on the actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, determine the enqueue speed corresponding to each task type; and for any task type, enqueue the tasks of that task type according to the enqueue speed corresponding to that task type. Database 103 is used to update data based on the processing results of the tasks stored in the task queue.
[0027] Of course, the methods provided in the embodiments of this application are not limited to... Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of this application do not impose limitations. Figure 1 The functions that each device in the application scenario shown can achieve will be described in subsequent method embodiments, and will not be elaborated on here.
[0028] After introducing the application scenario diagram of the task processing method provided in this application, the terminal device provided in this application will be described below.
[0029] Figure 2 A schematic diagram of the structure of a terminal device 100 is shown. It should be understood that... Figure 2 The terminal device 100 shown is merely an example, and the terminal device 100 may have more than Figure 2 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0030] Figure 2 The diagram illustrates a hardware configuration block diagram of a terminal device 100 according to an exemplary embodiment. Figure 2 As shown, the terminal device 100 includes components such as a radio frequency (RF) circuit 110, a memory 120, a display unit 130, a camera 140, a sensor 150, an audio circuit 160, a wireless Fidelity (Wi-Fi) module 170, a processor 180, a Bluetooth module 181, and a power supply 190.
[0031] RF circuit 110 can be used to receive and transmit signals during information transmission or calls. It can receive downlink data from the base station and hand it over to processor 180 for processing; it can also send uplink data to the base station. Typically, RF circuits include, but are not limited to, devices such as antennas, at least one amplifier, transceivers, couplers, low-noise amplifiers, and duplexers.
[0032] The memory 120 can be used to store software programs and data. The processor 180 executes various functions of the terminal device 100 and performs data processing by running the software programs or data stored in the memory 120. The memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The memory 120 stores an operating system that enables the terminal device 100 to run. In this application, the memory 120 may store the operating system and various applications, and may also store program code that executes the task processing method of the embodiments of this application.
[0033] The display unit 130 can be used to receive input digital or character information and generate signal inputs related to user settings and function control of the terminal device 100. Specifically, the display unit 130 may include a touch screen 131 disposed on the front of the terminal device 100, which can collect touch operations on or near the user, such as clicking a button.
[0034] The display unit 130 can also be used to display information input by the user or information provided to the user, as well as a graphical user interface (GUI) for various menus of the terminal device 100. Specifically, the display unit 130 may include a display screen 132 disposed on the front of the terminal device 100. The display screen 132 may be configured as a liquid crystal display, a light-emitting diode, or the like.
[0035] The touchscreen 131 can be placed over the display screen 132, or the touchscreen 131 and the display screen 132 can be integrated to realize the input and output functions of the terminal device 100. After integration, it can be referred to as a touch display screen. In this application, the display unit 130 can display the application program and the corresponding operation steps.
[0036] Camera 140 can be used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to processor 180 to be converted into a digital image signal.
[0037] The terminal device 100 may also include at least one sensor 150, such as an accelerometer 151, a proximity sensor 152, a fingerprint sensor 153, and a temperature sensor 154. The terminal device 100 may also be equipped with other sensors such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, and motion sensor.
[0038] Audio circuitry 160, speaker 161, and microphone 162 provide an audio interface between the user and terminal device 100. Audio circuitry 160 converts received audio data into electrical signals, which are then transmitted to speaker 161, where they are converted into sound signals for output. Terminal device 100 may also be equipped with volume buttons for adjusting the volume of the sound signal, and these buttons can be combined with other buttons to adjust the enclosed area. On the other hand, microphone 162 converts collected sound signals into electrical signals, which are then received by audio circuitry 160, converted into audio data, and output to RF circuitry 110 for transmission to, for example, another terminal device, or to memory 120 for further processing.
[0039] Wi-Fi is a short-range wireless transmission technology. Terminal device 100 can use Wi-Fi module 170 to help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access.
[0040] The processor 180 is the control center of the terminal device 100. It connects various parts of the terminal device via various interfaces and lines, and performs various functions and processes data by running or executing software programs stored in the memory 120 and calling data stored in the memory 120. In some embodiments, the processor 180 may include one or more processing units; the processor 180 may also integrate an application processor and a baseband processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the baseband processor mainly handles wireless communication. It is understood that the baseband processor may not be integrated into the processor 180. In this application, the processor 180 can run the operating system, applications, user interface display and touch response, and the task processing methods of the embodiments of this application. Furthermore, the processor 180 is coupled to the display unit 130.
[0041] Bluetooth module 181 is used to interact with other Bluetooth devices that also have Bluetooth modules via the Bluetooth protocol. For example, terminal device 100 can establish a Bluetooth connection with wearable electronic devices (such as smartwatches) that also have Bluetooth modules through Bluetooth module 181, thereby exchanging data.
[0042] The terminal device 100 also includes a power supply 190 (such as a battery) that supplies power to various components. The power supply can be logically connected to the processor 180 through a power management system, thereby enabling the management of charging, discharging, and power consumption. The terminal device 100 may also be equipped with a power button for powering on and off the terminal device, as well as for screen locking.
[0043] Figure 3 This is a software structure block diagram of a terminal device 100 according to an embodiment of this application.
[0044] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0045] The application layer can include a series of application packages.
[0046] like Figure 3As shown, the application package can include applications such as phone, MMS, WiFi, WeChat, messaging, alarm clock, gallery, calendar, and WLAN.
[0047] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0048] like Figure 3 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0049] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0050] Content providers are used to store and retrieve data, making that data accessible to applications. This data can include video, images, audio, phone calls made and received, browsing history and bookmarks, phone books, text messages, etc.
[0051] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon can include views for displaying text and views for displaying images.
[0052] The phone manager is used to provide communication functions for terminal device 100. For example, it manages call status (including connection, hang-up, etc.).
[0053] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, etc.
[0054] The notification manager allows applications to display notification information (such as SMS message content) in the status bar. It can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager can be used to notify of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, and flashing indicator lights.
[0055] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0056] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0057] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0058] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0059] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0060] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0061] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0062] A 2D (an animation method) graphics engine is a graphics engine for 2D drawing.
[0063] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0064] The terminal 100 in this application embodiment can be an electronic device including but not limited to smartphones, tablets, wearable electronic devices (such as smartwatches), laptops, etc.
[0065] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation steps as shown in the following embodiments or drawings, the method may include more or fewer operation steps based on conventional or non-inventive methods. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application.
[0066] See Figure 4This is a flowchart illustrating a task processing method provided in an embodiment of this application. Figure 4 As shown, the method includes the following steps: In step 401, after the terminal device starts, the threshold number of tasks stored in the task queue of the Handler thread is determined, and the actual number of tasks stored in the task queue is obtained in real time.
[0067] In one possible implementation, the real-time acquisition of the actual number of tasks stored in the task queue in this embodiment can be performed in the following two ways: Method 1: Perform a locking operation on the task queue; and after performing the locking operation, traverse the task queue to determine the actual number of tasks stored in the task queue.
[0068] Method 2: Monitor the enqueue and dequeue operations of tasks of various task types supported by the task queue in real time; count the actual number of tasks stored in the task queue based on the number of enqueue and / or dequeue operations performed.
[0069] For example, after the terminal device starts up, it begins real-time monitoring of the enqueue and dequeue operations of tasks of various task types supported by the task queue. Each enqueue operation increases the actual number of tasks stored in the task queue by one, and each dequeue operation decreases the actual number of tasks stored in the task queue by one. For instance, when obtaining the actual number of tasks stored in the task queue, if the detected task queue supports 100 enqueue operations and 20 dequeue operations for all task types, then the actual number of tasks stored in the task queue is 80.
[0070] In one possible implementation, determining the threshold number of tasks stored in the task queue of the Handler thread in this embodiment can be performed as follows: Figure 5 The steps shown are as follows: In step 501, the remaining memory space of the process corresponding to the Handler thread is obtained; In step 502, the memory space for storing the task queue in the process is determined based on the remaining memory space and the preset storage ratio; In step 503, a threshold for the number of tasks stored in the task queue is determined based on the memory space of the task queue stored in the process and the memory space occupied by a task in the task queue.
[0071] For example, the remaining memory space can be multiplied by a preset storage ratio to obtain the memory space for storing the task queue in the process. Then, the memory space for storing the task queue in the process can be divided by the memory space occupied by a task in the task queue to obtain the threshold number of tasks stored in the task queue.
[0072] Therefore, the embodiments of this application can determine the threshold number of tasks stored in the task queue and obtain the actual number of tasks stored in the task queue, so as to adjust the queuing speed of the task queue.
[0073] In step 402, based on the actual number of tasks stored in the task queue obtained in real time, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, the enqueue speed corresponding to each task type is determined.
[0074] In step 403, for any task type, tasks of that task type are enqueued according to the enqueue speed corresponding to the task type.
[0075] In one possible implementation, step 402, which determines the enqueue speed for each task type based on the actual number of tasks stored in the task queue in real time, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, can be executed as follows: Figure 6 The steps shown are as follows: In step 601, the enqueue speed corresponding to the task queue is determined based on the actual number of tasks stored in the task queue obtained in real time and the threshold number of tasks stored in the task queue. In step 602, based on the priority information of each task type supported by the task queue and the enqueue speed corresponding to the task queue, a corresponding enqueue speed is assigned to each task type.
[0076] In one possible implementation, the quantity threshold in step 601 includes a first quantity threshold and a second quantity threshold, where the first quantity threshold is less than the second quantity threshold. Therefore, the step 601, which determines the enqueue speed corresponding to the task queue based on the actual number of tasks stored in the task queue obtained in real time and the quantity threshold of tasks stored in the task queue, can be executed as follows: Figure 7 The steps shown are as follows: In step 701, if the actual number of tasks stored in the task queue obtained in real time is not greater than the first number threshold, then the enqueue speed corresponding to the task queue is determined to be the first enqueue speed. In step 702, if the actual number of tasks stored in the task queue obtained in real time is greater than the first number threshold and not greater than the second number threshold, then the enqueue speed corresponding to the task queue is determined to be the second enqueue speed. In step 703, if the actual number of tasks stored in the task queue obtained in real time is greater than the second number threshold, then the enqueue speed corresponding to the task queue is determined to be the third enqueue speed.
[0077] Among them, the first queuing speed is greater than the second queuing speed, and the second queuing speed is greater than the third queuing speed.
[0078] In specific implementation, the quantity threshold in step 601 includes a first quantity threshold and a second quantity threshold, where the first quantity threshold is less than the second quantity threshold. In this embodiment of the application, in order to adjust the enqueue speed corresponding to each task type supported by the task queue, it can be executed as follows: Figure 8 The steps shown are as follows: In step 801, the actual number of tasks stored in the task queue is obtained in real time; In step 802, the first enqueue velocity is determined; In step 803, it is determined whether the actual number of tasks stored in the real-time acquired task queue is not greater than the first number threshold. If the actual number of tasks stored in the real-time acquired task queue is not greater than the first number threshold, then in step 804, the enqueue speed corresponding to the task queue is determined as the first enqueue speed, and then step 809 is executed directly. If the actual number of tasks stored in the real-time acquired task queue is greater than the first number threshold, then in step 805, the second enqueue speed is determined. In step 806, it is determined whether the actual number of tasks stored in the real-time acquired task queue is not greater than the second quantity threshold. If the actual number of tasks stored in the real-time acquired task queue is not greater than the second quantity threshold, then in step 807, the enqueue speed corresponding to the task queue is the second enqueue speed, and then step 809 is executed directly. If the actual number of tasks stored in the real-time acquired task queue is greater than the second quantity threshold, then in step 808, the enqueue speed corresponding to the task queue is determined to be the third enqueue speed, and then in step 809, based on the priority information of each task type supported by the task queue and the enqueue speed corresponding to the task queue, the corresponding enqueue speed is assigned to each task type.
[0079] For example, suppose the task queue supports various task types including scanning, creation, deletion, and updating. The congestion level of the handler thread has different effects on the enqueue speed corresponding to different priority task types. For example, the user's perception of file scanning tasks is not strong, so a lower priority can be assigned. Therefore, different priority information needs to be assigned to each task type. For example, the priority corresponding to task type scanning is low, the priority corresponding to task type creation is medium, the priority corresponding to task type deletion is high, and the priority corresponding to task type updating is high. At this time, if the enqueue speed is 1000 tasks / second, then according to the priority information, the enqueue speed corresponding to task type updating can be determined to be 400 tasks / second, the enqueue speed corresponding to task type deletion is 300 tasks / second, the enqueue speed corresponding to task type creation is 200 tasks / second, and the enqueue speed corresponding to task type scanning is 100 tasks / second.
[0080] The first queuing rate can be obtained by dividing the number of tasks entering the task queue within a preset time period by the preset time period. For example, if 300 tasks enter the task queue within 3 seconds, the first queuing rate is 100 tasks / second.
[0081] The first quantity threshold can be obtained through Figure 5 As shown in the steps, the second quantity threshold can be set to n times the first quantity threshold, or it can be set by the user based on experience. This application embodiment does not impose any restrictions on this.
[0082] In one possible implementation, the second enqueue velocity can be determined using the following formula:
[0083] in, , This refers to the dequeue speed corresponding to the task queue. This refers to the actual number of tasks stored in the task queue, obtained in real time. The first quantity threshold, The second quantity threshold is n times the first quantity threshold. The dequeue speed corresponding to the task queue is... The first enqueue speed can be calculated by dividing the number of tasks leaving the task queue within a preset time period by the preset time period. For example, if 100 tasks leave the task queue within 2 seconds, then the first enqueue speed is 50 tasks per second.
[0084] For example, if the actual number of tasks stored in the task queue obtained in real time is The first quantity threshold is The second quantity threshold is The third enqueue speed is 0 items / second, meaning enqueueing stops. To adjust the enqueue speed for each task type supported by the task queue, it can be executed as follows: Figure 9 The steps shown are as follows: In step 901, the actual number C of tasks stored in the task queue is obtained in real time; In step 902, the first queuing speed is obtained by dividing the number of tasks entering the task queue within a preset time period by the preset time period. In step 903, it is determined whether C is not greater than the first quantity threshold. If C is not greater than the first quantity threshold In step 904, the enqueue speed corresponding to the task queue is determined as the first enqueue speed, and then step 910 is executed directly; if C is greater than the first quantity threshold... In step 905, the dequeue speed corresponding to the task queue is determined. In step 906, according to Determine the second queuing speed; In step 907, it is determined whether C is not greater than the second quantity threshold. If C is not greater than the second quantity threshold In step 908, the enqueue speed corresponding to the task queue is determined as the second enqueue speed, and then step 910 is executed directly; if C is greater than the second quantity threshold... In step 909, the enqueue speed corresponding to the task queue is determined to be 0 tasks / second. Then, in step 910, based on the priority information of each task type supported by the task queue and the enqueue speed corresponding to the task queue, the corresponding enqueue speed is assigned to each task type.
[0085] In one possible implementation, step 402, which determines the enqueue speed for each task type based on the actual number of tasks stored in the task queue in real time, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, can also be executed as follows: Figure 10 The steps shown are as follows: In step 1001, based on the priority information of each task type supported by the task queue and the threshold number of tasks stored in the task queue, the corresponding quantity threshold for each task type is determined. In step 1002, based on the actual number of tasks stored in the task queue obtained in real time and the corresponding number thresholds for each task type, the enqueue speed corresponding to each task type is determined.
[0086] In one possible implementation, step 1002, which determines the enqueue speed for each task type based on the actual number of tasks stored in the task queue obtained in real time and the corresponding quantity thresholds for each task type, can be executed as follows for any task type supported by the task queue: Figure 11 The steps shown are as follows: In step 1101, when the actual number of tasks stored in the task queue obtained in real time is not greater than the number threshold, the enqueue speed corresponding to the task type is determined as the fourth enqueue speed. In step 1102, when the actual number of tasks stored in the task queue obtained in real time is greater than the number threshold, the enqueue speed corresponding to the task type is determined as the fifth enqueue speed.
[0087] In specific implementation, if there is only one threshold for the number of tasks stored in the task queue in this embodiment, then in order to adjust the enqueue speed corresponding to each task type supported by the task queue, it can be executed as follows: Figure 12 The steps shown are as follows: In step 1201, based on the priority information of each task type supported by the task queue and the threshold number of tasks stored in the task queue, the corresponding quantity threshold for each task type is determined. In step 1202, when the actual number of tasks stored in the task queue obtained in real time is not greater than the number threshold, the enqueue speed corresponding to the task type is determined as the fourth enqueue speed. In step 1203, when the actual number of tasks stored in the task queue obtained in real time is greater than the number threshold, the enqueue speed corresponding to the task type is determined as the fifth enqueue speed.
[0088] In specific implementation, if the threshold for the number of tasks stored in the task queue in this embodiment includes a first threshold and a second threshold, and the first threshold is less than the second threshold, then in order to adjust the enqueue speed corresponding to each task type supported by the task queue, it can be executed as follows: Figure 13 The steps shown are as follows: In step 1301, based on the priority information of each task type supported by the task queue and the first and second quantity thresholds of the tasks stored in the task queue, the first and second quantity thresholds corresponding to each task type are determined respectively. In step 1302, counting begins from the start of the terminal device. Before the actual number of tasks stored in the real-time acquired task queue is greater than the second quantity threshold, the enqueue speed corresponding to the task type is determined as the fourth enqueue speed. In step 1303, counting begins from the start of the terminal device. Once the actual number of tasks stored in the real-time acquired task queue is greater than the second quantity threshold, the enqueue speed corresponding to the task type is determined as the fifth enqueue speed. Subsequently, if the actual number of tasks stored in the real-time acquired task queue is again less than the second quantity threshold and less than the first quantity threshold, the enqueue speed corresponding to the task type is determined to revert to the fourth enqueue speed.
[0089] The queuing speed for the task queue can be calculated by dividing the number of tasks entering the queue within a preset time period by the duration of the preset time period. Then, based on the priority information of each task type supported by the task queue, the fourth queuing speed for each task type can be determined. The fifth queuing speed can be the same as the third queuing speed, for example, it can be 0 tasks / second, or it can be different, set according to experience, for example, it can be 0.02 tasks / second.
[0090] For example, assuming the threshold for the number of tasks stored in the task queue includes a first threshold and a second threshold, then the first threshold and the second threshold corresponding to each task type are determined as follows: ;like Figure 14 As shown, if the task queue supports task types including scanning, creation, deletion, and updating, and based on the priority information of each task type, the first and second quantity thresholds for scanning are determined as follows: The first and second quantity thresholds for creation, deletion, and update are respectively... When the actual number of tasks stored in the real-time task queue reaches 2560, tasks of the scanning type are prohibited from entering the task queue. When the actual number of tasks stored in the real-time task queue reaches 10240, tasks of the creation, deletion, and update types are prohibited from entering the task queue. After that, since no tasks are entering the task queue, the actual number of tasks stored in the real-time task queue continues to decrease. When the actual number of tasks stored in the real-time task queue drops to 4096, tasks of the creation, deletion, and update types are allowed to enter the task queue again. When the actual number of tasks stored in the real-time task queue drops to 1024, tasks of the scanning type are allowed to enter the task queue again.
[0091] like Figure 15 This is a block diagram of FUSE for Android on a terminal device. Figure 15The queue dynamic control module of the terminal device shown controls the enqueue speed of the task queue in the background task queue module through the task processing method provided in this application embodiment. This allows control over the speed of the fuse daemon module, the database monitoring submodule in the fuse daemon module, the file operation post-processing submodule in the fuse daemon module, and the scanning module in the media service module. By controlling the enqueue speed of the task queue, a dynamic balance is achieved between the speeds of the file operation and task processing threads, alleviating congestion in the task queue and greatly increasing the task processing speed.
[0092] Based on the foregoing description, this embodiment of the application determines the threshold number of tasks stored in the task queue of the Handler thread after the terminal device starts up, and obtains the actual number of tasks stored in the task queue in real time. Based on the actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, the enqueue speed corresponding to each task type is determined. For any task type, tasks of that task type are enqueued according to the enqueue speed corresponding to the task type. This controls the enqueue speed of the task queue, thereby alleviating the congestion of tasks in the task queue, greatly increasing the processing speed of tasks, saving terminal device resources, and significantly improving the terminal device's anti-aging score.
[0093] Based on the same inventive concept, embodiments of this application also provide a terminal device, such as... Figure 16 As shown, it includes: processor 180, memory 120 and bus interface 1600. Processor 180 is responsible for managing the bus architecture and general processing, and memory 120 can store data used by processor 180 when performing operations.
[0094] Among them, Figure 16In this configuration, bus interface 1600 may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors 180 represented by processor 180 and memory 120 represented by memory 120. The bus architecture may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 1600 provides an interface. Optionally, processor 180 may be a CPU (Central Processing Unit), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or CPLD (Complex Programmable Logic Device), and the processor may also employ a multi-core architecture.
[0095] The processor 180 executes any of the task processing methods provided in the embodiments of this application by calling a computer program stored in the memory 120, according to the obtained executable instructions. The processor 180 and the memory 120 may also be physically separated.
[0096] It should be noted that the device provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0097] Based on the same inventive concept, embodiments of this application also provide a task processing device 1700, such as... Figure 17 As shown, it includes: The acquisition module 1701 is used to determine the threshold number of tasks stored in the task queue of the Handler thread after the terminal device is started, and to acquire the actual number of tasks stored in the task queue in real time. The speed determination module 1702 is used to determine the enqueue speed corresponding to each task type based on the actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue. The processing module 1703 is used to enqueue tasks of any given task type according to the enqueue speed corresponding to the task type.
[0098] In one possible implementation, such as Figure 18 As shown, the speed determination module 1702 includes: The queue speed determination unit 1801 is used to determine the enqueue speed corresponding to the task queue based on the actual number of tasks stored in the task queue and the threshold number of tasks stored in the task queue obtained in real time. The task speed determination unit 1802 is used to assign a corresponding enqueue speed to each task type based on the priority information of each task type supported by the task queue and the enqueue speed corresponding to the task queue.
[0099] In one possible implementation, the quantity threshold includes a first quantity threshold and a second quantity threshold, wherein the first quantity threshold is less than the second quantity threshold; the queue speed determination unit 1801 includes: If the actual number of tasks stored in the task queue obtained in real time is not greater than the first number threshold, then the enqueue speed corresponding to the task queue is determined to be the first enqueue speed. If the actual number of tasks stored in the task queue obtained in real time is greater than the first number threshold and not greater than the second number threshold, then the enqueue speed corresponding to the task queue is determined to be the second enqueue speed. If the actual number of tasks stored in the task queue obtained in real time is greater than the second number threshold, then the enqueue speed corresponding to the task queue is determined to be the third enqueue speed. Wherein, the first queuing speed is greater than the second queuing speed, and the second queuing speed is greater than the third queuing speed.
[0100] In one possible implementation, such as Figure 19 As shown, the speed determination module 1702 includes: The threshold determination unit 1901 is used to determine the quantity threshold corresponding to each task type based on the priority information of each task type supported by the task queue and the quantity threshold of the tasks stored in the task queue. The task speed determination unit 1902 is used to determine the enqueue speed corresponding to each task type based on the actual number of tasks stored in the task queue obtained in real time and the number threshold corresponding to each task type.
[0101] In one possible implementation, the task speed determination unit 1902 includes: For any task type supported by the task queue: When the actual number of tasks stored in the task queue obtained in real time is not greater than the number threshold, the enqueue speed corresponding to the task type is determined as the fourth enqueue speed. When the actual number of tasks stored in the task queue obtained in real time is greater than the number threshold, the enqueue speed corresponding to the task type is determined to be the fifth enqueue speed.
[0102] In one possible implementation, the acquisition module 1701 includes: Perform a locking operation on the task queue; and after performing the locking operation, traverse the task queue to determine the actual number of tasks stored in the task queue; or... The system monitors the enqueue and dequeue operations of tasks of various task types supported by the task queue in real time; and counts the actual number of tasks stored in the task queue based on the number of enqueue and / or dequeue operations performed.
[0103] In one possible implementation, such as Figure 20 As shown, the acquisition module 1701 includes: The memory space acquisition unit 2001 is used to acquire the remaining memory space of the process corresponding to the Handler thread; The memory space acquisition unit 2001 is also used to determine the memory space in the process for storing the task queue based on the remaining memory space and a preset storage ratio. The quantity threshold determination unit 2002 is used to determine the quantity threshold of tasks stored in the task queue based on the memory space in the process that stores the task queue and the memory space occupied by a task in the task queue.
[0104] In an exemplary embodiment, this application also provides a computer-readable storage medium including instructions, such as a memory 120 including instructions, which can be executed by a processor 180 of a terminal device 100 to complete the above-described task processing method. Optionally, the computer-readable storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0105] In an exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by a processor 180, implements the task processing method provided in this application.
[0106] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can 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, etc.) containing computer-usable program code.
[0107] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can 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, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0108] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0109] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0110] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A task processing method, characterized in that, The method includes: After the terminal device starts up, determine the threshold number of tasks stored in the task queue of the Handler thread, and obtain the actual number of tasks stored in the task queue in real time. Based on the real-time acquired actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue, the enqueue speed corresponding to each task type is determined; the determination of the enqueue speed corresponding to each task type based on the real-time acquired actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue includes: dividing the number of tasks entering the task queue within a preset time period by the preset time period to obtain a first enqueue speed; if the real-time acquired actual number of tasks stored in the task queue is not greater than the first quantity threshold, then the enqueue speed corresponding to the task queue is determined as the first enqueue speed; the first quantity threshold is the threshold number of tasks stored in the task queue of the Handler thread; If the actual number of tasks stored in the task queue, as obtained in real time, is greater than the first quantity threshold but not greater than the second quantity threshold, then the enqueue speed corresponding to the task queue is determined to be the second enqueue speed; the second quantity threshold is n times the first quantity threshold; the second enqueue speed is determined using the following formula. : ; This refers to the dequeue speed corresponding to the task queue. The result is obtained by dividing the number of tasks that leave the task queue within a preset time period by the preset time period. The actual number of tasks stored in the task queue as obtained in real time; This represents the first quantity threshold. This indicates that the second quantity threshold is n times the first quantity threshold; If the actual number of tasks stored in the task queue obtained in real time is greater than the second number threshold, then the enqueue speed corresponding to the task queue is determined to be the third enqueue speed; the third enqueue speed is the speed at which enqueueing stops. Wherein, the first queuing speed is greater than the second queuing speed, and the second queuing speed is greater than the third queuing speed; Based on the priority information of each task type supported by the task queue and the enqueue speed corresponding to the task queue, a corresponding enqueue speed is assigned to each task type; the task types include scanning, creating, deleting, and updating. For any given task type, tasks of that task type are enqueued according to the enqueue speed corresponding to that task type.
2. The method according to claim 1, characterized in that, The method of determining the enqueue speed for each task type based on the actual number of tasks stored in the task queue, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue includes: Based on the priority information of each task type supported by the task queue and the number threshold of tasks stored in the task queue, the number threshold corresponding to each task type is determined respectively. Based on the actual number of tasks stored in the task queue obtained in real time and the number threshold corresponding to each task type, the enqueue speed corresponding to each task type is determined.
3. The method according to claim 2, characterized in that, The determination of the enqueue speed for each task type based on the actual number of tasks stored in the task queue obtained in real time and the corresponding quantity thresholds for each task type includes: For any task type supported by the task queue: When the actual number of tasks stored in the task queue obtained in real time is not greater than the number threshold, the enqueue speed corresponding to the task type is determined as the fourth enqueue speed. When the actual number of tasks stored in the task queue obtained in real time is greater than the number threshold, the enqueue speed corresponding to the task type is determined to be the fifth enqueue speed.
4. The method according to claim 1, characterized in that, The real-time acquisition of the actual number of tasks stored in the task queue includes: Perform a locking operation on the task queue; and after performing the locking operation, traverse the task queue to determine the actual number of tasks stored in the task queue; or... The system monitors the enqueue and dequeue operations of tasks of various task types supported by the task queue in real time; and counts the actual number of tasks stored in the task queue based on the number of enqueue and / or dequeue operations performed.
5. The method according to claim 1, characterized in that, The step of determining the threshold for the number of tasks stored in the task queue of the Handler thread includes: Obtain the remaining memory space of the process corresponding to the Handler thread; Based on the remaining memory space and the preset storage ratio, determine the memory space in the process for storing the task queue; Based on the memory space used to store the task queue in the process and the memory space occupied by a task in the task queue, a threshold for the number of tasks stored in the task queue is determined.
6. A task processing device, characterized in that, The device includes: The acquisition module is used to determine the threshold number of tasks stored in the task queue of the Handler thread after the terminal device is started, and to acquire the actual number of tasks stored in the task queue in real time. The speed determination module is used to determine the enqueue speed corresponding to each task type based on the actual number of tasks stored in the task queue obtained in real time, the threshold number of tasks stored in the task queue, and the priority information of each task type supported by the task queue. Specifically, the speed determination module is used to: divide the number of tasks entering the task queue within a preset time period by the preset time period to obtain a first enqueue speed; if the actual number of tasks stored in the task queue obtained in real time is not greater than the first threshold number, then the enqueue speed corresponding to the task queue is determined as the first enqueue speed; the first threshold number is the threshold number of tasks stored in the task queue of the Handler thread. If the actual number of tasks stored in the task queue, as obtained in real time, is greater than the first quantity threshold but not greater than the second quantity threshold, then the enqueue speed corresponding to the task queue is determined to be the second enqueue speed; the second quantity threshold is n times the first quantity threshold; the second enqueue speed is determined using the following formula. : ; This refers to the dequeue speed corresponding to the task queue. The result is obtained by dividing the number of tasks that leave the task queue within a preset time period by the preset time period. The actual number of tasks stored in the task queue as obtained in real time; This represents the first quantity threshold. This indicates that the second quantity threshold is n times the first quantity threshold; If the actual number of tasks stored in the task queue obtained in real time is greater than the second number threshold, then the enqueue speed corresponding to the task queue is determined to be the third enqueue speed; the third enqueue speed is the speed at which enqueueing stops. Wherein, the first queuing speed is greater than the second queuing speed, and the second queuing speed is greater than the third queuing speed; Based on the priority information of each task type supported by the task queue and the enqueue speed corresponding to the task queue, a corresponding enqueue speed is assigned to each task type; the task types include scanning, creating, deleting, and updating. The processing module is used to enqueue tasks of any given task type according to the enqueue speed corresponding to that task type.
7. A terminal device, characterized in that, include: Processor and memory; The memory is used to store the processor-executable instructions; The processor is configured to execute the instructions to implement the task processing method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by a terminal device, the terminal device is able to perform the task processing method as described in any one of claims 1-5.
Citation Information
Patent Citations
Data control method and device, electronic equipment and storage medium
CN111274010A