Resource scheduling method and device
By calculating the estimated time and variance of each scanning service domain, priority is given to the scanning service domain scheduling resources that are the most time-consuming, solving the problem that scanning resources cannot be automatically allocated in the existing technology, and achieving efficient resource utilization and task time-consuming optimization.
Patent Information
- Application Number
- CN202111502769.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The prior art cannot automatically allocate scanning resources for each scanning domain, resulting in unreasonable resource utilization and increasing task time.
By calculating the average time when the scan tasks are currently completed within each scan service domain, the total time required for each scan service domain to perform the target task flow is estimated, and the variance of the estimated total time is calculated. If the variance is greater than or equal to the set threshold, priority is given to the scanning service domain scheduling resources that are expected to consume the most time.
The overall task execution time is optimized, resource mismatch and waste problems are solved, resource utilization is improved, task execution time is shortened, and cost is saved.
Smart Images

Figure CN114168337B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of resource management, and in particular to a resource scheduling method and device. Background Art
[0002] On the basis of realizing the centralization and automation of multiple testing tools, the entire task flow is optimized by reasonably scheduling limited resources. The task flow contains a large number of services / devices to be scanned (for convenience, the services / devices to be scanned are collectively referred to as scanning tasks below). To complete the scanning tasks, the management end needs to allocate server resources in real time according to the current scanning progress and queuing status, so as to maximize resource utilization, reduce waste and minimize task time. This work is highly repetitive and complex, and requires a lot of calculations. If it is implemented manually, the investment is large, the efficiency is low, and there are many influencing factors. Once the scheduling is improper, a large number of servers in some scanning service domains will be idle, while other scanning service domains will have serious queues, which greatly increases the overall task time. Summary of the invention
[0003] The present application provides a resource scheduling method and device to solve the problem in the prior art that scanning resources cannot be automatically allocated for each scanning domain.
[0004] In a first aspect, the present application provides a resource scheduling method, the method comprising:
[0005] Calculating the average scanning time taken by the currently completed scanning tasks in each scanning service domain, wherein the currently processed target task flow includes multiple scanning tasks, and the multiple scanning tasks included in the target task flow pass through the respective scanning service domains in sequence to complete the scanning processing of the target task flow;
[0006] Calculate the estimated total time required for each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow;
[0007] Calculating the variance of the estimated total time consumption of each scanning service domain, and if it is determined that the variance is greater than or equal to a set threshold, calculating the estimated time consumption required for the first scanning service domain with the largest estimated total time consumption and the second scanning service domain with the smallest estimated total time consumption to complete the unscanned tasks in the target task flow;
[0008] If a first estimated time consumption corresponding to the first scanning service domain is greater than a second estimated time consumption corresponding to the second scanning service domain, resources are preferentially scheduled and allocated to the first scanning service domain.
[0009] Optionally, the step of calculating the average scanning time taken by the currently completed scanning tasks in each scanning service domain includes:
[0010] The following formula is used to calculate the average scanning time of the currently completed scanning tasks in each scanning service domain:
[0011]
[0012] Among them, T ai represents the average scanning time of the currently completed scanning task in the i-th scanning service domain, T j represents the time taken by the jth completed scanning task in the target task flow during the execution of this task, N 已i Indicates the number of completed tasks in the iScan service domain in the overall task.
[0013] Optionally, based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain and the number of unscanned tasks in the target task flow, the step of calculating the estimated total time consumed by each scanning service domain to complete executing the target task flow includes:
[0014] The estimated total time required for each scanning service domain to complete the target task flow is calculated using the following formula:
[0015]
[0016] Among them, T Ni represents the estimated total time required to complete the execution of the target task flow in the i-th scanning service domain, T 已 represents the time used from the initiation of the target task flow to the present moment, N 未i represents the number of unscanned tasks in the i-th scanning service domain of the target task flow, T ai N represents the average scanning time of the target task flow in the i-th scanning service domain that has completed the scanning task. i Indicates the number of scanning nodes that perform scanning tasks in the i-th scanning service domain.
[0017] Optionally, the step of calculating the variance of the estimated total time consumption of each scanning service domain includes:
[0018] The variance of the estimated total time consumption of each scanning service domain is calculated using the following formula:
[0019]
[0020] Where n represents the total number of scanned service domains, and u represents the average estimated total time consumption of each scanned service domain.
[0021] Optionally, the step of calculating the estimated time taken for a scanning service domain to complete executing the unscanned tasks in the target task flow includes:
[0022] The estimated time required for a scanning service domain to complete the unscanned tasks in the target task flow is calculated using the following formula:
[0023]
[0024] Among them, T Qi N represents the estimated time required for the i-th scanning service domain to complete the unscanned tasks in the target task flow. Qi Indicates the number of queued tasks in the queue of the i-th service domain.
[0025] Optionally, the step of preferentially scheduling and allocating resources for the first scanning service domain includes:
[0026] Prioritizing the allocation of idle resources from an idle resource pool to the first scanning service domain;
[0027] If there are no idle resources in the idle resource pool, part of the resources in the second scanning service domain are scheduled and allocated to the first scanning service domain.
[0028] In a second aspect, the present application provides a resource scheduling device, the device comprising:
[0029] A first calculation unit is used to calculate the average scanning time spent by the currently completed scanning tasks in each scanning service domain, wherein the currently processed target task flow includes multiple scanning tasks, and the multiple scanning tasks included in the target task flow pass through the respective scanning service domains in sequence to complete the scanning processing of the target task flow;
[0030] A second calculation unit is used to calculate the estimated total time required for each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow;
[0031] A third calculation unit is used to calculate the variance of the estimated total time consumption of each scanning service domain, and if it is determined that the variance is greater than or equal to a set threshold, calculate the estimated time consumption required for the first scanning service domain with the largest estimated total time consumption and the second scanning service domain with the smallest estimated total time consumption to complete the unscanned tasks in the target task flow;
[0032] The scheduling unit is configured to preferentially schedule and allocate resources to the first scanning service domain if a first estimated time consumption corresponding to the first scanning service domain is greater than a second estimated time consumption corresponding to the second scanning service domain.
[0033] Optionally, when calculating the average scanning time taken by the currently completed scanning tasks in each scanning service domain, the first calculating unit is specifically configured to:
[0034] The following formula is used to calculate the average scanning time of the currently completed scanning tasks in each scanning service domain:
[0035]
[0036] Among them, T ai represents the average scanning time of the currently completed scanning task in the i-th scanning service domain, T j represents the time taken by the jth completed scanning task in the target task flow during the execution of this task, N 已i Indicates the number of completed tasks in the iScan service domain in the overall task.
[0037] Optionally, when calculating the estimated total time consumed by each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow, the second calculating unit is specifically used to:
[0038] The estimated total time required for each scanning service domain to complete the target task flow is calculated using the following formula:
[0039]
[0040] Among them, T Ni represents the estimated total time required to complete the execution of the target task flow in the i-th scanning service domain, T 已 represents the time used from the initiation of the target task flow to the present moment, N 未i represents the number of unscanned tasks in the i-th scanning service domain of the target task flow, T ai N represents the average scanning time of the target task flow in the i-th scanning service domain that has completed the scanning task. i Indicates the number of scanning nodes that perform scanning tasks in the i-th scanning service domain.
[0041] Optionally, when calculating the variance of the estimated total time consumption of each scanning service domain, the third calculation unit is specifically configured to:
[0042] The variance of the estimated total time consumption of each scanning service domain is calculated using the following formula:
[0043]
[0044] Where n represents the total number of scanned service domains, and u represents the average estimated total time consumption of each scanned service domain.
[0045] Optionally, when calculating the estimated time taken for a scanning service domain to complete executing the unscanned tasks in the target task flow, the third calculation unit is specifically configured to:
[0046] The estimated time required for a scanning service domain to complete the unscanned tasks in the target task flow is calculated using the following formula:
[0047]
[0048] Among them, T Qi N represents the estimated time required for the i-th scanning service domain to complete the unscanned tasks in the target task flow. Qi Indicates the number of queued tasks in the queue of the i-th service domain.
[0049] Optionally, when scheduling and allocating resources for the first scanning service domain first, the scheduling unit is specifically configured to:
[0050] Prioritizing the allocation of idle resources from an idle resource pool to the first scanning service domain;
[0051] If there are no idle resources in the idle resource pool, part of the resources in the second scanning service domain are scheduled and allocated to the first scanning service domain.
[0052] In a third aspect, the present application provides a resource scheduling device, the device comprising:
[0053] A memory for storing program instructions;
[0054] The processor is used to call the program instructions stored in the memory, and execute the steps of the method as described in any one of the first aspects above according to the obtained program instructions.
[0055] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method described in any one of the first aspects above.
[0056] In summary, the resource scheduling method provided in the embodiment of the present application calculates the average scanning time spent by the currently completed scanned tasks in each scanning service domain, wherein the target task flow currently being processed includes multiple scanning tasks, and the multiple scanning tasks included in the target task flow pass through the scanning service domains in sequence to complete the scanning processing of the target task flow; based on the time consumed in processing the target task flow, the average scanning time corresponding to each scanning service domain and the number of unscanned tasks in the target task flow, calculates the estimated total time required for each scanning service domain to execute the target task flow; calculates the variance of the estimated total time of each scanning service domain, and if it is determined that the variance is greater than or equal to a set threshold, calculates the estimated time required for the first scanning service domain with the largest estimated total time and the second scanning service domain with the smallest estimated total time to execute the unscanned tasks in the target task flow; if the first estimated time corresponding to the first scanning service domain is greater than the second estimated time corresponding to the second scanning service domain, then the first scanning service domain is prioritized for scheduling and allocating resources.
[0057] By adopting the resource scheduling method provided in the embodiment of the present application and designing a dynamic resource scheduling algorithm between scanning service domains of serial tasks, the overall task execution time is optimized, and the problems of unreasonable resource utilization and low overall task execution efficiency caused by resource mismatch and waste during task execution are solved, thereby improving resource utilization, shortening task execution time, freeing up a large amount of manpower, saving costs and achieving efficiency improvement. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments of the present application or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present application.
[0059] Figure 1 A detailed flow chart of a resource scheduling method provided in an embodiment of the present application;
[0060] Figure 2 A structural diagram of a task scanning system provided for implementation of this application;
[0061] Figure 3 A schematic diagram of the structure of a resource scheduling device provided in an embodiment of the present application;
[0062] Figure 4 A schematic diagram of the structure of another resource scheduling device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than limiting the present application. The singular forms of "a", "said" and "the" used in the present application and claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.
[0064] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "at..." or "when..." or "in response to determination".
[0065] For example, see Figure 1 , which is a detailed flow chart of a resource scheduling method provided in an embodiment of the present application, the method comprises the following steps:
[0066] Step 100: Calculate the average scanning time taken by the currently completed scanning tasks in each scanning service domain.
[0067] The target task flow currently being processed includes multiple scanning tasks, and the multiple scanning tasks included in the target task flow pass through the scanning service domains in sequence to complete the scanning processing of the target task flow.
[0068] In actual applications, one task flow may include multiple scanning tasks. The multiple scanning tasks included in one task flow pass through multiple scanning service domains at one time to complete the scanning process of the task flow.
[0069] For example, see Figure 2 As shown, it is a structural diagram of a task scanning system provided by an embodiment of the present application; the task scanning system includes multiple scanning service domains (such as A service domain, B service domain, ..., G service domain), and the structure of each scanning service domain includes: a task queue (such as A queue in A service domain), an internal scheduling terminal (such as A internal scheduling terminal in A service domain), and a scanning server (such as server A1, server A2, ... server An in A service domain for executing scanning tasks), and the structure in each scanning service domain is consistent with the structure of A service domain, which will not be repeated here. The scanning servers of each scanning service domain can be uniformly managed through resource scheduling, that is, in the initialization stage, each server belongs to an idle resource pool, and according to the resource requirements of each scanning service domain, a scanning server is scheduled and allocated for the scanning service domain from the idle resource pool.
[0070] Then, in the embodiment of the present application, the task flow currently executed by the task scanning system is taken as an example for explanation.
[0071] In actual applications, in order to reasonably and effectively schedule server resources, it is necessary to obtain the scanning progress and queue status of each scanning service domain in real time, and use this as a basis for scheduling server resources. In the initial state, each scanning service domain is equipped with a part of server resources. After the task distribution end starts to distribute the task flow, each scanning service domain needs to obtain server resources under the overall scheduling of the scheduling end according to its own needs. The overall scheduling algorithm of the scheduling end is as follows:
[0072] Calculates the average scanning time of the currently completed scanning tasks in each scanning service domain.
[0073] The currently executed task flow is the target task flow, then the average scanning time taken by the currently completed scanned tasks of the target task flow in each scanning service domain is calculated.
[0074] Preferably, the following formula can be used to calculate the average scanning time taken by the currently completed scanning tasks in each scanning service domain:
[0075]
[0076] Among them, T ai represents the average scanning time of the currently completed scanning task in the i-th scanning service domain, T j represents the time taken by the jth completed scanning task in the target task flow during the execution of this task, N 已i Indicates the number of completed tasks in the iScan service domain in the overall task.
[0077] Step 110: Calculate the estimated total time required for each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow;
[0078] In the embodiment of the present application, when calculating the estimated total time consumed by each scanning service domain to complete the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow, a preferred implementation method is to use the following formula to calculate the estimated total time consumed by each scanning service domain to complete the target task flow:
[0079]
[0080] Among them, T Nirepresents the estimated total time required to complete the execution of the target task flow in the i-th scanning service domain, T 已 represents the time used from the initiation of the target task flow to the present moment, N 未i represents the number of unscanned tasks in the i-th scanning service domain of the target task flow, T ai N represents the average scanning time of the target task flow in the i-th scanning service domain that has completed the scanning task. i Indicates the number of scanning nodes that perform scanning tasks in the i-th scanning service domain.
[0081] Step 120: Calculate the variance of the estimated total time consumption of each scanning service domain. If it is determined that the variance is greater than or equal to the set threshold, calculate the estimated time consumption required for the first scanning service domain with the largest estimated total time consumption and the second scanning service domain with the smallest estimated total time consumption to complete the unscanned tasks in the target task flow.
[0082] Specifically, in the embodiment of the present application, when calculating the variance of the estimated total time consumption of each scanning service domain, a preferred implementation method is to use the following formula to calculate the variance of the estimated total time consumption of each scanning service domain:
[0083]
[0084] Where n represents the total number of scanned service domains, and u represents the average estimated total time consumption of each scanned service domain.
[0085] Next, determine whether the calculated variance is greater than or equal to a set threshold (for example, the set threshold is 2). If the variance is determined to be greater than or equal to the set threshold, determine the first scanning service domain with the largest estimated total time consumption and the second scanning service domain with the smallest estimated total time consumption based on the estimated total time consumption of each service domain calculated above. Further, calculate the first estimated time consumption required for the first scanning service domain to complete the unscanned tasks in the target task flow, and calculate the second estimated time consumption required for the second scanning service domain to complete the unscanned tasks in the target task flow.
[0086] In an embodiment of the present application, when calculating the estimated time taken by a scanning service domain to complete the unscanned tasks in the target task flow, a preferred implementation method is to use the following formula to calculate the estimated time taken by a scanning service domain to complete the unscanned tasks in the target task flow:
[0087]
[0088] Among them, T Qi N represents the estimated time required for the i-th scanning service domain to complete the unscanned tasks in the target task flow. Qi Indicates the number of queued tasks in the queue of the i-th service domain.
[0089] Step 130: If the first estimated time consumption corresponding to the first scanning service domain is greater than the second estimated time consumption corresponding to the second scanning service domain, resources are preferentially scheduled and allocated to the first scanning service domain.
[0090] In an embodiment of the present application, after calculating the first estimated time corresponding to the first scanning service domain and the second estimated time corresponding to the second scanning service domain, it is determined whether the first estimated time is greater than or equal to the second estimated time. If it is determined that the first estimated time is greater than or equal to the second estimated time, it means that the server resources of the first scanning service domain are tight, and a certain amount of resources need to be increased or decreased for the scheduling of the first scanning service domain.
[0091] In the embodiment of the present application, when scheduling and allocating resources to the first scanning service domain in priority, a preferred implementation method is to schedule and allocate idle resources to the first scanning service domain in priority from an idle resource pool.
[0092] Furthermore, if there are no idle resources in the idle resource pool, part of the resources in the second scanning service domain are scheduled and allocated to the first scanning service domain.
[0093] Based on the same inventive concept as the above method embodiment, for example, refer to Figure 3 FIG. 1 is a schematic diagram of a resource scheduling device provided in an embodiment of the present application, the device comprising:
[0094] The first calculation unit 30 is used to calculate the average scanning time spent by the currently completed scanning tasks in each scanning service domain, wherein the currently processed target task flow includes multiple scanning tasks, and the multiple scanning tasks included in the target task flow pass through the respective scanning service domains in sequence to complete the scanning processing of the target task flow;
[0095] A second calculation unit 31 is used to calculate the estimated total time required for each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow;
[0096] The third calculation unit 32 is used to calculate the variance of the estimated total time consumption of each scanning service domain, and if it is determined that the variance is greater than or equal to a set threshold, calculate the estimated time consumption required for the first scanning service domain with the largest estimated total time consumption and the second scanning service domain with the smallest estimated total time consumption to complete the unscanned tasks in the target task flow;
[0097] The scheduling unit 33 is configured to preferentially schedule and allocate resources to the first scanning service domain if the first estimated time consumption corresponding to the first scanning service domain is greater than the second estimated time consumption corresponding to the second scanning service domain.
[0098] Optionally, when calculating the average scanning time taken by the currently completed scanning tasks in each scanning service domain, the first calculating unit 30 is specifically used to:
[0099] The following formula is used to calculate the average scanning time of the currently completed scanning tasks in each scanning service domain:
[0100]
[0101] Among them, T ai represents the average scanning time of the currently completed scanning task in the i-th scanning service domain, T j represents the time taken by the jth completed scanning task in the target task flow during the execution of this task, N 已i Indicates the number of completed tasks in the iScan service domain in the overall task.
[0102] Optionally, when calculating the estimated total time consumed by each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow, the second calculating unit 31 is specifically used to:
[0103] The estimated total time required for each scanning service domain to complete the target task flow is calculated using the following formula:
[0104]
[0105] Among them, T Ni represents the estimated total time required to complete the execution of the target task flow in the i-th scanning service domain, T 已 represents the time used from the initiation of the target task flow to the present moment, N 未i represents the number of unscanned tasks in the i-th scanning service domain of the target task flow, T ai N represents the average scanning time of the target task flow in the i-th scanning service domain that has completed the scanning task. i Indicates the number of scanning nodes that perform scanning tasks in the i-th scanning service domain.
[0106] Optionally, when calculating the variance of the estimated total time consumption of each scanning service domain, the third calculating unit 32 is specifically configured to:
[0107] The variance of the estimated total time consumption of each scanning service domain is calculated using the following formula:
[0108]
[0109] Where n represents the total number of scanned service domains, and u represents the average estimated total time consumption of each scanned service domain.
[0110] Optionally, when calculating the estimated time taken by a scanning service domain to complete the unscanned tasks in the target task flow, the third calculating unit 32 is specifically configured to:
[0111] The estimated time required for a scanning service domain to complete the unscanned tasks in the target task flow is calculated using the following formula:
[0112]
[0113] Among them, T Qi N represents the estimated time required for the i-th scanning service domain to complete the unscanned tasks in the target task flow. Qi Indicates the number of queued tasks in the queue of the i-th service domain.
[0114] Optionally, when scheduling and allocating resources for the first scanning service domain first, the scheduling unit 33 is specifically configured to:
[0115] Prioritizing the allocation of idle resources from an idle resource pool to the first scanning service domain;
[0116] If there are no idle resources in the idle resource pool, part of the resources in the second scanning service domain are scheduled and allocated to the first scanning service domain.
[0117] The above units may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a certain unit above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0118] Furthermore, the resource scheduling device provided in the embodiment of the present application, from the hardware level, the hardware architecture diagram of the resource scheduling device can be seen in Figure 4 As shown, the resource scheduling device may include: a memory 40 and a processor 41,
[0119] The memory 40 is used to store program instructions; the processor 41 calls the program instructions stored in the memory 40 and executes the above method embodiment according to the obtained program instructions. The specific implementation method and technical effect are similar and will not be repeated here.
[0120] Optionally, the present application also provides a resource scheduling device, comprising at least one processing element (or chip) for executing the above method embodiment.
[0121] Optionally, the present application also provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the above method embodiments.
[0122] Here, the machine-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium may be: RAM (RadomAccess Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.
[0123] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0124] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0125] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0126] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0127] Moreover, these computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0129] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A resource scheduling method, characterized in that: The method comprises: Calculating the average scanning time taken by the currently completed scanning tasks in each scanning service domain, wherein the currently processed target task flow includes multiple scanning tasks, and the multiple scanning tasks included in the target task flow pass through the respective scanning service domains in sequence to complete the scanning processing of the target task flow; Calculate the estimated total time required for each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow; Calculating the variance of the estimated total time consumption of each scanning service domain, and if it is determined that the variance is greater than or equal to a set threshold, calculating the estimated time consumption required for the first scanning service domain with the largest estimated total time consumption and the second scanning service domain with the smallest estimated total time consumption to complete the unscanned tasks in the target task flow; If a first estimated time consumption corresponding to the first scanning service domain is greater than a second estimated time consumption corresponding to the second scanning service domain, scheduling and allocating resources for the first scanning service domain first; The step of calculating the average scanning time taken by the currently completed scanning tasks in each scanning service domain includes: using the following formula to calculate the average scanning time taken by the currently completed scanning tasks in each scanning service domain: Among them, T ai represents the average scanning time of the currently completed scanning task in the i-th scanning service domain, T j represents the time taken by the jth completed scanning task in the target task flow during the execution of this task, N 已i Indicates the number of completed tasks in the i-scan service domain in the overall task; The step of calculating the estimated total time consumed by each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow includes: calculating the estimated total time consumed by each scanning service domain to complete the execution of the target task flow using the following formula: Among them, T Ni represents the estimated total time required to complete the execution of the target task flow in the i-th scanning service domain, T 已 represents the time used from the initiation of the target task flow to the present moment, N 未i represents the number of unscanned tasks in the i-th scanning service domain of the target task flow, T ai N represents the average scanning time of the target task flow in the i-th scanning service domain that has completed the scanning task. i represents the number of scanning nodes that perform scanning tasks in the i-th scanning service domain; The step of calculating the variance of the estimated total time consumption of each scanning service domain includes: calculating the variance of the estimated total time consumption of each scanning service domain by using the following formula: Where n represents the total number of scanned service domains, and u represents the average estimated total time consumption of each scanned service domain; The step of calculating the estimated time taken by a scanning service domain to complete the unscanned tasks in the target task flow includes: calculating the estimated time taken by a scanning service domain to complete the unscanned tasks in the target task flow using the following formula: Among them, T Qi N represents the estimated time required for the i-th scanning service domain to complete the unscanned tasks in the target task flow. Qi Indicates the number of queued tasks in the queue of the i-th service domain.
2. The method according to claim 1, characterized in that The step of preferentially scheduling and allocating resources for the first scanning service domain includes: Preferentially scheduling and allocating idle resources from an idle resource pool for the first scanning service domain; If there are no idle resources in the idle resource pool, part of the resources in the second scanning service domain are scheduled and allocated to the first scanning service domain.
3. A resource scheduling device, characterized in that: The device comprises: A first calculation unit is used to calculate the average scanning time spent by the currently completed scanning tasks in each scanning service domain, wherein the currently processed target task flow includes multiple scanning tasks, and the multiple scanning tasks included in the target task flow pass through the respective scanning service domains in sequence to complete the scanning processing of the target task flow; A second calculation unit is used to calculate the estimated total time required for each scanning service domain to complete the execution of the target task flow based on the time consumed for processing the target task flow, the average scanning time corresponding to each scanning service domain, and the number of unscanned tasks in the target task flow; A third calculation unit is used to calculate the variance of the estimated total time consumption of each scanning service domain, and if it is determined that the variance is greater than or equal to a set threshold, calculate the estimated time consumption required for the first scanning service domain with the largest estimated total time consumption and the second scanning service domain with the smallest estimated total time consumption to complete the unscanned tasks in the target task flow; a scheduling unit, wherein if a first estimated time consumption corresponding to the first scanning service domain is greater than a second estimated time consumption corresponding to the second scanning service domain, the scheduling unit preferentially schedules and allocates resources to the first scanning service domain; When calculating the average scanning time taken by the currently completed scanning tasks in each scanning service domain, the first calculation unit is specifically used to: calculate the average scanning time taken by the currently completed scanning tasks in each scanning service domain using the following formula: Among them, T ai represents the average scanning time of the currently completed scanning task in the i-th scanning service domain, T j represents the time taken by the jth completed scanning task in the target task flow during the execution of this task, N 已i Indicates the number of completed tasks in the i-scan service domain in the overall task; Based on the time consumed in processing the target task flow, the average scanning time corresponding to each scanning service domain and the number of unscanned tasks in the target task flow, the estimated total time consumed by each scanning service domain to complete the execution of the target task flow is calculated, and the second calculation unit is specifically used to calculate the estimated total time consumed by each scanning service domain to complete the execution of the target task flow using the following formula: Among them, T Ni represents the estimated total time required to complete the execution of the target task flow in the i-th scanning service domain, T 已 represents the time used from the initiation of the target task flow to the present moment, N 未i represents the number of unscanned tasks in the i-th scanning service domain of the target task flow, T ai N represents the average scanning time of the target task flow in the i-th scanning service domain that has completed the scanning task. i represents the number of scanning nodes that perform scanning tasks in the i-th scanning service domain; When calculating the variance of the estimated total time consumption of each scanning service domain, the third calculation unit is specifically used to: calculate the variance of the estimated total time consumption of each scanning service domain by using the following formula: Where n represents the total number of scanned service domains, and u represents the average estimated total time consumption of each scanned service domain; Calculate the estimated time taken by a scanning service domain to complete the unscanned tasks in the target task flow, wherein the third calculation unit is further used to calculate the estimated time taken by a scanning service domain to complete the unscanned tasks in the target task flow using the following formula: Among them, T Qi N represents the estimated time required for the i-th scanning service domain to complete the unscanned tasks in the target task flow. Qi Indicates the number of queued tasks in the queue of the i-th service domain.
Citation Information
Patent Citations
Computation task adjusting method and device
CN107357642A
Simulation execution method and system based on dynamic load migration and time synchronization
CN111651866A