Distributed task allocation scheduling method and device and storage medium
By classifying the importance and resource availability of distributed tasks, allocating them to the corresponding processing queues and processing them according to priority, the flexibility and efficiency of task allocation and scheduling in the marketing activities of existing telecommunications customers is solved, and the maximum utilization of resources and the minimization of task time is achieved.
Patent Information
- Application Number
- CN202311776294.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-07-01
AI Technical Summary
How to flexibly and efficiently allocate and dispatch distributed tasks in the marketing activities of existing telecommunications customers under limited system resources, especially when subtasks of different marketing activities, subsystems or modules, and associated external systems are carried out simultaneously, to maximize resource utilization and minimize task execution time.
By receiving task requests, the tasks are classified hierarchically according to the importance of the task and the current availability of system resources, assigned to the corresponding processing queue, and allocated to the system resources in hierarchical order for processing, including calculating the resource priority and priority of the task, and dynamically adjusting resource allocation.
It realizes flexible and efficient distributed task allocation and scheduling, improves resource utilization and task execution efficiency, and reduces task execution time.
Smart Images

Figure CN120234101A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a distributed task allocation and scheduling method, apparatus, and storage medium. Background Art
[0002] With the continuous development of customer marketing activities for telecommunications inventory, different marketing activities, different subsystems or modules, and subtasks of different associated external systems need to be carried out simultaneously, while system resources are not infinite.
[0003] Based on this, how to flexibly and efficiently allocate and schedule distributed tasks has become an urgent problem to be solved. Summary of the Invention
[0004] Embodiments of this application provide a distributed task allocation and scheduling method, apparatus, and storage medium to solve the problems in the related art. The technical solutions are as follows:
[0005] In a first aspect, embodiments of this application provide a distributed task allocation and scheduling method, including:
[0006] Receiving a task request, classifying each task in the distributed task according to the importance of each task and the current availability of system resources to obtain a classification result;
[0007] According to the classification result, allocating each task to a corresponding processing queue in the task queue;
[0008] Scanning the task queue, and sequentially selecting tasks from the corresponding processing queues of the task queue according to the level order to be allocated to available resources in the system resources for processing.
[0009] In an implementation, receiving a task request, classifying each task in the distributed task according to the importance of each task and the current availability of system resources, and obtaining a classification result includes:
[0010] After receiving the task request, obtaining the estimated occupied resources and importance level of each pre-configured task;
[0011] According to the estimated occupied resources, the total resources of the system resources, and their current available resources, determining the resource priority weight of each task;
[0012] According to the importance level and the resource priority weight, determining the priority weight of each task;
[0013] According to the priority weight, classifying each task to obtain the classification result.
[0014] In one implementation, determining the resource priority weight of each task according to the estimated occupied resources, the total system resources and the currently available resources includes:
[0015] Determine the resource priority weight of each task according to the estimated occupied resources, the total system resources and the currently available resources according to the following first calculation formula;
[0016] The first calculation formula is expressed as:
[0017]
[0018] Among them, P1 represents the resource priority weight, R represents the total resources of the system resources, S represents the current available resources of the system resources, and P represents the estimated occupied resources.
[0019] In one implementation, determining the priority weight of each task according to the importance level and the resource priority weight includes:
[0020] According to the importance level and the resource priority weight, determine the priority weight of each task according to the following second calculation formula;
[0021] The second calculation formula is expressed as:
[0022] P2=V*10+P1
[0023] Among them, P2 represents the priority weight, and V represents the importance level.
[0024] In one embodiment, the task queue includes a high priority processing queue, a medium priority processing queue and a low priority processing queue; and according to the classification result, assigning each task to a corresponding processing queue in the task queue includes:
[0025] When each of the tasks is determined to be a high priority task according to the classification result, each of the tasks is assigned to the high priority processing queue;
[0026] When each of the tasks is determined to be a medium priority task according to the classification result, each of the tasks is assigned to the medium priority processing queue;
[0027] When each task is determined to be a low priority task according to the classification result, each task is allocated to the low priority processing queue.
[0028] In one embodiment, scanning the task queue and selecting tasks from the corresponding processing queues of the task queue in order of level and assigning them to available resources in the system resources for processing includes:
[0029] Scan the high - priority processing queue, select tasks from the high - priority processing queue, and assign them to the available resources of the system resources for processing;
[0030] When it is scanned that there are no tasks in the high - priority processing queue, scan the medium - priority processing queue, select tasks from the medium - priority processing queue, and assign them to the available resources of the system resources for processing;
[0031] When it is scanned that there are no tasks in the medium - priority processing queue, scan the low - priority processing queue, select tasks from the low - priority processing queue, and assign them to the available resources of the system resources for processing.
[0032] In one embodiment, the method further includes:
[0033] Whenever one task in the distributed tasks is processed, re - allocate the resources used to process the one task among the available resources of the system resources to other pending tasks in the distributed tasks.
[0034] In a second aspect, an embodiment of the present application further provides a distributed task allocation and scheduling device, including:
[0035] A classification unit, configured to receive a task request, classify each task according to the importance of each task in the distributed tasks and the current availability of system resources, and obtain a classification result;
[0036] An allocation unit, configured to allocate each task to the corresponding processing queue in the task queue according to the classification result;
[0037] A scheduling unit, configured to scan the task queue, and sequentially select tasks from the corresponding processing queues of the task queue according to the level order, and assign them to the available resources in the system resources for processing.
[0038] In one embodiment, the classification unit is specifically configured to:
[0039] After receiving the task request, obtain the estimated occupied resources and importance levels of each task configured in advance;
[0040] Determine the resource priority weights of each task according to the estimated occupied resources, the total resources of the system resources and their current available resources;
[0041] Determine the priority weights of each task according to the importance levels and the resource priority weights;
[0042] Classify each task according to the priority weights to obtain the classification result.
[0043] In one embodiment, the classification unit is specifically configured to:
[0044] According to the estimated occupied resources, the total resources of the system resources, and its current available resources, determine the resource priority weight of each task according to the following first calculation formula;
[0045] The first calculation formula is expressed as:
[0046]
[0047] Wherein, P1 represents the resource priority weight, R represents the total resources of the system resources, S represents the current available resources of the system resources, and P represents the estimated occupied resources.
[0048] In one embodiment, the classification unit is specifically configured to:
[0049] According to the importance level and the resource priority weight, determine the priority weight of each task according to the following second calculation formula;
[0050] The second calculation formula is expressed as:
[0051] P2 = V * 10 + P1
[0052] Wherein, P2 represents the priority weight, and V represents the importance level.
[0053] In one embodiment, the task queue includes a high-priority processing queue, a medium-priority processing queue, and a low-priority processing queue; the allocation unit is specifically configured to:
[0054] When it is determined according to the classification result that each task is a high-priority task, allocate each task to the high-priority processing queue;
[0055] When it is determined according to the classification result that each task is a medium-priority task, allocate each task to the medium-priority processing queue;
[0056] When it is determined according to the classification result that each task is a low-priority task, allocate each task to the low-priority processing queue.
[0057] In one embodiment, the scheduling unit is specifically configured to:
[0058] Scan the high-priority processing queue, and select tasks from the high-priority processing queue to be allocated to the available resources of the system resources for processing;
[0059] When it is scanned that there is no task in the high-priority processing queue, scan the medium-priority processing queue, select a task from the medium-priority processing queue, and allocate it to the available resources of the system resources for processing;
[0060] When it is scanned that there is no task in the medium-priority processing queue, scan the low-priority processing queue, select a task from the low-priority processing queue, and allocate it to the available resources of the system resources for processing.
[0061] In one implementation, the scheduling unit is further configured to:
[0062] Whenever a task in the distributed task is processed and completed, reallocate the resources used to process the one task among the available resources of the system resources to other pending tasks in the distributed task.
[0063] In a third aspect, an embodiment of the present application further provides a computer device, which includes: a memory and a processor, instructions are stored in the memory, and the instructions are loaded and executed by the processor to implement the method in any one of the above aspects. Among them, the memory and the processor communicate with each other through an internal connection path.
[0064] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the method in any one of the above aspects is implemented.
[0065] The advantages or beneficial effects in the above technical solutions at least include:
[0066] By receiving a task request, classifying each task in the distributed task according to the importance of each task and the current availability of system resources, and obtaining a classification result, each task in the distributed task can be classified, which is convenient for allocation scheduling and execution according to the importance of each task and the availability of system resources, and can improve the flexibility and adaptability of distributed task allocation scheduling; further, by allocating each task to the corresponding processing queue in the task queue according to the classification result, each task in the distributed task can be sorted by priority, so that the maximum resource utilization rate and the minimum task execution time can be achieved; further, by scanning the task queue and sequentially selecting tasks from the corresponding processing queues of the task queue according to the hierarchical order and allocating them to the available resources in the system resources for processing, the resource allocation can be automatically optimized, and the allocation scheduling can be performed according to the importance of each task in the distributed task and the current availability of system resources, the maximum resource utilization rate and the minimum task execution time can be achieved, so that the effect of flexibly and efficiently allocating and scheduling distributed tasks can be achieved.
[0067] The above summary is for the purpose of the specification only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present application will become readily apparent by reference to the drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In the drawings, unless otherwise specified, the same reference numerals throughout the several views represent the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments disclosed in accordance with the present application and should not be regarded as limiting the scope of the present application.
[0069] Figure 1 A flowchart of a task scheduling and allocation method provided for an embodiment of the present application;
[0070] Figure 2 A flowchart of an execution step S110 provided for an embodiment of the present application;
[0071] Figure 3 A schematic diagram of a scheduling and allocation system architecture for distributed tasks provided for an embodiment of the present application;
[0072] Figure 4 A structural block diagram of a distributed task allocation and scheduling device provided for an embodiment of the present application;
[0073] Figure 5 A structural block diagram of a computer device provided for an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0074] In the following, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various different ways without departing from the spirit or scope of the present application. Therefore, the drawings and the description are to be regarded as illustrative in nature and not restrictive.
[0075] Figure 1 A flowchart showing a distributed task allocation and scheduling method according to an embodiment of the present application. As Figure 1 shown, the method may include the following steps:
[0076] S110. Receive a task request, classify each task in the distributed task according to the importance of each task and the current availability of system resources, and obtain a classification result.
[0077] In one implementation, the distributed task can be a distributed task involving multiple modules or multiple systems, or a distributed task with different business boundaries. Each task in the distributed task can be a timed task or a batch processing task, and the embodiments of the present application do not limit this.
[0078] In one implementation, as shown in Figure 1-2 Step S110 may include the following steps:
[0079] S111. After receiving a task request, obtain the estimated occupied resources and importance levels of each pre-configured task.
[0080] In specific implementation, before executing step S110, the estimated occupied resources of each task in the distributed task can be pre-configured, and the importance level of each task can be pre-configured. After receiving the task request, the estimated occupied resources and importance levels of each task can be directly obtained.
[0081] As an example, the importance level of each task can be configured with 1 - 10 levels, and the larger the corresponding value of the level, the higher the importance level.
[0082] S112. Determine the resource priority weight of each task according to the estimated occupied resources of each task, the total resources of the system resources, and its current available resources.
[0083] In specific implementation, the resource priority weight of each task can be determined according to the estimated occupied resources of each task, the total resources of the system resources, and its current available resources according to the following first calculation formula (1).
[0084]
[0085] Among them, P1 represents the resource priority weight of each task, R represents the total resources of the system resources, S represents the current available resources of the system resources, and P represents the estimated occupied resources of each task.
[0086] As an example, when taking the value of the estimated occupied resources P of each task, if P has been executed before, then the occupied resources of the last execution can be preferentially used to take the value of P.
[0087] S113. Determine the priority weight of each task according to the importance level and resource priority weight of each task.
[0088] In specific implementation, the priority weight of each task can be determined according to the importance level and resource priority weight of each task according to the following second calculation formula (2).
[0089] P2 = V * 10 + P1 (2)
[0090] Among them, P2 represents the priority weight for each task, and V represents the importance level for each task.
[0091] S114. Classify each task according to the priority weight of each task to obtain a classification result.
[0092] In specific implementation, the corresponding relationship between the priority weight and the level category can be pre-configured. According to the priority weight of each task and this corresponding relationship, the level classification of each task can be identified.
[0093] For example, when the corresponding relationship is as shown in Table 1 below, if the priority weight of a certain task is 75, this task can be identified as a high-priority task.
[0094] Table 1
[0095] Priority weight Level category 70 ≤ Priority weight High priority 30 ≤ Priority weight < 70 Medium priority Priority weight < 30 Low priority
[0096] As an example, in combination with Figure 1-3 shown, the above steps S111 - S114 can be executed by a task classifier, that is, the above step S110 can be executed by this task classifier. For example, the task classifier receives a task request and analyzes it, and classifies each task as a high-priority task, a medium-priority task, or a low-priority task according to the importance of each task and the current availability of system resources.
[0097] In the embodiment of the present application, by executing step S110, the level classification of each task in the distributed task can be performed, which is convenient for allocation and scheduling execution according to the importance of each task and the availability of system resources, can improve the flexibility and adaptability of the distributed task allocation and scheduling, and helps to achieve the effect of flexibly and efficiently allocating and scheduling the distributed task.
[0098] S120. According to the classification result, allocate each task to the corresponding processing queue in the task queue.
[0099] In one implementation, the task queue includes a high-priority processing queue, a medium-priority processing queue, and a low-priority processing queue.
[0100] In one implementation, when it is determined according to the classification result that each task is a high-priority task, then each task is allocated to the high-priority processing queue in the task queue.
[0101] In one implementation, when it is determined according to the classification result that each task is a medium-priority task, then each task is allocated to the medium-priority processing queue in the task queue.
[0102] In one embodiment, when it is determined that each task is a low-priority task according to the classification result, each task is assigned to the low-priority processing queue in the task queue.
[0103] It should be understood that in the embodiments of the present application, different tasks in the distributed tasks can be assigned to different processing queues in the task queue.
[0104] As an example, in combination with Figure 1-3 As shown, step S120 can be executed by a task allocator. That is, the task allocator receives the output of the task classifier, writes the high-priority tasks in the distributed tasks into the high-priority processing queue, and thus the high-priority tasks can be assigned to the high-priority processing queue, and writes the medium-priority tasks in the distributed tasks into the medium-priority processing queue, and thus the medium-priority tasks can be assigned to the medium-priority processing queue, and writes the low-priority tasks in the distributed tasks into the low-priority processing queue, and thus the low-priority tasks can be assigned to the low-priority processing queue.
[0105] In the embodiments of the present application, by executing step S120, the priority of each task in the distributed tasks can be sorted, so that the resource utilization rate can be maximized and the task execution time can be minimized, which helps to achieve the effect of flexibly and efficiently allocating and scheduling the distributed tasks.
[0106] S130. Scan the task queue, and select tasks from the corresponding processing queues in the task queue in order of level and assign them to the available resources in the system resources for processing.
[0107] In one embodiment, the high-priority processing queue can be scanned first, and tasks are selected from the high-priority processing queue and assigned to the available resources of the system resources for processing. For example, the high-priority processing queue can be scanned, and tasks are selected from the high-priority processing queue in order of the priority weights from high to low. For any task selected from the high-priority processing queue, the task parameters of any task are parsed, the availability of the system resources is judged according to the task parameters, available resources are selected from the resource pool of the system resources, and then any task is assigned to the available resources for processing.
[0108] In one embodiment, when it is scanned that there is no task in the high-priority processing queue, the medium-priority processing queue can be scanned, and tasks are selected from the medium-priority processing queue and assigned to the available resources of the system resources for processing. Among them, the processing process of the tasks in the medium-priority processing queue can refer to the processing process of the tasks in the above high-priority processing queue, and the embodiments of the present application will not be elaborated herein.
[0109] In one embodiment, when it is scanned that there is no task in the medium-priority processing queue, the low-priority processing queue is scanned, and a task is selected from the low-priority processing queue and assigned to the available resources of the system resources for processing. Among them, for the processing process of the tasks in the low-priority processing queue, reference may be made to the processing process of the tasks in the high-priority processing queue described above, which will not be elaborated in this embodiment of the present application.
[0110] As an example, in combination with Figure 1-3 As shown, step S130 can be executed by a task scheduler. For example, the task scheduler receives the output of the task allocator, first selects a task from the high-priority processing queue and assigns it to the available resources of the system resources for processing. If there is no task in the high-priority processing queue, then a task is selected from the medium-priority processing queue and assigned to the available resources of the system resources for processing. If there is also no task in the medium-priority processing queue, then a task is selected from the low-priority processing queue and assigned to the available resources of the system resources for processing.
[0111] In the embodiment of the present application, by executing step S130, the resource allocation can be automatically optimized, and the allocation scheduling can be performed according to the importance of each task in the distributed task and the current availability of the system resources, so as to maximize the resource utilization rate and minimize the task execution time, thereby achieving the effect of flexibly and efficiently allocating and scheduling the distributed tasks.
[0112] In an applicable scenario provided by the embodiment of the present application, in combination with Figure 1-3 As shown, the distributed task allocation and scheduling method provided by the embodiment of the present application may further include the following steps:
[0113] S140. Whenever a task in the distributed task is processed and completed, the resources used to process one task among the available resources of the system resources are reallocated to other pending tasks in the distributed task.
[0114] In one embodiment, whenever a task in the distributed task is processed and completed, the resources used to process one task among the available resources of the system resources can be recycled, and then the resources are reallocated to other pending tasks in the distributed task.
[0115] For example, during the process of processing tasks in the high-priority processing queue, whenever a high-priority task is processed and completed, the resources used to process the high-priority task are recycled, such as being recycled to the resource pool of system resources. At this time, if there are unprocessed tasks in the high-priority processing queue, the resources are reallocated to the unprocessed tasks in the high-priority processing queue. Or, if there are no unprocessed tasks in the high-priority processing queue, the resources are reallocated to the unprocessed tasks in the medium-priority processing queue. Among them, the processing process of tasks in the medium-priority processing queue and the processing process of tasks in the low-priority processing queue can be the same as or similar to the processing process of tasks in the high-priority processing queue, which will not be elaborated here.
[0116] As an example, in combination with Figure 1-3 As shown, step S140 can be executed by a resource manager. For example, the resource manager receives the output of the task scheduler and reallocates the resources used by the tasks that have been processed and completed in the distributed tasks (hereinafter referred to as resource A) to other pending tasks in the distributed tasks. For example, the reallocation process of resource A can be as follows:
[0117] If there are unprocessed tasks (such as task A) in the high-priority processing queue, then task A is allocated to resource A for processing. If there are no unprocessed tasks in the high-priority processing queue, but there are unprocessed tasks (such as task B) in the medium-priority processing queue, then task B is allocated to resource A for processing. If there are no unprocessed tasks in the high-priority processing queue, no unprocessed tasks in the medium-priority processing queue either, but there are unprocessed tasks (such as task C) in the low-priority processing queue, then task C is allocated to resource A for processing.
[0118] In the embodiments of the present application, by executing step S140, the available resources of the system resources can be dynamically adjusted according to the actual situation, with high flexibility and adaptability, and further, the effect of flexibly and efficiently allocating and scheduling distributed tasks can be achieved.
[0119] In summary, the distributed task allocation and scheduling method provided by the embodiments of the present application receives a task request, classifies each task in the distributed task according to the importance of each task and the current availability of system resources to obtain a classification result, and can classify each task in the distributed task, which is convenient for allocation, scheduling and execution according to the importance of each task and the availability of system resources, and can improve the flexibility and adaptability of distributed task allocation and scheduling; further, according to the classification result, each task is allocated to the corresponding processing queue in the task queue, and the priority of each task in the distributed task can be sorted, so that the maximum resource utilization rate and the minimum task execution time can be achieved; further, by scanning the task queue and sequentially selecting tasks from the corresponding processing queues of the task queue according to the hierarchical order and allocating them to the available resources in the system resources for processing, the resource allocation can be automatically optimized, and the allocation and scheduling can be performed according to the importance of each task in the distributed task and the current availability of system resources, and the maximum resource utilization rate and the minimum task execution time can be achieved, so that the effect of flexibly and efficiently allocating and scheduling distributed tasks can be achieved.
[0120] Figure 4 FIG. shows a structural block diagram of a distributed task allocation and scheduling device according to an embodiment of the present application. As Figure 4 shown, the device may include:
[0121] A classification unit 210, configured to receive a task request, classify each task according to the importance of each task in the distributed task and the current availability of system resources, and obtain a classification result;
[0122] An allocation unit 220, configured to allocate each task to the corresponding processing queue in the task queue according to the classification result;
[0123] A scheduling unit 230, configured to scan the task queue, and sequentially select tasks from the corresponding processing queues of the task queue according to the hierarchical order and allocate them to the available resources in the system resources for processing.
[0124] In an implementation manner, the classification unit 210 is specifically configured to:
[0125] After receiving the task request, obtain the estimated occupied resources and importance levels of each task configured in advance;
[0126] Determine the resource priority weights of each task according to the estimated occupied resources, the total resources of the system resources and their current available resources;
[0127] Determine the priority weights of each task according to the importance levels and the resource priority weights;
[0128] Classify each task according to the priority weights to obtain a classification result.
[0129] In one embodiment, the classification unit 210 is specifically configured to:
[0130] According to the estimated occupied resources, the total resources of the system resources, and its current available resources, determine the resource priority weight of each task according to the following first calculation formula;
[0131] The first calculation formula is expressed as:
[0132]
[0133] Wherein, P1 represents the resource priority weight, R represents the total resources of the system resources, S represents the current available resources of the system resources, and P represents the estimated occupied resources.
[0134] In one embodiment, the classification unit 210 is specifically configured to:
[0135] According to the importance level and the resource priority weight, determine the priority weight of each task according to the following second calculation formula;
[0136] The second calculation formula is expressed as:
[0137] P2 = V * 10 + P1
[0138] Wherein, P2 represents the priority weight, and V represents the importance level.
[0139] In one embodiment, the task queue includes a high-priority processing queue, a medium-priority processing queue, and a low-priority processing queue; the allocation unit 220 is specifically configured to:
[0140] When it is determined according to the classification result that each task is a high-priority task, allocate each task to the high-priority processing queue;
[0141] When it is determined according to the classification result that each task is a medium-priority task, allocate each task to the medium-priority processing queue;
[0142] When it is determined according to the classification result that each task is a low-priority task, allocate each task to the low-priority processing queue.
[0143] In one embodiment, the scheduling unit 230 is specifically configured to:
[0144] Scan the high-priority processing queue, and select tasks from the high-priority processing queue to be processed by the available resources of the system resources;
[0145] When no task is scanned in the high-priority processing queue, scan the medium-priority processing queue, and select tasks from the medium-priority processing queue to be processed by the available resources of the system resources;
[0146] When it is scanned that there is no task in the medium-priority processing queue, the low-priority processing queue is scanned, and a task is selected from the low-priority processing queue and assigned to the available resources of the system resources for processing.
[0147] In one implementation, the scheduling unit 230 is further configured to:
[0148] Whenever a task in the distributed task is processed and completed, the resources used to process one task among the available resources of the system resources are re-assigned to other pending tasks in the distributed task.
[0149] For the functions of the units in the distributed task allocation and scheduling device in the embodiments of the present application, reference may be made to the corresponding descriptions in the above methods, and details are not described herein again.
[0150] Figure 5 The structural block diagram of a computer device according to an embodiment of the present application is shown. As Figure 5 shown, the computer device includes: a memory 310 and a processor 320. Instructions are stored in the memory 310, and the instructions are loaded and executed by the processor 320 to implement the distributed task allocation and scheduling method in the above embodiments. The number of the memory 310 and the processor 320 may be one or more.
[0151] The computer device further includes:
[0152] A communication interface 330, configured to communicate with external devices and perform data interaction and transmission.
[0153] If the memory 310, the processor 320, and the communication interface 330 are implemented independently, the memory 310, the processor 320, and the communication interface 330 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 5 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0154] Optionally, in a specific implementation, if the memory 310, the processor 320, and the communication interface 330 are integrated on a chip, the memory 310, the processor 320, and the communication interface 330 may communicate with each other through an internal interface.
[0155] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, the method provided in the embodiment of the present application is implemented.
[0156] An embodiment of the present application further provides a chip, which includes a processor for calling and running instructions stored in a memory, so that a communication device equipped with the chip executes the method provided in the embodiment of the present application.
[0157] An embodiment of the present application further provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is configured to execute code in the memory. When the code is executed, the processor is configured to execute the method provided in the embodiment of the application.
[0158] It should be understood that the above-mentioned processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced reduced instruction set machine (ARM) architecture.
[0159] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may further include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM).
[0160] In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0161] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0162] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description of this application, "a plurality of" means two or more unless otherwise specifically defined.
[0163] Any process or method description represented in a flowchart or described in other ways herein may be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process. And the scope of the preferred embodiments of this application includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in a reverse order according to the functions involved, rather than in the order shown or discussed.
[0164] The logic and / or steps represented in a flowchart or described in other ways herein, for example, may be considered as a sequenced list of executable instructions for implementing a logical function, and may be specifically implemented in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device.
[0165] It should be understood that each part of this application may be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the method in the above embodiments may be completed by a program instructing relevant hardware, and this program may be stored in a computer-readable storage medium. When this program is executed, it includes one or a combination of the steps of the method embodiment.
[0166] In addition, each functional unit in various embodiments of the present application may be integrated into a processing module, or each unit may exist physically alone, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, an optical disc, or the like.
[0167] As described above, the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present application can easily think of various changes or substitutions, and these should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A distributed task allocation and scheduling method, characterized in that Including: Receiving a task request, classifying each task in the distributed task according to the importance of each task and the current availability of system resources to obtain a classification result; According to the classification result, allocating each task to the corresponding processing queue in the task queue; Scanning the task queue, and sequentially selecting tasks from the corresponding processing queues of the task queue according to the level order and allocating them to the available resources in the system resources for processing.
2. The method according to claim 1, characterized in that, Receiving a task request, classifying each task in the distributed task according to the importance of each task and the current availability of system resources, and the obtained classification result includes: After receiving the task request, obtaining the estimated occupied resources and importance levels of each pre-configured task; According to the estimated occupied resources, the total resources of the system resources and their current available resources, determining the resource priority weight of each task; According to the importance level and the resource priority weight, determining the priority weight of each task; Classifying each task according to the priority weight to obtain the classification result.
3. The method according to claim 2, wherein Determining the resource priority weight of each task according to the estimated occupied resources, the total resources of the system resources and their current available resources includes: According to the estimated occupied resources, the total resources of the system resources and their current available resources, determining the resource priority weight of each task according to the following first calculation formula; The first calculation formula is expressed as: Where, P1 represents the resource priority weight, R represents the total resources of the system resources, S represents the current available resources of the system resources, and P represents the estimated occupied resources.
4. The method according to claim 3, wherein Determining the priority weight of each task according to the importance level and the resource priority weight includes: According to the importance level and the resource priority weight, determining the priority weight of each task according to the following second calculation formula; The second calculation formula is expressed as: P2 = V * 10 + P1 Where, P2 represents the priority weight, and V represents the importance level.
5. The method according to claim 1, wherein The task queue includes a high-priority processing queue, a medium-priority processing queue, and a low-priority processing queue; allocating each task to the corresponding processing queue in the task queue according to the classification result includes: When it is determined according to the classification result that each task is a high-priority task, allocating each task to the high-priority processing queue; When it is determined according to the classification result that each task is a medium-priority task, allocating each task to the medium-priority processing queue; When it is determined according to the classification result that each task is a low-priority task, allocating each task to the low-priority processing queue.
6. The method according to claim 5, wherein Scanning the task queue, and sequentially selecting tasks from the corresponding processing queues of the task queue according to the level order and allocating them to the available resources in the system resources for processing includes: Scanning the high-priority processing queue, and selecting tasks from the high-priority processing queue and allocating them to the available resources of the system resources for processing; When it is scanned that there is no task in the high-priority processing queue, scan the medium-priority processing queue, select a task from the medium-priority processing queue, and allocate it to the available resources of the system resources for processing; When it is scanned that there is no task in the medium-priority processing queue, scan the low-priority processing queue, select a task from the low-priority processing queue, and allocate it to the available resources of the system resources for processing.
7. The method according to any one of claims 1 to 6, characterized in that The method further includes: Whenever one task in the distributed task is processed, reallocate the resources used to process the one task among the available resources of the system resources to other pending tasks in the distributed task.
8. A distributed task allocation and scheduling device, characterized in that, It includes: A classification unit, configured to receive a task request, classify each task according to the importance of each task in the distributed task and the current availability of system resources, and obtain a classification result; An allocation unit, configured to allocate each task to the corresponding processing queue in the task queue according to the classification result; A scheduling unit, configured to scan the task queue, and sequentially select tasks from the corresponding processing queues of the task queue according to the level order and allocate them to the available resources in the system resources for processing.
9. A computer device, characterized in that, It includes: A memory and a processor, instructions are stored in the memory, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program runs on a computer, the method according to any one of claims 1-7 is implemented.