Task Scheduling System Based on License Management
By obtaining license usage information in real time in the task scheduling system and performing dual sorting, determining target tasks and allocating licenses, the problems of task congestion and low license utilization in the task scheduling system are solved, and more efficient task processing and resource utilization are achieved.
Patent Information
- Application Number
- CN202311570062.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-22
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-11-22
AI Technical Summary
In the existing technology, the task scheduling system based on license management can easily cause task congestion during task execution, and the license utilization rate is low, which cannot effectively solve the problem of license idleness and waste.
A task scheduling system based on License management is designed, including a License management module, a task scheduling module, a mapping module and multiple License servers. By obtaining License usage information in real time, dual sorting is performed according to task priority and License usage to determine the target. Tasks and allocate licenses to avoid task congestion and improve license utilization.
It effectively avoids task congestion, improves license utilization, reduces license idle waste, and improves task processing efficiency.
Smart Images

Figure CN117555663B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a task scheduling system based on License management. Background Art
[0002] When performing tasks such as hardware testing or simulation based on electronic design automation (EDA) software, it is necessary to obtain the license corresponding to the task before the task can be executed. In the prior art, the corresponding license is usually obtained directly from multiple license servers based on the submitted tasks. In many cases, a large number of license servers need to be traversed to find the corresponding license, which takes a lot of time. And when the task volume is large, it is very easy to cause task congestion. When the task cannot obtain the corresponding license for a long time, it will cause the task to exit and need to resubmit the task, which reduces the task processing efficiency. In addition, if the license is allocated according to the submitted task, some licenses will not be used by the submitted tasks temporarily, but the license cost is very high, and long-term idleness will cause huge waste. In the prior art, a load balancing module is added in front of the license server, but it can only alleviate the congestion problem and cannot solve the problem of partial license idleness. It can be seen from this that how to more reasonably schedule tasks, avoid task congestion, and improve the utilization rate of licenses has become a technical problem to be solved urgently. Summary of the invention
[0003] The object of the present invention is to provide a task scheduling system based on license management, which can avoid task congestion and improve the utilization rate of license.
[0004] According to a first aspect of the present invention, a task scheduling system based on license management is provided, comprising a license management module, a task scheduling module, a mapping module, M license servers, and a processing module, wherein the license management module is connected to the task scheduling module and the M license servers, the task scheduling module is connected to the mapping module and the processing module, the M license servers are connected to the processing module, and M>2;
[0005] The license management module is used to obtain the license usage information of M license servers in real time;
[0006] The processing module is used to send a task identifier to the task scheduling module, wherein the task identifier includes a first-category task identifier and a second-category task identifier, and the first-category task identifier has a higher priority than the second-category task identifier;
[0007] The mapping module stores a mapping relationship between the task identifier, the license identifier, and the license server identifier;
[0008] The task scheduling module is used to perform a first sort on the received task identifiers to generate a task queue;
[0009] and obtaining a mapping relationship between a task identifier and a license identifier from the mapping module and obtaining license information of the current M license servers from the license management module;
[0010] and determining the License identifier corresponding to each received task identifier based on the mapping relationship between the task identifier and the License identifier, and performing a second sort on the current task queue based on the License information of the current M License servers, determining the first X tasks in the task queue after the second sort as target tasks, and deleting the target task identifier from the current task queue, where X is the number of currently executable tasks determined when the current task queue is subjected to the second sort;
[0011] and sending the License server identifier corresponding to each target task to the corresponding target task;
[0012] The processing module is used to obtain a license from a corresponding license server based on a license server identifier corresponding to the target task, and execute the target task.
[0013] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solution, the task scheduling system based on license management provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following beneficial effects:
[0014] The embodiment of the present invention obtains the license usage information of the license server in real time by setting a license management module, sorts the tasks according to the task priority through the task scheduling system, and performs secondary sorting on the tasks according to the license usage information of the license server, determines the target tasks that can be executed currently, and allocates licenses to the target tasks, which can avoid task congestion and improve the utilization rate of the license. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] 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.
[0016] Figure 1 A schematic diagram of a task scheduling system based on License management provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0018] The embodiment of the present invention provides a task scheduling system based on License management, such as Figure 1 As shown, it includes a License management module, a task scheduling module, a mapping module, M License servers, and a processing module, wherein the License management module is connected to the task scheduling module and the M License servers, the task scheduling module is connected to the mapping module and the processing module, the M License servers are connected to the processing module, and M>2.
[0019] A unified access interface is provided on each license server, which is connected to the license management module through the access interface. The license management module is used to obtain the license usage information of M license servers in real time through the access interface; the license usage information includes the license identifier and the current remaining number of licenses f(P) corresponding to the license identifier.
[0020] The processing module is used to send a task identifier to the task scheduling module, and the task identifier is a hardware simulation task identifier or a hardware test task identifier, etc. The task identifier includes a first-class task identifier and a second-class task identifier, and the first-class task identifier has a higher priority than the second-class task identifier. For example, the first-class task identifier is a task that is manually submitted by a user and needs to be processed immediately, and the second-class task identifier is a task that is actively submitted by a machine and does not need to be processed immediately.
[0021] The mapping module stores the mapping relationship between the task identifier, the license identifier and the license server identifier. It should be noted that at least one license is required for the execution of a task, and the mapping relationship between each task identifier, the license identifier and the license server identifier is pre-stored in the mapping module.
[0022] The task scheduling module is used to perform a first sorting on the received task identifiers to generate a task queue. It should be noted that the first sorting is mainly based on the priority factors of the tasks themselves to ensure that under the same license resources, tasks with higher priority factors are executed first.
[0023] The task scheduling module is used to obtain the mapping relationship between the task identifier and the license identifier from the mapping module and to obtain the license information of the current M license servers from the license management module.
[0024] The task scheduling module is used to determine the license identifier corresponding to each received task identifier based on the mapping relationship between the task identifier and the license identifier, and to perform a second sort on the current task queue based on the license information of the current M license servers, and to determine the first X tasks in the task queue after the second sort as target tasks, and to delete the target task identifier from the current task queue, where X is the number of currently executable tasks determined when the current task queue is second sorted. It should be noted that the second sort is based on the first sort, and is then sorted again based on the degree of matching between the tasks and the currently remaining available licenses.
[0025] The task scheduling module is used to send the License server identifier corresponding to each target task to the corresponding target task.
[0026] The processing module is used to obtain a license from a corresponding license server based on the license server identifier corresponding to the target task and execute the target task. It should be noted that the task scheduling module only needs to feed back the license server identifier corresponding to the target task to the processing module. The processing module does not need to search for the license server identifier corresponding to the target task on multiple license servers. When the processing module executes the target task, it will automatically obtain the corresponding license from the license server.
[0027] As an embodiment, at least one license usage information is maintained in each license server. The license usage information includes a license identifier and the current remaining number of licenses f(P) corresponding to the license identifier. The licenses maintained by each license server have the same source. Each license identifier is unique. It should be noted that each license corresponds to a functional feature. There may be licenses with the same functional feature in different license servers, but the license sources are not the same. Therefore, different license identifiers are set to ensure the uniqueness of each license identifier. The f(P) corresponding to the license identifier is initially the total number of licenses corresponding to the license identifier, and the total number of licenses is greater than or equal to 1. When a license is assigned to a task, the license server updates the corresponding f(P) to f(P)=f(P)-1. When a task releases a license, the license server updates the corresponding f(P) to f(P)=f(P)+1.
[0028] As an embodiment, the task scheduling module is used to perform a first sort on the received task identifiers to generate a task queue, including:
[0029] The task scheduling module sets the first weight, the second weight and the third weight for the received task identifier; if the received task identifier is a first-class task identifier, the first weight is set to A, if the received task identifier is a second-class task identifier, the first weight is set to B, and the value of A is much greater than the value of B. It should be noted that the value of A is much greater than the value of B, which will make the first-class task identifier be ranked before the second-class task identifier in the absence of special circumstances. The second weight is proportional to the time of task sending, that is, the earlier the task is sent, the greater the second weight. The third weight is inversely proportional to the length of time required for task execution, that is, the shorter the time required to execute the task, the greater the third weight. A comprehensive weight is generated based on the first weight, the second weight and the third weight of the received task identifier, and a first sorting is performed based on the comprehensive weight to generate a task queue. The comprehensive weight can be calculated in the form of accumulation or multiplication of the first weight, the second weight and the third weight.
[0030] It should be noted that, under normal circumstances, the first category of task identifiers are arranged in front of the second category of task identifiers, but for some special cases, for example, the second category of task identifiers are not executed until the processing deadline, in order to avoid the task being forced to exit, the task can also be moved to the front of the queue so that the task is processed first. As an embodiment, the task scheduling module is also used to set the first weight value of the second category of task identifiers whose time away from the task processing deadline is less than the preset processing time threshold to C, C ≥ A when performing the first sorting. Specifically, C can be set to be much larger than A, and the second category of task identifiers whose time away from the task processing deadline is less than the preset processing time threshold will be directly arranged at the head of the current queue, or it can be set equal to A, and the second category of task identifiers whose time away from the task processing deadline is less than the preset processing time threshold will be set at the front of the queue. It can be flexibly adjusted according to the actual application scenario.
[0031] As an embodiment, the task scheduling module is used to perform a second sorting on the current task queue based on the license information of the current M license servers, and determine the first X tasks in the task queue after the second sorting as the target tasks, including:
[0032] The task scheduling module traverses the current task queue in a forward-to-backward order, determines all possible currently executable task sets based on the license information of the current M license servers, obtains the license utilization rate corresponding to each currently executable task set, and determines the executable task set with the highest license utilization rate as the target task set. It should be noted that the number of tasks in the currently executable task set may be different.
[0033] For example, the current task queue is L1, L2, L3, L4, L5, L6, the license required to execute L1 is A, the license required to execute L2 is B, the license required to execute L3 is B and C, the license required to execute L4 is C and D, the license required to execute L5 is F, and the license required to execute L6 is A and F. Based on the license information of the current M license servers, it can be known that the currently idle licenses include 2 A, 1 B, 3 C, 1 F, and 2 D. Then, traverse the current task queue from front to back, and determine all possible currently executable task sets based on the license information of the current M license servers, including {L1, L2, L4, L5}, {L1, L2, L4, L6}, {L1, L3, L5}, and {L1, L3, L6}. Through analysis, it can be known that {L1, L2, L4, L5} needs to be allocated 5 licenses. ense, {L1,L2,L4,L6} need to be allocated 6 licenses, {L1,L3,L5} need to be allocated 4 licenses, and {L1,L3,L5} need to be allocated 5 licenses. Therefore, {L1,L2,L4,L6} makes the license utilization rate the highest. Therefore, {L1,L2,L4,L6} is determined as the target task set. It should be noted that the above is just a simple example. In actual applications, the sorting information of the current task queue itself and the historical usage frequency of the license can be comprehensively considered to determine the target task set.
[0034] The task scheduling module sorts the tasks in the target task set according to the sorting of the original task queue, and updates them to the first X tasks of the current task queue. Other non-target tasks are sequentially arranged after the first X tasks according to the sorting of the original task queue, and the second sorting is completed. The first X tasks in the task queue after the second sorting are determined as target tasks.
[0035] As an embodiment, the processing module includes a first processing module and a second processing module, wherein:
[0036] The first processing module is used to actively send a first type of task identifier to the task scheduling module.
[0037] The second processing module is used to periodically and actively send the second type of task identifier to the task scheduling module or send the second type of task identifier to the task scheduling module based on the task scheduling instruction sent by the task scheduling module. The second processing module is implemented based on Jenkins, which is an open source software project and a continuous integration tool developed based on Java. It will not be repeated here. Through Jenkins, the second type of task identifier can be sent to the task scheduling module periodically and actively.
[0038] In order to further improve the utilization rate of the license and reduce the license idleness, as an embodiment, the task scheduling module is also used to determine whether the license idleness rate after distributing the license corresponding to each target task is higher than a preset threshold. If so, the idle license information after the current distribution and the license information required by the second type of task identifier to be submitted by the second processing module are obtained, and a task scheduling instruction is generated and sent to the second processing module. It can be understood that the task scheduling instruction includes the need to actively obtain the second type of task identifier, and the actively obtained second type of task identifier is the second type of task identifier that the current idle license can meet the execution conditions, and the required license can be allocated from the current idle license for each actively obtained second type of task identifier. The task scheduling module actively obtains the second type of task identifier from the second processing module, and directly determines the task corresponding to the actively obtained second type of task identifier as the target task.
[0039] As an embodiment, the processing module generates a target environment variable based on the License server identifier corresponding to the target task, obtains the license from the corresponding License server based on the target environment variable, and executes the target task. There is no need to set environment variables for each task to search for the license in multiple License servers, which reduces the consumption of hardware resources and improves the task processing efficiency.
[0040] The embodiment of the present invention obtains the license usage information of the license server in real time by setting a license management module, sorts the tasks according to the task priority through the task scheduling system, and performs secondary sorting on the tasks according to the license usage information of the license server, determines the target tasks that can be executed currently, and allocates licenses to the target tasks, which can avoid task congestion and improve the utilization rate of the license.
[0041] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.
Claims
1. A task scheduling system based on license management, characterized in that: It includes a license management module, a task scheduling module, a mapping module, M license servers, and a processing module, wherein the license management module is connected to the task scheduling module and the M license servers, the task scheduling module is connected to the mapping module and the processing module, and the M license servers are connected to the processing module, and M>2; The license management module is used to obtain license usage information of M license servers in real time; The processing module is used to send a task identifier to the task scheduling module, wherein the task identifier includes a first-category task identifier and a second-category task identifier, and the first-category task identifier has a higher priority than the second-category task identifier; The mapping module stores a mapping relationship between the task identifier, the license identifier, and the license server identifier; The task scheduling module is used to perform a first sort on the received task identifiers to generate a task queue; and obtaining a mapping relationship between a task identifier and a license identifier from the mapping module and obtaining license information of the current M license servers from the license management module; and determining the License identifier corresponding to each received task identifier based on the mapping relationship between the task identifier and the License identifier, and performing a second sort on the current task queue based on the License information of the current M License servers, determining the first X tasks in the task queue after the second sort as target tasks, and deleting the target task identifier from the current task queue, where X is the number of currently executable tasks determined when the current task queue is subjected to the second sort; and sending the License server identifier corresponding to each target task to the corresponding target task; The processing module is used to obtain a license from a corresponding license server based on a license server identifier corresponding to the target task, and execute the target task; The task scheduling module is used to perform a first sort on the received task identifiers to generate a task queue, including: The task scheduling module sets a first weight, a second weight and a third weight for the received task identifier; if the received task identifier is a first-class task identifier, the first weight is set to A, and if the received task identifier is a second-class task identifier, the first weight is set to B, and the value of A is much greater than the value of B; the second weight is proportional to the order of task sending time; the third weight is inversely proportional to the execution time required for the task; a comprehensive weight is generated based on the first weight, the second weight and the third weight of the received task identifier, a first sorting is performed based on the comprehensive weight, and a task queue is generated; The task scheduling module is used to perform a second sorting on the current task queue based on the license information of the current M license servers, and determine the first X tasks in the task queue after the second sorting as target tasks, including: The task scheduling module traverses the current task queue in a forward-to-backward order, determines all possible currently executable task sets based on the license information of the current M license servers, obtains the license utilization rate corresponding to each currently executable task set, determines the executable task set with the highest license utilization rate as the target task set, sorts the tasks in the target task set according to the sorting of the original task queue, and updates them to the first X tasks of the current task queue, and other non-target tasks are sequentially arranged after the first X tasks according to the sorting of the original task queue, completing the second sorting, and determining the first X tasks in the task queue after the second sorting as the target tasks.
2. The system according to claim 1, characterized in that Each license server maintains at least one license usage information, which includes the license identifier and the current remaining number of licenses f(P) corresponding to the license identifier. Each license identifier is unique. The f(P) corresponding to the license identifier is initially the total number of licenses corresponding to the license identifier. When a license is allocated to a task, the corresponding f(P) is updated to f(P)=f(P)-1. When a task releases a license, the corresponding f(P) is updated to f(P)=f(P)+1.
3. The system according to claim 1, characterized in that The task scheduling module is further used to set the first weight value of the second type of task identifier whose time to task processing deadline is less than a preset processing time threshold to C, C≥A when performing the first sorting.
4. The system according to claim 1, characterized in that The processing module includes a first processing module and a second processing module, wherein: The first processing module is used to actively send a first type of task identifier to the task scheduling module; The second processing module is used to actively send the second type of task identifier to the task scheduling module at a regular time or send the second type of task identifier to the task scheduling module based on the task scheduling instruction sent by the task scheduling module.
5. The system according to claim 4, characterized in that The second processing module is implemented based on Jenkins.
6. The system according to claim 4, characterized in that The task scheduling module is also used to determine whether the license idle rate after the license corresponding to each target task is distributed is higher than a preset threshold. If so, the idle license information after the current distribution and the license information required for the second type of task identifier to be submitted by the second processing module are obtained, and a task scheduling instruction is generated and sent to the second processing module, and the second type of task identifier is actively obtained from the second processing module, and the task corresponding to the actively obtained second type of task identifier is directly determined as the target task.
7. The system according to claim 1, characterized in that The processing module generates a target environment variable based on a License server identifier corresponding to the target task, obtains a License from the corresponding License server based on the target environment variable, and executes the target task.
8. The system according to claim 1, characterized in that The task identifier is a hardware simulation task identifier or a hardware test task identifier.
Citation Information
Patent Citations
Licence resource scheduling method and system
CN108718327A
GPU resource scheduling method
CN116450334A
