Job scheduling method and system based on path search and storage medium
By adopting a path search-based job scheduling method in multi-job and multi-resource environments, dynamically detecting and resolving job conflicts, and adjusting resource allocation through reverse iteration, the problems of low efficiency and poor adaptability in the existing technology are solved, and efficient and reliable job scheduling is achieved.
Patent Information
- Application Number
- CN202411766426.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-25
AI Technical Summary
The existing job scheduling methods are difficult to effectively handle conflicts between jobs in multi-job and multi-resource environments, resulting in low resource utilization, long wait time and low scheduling efficiency.
Using a job scheduling method based on path search, by constructing a data dictionary centered on jobs and execution resources, randomly allocate execution resources, and detect and resolve conflicts between jobs through dynamic path search algorithms, and adjust resource allocation through reverse iteration to optimize scheduling.
It improves the efficiency and adaptability of job scheduling, optimizes resource allocation, improves resource utilization, ensures the smooth execution of jobs, and enhances the system's ability to handle complex job conflicts.
Smart Images

Figure CN119883541A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, system and storage medium for job scheduling based on path search. Background Art
[0002] The core goal of job scheduling is to reasonably arrange the job execution sequence and resource allocation under limited resource conditions to improve resource utilization, reduce waiting time and improve job completion efficiency.
[0003] In existing job scheduling methods, a key challenge is how to effectively handle conflicts between jobs in a multi-job and multi-resource environment. Job conflicts usually arise from resource competition, that is, multiple jobs may need to use the same resources in the same time period, resulting in conflicts in execution time. Traditional methods for resolving these conflicts include priority rules, heuristic algorithms, and local search strategies.
[0004] However, existing job scheduling methods often rely on static scheduling strategies, which have problems of low efficiency and poor adaptability. Summary of the invention
[0005] The main purpose of the present invention is to provide a job scheduling method, system and storage medium based on path search, aiming to solve the technical problem that the user experience of the existing job scheduling method based on path search is not good.
[0006] To achieve the above object, the present invention provides a job scheduling method based on path search, which includes the following steps: constructing a job-centric data dictionary M, whose format is defined as M = [MK, (V1, V2, ..., V i )], MK represents the unique identifier of the job, (V1, V2, ..., V i ) represents a list of execution resources that can complete the job, Vi includes the unique identifier of the job, the unique identifier of the execution resource, the execution resource usage time period, and the current status of the execution resource;
[0007] Construct a data dictionary J centered on execution resources, whose format is defined as J = [JK, (V1, V2, ..., V i )], JK represents the unique identifier of the execution resource;
[0008] Randomly assign a round of execution resources to each job;
[0009] Taking the job that has not been allocated execution resources as the starting node and the job that has been allocated two or more execution resources as the ending node, it is sequentially detected whether the execution resource usage time period of the current job conflicts with the execution resource usage time period of other jobs;
[0010] If there is a conflict, other jobs are added as new nodes to the current conflict path until a conflict-free job is found;
[0011] For each job, the execution resources that can complete the job are counted, and resource allocation is adjusted starting from the termination node according to the current conflict path to optimize job scheduling.
[0012] Optionally, the current state of the execution resource is specifically occupied or unoccupied.
[0013] Optionally, adjusting resource allocation starting from the termination node according to the current conflict path includes at least the following steps:
[0014] Obtain the current conflict path, start from the end node of the current conflict path, and iterate backward along the conflict path toward the start node. During each iteration, for each execution resource, check whether its execution resource usage time period in the current job conflicts with its execution resource usage time period in the previous job.
[0015] If there is a conflict, the execution resources of the current job are released and allocated to the previous job;
[0016] Continue iterating until all jobs are successfully assigned to execution resources or until the preset number of iterations is reached.
[0017] Optionally, release the execution resources of the current job and allocate them to the previous job, including the following steps:
[0018] An execution resource with a time conflict is obtained, and a current state of the execution resource in a current job is updated to be unoccupied, and a current state of the execution resource in a previous job is updated to be occupied.
[0019] Optionally, all jobs are successfully allocated to execution resources specifically: all jobs are allocated to execution resources whose current status is occupied.
[0020] Optionally, after adding other jobs as new nodes to the current conflict path, starting from the new node, continue to check in sequence whether the execution resource usage time period of the current job conflicts with the execution resource usage time period of other jobs, and repeat this cycle until a conflict-free job is found.
[0021] Optionally, if there are multiple conflicting paths, resource allocation is adjusted preferentially from conflicting paths with lower job score weights according to the job score weights.
[0022] Optionally, the job score weight adopts a preset value or a default value, and the job score weight is specifically the score weight of the termination node in the conflict path.
[0023] Corresponding to the job scheduling method based on path search, the present invention provides a job scheduling system based on path search, which includes: a data dictionary construction module, used to construct a job-centric data dictionary M, whose format is defined as M = [MK, (V1, V2, ..., V i )], MK represents the unique identifier of the job, (V1, V2, ..., V i ) represents the list of execution resources that can complete the job, Vi contains the unique identifier of the job, the unique identifier of the execution resource, the execution resource usage time period and the current status of the execution resource; and, construct a data dictionary J centered on the execution resource, whose format is defined as J = [JK, (V1, V2, ..., V i )], JK represents the unique identifier of the execution resource;
[0024] Resource allocation module, used to randomly allocate a round of execution resources to each job;
[0025] The conflict path construction module is used to use the job that has not been allocated execution resources as the starting node and the job that has been allocated two or more execution resources as the ending node, and sequentially detect whether the execution resource usage time period of the current job conflicts with the execution resource usage time period of other jobs; if there is a conflict, the other jobs are added as new nodes to the current conflict path until a conflict-free job is found;
[0026] The job scheduling module is used to count the execution resources that can complete each job and adjust the resource allocation starting from the termination node according to the current conflict path to optimize the job scheduling.
[0027] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a path search-based job scheduling program is stored. When the path search-based job scheduling program is executed by a processor, the steps of the path search-based job scheduling method described above are implemented.
[0028] The beneficial effects of the present invention are:
[0029] (1) Compared with the prior art, the present invention detects and resolves conflicts between jobs through a dynamic path search algorithm without relying on a static scheduling strategy, thereby improving the efficiency and adaptability of job scheduling. By starting from the end node of the conflicting path and iteratively adjusting resource allocation in reverse, the current conflict is effectively resolved, and the overall resource allocation is optimized, thereby improving resource utilization.
[0030] (2) Compared with the prior art, the present invention implements an effective resource reallocation strategy through reverse iteration; in addition, by presetting the number of iterations, it is possible to avoid infinite loop iterations while ensuring scheduling efficiency, thereby improving the execution efficiency of the algorithm.
[0031] (3) Compared with the prior art, the present invention resolves conflicts by adjusting resource status, which can ensure smooth execution of jobs and improve the real-time performance and reliability of job scheduling.
[0032] (4) Compared with the prior art, the present invention can continuously optimize the scheduling scheme by continuing to detect after adding other jobs as new nodes to the current conflict path. This not only improves the accuracy of scheduling, but also enhances the system's ability to handle complex job conflicts, thereby achieving more efficient and reliable job scheduling in a multi-job and multi-resource environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0034] Figure 1 A simplified flow chart of an embodiment of a job scheduling method based on path search of the present invention;
[0035] Figure 2 An example of the present invention after randomly allocating a round of execution resources to each job;
[0036] Figure 3 This is an example after the resource allocation is adjusted for the first time in the present invention;
[0037] Figure 4 This is an example of the present invention after adjusting resource allocation for the second time;
[0038] Figure 5 This is an example of the third adjustment of resource allocation in the present invention;
[0039] Figure 6 This is an example after the fourth adjustment of resource allocation in the present invention;
[0040] Figure 7 It is a framework diagram of an embodiment of a job scheduling system based on path search of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, 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 part of the embodiments of the present invention, rather than all the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0042] like Figure 1 As shown, a job scheduling method based on path search of the present invention comprises the following steps: constructing a job-centric data dictionary M, whose format is defined as M=[MK,(V1,V2,...,V i )], MK represents the unique identifier of the job, (V1, V2, ..., V i ) represents a list of execution resources that can complete the job, Vi includes the unique identifier of the job, the unique identifier of the execution resource, the execution resource usage time period, and the current status of the execution resource;
[0043] Construct a data dictionary J centered on execution resources, whose format is defined as J = [JK, (V1, V2, ..., V i )], JK represents the unique identifier of the execution resource;
[0044] Randomly assign a round of execution resources to each job;
[0045] Taking the job that has not been allocated execution resources as the starting node and the job that has been allocated two or more execution resources as the ending node, it is sequentially detected whether the execution resource usage time period of the current job conflicts with the execution resource usage time period of other jobs;
[0046] If there is a conflict, other jobs are added as new nodes to the current conflict path until a conflict-free job is found;
[0047] For each job, the execution resources that can complete the job are counted, and resource allocation is adjusted starting from the termination node according to the current conflict path to optimize job scheduling.
[0048] Preferably, i∈N * .
[0049] The present invention detects and resolves conflicts between jobs through a dynamic path search algorithm without relying on a static scheduling strategy, thereby improving the efficiency and adaptability of job scheduling; by starting from the termination node of the conflicting path and iteratively adjusting resource allocation in reverse, the current conflict is effectively resolved, the overall resource allocation is optimized, and resource utilization is improved.
[0050] In this embodiment, the current state of the execution resource is specifically occupied or unoccupied.
[0051] In this embodiment, adjusting resource allocation starting from the termination node according to the current conflicting path includes at least the following steps:
[0052] Obtain the current conflict path, start from the end node of the current conflict path, and iterate backward along the conflict path toward the start node. During each iteration, for each execution resource, check whether its execution resource usage time period in the current job conflicts with its execution resource usage time period in the previous job.
[0053] If there is a conflict, the execution resources of the current job are released and allocated to the previous job;
[0054] Continue iterating until all jobs are successfully assigned to execution resources or until the preset number of iterations is reached.
[0055] Preferably, the preset number of iterations is an integer between 2 and 5 (including 2 and 5).
[0056] The present invention realizes an effective resource reallocation strategy through reverse iteration; in addition, by presetting the number of iterations, infinite loop iterations can be avoided while ensuring scheduling efficiency, thereby improving the execution efficiency of the algorithm.
[0057] In this embodiment, releasing the execution resources of the current job and allocating them to the previous job specifically includes the following steps:
[0058] An execution resource with a time conflict is obtained, and a current state of the execution resource in a current job is updated to be unoccupied, and a current state of the execution resource in a previous job is updated to be occupied.
[0059] The present invention resolves conflicts by adjusting resource states, can ensure smooth execution of jobs, and improves the real-time performance and reliability of job scheduling.
[0060] In this embodiment, all jobs are successfully allocated to the execution resources specifically means that all jobs are allocated to the execution resources whose current status is occupied.
[0061] In this embodiment, after other jobs are added as new nodes to the current conflict path, starting from the new node, the execution resource usage time period of the current job is continuously detected in turn to see if there is a conflict between the execution resource usage time period of other jobs, and this cycle is repeated until a conflict-free job is found.
[0062] The present invention can continuously optimize the scheduling scheme by continuing to detect after adding other jobs as new nodes to the current conflict path, which not only improves the accuracy of scheduling, but also enhances the system's ability to handle complex job conflicts, thereby achieving more efficient and reliable job scheduling in a multi-job and multi-resource environment.
[0063] In this embodiment, if there are multiple conflicting paths, resource allocation is adjusted preferentially from the conflicting paths with lower job score weights according to the job score weights.
[0064] Preferably, the job score weight adopts a preset value or a default value, and the job score weight is specifically the score weight of the termination node (i.e., the termination job, each node in the present invention also refers to a job) in the conflict path. It is understandable that if there is a preset value (manually set), the preset value is preferred, and if there is no preset value, the default value is adopted, and the default value is 1.
[0065] Please refer to Figure 2-6 ,It should be explained that after a round of execution resources are ,randomly assigned to each job, some jobs may be ,assigned more than two execution resources, and some jobs may not be ,assigned to execution resources, and those that are not ,assigned may have conflicts.
[0066] like Figure 2 As shown, red indicates that the execution resource has not been successfully allocated (the current state is unoccupied), and green indicates that the execution resource has been successfully allocated (the current state is occupied). That is, jobs MK-2, MK-3, and MK-4 are all allocated to execution resources whose current state is occupied. In addition, job MK-5 is allocated to two execution resources whose current state is occupied. It should be noted that the same execution resource may have different usage time periods (the usage time periods are preset), but different usage time periods cannot overlap.
[0067] from Figure 2 It can be seen that job MK-1 has not been assigned to an execution resource that is currently occupied, and there is no available execution resource. Figure 2 In the example, with job MK-1 as the starting node and job MK-5 as the ending node, check in turn whether there is a conflict between the execution resource usage time period of the current job and the execution resource usage time period of other jobs. Since there is an execution time conflict between the execution resource JK-1 usage time period of job MK-1 and the execution resource JK-1 usage time period of job MK-2 (10-20 and 19-30 intersect). Therefore, job MK-2 is added to the current conflict path. It should be noted that 10-20 in the figure represents a period of time, which can refer to 10-20s, and the other numbers are similar.
[0068] Next, the second detection starts from job MK-2. Similarly, since the execution time of job MK-2's execution resource JK-2 usage time period conflicts with the execution time of job MK-3's execution resource JK-2 usage time period, MK-3 is added to the current conflict path. This process is repeated until a conflict-free job is found.
[0069] Please refer to Figure 3-6 , obtain the current conflict path, start from the end node (MK-5) of the current conflict path, and iterate backward along the conflict path toward the start node (MK-1);
[0070] During each iteration, for each execution resource, check whether its execution resource usage time period in the current job conflicts with its execution resource usage time period in the previous job;
[0071] For example, if the execution resource JK-2 usage time period of job MK-5 and the execution resource JK-2 usage time period of job MK-4 have an execution time conflict (109-119 and 100-110 have an intersection), the execution resource of the current job is released and allocated to the previous job; specifically, Figure 3 As shown, by updating the current state of the execution resource JK-2 of job MK-5 to unoccupied (marked in red), the current state of the execution resource JK-2 of job MK-4 is updated to occupied (marked in green); and so on (as shown in FIG. Figure 4-6 shown);
[0072] Continue iterating until all jobs are assigned to execution resources that are currently occupied (such as Figure 6 ), or until a preset number of iterations is reached.
[0073] like Figure 7 As shown, the present invention also provides a job scheduling system based on path search, which includes: a data dictionary construction module 10, which is used to construct a job-centric data dictionary M, and its format is defined as M = [MK, (V1, V2, ..., V i )], MK represents the unique identifier of the job, (V1, V2, ..., V i ) represents the list of execution resources that can complete the job, Vi contains the unique identifier of the job, the unique identifier of the execution resource, the execution resource usage time period and the current status of the execution resource; and, construct a data dictionary J centered on the execution resource, whose format is defined as J = [JK, (V1, V2, ..., V i )], JK represents the unique identifier of the execution resource;
[0074] A resource allocation module 20, used to randomly allocate a round of execution resources to each job;
[0075] The conflict path construction module 30 is used to use the job that is not allocated with execution resources as the starting node and the job that is allocated with two or more execution resources as the ending node, and sequentially detect whether the execution resource usage time period of the current job conflicts with the execution resource usage time period of other jobs; if there is a conflict, the other jobs are added as new nodes to the current conflict path until a conflict-free job is found;
[0076] The job scheduling module 40 is used to count the execution resources that can complete each job, and adjust the resource allocation starting from the termination node according to the current conflict path to optimize the job scheduling.
[0077] The embodiment of the present invention further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory in the above embodiment; or a computer-readable storage medium that exists independently and is not installed in a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement Figure 1 The job scheduling method based on path search is shown. The computer readable storage medium may be a read-only memory, a disk or an optical disk, etc.
[0078] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system embodiment and the storage medium embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0079] Furthermore, in this document, the terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0080] The above description shows and describes the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the invention, through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not depart from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.
Claims
1. A job scheduling method based on path search, characterized in that: The following steps are involved: Construct a job-centric data dictionary M, whose format is defined as M = [MK, (V1, V2, ..., V i )], MK represents the unique identifier of the job, (V1, V2, ..., V i ) represents the list of execution resources that can complete the job, V i Contains the unique ID of the job, the unique ID of the execution resource, the time period of the execution resource usage, and the current status of the execution resource; Construct a data dictionary J centered on execution resources, whose format is defined as J = [JK, (V1, V2, ..., V i )], JK represents the unique identifier of the execution resource; Randomly assign a round of execution resources to each job; Taking the job that has not been allocated execution resources as the starting node and the job that has been allocated two or more execution resources as the ending node, it is sequentially detected whether the execution resource usage time period of the current job conflicts with the execution resource usage time period of other jobs; If there is a conflict, other jobs are added as new nodes to the current conflict path until a conflict-free job is found; For each job, the execution resources that can complete the job are counted, and resource allocation is adjusted starting from the termination node according to the current conflict path to optimize job scheduling.
2. The job scheduling method based on path search according to claim 1, characterized in that: The current state of the execution resource is specifically occupied or unoccupied.
3. The job scheduling method based on path search according to claim 2 is characterized in that: Adjusting resource allocation starting from the termination node according to the current conflict path includes at least the following steps: Obtain the current conflict path, start from the end node of the current conflict path, and iterate backward along the conflict path toward the start node. During each iteration, for each execution resource, check whether its execution resource usage time period in the current job conflicts with its execution resource usage time period in the previous job. If there is a conflict, the execution resources of the current job are released and allocated to the previous job; Continue iterating until all jobs are successfully assigned to execution resources or until the preset number of iterations is reached.
4. The job scheduling method based on path search according to claim 3 is characterized in that: Release the execution resources of the current job and allocate them to the previous job. The specific steps include: An execution resource with a time conflict is obtained, and a current state of the execution resource in a current job is updated to be unoccupied, and a current state of the execution resource in a previous job is updated to be occupied.
5. The job scheduling method based on path search according to claim 3 is characterized in that: All jobs are successfully assigned to execution resources: Specifically, all jobs are assigned to execution resources whose current status is occupied.
6. The job scheduling method based on path search according to claim 1, characterized in that: After adding other jobs as new nodes to the current conflict path, starting from the new node, continue to check whether the execution resource usage time period of the current job conflicts with the execution resource usage time period of other jobs, and repeat this process until a conflict-free job is found.
7. The job scheduling method based on path search according to claim 1, characterized in that: If there are multiple conflicting paths, resource allocation will be adjusted based on the job score weights, with priority given to the conflicting paths with lower job score weights.
8. The job scheduling method based on path search according to claim 7 is characterized in that: The job score weight adopts a preset value or a default value, and the job score weight is specifically the score weight of the termination node in the conflict path.
9. A job scheduling system based on path search, characterized in that: include: The data dictionary building module is used to build a job-centric data dictionary M, whose format is defined as M = [MK, (V1, V2, ..., V i )], MK represents the unique identifier of the job, (V1, V2, ..., V i ) represents the list of execution resources that can complete the job, Vi contains the unique identifier of the job, the unique identifier of the execution resource, the execution resource usage time period and the current status of the execution resource; and, construct a data dictionary J centered on the execution resource, whose format is defined as J = [JK, (V1, V2, ..., V i )], JK represents the unique identifier of the execution resource; Resource allocation module, used to randomly allocate a round of execution resources to each job; A conflict path construction module is used to take a job that is not allocated with execution resources as a starting node and a job that is allocated with two or more execution resources as an ending node, and sequentially detect whether there is a conflict between the execution resource usage time period of the current job and the execution resource usage time period of other jobs; If there is a conflict, other jobs are added as new nodes to the current conflict path until a conflict-free job is found; The job scheduling module is used to count the execution resources that can complete each job, and adjust the resource allocation starting from the termination node according to the current conflict path to optimize the job scheduling.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a job scheduling program based on path search, and when the job scheduling program based on path search is executed by a processor, the steps of the job scheduling method based on path search as described in any one of claims 1 to 8 are implemented.