Task scheduling method and device based on multiple scenes, equipment and medium

By determining priority and merging task queues based on task attribute information in an intelligent application system, the problems of resource competition and task scheduling optimization in multiple scenarios are solved, and the system resource utilization and responsiveness are improved.

CN119862016APending Publication Date: 2025-04-22MACROWING SOFTWARE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411973904.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

In an intelligent application system based on artificial intelligence model, applications in different scenarios rely on the same underlying model, resulting in competition for hardware and software resources, and the problem of resource configuration on demand and task scheduling optimization cannot be effectively solved, resulting in poor system performance.

Method used

By obtaining multiple pending task requests corresponding to multiple business scenarios, determining priority parameters based on the attribute information of the task request, establishing task queues for each business scenario, and combining these queues into a global task queue, and processing task requests in the global task queue in turn.

Benefits of technology

Multi-scenario task scheduling is implemented, the availability of system resources is improved, task queuing and resource occupation caused by a large number of tasks in individual scenarios is avoided, and system responsiveness and performance are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862016A_ABST
    Figure CN119862016A_ABST
Patent Text Reader

Abstract

The invention discloses a task scheduling method and device based on multiple scenes, equipment and a medium. The method comprises the following steps: acquiring a plurality of to-be-processed task requests corresponding to a plurality of business scenes; wherein the to-be-processed task request carries attribute information; determining a first priority parameter of each to-be-processed task request based on the attribute information; determining a task queue of each business scene based on the first priority parameter of each to-be-processed task request; merging the tasks contained in the task queues to obtain a global task queue; and sequentially processing based on the to-be-processed task requests in the global task queue. According to the technical scheme, task scheduling processing of multiple scenes can be achieved, the availability of system resources is improved, and the situation that the system resources are subjected to response loss due to task queuing caused by a large number of tasks of individual scenes is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a multi-scenario based task scheduling method, device, equipment and medium. Background Art

[0002] With the development of computer technology and the Internet, the types of scenarios involved in various network platforms, applications, and products are constantly enriched, and the functions and services provided to users are gradually increasing; and with the increase in the number of users, the number of tasks that the platform needs to face has increased sharply, and the scenarios and task requirements are becoming increasingly complex.

[0003] In intelligent application systems based on artificial intelligence models, applications in various scenarios often rely on the same underlying model. Competition for hardware and software resources is cross-business scenario. A certain business may occupy all underlying resources, causing other businesses to wait for a long time and be unable to execute. Different businesses have different characteristics in terms of resource occupation. For example, foreground requests occupy few resources but require timely responses, and background tasks occupy a lot of resources but can be planned and run on demand. With limited underlying resources, it is impossible to meet the needs of on-demand resource configuration and task scheduling optimization, which either results in idle resources and low utilization, or they are crowded together to queue up to compete for resources, resulting in unsatisfactory performance of the entire system. Summary of the invention

[0004] The present invention provides a multi-scenario task scheduling method, device, equipment and medium, which can realize multi-scenario task scheduling processing, improve the availability of system resources, and avoid the situation where system resources lose response due to task queuing caused by a large number of tasks in individual scenarios.

[0005] According to one aspect of the present invention, a multi-scenario based task scheduling method is provided, comprising:

[0006] Acquire multiple pending task requests corresponding to multiple business scenarios; wherein the pending task requests carry attribute information;

[0007] Determine a first priority parameter of each pending task request based on the attribute information;

[0008] Determine the task queue for each business scenario based on the first priority parameter of each pending task request;

[0009] The task queues of the various business scenarios are merged to obtain a global task queue, and the pending task requests in the global task queue are processed in sequence.

[0010] According to another aspect of the present invention, a task scheduling device based on multiple scenarios is provided, comprising:

[0011] A task acquisition module, used to acquire multiple pending task requests corresponding to multiple business scenarios; wherein the pending task requests carry attribute information;

[0012] A weight determination module, used to determine a first priority parameter of each pending task request based on the attribute information;

[0013] A scenario task queue determination module, used to determine the task queue of each business scenario based on the first priority parameter of each pending task request;

[0014] The task processing module is used to merge the task queues of the various business scenarios to obtain a global task queue, and process the pending task requests in the global task queue in sequence.

[0015] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-scenario based task scheduling method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-scenario based task scheduling method described in any embodiment of the present invention when executed.

[0020] The technical solution of the embodiment of the present invention is to obtain multiple pending task requests corresponding to multiple business scenarios; wherein the pending task requests carry attribute information; determine the first priority parameter of each pending task request based on the attribute information; determine the task queue of each business scenario based on the first priority parameter of each pending task request; merge the tasks contained in each task queue to obtain a global task queue; and process the pending task requests in the global task queue in sequence. This technical solution can realize task scheduling processing for multiple scenarios, improve the availability of system resources, and avoid the situation where system resources lose response due to task queuing caused by a large number of tasks in individual scenarios.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flowchart of a multi-scenario based task scheduling method provided according to Embodiment 1 of the present invention;

[0024] Figure 2 is a flowchart of a multi-scenario task scheduling method provided according to Embodiment 2 of the present invention;

[0025] Figure 3 is a structural diagram of a multi-scenario task scheduling device provided according to Embodiment 3 of the present invention;

[0026] Figure 4 It is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second" and "target" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] Embodiment 1

[0030] Figure 1 This is a flowchart of a multi-scenario task scheduling method provided according to the first embodiment of the present invention. This embodiment is applicable to the case of unified task resource scheduling for task requests facing multiple business scenarios. The method can be executed by a multi-scenario task scheduling device. The multi-scenario task scheduling device can be implemented in the form of hardware and / or software. The multi-scenario task scheduling device can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:

[0031] S110: Acquire multiple pending task requests corresponding to multiple business scenarios.

[0032] The technical solution in this embodiment can be executed by an intelligent application system. Multiple business scenarios can be understood as different business scenarios processed in the intelligent application system of artificial intelligence. For example, multiple business scenarios can include text processing business scenarios, image processing business processing, and multimodal data processing business scenarios such as images and videos. Among them, the text processing scenario can be divided into short text processing and long text processing, and processing tasks such as text extraction and classification of short text or long text; image business scenario processing can be a processing task of converting images into text, or a scenario of business processing such as audio extraction of images and videos. It can be understood that the business scenarios in this embodiment can be some conventional artificial intelligence scenarios, and the corresponding business tasks have different processing times and processing requirements when processing, but there are differences in task processing in different business scenarios. Multiple pending task requests can be considered as task requests that the current intelligent system needs to process. Multiple pending task requests can be understood as different pending task requests corresponding to multiple business scenarios, and there can be multiple pending task requests in each business scenario.

[0033] Among them, the pending task request carries attribute information. The attribute information can be understood as describing the characteristics, requirements, status of the task request and data or metadata related to the task execution. In this embodiment, the attribute information carried by the pending task request can be used to determine the allocation and execution of the task. The attribute information in this embodiment can include task type and task time limit, and can also include task description, task source, task status, task priority, task status, and task executor information.

[0034] The intelligent application system in this embodiment can obtain multiple pending task requests corresponding to multiple business scenarios, and can schedule the execution order of the pending tasks according to the attribute information carried in the multiple pending task requests.

[0035] S120. Determine a first priority parameter of each pending task request based on the attribute information.

[0036] The first priority parameter may be a priority parameter determined according to the attribute information of each pending task request. In this embodiment, the first priority parameter may be represented by a priority weight, which may be used to sort multiple pending task requests so as to obtain an arrangement order of the multiple pending task requests.

[0037] In this embodiment, each pending task request is evaluated according to a preset priority standard by evaluating the attribute information of each pending task request, so as to determine the first priority weight of each pending task request according to the priority evaluation result of the attribute information.

[0038] In this embodiment, optionally, the attribute information includes at least a task type and a task deadline; accordingly, determining the first priority parameter of each pending task request based on the attribute information includes: determining the first priority parameter of each pending task request according to the task type and the task deadline.

[0039] The task type may refer to the nature or category of the task, and may include, for example, regular tasks, project tasks, and tight tasks. The task deadline may be a time range or deadline specified for the task request to be processed, or may be the time required for task processing determined by evaluating the specific task in the task request to be processed.

[0040] In this embodiment, a corresponding type priority weight can be determined based on the task type of the pending task request, and then a corresponding time limit priority weight can be determined based on the task time limit of the pending task request, and then the type priority weight and the time limit priority weight are fused to obtain the first priority parameter of the pending task request, and the first priority parameter of each pending task request can be determined in the same manner. The fusion process can be a weighted summation process or other fusion processing methods, which can be set according to actual needs.

[0041] It can be understood that in this embodiment, different priority parameters can be assigned based on various attribute information of the pending task request in a pre-evaluation manner, and then the priority parameters can be merged to obtain the first priority parameter of each pending task request.

[0042] Through such a setting in the present embodiment, the priority weight can be evaluated based on the various attribute information carried in the pending task request. By comprehensively considering multiple factors and flexibly adjusting the priority parameters, the task execution order of each pending task request can be determined, so that the corresponding execution can be performed according to the sorting order of the pending task requests, which can better manage the usage of the system's underlying resources.

[0043] S130. Determine a task queue for each business scenario based on the first priority parameter of each task request to be processed.

[0044] Among them, the task queue of each business scenario may refer to a queue obtained by sorting and storing the to-be-processed task requests corresponding to each business scenario as a whole.

[0045] In this embodiment, in order to ensure that multiple scenarios have reasonable resource allocation rights in a unified scheduling system, it is first necessary to queue each pending task request in each scenario queue q according to the business scenario. Generally speaking, in each scenario, some pending task requests are of the same nature, or the determined priority parameters are the same, and they can be queued on a first-come, first-served basis; if the first priority parameters in each pending task request are different, or the task itself carries a separate priority parameter, the queue order will be sorted with reference to the first priority parameter of the pending task request to obtain the respective scenario task queues in each business scenario.

[0046] In this embodiment, optionally, the task queue of each business scenario is determined based on the first priority parameter of each pending task request, including: for each business scenario, multiple pending task requests are sorted based on the first priority parameter of each pending task request to obtain the corresponding task queue of each business scenario.

[0047] In this embodiment, for each business scenario, multiple pending task requests may be sorted in sequence according to the first priority weights of the pending task requests contained in each business scenario to obtain a task queue corresponding to each business scenario.

[0048] Through such a setting in this embodiment, the corresponding scenario task queue can be determined according to the business scenario of each task request to be processed, which can improve the efficiency of task execution.

[0049] S140: Merge the task queues of various business scenarios to obtain a global task queue.

[0050] Among them, the merging process can be understood as the operation of merging the pending task requests in the task queues of various business scenarios. The global task queue can be an operation that integrates the pending task requests in the task queues of various business scenarios into a unified global task queue. In this embodiment, the task requests contained in the task queues of various business scenarios can be integrated into a unified task queue, that is, a global task queue is obtained. Specifically, in this embodiment, each business scenario can also be pre-configured with different priority weights. When the task queues of various business scenarios are merged, all tasks of each business scenario can also be unified and sorted together with reference to the priority weights of each business scenario, so as to obtain a global queue.

[0051] S150: Process the pending task requests in the global task queue in sequence.

[0052] In this embodiment, the thread pool configured by the underlying resources can obtain the corresponding number of pending task requests from the global task queue in the order of arrangement and process them in sequence, thereby improving the efficiency of task request processing.

[0053] The technical solution of the embodiment of the present invention is to obtain multiple pending task requests corresponding to multiple business scenarios; wherein the pending task requests carry attribute information; determine the first priority parameter of each pending task request based on the attribute information; determine the task queue of each business scenario based on the first priority parameter of each pending task request; merge the tasks contained in each task queue to obtain a global task queue; and process the pending task requests in the global task queue in sequence. This technical solution can realize task scheduling processing for multiple scenarios, improve the availability of system resources, and avoid the situation where system resources lose response due to task queuing caused by a large number of tasks in individual scenarios.

[0054] Embodiment 2

[0055] Figure 2 This is a flowchart of a multi-scenario task scheduling method provided according to the second embodiment of the present invention. This embodiment is optimized based on the above embodiment. The specific optimization is: merging the task queues of each business scenario to obtain a global task queue, including: determining the second priority parameter corresponding to the task queue of each business scenario based on multiple business scenarios; and uniformly sorting the tasks contained in the task queues of each corresponding business scenario according to the second priority parameter to obtain a global task queue. Figure 2 As shown, the method includes:

[0056] S210: Obtain multiple pending task requests corresponding to multiple business scenarios.

[0057] The pending task request carries attribute information.

[0058] S220. Determine a first priority parameter of each pending task request based on the attribute information.

[0059] S230. Determine a task queue for each business scenario based on the first priority parameter of each task request to be processed.

[0060] S240. Determine a second priority parameter corresponding to a task queue of each business scenario based on multiple business scenarios.

[0061] Among them, the second priority parameter can be considered as the priority weight corresponding to each business scenario. In this embodiment, different priority weights can be pre-configured based on different business scenarios. For example, some business scenarios are task requests sent by front-end users, and high priority weights can be set; some business scenarios are task requests sent by back-end users, and low priority weights can be set. They can be pre-set according to actual conditions, and different business scenarios can also be configured with different priority weights according to the nature of the scenario.

[0062] For example, the priority weight of each scenario task queue q can be determined by the inverse of the average execution time of the historical tasks in this queue. It is understandable that business scenarios with short execution time are generally foreground query task requests, and their priority will be significantly higher than background task requests with long execution time. The weight design that is inversely proportional to the execution time ensures the fairness of time allocation as a whole.

[0063] In this embodiment, each task queue of a business scenario in a plurality of business scenarios may have a corresponding priority reference, and the second priority weight corresponding to the task queue of each scenario may be obtained based on the business scenario.

[0064] It should be noted that the first priority parameter and the second priority parameter in this embodiment may be calculated by a set priority algorithm, and the set priority algorithm may be set according to demand, which is not limited in this embodiment.

[0065] S250. Sort the tasks contained in the task queues of the corresponding business scenarios in a unified manner according to the second priority parameter to obtain a global task queue.

[0066] In this embodiment, different second priority weights may be assigned to the task queue q of each business scenario, and then the priorities of all tasks of each business scenario may be unified and sorted together according to the second priority weights, thereby generating a global queue Q.

[0067] In this embodiment, the second priority parameter and the first priority parameter may be weightedly summed to obtain a global priority parameter, and the tasks included in the task queues of various business scenarios may be uniformly sorted according to the global priority parameter to obtain a corresponding global task queue.

[0068] Furthermore, in order to ensure the timeliness of task scheduling in this embodiment, generally speaking, the newly submitted task request is calculated according to the priority algorithm in an incremental calculation manner, and is finally inserted into the appropriate position of the global queue Q according to the calculated priority value.

[0069] S260: Process the pending task requests in the global task queue in sequence.

[0070] In this embodiment, optionally, before obtaining multiple pending task requests corresponding to multiple business scenarios, it also includes: obtaining thread pools of multiple business scenarios in system resources; merging the thread pools of multiple business scenarios into a target thread pool; and determining the number of concurrent threads of the target thread pool based on the number of underlying service instances.

[0071] Among them, the thread pool is a server architecture based on multi-threaded processing, which pre-creates a group of threads and puts them in a waiting state. When a task arrives, these threads will be activated and process the task. In this embodiment, each of the multiple business scenarios in the system resources has its own corresponding thread pool. The target thread pool can be considered to be a thread pool that merges the thread pools corresponding to each of the multiple business scenarios into an overall thread pool. In this embodiment, the thread pool corresponding to each business scenario in the system data can be obtained, and then the thread pools for various scenarios are merged into an overall target thread pool, which can prevent each business from directly requesting the underlying service, causing queuing on the underlying service interface and unable to control the expected execution time. By merging thread pools, the total number of threads can be reduced, thereby reducing the overhead of thread switching and context switching, and improving the utilization of underlying resources.

[0072] Among them, the number of underlying service instances refers to the number of instances (i.e., servers, virtual machines, containers, etc.) that support the operation of specific services or applications at the bottom layer, which has a direct impact on the performance, reliability, and scalability of the system. The number of concurrent threads may refer to the number of threads running simultaneously in multi-threaded programming. In this embodiment, it may refer to the number of threads that can run simultaneously in the target thread pool, that is, the number of notifications that can execute corresponding task requests. In this embodiment, the number of threads that can be run simultaneously by the current system resources corresponding to the number of service instances of the underlying resources of the system, and the thread data is determined as the number of concurrent threads of the target thread pool.

[0073] Through such a setting in this embodiment, all resources of the system's underlying resources can be unified together to form a target thread pool, and each task request in the global queue can be processed according to the target thread pool. This can optimize the system performance to the greatest extent possible in a resource-constrained environment and ensure that the system will not lose response due to task queuing caused by a large number of tasks in individual scenarios.

[0074] In this embodiment, optionally, the pending task requests in the global task queue are processed sequentially, including: obtaining the corresponding number of pending task requests from the global task queue based on the number of concurrent threads, and processing the pending task requests sequentially.

[0075] In this embodiment, the corresponding number of pending task requests can be obtained from a global queue Q (thread-safe) according to the number of concurrent threads in the target thread pool, that is, through all active threads, and the pending task requests are executed in turn.

[0076] Through such a setting in this embodiment, the limited resources of the system are used to execute each task request in sequence according to the arrangement order of each task in the global queue, which not only improves the utilization rate of system resources but also effectively ensures the execution efficiency of tasks.

[0077] In this embodiment, optionally, it also includes: if the number of concurrent threads running meets the set conditions, determining whether the expected execution time of the current pending task request is greater than the set time; if the expected execution time is greater than the set time, returning the current pending task request.

[0078] Among them, the setting condition can be the condition set for the number of concurrent threads running, and the setting condition in this embodiment can be pre-set. The purpose of setting the condition in this embodiment is to ensure that the current number of concurrent threads still has the last running number left to ensure the response requirements of the tense task request. Therefore, the setting condition can be determined according to the specific value of the number of concurrent threads. Exemplarily, if the number of concurrent threads is 10, the setting condition can be that the number of running threads of the current concurrent threads satisfies 9 concurrent threads, that is, there is one free concurrent thread left to run. The expected execution time can be the time required for the execution estimated based on the task request. The setting time can refer to the acceptable delay time for the execution time required for the pending task request. The setting time in this embodiment can be pre-set. Exemplarily, the setting time can be set to 2 seconds, or it can be set according to actual needs.

[0079] In this embodiment, if the number of currently running concurrent threads reaches a preset condition, that is, the last executable concurrent thread is left, it will be determined whether the execution time of the current pending task request is greater than the set time. If the expected execution time of the current pending task request is greater than the set time, it can be considered whether the pending task request can be completed within this set time. If the expected execution time of the current pending task request is greater than the set time, that is, the current pending task request cannot be completed within the set time, the current pending task request will be returned and wait for a sufficient number of concurrent threads to process the current pending task request again.

[0080] Exemplarily, the global queue in this embodiment contains 1,000 pending task requests, and the number of active concurrent threads is 10 active threads. When these 10 active concurrent threads go to the corresponding number of tasks in the global queue in turn to process, if 9 active concurrent threads obtain the first 9 tasks in the sorted order from front to back, if the estimated execution time of the 10th task request is 10 seconds, it exceeds 2 seconds, that is, exceeds 2 seconds, the 10th task request is returned; when waiting for sufficient concurrent thread resources, the task request with an execution time of 10 seconds is obtained again for execution.

[0081] In this embodiment, such a setting is used to ensure that system resources can respond to urgent task requests in a timely manner even in the case of long-term task scenario queuing, thereby ensuring the timeliness of urgent task request processing.

[0082] Furthermore, in this embodiment, a WEB interface can be provided to display the current task queue in the memory, and the priority weight of the scene can be adjusted manually, and even the position of individual tasks in the queue. It can be understood that in this embodiment, there can be a configuration interface for the global task queue, and this configuration interface can display the visualization of all pending task requests contained in this global queue. If there are special reasons, adjustments can be made through manual intervention of the visualization interface;

[0083] The technical solution of this embodiment obtains the corresponding task request from the global queue for processing by prioritizing the task request through the scene queue and the global queue, and uniformly arranges the thread pool of the underlying resources. This ensures both timely processing of foreground requests and sufficient allocation of resources. In the case of a large number of back-end queuing tasks, the front-end user requests can also be reasonably allocated to the underlying resources to ensure that the response is not too slow.

[0084] The technical solution of the embodiment of the present invention is to obtain multiple pending task requests corresponding to multiple business scenarios; wherein the pending task requests carry attribute information; determine the first priority parameter of each pending task request based on the attribute information; determine the task queue of each business scenario based on the first priority parameter of each pending task request; determine the second priority parameter corresponding to the task queue of each business scenario based on multiple business scenarios; uniformly sort the tasks contained in the task queues of the corresponding business scenarios according to the second priority parameter to obtain a global task queue; and process the pending task requests in the global task queue in sequence. This technical solution can realize task scheduling processing for multiple scenarios, improve the availability of system resources, and avoid the situation where system resources lose response due to task queuing caused by a large number of tasks in individual scenarios.

[0085] Embodiment 3

[0086] Figure 3 Schematic diagram of a multi-scenario task scheduling device provided according to Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0087] The task acquisition module 310 is used to acquire multiple pending task requests corresponding to multiple business scenarios; wherein the pending task requests carry attribute information;

[0088] A weight determination module 320, configured to determine a first priority parameter of each pending task request based on the attribute information;

[0089] A scenario task queue determination module 330, configured to determine a task queue for each business scenario based on a first priority parameter of each pending task request;

[0090] A global task queue determination module 340 is used to merge the task queues of various business scenarios to obtain a global task queue;

[0091] The task processing module 350 is used to sequentially process the pending task requests in the global task queue.

[0092] Optionally, the attribute information includes at least the task type and the task time limit;

[0093] Accordingly, the weight determination module 320 is specifically configured to determine the first priority parameter of each pending task request according to the task type and the task deadline.

[0094] Optionally, the scenario task queue determination module 330 is specifically configured to:

[0095] For each business scenario, a plurality of task requests to be processed are sorted based on the first priority parameters of each task request to be processed, so as to obtain a task queue corresponding to each business scenario.

[0096] Optionally, the global task queue determination module 340 is specifically configured to:

[0097] Determine, based on multiple business scenarios, a second priority parameter corresponding to a task queue of each business scenario;

[0098] The tasks contained in the task queues of the corresponding business scenarios are uniformly sorted according to the second priority parameter to obtain a global task queue.

[0099] Optionally, the device further comprises:

[0100] A thread pool acquisition module, used to acquire thread pools of multiple business scenarios in system resources before acquiring multiple pending task requests corresponding to multiple business scenarios;

[0101] The thread pool merging module is used to merge the thread pools of multiple business scenarios into a target thread pool;

[0102] The concurrent thread number determination module is used to determine the number of concurrent threads of the target thread pool based on the number of underlying service instances.

[0103] Optionally, the task processing module 350 is specifically configured to obtain the corresponding number of pending task requests from the global task queue based on the number of concurrent threads, and process the pending task requests in sequence.

[0104] Optionally, the device further comprises:

[0105] The task duration judgment module is used to judge whether the expected execution duration of the current pending task request is greater than the set duration if the number of concurrent threads running meets the set conditions; if the expected execution duration is greater than the set duration, the current pending task request is returned.

[0106] A multi-scenario task scheduling device provided in an embodiment of the present invention can execute a multi-scenario task scheduling method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0107] Embodiment 4

[0108] Figure 41 is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0109] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0110] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0111] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a multi-scenario based task scheduling method.

[0112] In some embodiments, the multi-scenario based task scheduling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the multi-scenario based task scheduling method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the multi-scenario based task scheduling method by any other appropriate means (e.g., by means of firmware).

[0113] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0114] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0115] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0116] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0117] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0118] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0119] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0120] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A task scheduling method based on multiple scenarios, characterized in that: include: Acquire multiple pending task requests corresponding to multiple business scenarios; wherein the pending task requests carry attribute information; Determine a first priority parameter of each pending task request based on the attribute information; Determine the task queue for each business scenario based on the first priority parameter of each pending task request; The task queues of the various business scenarios are merged to obtain a global task queue; The pending task requests in the global task queue are processed sequentially.

2. The method according to claim 1, characterized in that The attribute information includes at least the task type and task time limit; Accordingly, determining the first priority parameter of each pending task request based on the attribute information includes: A first priority parameter of each to-be-processed task request is determined according to the task type and the task time limit.

3. The method according to claim 1, characterized in that The task queue for each business scenario is determined based on the first priority parameter of each pending task request, including: For each business scenario, a plurality of task requests to be processed are sorted based on the first priority parameters of each task request to be processed, so as to obtain a task queue corresponding to each business scenario.

4. The method according to claim 1, characterized in that: The task queues of the various business scenarios are merged to obtain a global task queue, including: Determine, based on the multiple business scenarios, a second priority parameter corresponding to the task queue of each business scenario; The tasks contained in the task queues of the corresponding business scenarios are uniformly sorted according to the second priority parameter to obtain a global task queue.

5. The method according to claim 1, characterized in that Before obtaining multiple pending task requests corresponding to multiple business scenarios, it also includes: Get thread pools for multiple business scenarios in system resources; Merging the thread pools of the multiple business scenarios into a target thread pool; The number of concurrent threads of the target thread pool is determined based on the number of underlying service instances.

6. The method according to claim 5, characterized in that Processing the pending task requests in the global task queue in sequence includes: Based on the number of concurrent threads, the corresponding number of pending task requests is obtained from the global task queue, and the pending task requests are processed in sequence.

7. The method according to claim 6, characterized in that Also includes: If the number of concurrent threads running meets the set condition, then determine whether the expected execution time of the current pending task request is greater than the set time; If the expected execution time is longer than the set time, the current pending task request is returned.

8. A task scheduling device based on multiple scenarios, characterized in that: include: A task acquisition module, used to acquire multiple pending task requests corresponding to multiple business scenarios; wherein the pending task requests carry attribute information; A weight determination module, used to determine a first priority parameter of each pending task request based on the attribute information; A scenario task queue determination module, used to determine the task queue of each business scenario based on the first priority parameter of each pending task request; A global task queue determination module is used to merge the task queues of each business scenario to obtain a global task queue; The task processing module is used to process the pending task requests in the global task queue in sequence.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-scenario based task scheduling method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-scenario based task scheduling method according to any one of claims 1 to 7 when executed.

Citation Information

Cited By

  • Fusion terminal communication resource allocation method and system based on multi-application collaboration

    CN120603072A