Method, electronic device and computer program product for processing a workload
By dynamically adjusting the priority threshold, deciding whether to use the processor to handle workloads, solving the performance bottleneck problem of processor resources under heavy load situations, and achieving efficient workload processing and system performance optimization.
Patent Information
- Application Number
- CN202311049751.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, processor resources become performance bottlenecks under heavy loads, resulting in high-priority workloads not being processed in time, affecting system performance.
By dynamically adjusting the priority threshold based on the queue data of the task queue, the current processor resource usage is judged, and thus determining whether to use the processor to process the workload. High-priority workloads prioritize processors when processor resources are tight, while low-priority workloads are processed without processors.
It realizes dynamic and adaptive allocation of processors to handle different types of workloads according to system resources, improves the processing efficiency of the system, and ensures that high-priority workloads can be processed in a timely manner.
Smart Images

Figure CN119493658A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate generally to the field of computers, and more particularly to methods, electronic devices, and computer program products for processing workloads. Background Art
[0002] Persistent Memory (PMEM) is a new storage technology that uses non-volatile memory media to achieve persistent data storage. Compared with traditional disks and solid-state drives, PMEM has faster read and write speeds and higher durability, which can accelerate data access and processing. It has broad application prospects in data centers, high-performance computing, embedded systems and other fields, and is expected to bring revolutionary changes to storage technology.
[0003] PMEM is a trending device on storage systems. Under current technology, accessing PMEM requires processor (processor) instructions, which means that processor resources may become a performance bottleneck under heavy load conditions. Therefore, how to better use processor resources for higher priority workloads under heavy load conditions is very important for optimizing the processing of workloads. Summary of the invention
[0004] Embodiments of the present disclosure provide a method, an apparatus, and a computer program product for processing workloads.
[0005] In one aspect of the present disclosure, a method for processing a workload is provided. The method includes determining a priority threshold for a task queue based on queue data of the task queue. The method also includes obtaining the priority of the workload at the head of the task queue. The method also includes using a processor to process the workload in response to the priority being greater than the priority threshold. In addition, the method also includes processing the workload without using a processor in response to the priority being less than or equal to the priority threshold.
[0006] In another aspect of the present disclosure, an electronic device is provided. The device includes a processing unit and a memory, wherein the memory is coupled to the processing unit and stores instructions. When the instructions are executed by the processing unit, the following actions are performed: based on queue data of the task queue, determining a priority threshold for the task queue; obtaining the priority of the workload at the head of the task queue; in response to the priority being greater than the priority threshold, using a processor to process the workload; and in response to the priority being less than or equal to the priority threshold, processing the workload without using a processor.
[0007] In yet another aspect of the present disclosure, a computer program product is provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which, when executed, cause a computer to perform a method or process according to an embodiment of the present disclosure.
[0008] This summary is provided to introduce a selection of concepts in a simplified form, which are further described in the detailed description below. This summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the various embodiments of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like elements throughout the exemplary embodiments of the present disclosure.
[0010] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;
[0011] Figure 2 A flowchart of a method for processing a workload according to some embodiments of the present disclosure is shown;
[0012] Figure 3 A schematic diagram showing a system for processing workloads according to some embodiments of the present disclosure is shown;
[0013] Figure 4A A schematic diagram showing a process of inserting a workload into a task queue according to some embodiments of the present disclosure is shown;
[0014] Figure 4B A schematic diagram showing a process of adjusting workload in a task queue according to some embodiments of the present disclosure is shown;
[0015] Figure 4C A schematic diagram showing a process of inserting a workload into a task queue according to some embodiments of the present disclosure is shown;
[0016] Figure 5 A flowchart showing a method for managing workload in a task queue according to some embodiments of the present disclosure is shown;
[0017] Figure 6 A flowchart showing a method of processing a workload according to some embodiments of the present disclosure; and
[0018] Figure 7 A schematic block diagram of a device that can be used to implement an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0019] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some specific embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0020] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects, unless explicitly indicated to be different.
[0021] When processing workloads in a computing device, due to the low processing efficiency when the processor resources are tight, high-priority workloads cannot be processed in time, affecting system performance. In existing solutions, a fixed static priority threshold is usually set. When the priority of the workload is greater than the static priority threshold, the processor (CPU) is used to process the workload. When the priority of the workload is less than the static priority threshold, the processor (CPU-less) is not used to process the workload. Static priority will produce some disadvantages. For example, when processing resources are seriously insufficient, all workloads greater than the static priority threshold are still processed by the processor, but there may be multiple different priorities greater than the static priority threshold, in which the workloads with lower priorities will still occupy the processor resources of the workloads with higher priorities. In addition, when the processor resources are relatively sufficient, some workloads with lower priorities can also be processed by the processor, but due to the static priority threshold, the processor still cannot be used to process these workloads, affecting the processing efficiency of the system. In short, the static priority threshold cannot be adjusted in time according to the use of processor resources, thereby affecting the processing of high-priority workloads and the overall processing efficiency of the system.
[0022] To this end, an embodiment of the present disclosure proposes a method for processing a workload, which uses queue data of a task queue to determine the current usage of processor resources to achieve dynamic adjustment of a priority threshold. The dynamic priority threshold can be adjusted in a timely manner according to the usage of processor resources, so that when processor resources are tight, the processor can be used to preferentially process high-priority loads, and low-priority loads can be processed without using the processor, to ensure that high-priority workloads can be preferentially processed. In addition, due to the use of a dynamic priority threshold, whether the processor is used to process the workload depends not only on the priority of the workload itself, but also on the relationship between the priority and the dynamic priority threshold, thereby dynamically and adaptively allocating processors to process different types of workloads according to system resources, thereby improving the processing efficiency of the system.
[0023] Figure 1 1 is a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. Figure 1 As shown, the example environment 100 includes a computing device 110. Examples of computing devices 110 include, but are not limited to, personal computers, handheld devices (such as smartphones and tablets), servers, workstations, embedded systems, cloud computing devices, supercomputers, game consoles, Internet of Things (IoT) devices, and embedded controllers. In the computing device 110, processing various types of workloads (such as workloads 170-1 to 170-N, where N is the number of workloads) often relies on a processor. For example, when processing a task in which a workload accesses PMEM, a processor is required to process it, and different workloads have different priorities. Therefore, it is necessary to dynamically process different types of workloads by judging priorities. When processor resources are insufficient, the processor is not used to process low-priority workloads, thereby ensuring that high-priority workloads can be processed first.
[0024] The example environment 100 also includes a scheduler 120, which can dynamically adjust the way to process different types of workloads according to the load of the current processor. For example, the scheduler 120 can obtain the usage of the current processor from the monitor 140, including but not limited to the processor usage, the length of the task queue, the load waiting time, etc., to determine the load of the processor. The scheduler 120 includes task queues 130-1, task queues 130-2, ..., task queues 130-M (individually or collectively referred to as task queues 130), where M is the actual number of task queues, and its range varies according to the processing power of the computing device 110, which is not limited herein. For example, when the processor resources are insufficient, when the workload is dequeued from the task queue 130, the scheduler will determine to process the workload by the processor processing 150 according to the priority and priority threshold of the workload, or to process the workload according to the way of not using the processor processing 160.
[0025] Using the processor to process workloads allows, for example, storage applications to access persistent memory (PMEM) in direct access (DAX) mode. In DAX mode, input / output (IO) operations do not need to switch from kernel mode to user mode, but CPU copy operations are still required. Note that the CPU copy operation here uses the MOVNT instruction without going through the CPU cache. Theoretically, pmem_memcpy is faster than memcpy, but this method still requires the participation of the CPU. Because the processor processes workloads faster, when processor resources are insufficient, processing workloads through the processor can ensure that high-priority workloads are processed quickly, thereby improving the processing efficiency of the computing device 110.
[0026] Loads that do not use the processor to handle work can be, for example, some IO technologies that do not require the processor. Here are some examples. For example, RDMA loopback (Remote Direct Memory Access, RDMA-loopback) is a PMEM access method that utilizes an RDMA-enabled host channel adapter, which does not involve the participation of the processor. In other words, RDMA-loopback can provide acceptable performance as a data transfer. However, compared with using the processor, a certain delay will be generated; DSA (Data Streaming Accelerato) is a technology that optimizes data transfer between different components within a computer system, such as processors, memory, and storage devices. It provides a hardware-based solution to move data more efficiently, reduce latency, and improve performance. DSA enables the processor to delegate data transfer tasks to a dedicated engine, freeing up the processor to focus on other tasks; I / OAT (I / OAcceleration Technology) DMA is a technology that accelerates data transfer between the server I / O subsystem and memory. It offloads the data transfer process from the processor to a dedicated DMA engine, freeing up the processor to perform other tasks. The I / OAT DMA engine provides optimized memory-to-memory and I / O-to-memory data transfer, reducing latency and increasing throughput. This technology is particularly useful in data-intensive applications such as database management, virtualization, and content delivery networks.
[0027] Figure 2 A flow chart of a method 200 for processing workload according to some embodiments of the present disclosure is shown. At 202, a priority threshold for a task queue is determined based on the queue data of the task queue. In some embodiments, a dynamically changing priority threshold is used to dynamically adjust the processor to process the workload in the task queue. For example, the priority threshold for the task queue is determined based on the queue data of the task queue. When the queue data reflects that the current processor resources are insufficient, the priority threshold can be increased, and when the queue data reflects that the current processor resources are sufficient, the priority threshold can be reduced. The priority threshold can be determined in different forms using the queue data of the task queue, such as determined by rule judgment, determined using a machine learning model, or determined by user configuration, or in any other way, and the present disclosure does not limit this.
[0028] At 204, the priority of the workload at the head of the team in the task queue is obtained. For example, when the workload at the head of the team of the current task queue is to be processed, it is necessary to obtain the priority of the workload. In some embodiments, the priority of the workload is directly obtained from the workload, and the priority of the workload can also be obtained from other modules. In addition, the priority of the workload can be configured according to conventional priority data, and can be configured by the user according to its actual business, so as to improve the processing efficiency of the actual business. After obtaining the priority of the workload at the head of the team, the priority can be compared with the priority threshold determined at 202 to determine the processing mode of the workload.
[0029] At 206, it is determined whether the priority of the workload at the head of the task queue is greater than the priority threshold. At 208, in response to the priority being greater than the priority threshold, a processor is used to process the workload. For example, the priority of the workload at the head of the team can be compared with the priority threshold, and when the priority is greater than the priority threshold, the processor is used to process the workload. Since the priority is greater than the priority threshold, it means that the workload is a high-priority workload, so the workload can be processed quickly using the processor, thereby ensuring that the high-priority load is processed quickly. It should be understood that the priority threshold can change dynamically according to the queue data and the usage of the processor, so the size relationship between a certain workload (with a fixed priority) and the priority threshold will also change accordingly.
[0030] At 210, in response to the priority being less than or equal to the priority threshold, the workload is processed without using the processor. For example, the priority of the workload at the head of the queue can be compared with the priority threshold, and when the priority is less than or equal to the priority threshold, the workload is processed without using the processor. Since the priority is less than or equal to the priority threshold, it means that the workload is a low priority workload, so the workload is processed without using the processor. Although not using the processing will result in a slower speed of processing the workload, processor resources can be saved to process high priority loads, thereby ensuring that the high priority loads are processed quickly. It should be understood that the priority threshold will change dynamically according to the queue data and the usage of the processor, so when the processor resources are sufficient, the processor may also be used to process the workload.
[0031] Therefore, according to the solution for processing workloads in the embodiment of the present disclosure, it is possible to determine whether to use the processor to process the workload by comparing the workload priority with the dynamically changing priority threshold. In this way, it is possible to use the processor to process high-priority workloads and not use the processor to process low-priority workloads, thereby ensuring that high-priority workloads can be processed preferentially, and the priority threshold can be dynamically adjusted, thereby improving system processing efficiency.
[0032] Figure 3 FIG. 3 is a schematic diagram of a system 300 for processing workloads according to some embodiments of the present disclosure. Figure 3 As shown, the system 300 includes a computing device 310, and examples of the computing device 310 include, but are not limited to, personal computers, handheld devices (such as smartphones and tablets), servers, workstations, embedded systems, cloud computing devices, supercomputers, game consoles, Internet of Things (IoT) devices, and embedded controllers. A user configuration interface 320 is included in the computing device 310, and the user configuration interface 320 can allow the user to configure the priority of each workload. For example, depending on the actual business of the user, the priority of the workload will also change, so the user needs to configure the priority of different workloads according to the actual situation. In addition, the user can also adjust the priority of different workloads according to the actual situation to improve the processing efficiency of the system. In addition, the user configuration interface 320 can also allow the user to configure the machine learning model 340 and the task queue 332. For example, in some embodiments, the user can use the user configuration interface 320 to select different machine learning models, or configure the number and length of the task queue 332.
[0033] like Figure 3 As shown, the system 300 also includes a scheduler 330, which is responsible for scheduling a task queue 332. The scheduler 330 can process the workload according to the priority threshold, and the priority threshold can be determined by the machine learning model 340 and the monitor 350. For example, in some embodiments, the monitor 350 can obtain queue data information of the current task queue, including but not limited to the task queue length, workload priority distribution, workload group size, and response time distribution. In addition, the monitor 350 can provide the queue data to the machine learning model 340, and the machine learning model 340 uses the queue data to calculate the current priority threshold. It can be understood that the queue data is real-time data obtained when calculating the priority threshold, so the priority threshold will change according to the queue data, and the queue data also reflects the use of the processor. Therefore, when the processor resources are tight, the priority threshold will be relatively large, and when the processor resources are sufficient, the priority threshold will be relatively small.
[0034] In addition, the scheduler 330 can also write the queue data of the task queue 332 into the historical information database 360 to save the queue data. In this way, the historical information database 360 and the annotated data of the priority threshold can be used to regularly train the machine learning model 340 to implement the iteration of the machine learning model 340. The machine learning model 340 may include but is not limited to a linear regression model, a logistic regression model, a decision tree model, a random forest model, a support vector machine (SVM), a K-nearest neighbor (KNN) model, a neural network model, etc., and the present disclosure does not limit this.
[0035] When workloads 370-1 to 370-N (collectively or individually referred to as workloads 370) enter the computing device 310, the workloads 370 are first inserted into work queues 332-1 to 332-M (collectively or individually referred to as work queues 332) in turn by polling. In some embodiments, when a workload needs to access persistent memory (PMEM) 380, the scheduler 330 can compare the priority of the workload with the priority threshold. When the priority of the workload is greater than the priority threshold, the processor is used to access PMEM. When the priority of the workload is less than or equal to the priority threshold, the processor is not used to access PMEM. Since the priority threshold changes dynamically, the way different workloads access PMEM also changes dynamically. Therefore, when processor resources are scarce, processor resources are used first to process high-priority workloads. When processor resources are sufficient, processor resources can also be used to process low-priority workloads, thereby improving the processing efficiency of the system 300.
[0036] Figure 4A The schematic diagram of the process 400A of inserting workload into task queue according to some embodiments of the present disclosure is shown.As shown in process 400A, at the T1 moment, there are 6 workloads in task queue 410, that is, the queue length is 6, and the queue length of length 6 here is only for illustration, and the queue length of other numbers can be used.Each workload priority in the task queue is listed, for example, the priority of the workload at the head of the team is 5, and the priority of the workload at the tail of the team is 1.When workload 420 is to enter queue 410, first need to determine the insertion position of workload 420.At the T2 moment, by comparing the priority of the workload in workload 420 and task queue 410, determine to insert workload 420 behind the third workload (as shown by arrow).It can be understood that the insertion position is selected according to the priority of workload here.At the T3 moment, workload 420 is inserted into the selected position, and the task queue 430 after insertion is obtained.
[0037] Figure 4BA schematic diagram of a process 400B for adjusting a workload in a task queue according to some embodiments of the present disclosure is shown. In process 400B, a workload covered with a grid shadow indicates that the time slice of the workload is about to run out, that is, the time allocated to the workload is about to run out, so the workload needs to be executed as soon as possible. As shown in process 400B, at time T1, the time slice of the sixth workload of task queue 441 is about to run out. For example, the time slice of the workload can be compared with the time slice threshold to determine whether the time slice of the workload is about to run out. At time T2, the workload is moved to the head of the queue without considering the priority situation, so as to process the workload whose time slice is about to run out as soon as possible, and obtain task queue 442. At time T3, it is determined that the time slice of the fourth workload of task queue 443 is about to run out, so the workload needs to be moved. At time T4, according to the sorting of the remaining time slices, the fewer the remaining time slices, the closer they are to the front, so the workload is moved to the second position of task queue 444.
[0038] Figure 4C FIG. 4 is a schematic diagram of a process 400C for inserting a workload into a task queue according to some embodiments of the present disclosure. Figure 4A Compared to process 400A shown in FIG. 4 , process 400C takes into account the time slice factor when inserting the workload. Figure 4C As shown, the workload covered by the oblique lines represents the workload to be inserted, and the workload covered by the grid represents the workload whose time segment is about to run out. At time T1, the time segments of the first workload and the second workload in the task queue 450 are about to run out, and workload 460 is the workload to be inserted. At time T2, when determining the insertion position for workload 460, the time segment factor needs to be considered first. The newly inserted workload must be after the workload whose time segment is about to run out to ensure that the workload whose time segment is about to run out can be executed preferentially. Secondly, consider the priority factor of the workload. Since the priority of workload 460 is 5, which is greater than the remaining workload in task queue 450, it can be determined that workload 460 needs to be inserted into the third position of task queue 450. At time T3, workload 460 is inserted into the third position of task queue 450 to obtain a new task queue 470.
[0039] Figure 5A flow chart of a method 500 for managing workloads in a task queue according to some embodiments of the present disclosure is shown. At 502, a workload enters. For example, in some embodiments, the workload is loaded into memory in preparation for execution. At 504, a task queue is selected by polling. For example, there are multiple task queues in the scheduler, and a task queue is selected from multiple task queues by polling, and the workload is subsequently inserted into the selected task queue. At 506, the priority of the workload is checked to determine the insertion position of the workload in the task queue. In some embodiments, the time segment of the workload in the task queue also needs to be considered to determine the insertion position of the workload in the task queue. At 508, the workload is inserted based on priority. For example, in some embodiments, a high-priority workload is inserted before a low-priority workload so that the high-priority workload can be processed as soon as possible. In some embodiments, when there is a workload in the task queue whose time segment is about to run out, all newly inserted workloads need to be inserted after the workload whose time segment is about to run out.
[0040] At 510, the workload in the task queue waits for instructions from the scheduler, and at 512, it is determined whether it is the turn of the workload at the head of the task queue to be processed. If the judgment is "yes", proceed to 518 to process the workload. Otherwise, proceed to 514 to determine whether there is a workload in the queue whose time segment is about to run out. In some embodiments, the time segment of the workload can be compared with the time segment threshold to make a judgment. If the judgment is "no", return to 510 and continue waiting. Otherwise, proceed to 516 to insert the workload whose time segment is about to run out into the head of the task queue to give priority to processing the workload whose time segment is about to run out.
[0041] Figure 6 A flow chart of a method 600 for processing a workload according to some embodiments of the present disclosure is shown. As shown in method 600, at 602, a workload enters. For example, in some embodiments, the workload is loaded into a memory in preparation for execution. At 604, the workload is inserted into a task queue. For example, in some embodiments, based on the priority of the workload, the workload is inserted into a specific position of the task queue. In some embodiments, based on the priority of the workload and the time segment of the workload in the task queue, the workload is inserted into the task queue. At 606, the workload is removed at the head of the task queue. For example, in some embodiments, the workload is removed from the head of each task queue in a plurality of task queues in turn, and the removed workload can be processed, while the remaining workloads in the task queue wait for processing.
[0042] At 608, a priority threshold is obtained from a machine learning model. For example, the queue data information of the task queue can be passed into the machine learning model, including but not limited to the task queue length, workload priority distribution, workload group size, and response time distribution, etc. The machine learning model calculates the current priority threshold based on the queue data information. It can be understood that when the queue data information changes, the calculated priority threshold may also change. At 610, the priority and priority threshold of the workload removed from the task queue are compared. For example, in some embodiments, the priority of the workload removed from the task queue can be 3, and the priority threshold can be 4, and the priority of the removed workload is less than the priority threshold, then proceed to 614, and process the workload without using processing to save processor resources to process other high-priority workloads. In addition, in some embodiments, the priority of the workload removed from the task queue can be 3, and the priority threshold can be 2, then proceed to 612, and use the processor to process the workload. It can be understood that as processor resources change, the priority threshold will also change dynamically, and the way workloads with the same priority are processed will also change, to ensure that the processor is used to process high-priority workloads when processor resources are insufficient, and the processor can also be used to process low-priority workloads when processor resources are sufficient, thereby improving the processing efficiency of the system.
[0043] Figure 7 1 shows a schematic block diagram of a device 700 that can be used to implement an embodiment of the present disclosure. The device 700 may be a device or apparatus described in an embodiment of the present disclosure. Figure 7 As shown, the device 700 includes a central processing unit (processor) 701, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 702 or computer program instructions loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0044] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0045] The various methods or processes described above may be performed by the processing unit 701. For example, in some embodiments, the methods may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the processor 701, one or more steps or actions in the methods or processes described above may be performed.
[0046] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0047] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0048] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0049] The computer program instructions for performing the disclosed operation may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, and conventional procedural programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In certain embodiments, by utilizing the state information of a computer-readable program instruction to customize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the present disclosure.
[0050] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0051] Computer-readable program instructions may be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0052] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the equipment, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each block in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the blocks can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous blocks can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flow chart, and the combination of the blocks in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0053] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for processing a workload, comprising: Determining a priority threshold for the task queue based on queue data of the task queue; Obtaining the priority of the workload at the head of the task queue; In response to the priority being greater than the priority threshold, processing the workload using a processor; and In response to the priority being less than or equal to the priority threshold, processing the workload without using the processor.
2. The method according to claim 1, further comprising: Selecting the task queue from a plurality of task queues; Obtaining the priority of each workload in the task queue; as well as The workload to be inserted is inserted into the task queue based on the priority of the workload to be inserted and the priority of each workload in the task queue.
3. The method according to claim 2, further comprising: In response to a time segment of the workload being less than a time segment threshold, the workload is moved to the head of the task queue.
4. The method according to claim 3, further comprising: The workload is inserted into the task queue based on the priority of the workload to be inserted and the priority and the time slice of each workload in the task queue.
5. The method according to claim 1, wherein the priority threshold is determined using a machine learning model, comprising: Obtaining the queue data of the task queue, wherein the queue data includes at least one of a task queue length, a workload priority distribution, a workload group size, and a response time distribution; and Based on the queue data, the priority threshold is determined using the machine learning model.
6. The method according to claim 5, further comprising: Writing the queue data into a historical database; as well as The machine learning model is trained regularly based on the historical queue data in the historical database and the labeled value of the priority threshold.
7. The method according to claim 2, wherein obtaining the priority of the workload at the head of the task queue comprises: Removing the workload at the head of the task queue; as well as The priority of the removed workload is obtained.
8. The method according to claim 7, further comprising: determining whether a time segment of the workload in each of the plurality of task queues is less than the time segment threshold; as well as In response to the time segment of the workload in each of the plurality of task queues being less than the time segment threshold, the workload is moved to the head of the corresponding task queue. The method of claim 8 , wherein the priority of the workload is configurable.
10. The method of claim 2, wherein selecting the task queue from the plurality of task queues comprises selecting the task queue using a round-robin scheduling algorithm.
11. An electronic device, comprising: Processing unit; as well as A memory coupled to the processing unit and storing instructions that, when executed by the processing unit, perform the following actions: Determining a priority threshold for the task queue based on queue data of the task queue; Obtaining the priority of the workload at the head of the task queue; In response to the priority being greater than the priority threshold, processing the workload using a processor; and In response to the priority being less than or equal to the priority threshold, processing the workload without using the processor.
12. The apparatus of claim 11, the actions further comprising: Selecting the task queue from a plurality of task queues; Obtaining the priority of each workload in the task queue; as well as The workload to be inserted is inserted into the task queue based on the priority of the workload to be inserted and the priority of each workload in the task queue.
13. The apparatus of claim 12, wherein the actions further comprise: In response to a time segment of the workload being less than a time segment threshold, the workload is moved to the head of the task queue.
14. The apparatus of claim 13, wherein the actions further comprise: The workload is inserted into the task queue based on the priority of the workload to be inserted and the priority and the time slice of each workload in the task queue.
15. The apparatus of claim 11, wherein the priority threshold is determined using a machine learning model, comprising: Obtaining the queue data of the task queue, wherein the queue data includes at least one of a task queue length, a workload priority distribution, a workload group size, and a response time distribution; and Based on the queue data, the priority threshold is determined using the machine learning model.
16. The apparatus of claim 15, the actions further comprising: Writing the queue data into a historical database; as well as The machine learning model is trained regularly based on the historical queue data in the historical database and the labeled value of the priority threshold.
17. The device according to claim 12, wherein obtaining the priority of the workload at the head of the task queue comprises: Removing the workload at the head of the task queue; as well as The priority of the removed workload is obtained.
18. The apparatus of claim 17, the actions further comprising: determining whether a time segment of the workload in each of the plurality of task queues is less than the time segment threshold; as well as In response to the time segment of the workload in each of the plurality of task queues being less than the time segment threshold, the workload is moved to the head of the corresponding task queue.
19. The apparatus of claim 18, wherein the priority of the workload is configurable.
20. A computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions which, when executed, cause a machine to perform the following actions: Determining a priority threshold for the task queue based on queue data of the task queue; Obtaining the priority of the workload at the head of the task queue; In response to the priority being greater than the priority threshold, processing the workload using a processor; and In response to the priority being less than or equal to the priority threshold, processing the workload without using the processor.