Scheduling strategy determination method and device, storage medium and computer program product
Through the scheduling strategy determination method based on operation time-consuming and genetic planning algorithms, the problem of unreasonable manual scheduling in the prior art is solved, and the reasonable scheduling of computer resources and real-time response to emergencies is realized.
Patent Information
- Application Number
- CN202411685375.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-01
AI Technical Summary
In the prior art, the scheduling of computer resources is determined through manual judgment, resulting in the unreasonable scheduling of computer resources in the scenario of parallel execution of multiple projects and the inability to respond to emergencies in real time.
By determining the first scheduling rule of computer resources based on the operation time-consuming operation of each of the at least two tasks to be scheduled, combining the multi-job sorting rules and machine allocation rules, adjusting the scheduling rules through the genetic planning algorithm, a reasonable computer resource scheduling strategy is determined.
It realizes reasonable scheduling of computer resources in the scenario of parallel execution of multiple projects, can respond to emergencies in real time, and improve resource utilization efficiency.
Smart Images

Figure CN119739501A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to a method and device for determining a scheduling strategy, a storage medium, and a computer program product. Background Art
[0002] In the current enterprise information and intelligent project management, the scheduling and management of computer resources often rely on manual judgment. If an emergency occurs in the scenario of multiple projects being executed in parallel, such as computer failure or changes in project requirements, manual scheduling often cannot respond in real time and make dynamic adjustments, resulting in unreasonable scheduling of computer resources.
[0003] In view of the problem in the related art that the scheduling of computer resources is determined by manual judgment, resulting in an unreasonable scheduling strategy for computer resources, no effective solution has been proposed yet.
[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention
[0005] The embodiments of the present application provide a method and device for determining a scheduling strategy, a storage medium, and a computer program product, so as to at least solve the problem in the related art that the scheduling of computer resources is determined by manual judgment, resulting in an unreasonable scheduling strategy for computer resources.
[0006] According to one aspect of an embodiment of the present application, a method for determining a scheduling strategy is provided, comprising: determining a first scheduling rule for computer resources based on the operation time of each of at least two tasks to be scheduled, wherein the computer resources are used to schedule the at least two tasks to be scheduled, and the first scheduling rule comprises: a multi-job sorting rule for indicating the priority of the at least two tasks to be scheduled and a machine allocation rule for indicating an initial scheduling strategy for the computer resources; determining a second scheduling rule for the computer resources based on the multi-job sorting rule and the machine allocation rule; adjusting the second scheduling rule through a genetic programming algorithm to obtain a third scheduling rule, and determining the scheduling strategy for the computer resources based on the third scheduling rule.
[0007] In an exemplary embodiment, a first scheduling rule for computer resources is determined based on the operation time of each of at least two tasks to be scheduled, including: determining a first operation with the shortest operation time and a second operation with the longest operation time from the operation times of the at least two tasks to be scheduled, and determining the first task to be scheduled with the shortest remaining time and the second task to be scheduled with the longest remaining time among the at least two tasks to be scheduled based on the latest completion time of the at least two tasks to be scheduled and the current time; determining the multi-job sorting rule based on the first operation, the second operation, the first task to be scheduled, and the second task to be scheduled, and determining the machine allocation rule based on the first computer resource with the slowest execution speed and the second computer resource with the fastest execution speed among the computer resources; determining the multi-job sorting rule and the machine allocation rule as the first scheduling rule.
[0008] In an exemplary embodiment, determining the second scheduling rule for the computer resources based on the multi-job sorting rule and the machine allocation rule includes: determining a first rule in the multi-job sorting rule that includes the first operation and the second operation, a second rule in the multi-job sorting rule that includes the first task to be scheduled and the second task to be scheduled, and a third rule in the machine allocation rule that includes the first computer resource and the second computer resource, wherein the first rule, the second rule and the third rule each include at least two rules; combining a preset number of rules in the first rule, a preset number of rules in the second rule and a preset number of rules in the third rule to obtain the second scheduling rule, wherein each rule in the second scheduling rule is not repeated.
[0009] In an exemplary embodiment, after determining the scheduling strategy of the computer resources according to the third scheduling rule, the method further includes: when the target computer is in an unavailable state, stopping allocating any of the at least two tasks to be scheduled to the target computer, wherein the target computer is any computer in the computer resources.
[0010] In an exemplary embodiment, after determining the scheduling strategy of the computer resources according to the third scheduling rule, the method further includes: when the target computer is in an unavailable state, determining the reason why the target computer is unavailable, and determining the time required for the target computer to recover to an available state according to the reason why the target computer is unavailable, wherein the target computer is any computer in the computer resources; when the difference between the current time and the time when the target computer is in the unavailable state reaches the time required for the target computer to recover to an available state, determining whether the target computer is in the available state; and when it is determined that the target computer is in the available state, continuing to allocate the at least two tasks to be scheduled to the target computer according to the third scheduling rule.
[0011] In an exemplary embodiment, after determining the scheduling strategy of the computer resource according to the third scheduling rule, the method further includes: when the third computer resource is processing the first task and the third computer resource receives the second task, placing the second task into the buffer of the third computer resource, wherein the third computer resource is a computer in the computer resource determined according to the third scheduling rule for processing the first task and the second task, and the first task and the second task are the tasks to be processed by the third computer resource determined according to the third scheduling rule among the at least two tasks to be scheduled; when the third computer resource has processed the first task and the third computer resource is in an available state, determining whether the priority of the second task is higher than other tasks in the buffer, wherein the other tasks are the tasks to be scheduled in all the tasks to be scheduled in the buffer except the second task; when it is determined that the priority of the second task is higher than that of the other tasks, instructing the third computer resource to process the second task.
[0012] In an exemplary embodiment, after determining the scheduling strategy of the computer resource according to the third scheduling rule, the method further includes: when the third computer resource is processing the first task and the third computer resource is unavailable at the current time, placing the first task into a cache area of the third computer resource, wherein the third computer resource is a computer in the computer resource determined according to the third scheduling rule for processing the first task, and the first task is a task to be processed by the third computer resource among the at least two tasks to be scheduled determined according to the third scheduling rule; and when the third computer resource resumes an available state, continuing to process the first task.
[0013] According to another aspect of an embodiment of the present application, a device for determining a scheduling strategy is also provided, including: a first determination module, used to determine a first scheduling rule for computer resources based on the operation time of each of at least two tasks to be scheduled, wherein the computer resources are used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority of the at least two tasks to be scheduled and a machine allocation rule for indicating the initial scheduling strategy of the computer resources; a second determination module, used to determine a second scheduling rule for the computer resources based on the multi-job sorting rule and the machine allocation rule; a third determination module, used to adjust the second scheduling rule through a genetic programming algorithm to obtain a third scheduling rule, and determine the scheduling strategy of the computer resources based on the third scheduling rule.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for determining the scheduling strategy when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for determining the scheduling strategy through the computer program.
[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0017] Through this application, the first scheduling rule of computer resources is determined according to the operation time of each of at least two tasks to be scheduled; the second scheduling rule of the computer resources is determined according to the multi-job sorting rule and the machine allocation rule in the first scheduling rule; the scheduling strategy of the computer resources is determined according to the third scheduling rule, wherein the third scheduling rule is obtained by adjusting the second scheduling rule through a genetic programming algorithm. This solves the problem in the related art that the scheduling of computer resources is determined by manual judgment, resulting in an unreasonable scheduling strategy of computer resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] 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 or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for determining a scheduling strategy in an embodiment of the present application;
[0021] Figure 2 is a flowchart of a method for determining a scheduling strategy according to an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of the operation content of a method for determining a scheduling strategy according to an embodiment of the present application;
[0023] Figure 4 It is a schematic diagram of the overall architecture of a method for determining a scheduling strategy according to an embodiment of the present application;
[0024] Figure 5 It is a structural block diagram of a device for determining a scheduling strategy according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal for determining a scheduling strategy according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the scheduling strategy in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0029] A wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0030] In this embodiment, a method for determining a scheduling strategy is provided, which is applied to the above-mentioned computer terminal. Figure 2is a flow chart of a method for determining a scheduling strategy according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0031] Step S202, determining a first scheduling rule for computer resources according to the operation time of each of at least two tasks to be scheduled, wherein the computer resources are used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority order of the at least two tasks to be scheduled and a machine allocation rule for indicating an initial scheduling strategy for the computer resources;
[0032] Step S204, determining a second scheduling rule for the computer resources according to the multi-job sorting rule and the machine allocation rule;
[0033] Step S206, adjusting the second scheduling rule by a genetic programming algorithm to obtain a third scheduling rule, and determining the scheduling strategy of the computer resources according to the third scheduling rule.
[0034] Through the above steps, the first scheduling rule of the computer resource is determined according to the operation time of each of the at least two tasks to be scheduled, wherein the computer resource is used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority of the at least two tasks to be scheduled and a machine allocation rule for indicating the initial scheduling strategy of the computer resource; the second scheduling rule of the computer resource is determined according to the multi-job sorting rule and the machine allocation rule; the second scheduling rule is adjusted by a genetic programming algorithm to obtain a third scheduling rule, and the scheduling strategy of the computer resource is determined according to the third scheduling rule. This solves the problem in the related art that the scheduling of computer resources is determined by manual judgment, resulting in an unreasonable scheduling strategy of computer resources.
[0035] In an exemplary embodiment, a first scheduling rule for computer resources is determined based on the operation time of each of at least two tasks to be scheduled, including: determining a first operation with the shortest operation time and a second operation with the longest operation time from the operation times of the at least two tasks to be scheduled, and determining the first task to be scheduled with the shortest remaining time and the second task to be scheduled with the longest remaining time among the at least two tasks to be scheduled based on the latest completion time of the at least two tasks to be scheduled and the current time; determining the multi-job sorting rule based on the first operation, the second operation, the first task to be scheduled, and the second task to be scheduled, and determining the machine allocation rule based on the first computer resource with the slowest execution speed and the second computer resource with the fastest execution speed among the computer resources; determining the multi-job sorting rule and the machine allocation rule as the first scheduling rule.
[0036] According to the first operation, the second operation, the first task to be scheduled and the second task to be scheduled in this embodiment, a multi-job sorting rule is determined, and the multi-job sorting rule includes: giving priority to the first task to be scheduled with the shortest remaining time in the task pool; giving priority to the second task to be scheduled with the longest remaining time in the task pool; giving priority to the first operation with the shortest operation time in the task pool; giving priority to the second operation with the longest operation time in the task pool. At the same time, the machine allocation rule is determined to include: giving priority to the first computer resource with the slowest execution speed; giving priority to the second computer resource with the fastest execution speed. According to the multi-job sorting rule and the machine allocation rule, the first scheduling rule is determined, and the first scheduling rule includes: giving priority to the first task to be scheduled with the shortest remaining time in the task pool; giving priority to the second task to be scheduled with the longest remaining time in the task pool; giving priority to the first operation with the shortest operation time in the task pool; giving priority to the second operation with the longest operation time in the task pool; giving priority to the first computer resource with the slowest execution speed; giving priority to the second computer resource with the fastest execution speed.
[0037] In an exemplary embodiment, determining the second scheduling rule for the computer resources based on the multi-job sorting rule and the machine allocation rule includes: determining a first rule in the multi-job sorting rule that includes the first operation and the second operation, a second rule in the multi-job sorting rule that includes the first task to be scheduled and the second task to be scheduled, and a third rule in the machine allocation rule that includes the first computer resource and the second computer resource, wherein the first rule, the second rule and the third rule each include at least two rules; combining a preset number of rules in the first rule, a preset number of rules in the second rule and a preset number of rules in the third rule to obtain the second scheduling rule, wherein each rule in the second scheduling rule is not repeated.
[0038] The first rule includes: giving priority to the first operation with the shortest operation time in the task pool; giving priority to the second operation with the longest operation time in the task pool. The second rule includes: giving priority to the first task to be scheduled with the shortest remaining time in the task pool; giving priority to the second task to be scheduled with the longest remaining time in the task pool. The third rule includes: giving priority to the first computer resource with the slowest execution speed; giving priority to the second computer resource with the fastest execution speed. Optionally, the second scheduling rule includes: (1) giving priority to the first operation with the shortest operation time in the task pool; giving priority to the first task to be scheduled with the shortest remaining time in the task pool; giving priority to the first computer resource with the slowest execution speed. (2) giving priority to the first operation with the shortest operation time in the task pool; giving priority to the first task to be scheduled with the shortest remaining time in the task pool; giving priority to the second computer resource with the fastest execution speed. (3) giving priority to the first operation with the shortest operation time in the task pool; giving priority to the second task to be scheduled with the longest remaining time in the task pool; giving priority to the first computer resource with the slowest execution speed. (4) Prioritize the first operation with the shortest operation time in the task pool; prioritize the second task to be scheduled with the longest remaining time in the task pool; and prioritize the second computer resource with the fastest execution speed. (5) Prioritize the second operation with the longest operation time in the task pool; prioritize the first task to be scheduled with the shortest remaining time in the task pool; and prioritize the first computer resource with the slowest execution speed. (6) Prioritize the second operation with the longest operation time in the task pool; prioritize the first task to be scheduled with the shortest remaining time in the task pool; and prioritize the second computer resource with the fastest execution speed. (7) Prioritize the second operation with the longest operation time in the task pool; prioritize the second task to be scheduled with the longest remaining time in the task pool; and prioritize the first computer resource with the slowest execution speed. (8) Prioritize the second operation with the longest operation time in the task pool; prioritize the second task to be scheduled with the longest remaining time in the task pool; and prioritize the second computer resource with the fastest execution speed.
[0039] In an exemplary embodiment, after determining the scheduling strategy of the computer resources according to the third scheduling rule, the method further includes: when the target computer is in an unavailable state, stopping allocating any of the at least two tasks to be scheduled to the target computer, wherein the target computer is any computer in the computer resources.
[0040] Optionally, assume that in an enterprise project management scenario, there are three working computer resources: high-performance computer HPC1, ordinary working computer PC1 and another ordinary working computer PC2. At the same time, there are four tasks to be scheduled: Task A, Task B, Task C and Task D, of which Task C and Task D require the use of high-performance computing resources. High-performance computer HPC1 is executing Task A, which is expected to take another hour to complete; ordinary working computers PC1 and PC2 currently have no tasks and are on standby; Tasks B, C and D are all waiting for scheduling in the task pool. At this time, the high-performance computer HPC1 fails and cannot continue to be used. Based on the principle of "stop allocating any of the at least two tasks to be scheduled to the target computer when the target computer is unavailable", stop allocating new tasks to the high-performance computer HPC1. This means that Task C and Task D cannot be scheduled to be executed on HPC1 temporarily.
[0041] In an exemplary embodiment, after determining the scheduling strategy of the computer resources according to the third scheduling rule, the method further includes: when the target computer is in an unavailable state, determining the reason why the target computer is unavailable, and determining the time required for the target computer to recover to an available state according to the reason why the target computer is unavailable, wherein the target computer is any computer in the computer resources; when the difference between the current time and the time when the target computer is in the unavailable state reaches the time required for the target computer to recover to an available state, determining whether the target computer is in the available state; and when it is determined that the target computer is in the available state, continuing to allocate the at least two tasks to be scheduled to the target computer according to the third scheduling rule.
[0042] Optionally, assume that there are three computer resources: high-performance computer HPC1, ordinary working computers PC1 and PC2. There are four tasks to be scheduled: task X, task Y, task Z and task W, among which task X and task Z require high-performance computing resources. At the current time, HPC1 is running task X, PC1 and PC2 are both idle, and tasks Y, Z and W are in the task pool waiting for scheduling. When HPC1 suddenly fails, the status of HPC1 becomes unavailable, and at this time, task Z is stopped from being assigned to HPC1. The terminal device analyzes the fault log of HPC1 and determines that the reason for the unavailability of HPC1 is the automatic shutdown caused by hardware overheating. According to the fault type and maintenance strategy, it is estimated that the time required for HPC1 to restore to an available state is 2 hours. The terminal device starts timing and monitors the difference from the moment HPC1 becomes unavailable to the current time. During this process, the terminal device continuously evaluates the availability of PC1 and PC2 and schedules tasks Y and W to these two ordinary working computers. When the time point of 2 hours is reached, it is confirmed that HPC1 has been restored to an available state. Since task Z is still waiting in the task pool and requires high-performance resources, the terminal device re-evaluates the task pool and resource status according to the third scheduling rule, and assigns task Z to the recovered HPC1 to ensure that task Z can be completed within the latest completion time limit.
[0043] In an exemplary embodiment, after determining the scheduling strategy of the computer resource according to the third scheduling rule, the method further includes: when the third computer resource is processing the first task and the third computer resource receives the second task, placing the second task into the buffer of the third computer resource, wherein the third computer resource is a computer in the computer resource determined according to the third scheduling rule for processing the first task and the second task, and the first task and the second task are the tasks to be processed by the third computer resource determined according to the third scheduling rule among the at least two tasks to be scheduled; when the third computer resource has processed the first task and the third computer resource is in an available state, determining whether the priority of the second task is higher than other tasks in the buffer, wherein the other tasks are the tasks to be scheduled in all the tasks to be scheduled in the buffer except the second task; when it is determined that the priority of the second task is higher than that of the other tasks, instructing the third computer resource to process the second task.
[0044] Alternatively, assume that in a project development environment, there are three computer resources: a high-performance server HPC1, and two ordinary working computers PC1 and PC2. There are five tasks to be scheduled at the same time: Task A, Task B, Task C, Task D, and Task E, among which Task A, Task D, and Task E are tasks with higher priority, while Task B and Task C have lower priority. The current initial state is that HPC1 is processing Task A, and Task B and C are assigned to PC1 and PC2. The priority evaluation of Task D and Task E shows that only HPC1 can process this task. Since HPC1 is currently processing Task A, the terminal device puts Task D and Task E into the buffer of HPC1 and waits. When HPC1 completes Task A and determines that HPC1 is in an available state, the priority of Task D and Task E in the buffer is determined. If the priority of Task D is higher than that of Task E, the terminal device will instruct HPC1 to start processing Task D immediately.
[0045] In an exemplary embodiment, after determining the scheduling strategy of the computer resource according to the third scheduling rule, the method further includes: when the third computer resource is processing the first task and the third computer resource is unavailable at the current time, placing the first task into a cache area of the third computer resource, wherein the third computer resource is a computer in the computer resource determined according to the third scheduling rule for processing the first task, and the first task is a task to be processed by the third computer resource among the at least two tasks to be scheduled determined according to the third scheduling rule; and when the third computer resource resumes an available state, continuing to process the first task.
[0046] Alternatively, assume that in a project management environment, there are three computer resources: a high-performance computer HPC1, and two ordinary working computers PC1 and PC2. Currently, HPC1 is processing a high-priority task T1, while PC1 and PC2 are executing low-priority tasks T2 and T3, respectively. Assume that the processing time of task T1 is relatively long and requires 4 hours. While HPC1 is processing task T1, it suddenly becomes unavailable due to a hardware failure. At this time, according to the third scheduling rule, task T1 is placed in the cache area of HPC1, and when HPC1 is restored to an available state, task T1 will be restarted to be processed on HPC1, where HPC1 continues from the point where task T1 was interrupted without having to start from the beginning.
[0047] In order to better understand the process of the method for determining the above-mentioned scheduling strategy, the method for determining the above-mentioned scheduling strategy is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0048] Figure 3is a schematic diagram of the operation content of a method for determining a scheduling strategy according to an embodiment of the present application, such as Figure 3 As shown, specifically including the following:
[0049] Before establishing the database, define the k possible operations O involved in the information and intelligent projects of the owner unit that need to be integrated, O = {O l ,l=1,…,k}. In order to support the subsequent intelligent scheduling and decision-making, a database is established, which includes multiple tables: operation table, time consumption table, performance comparison table, latest completion time limit table, etc. Among them, the construction of the time consumption table adopts the improved adaptive neuro-fuzzy inference system (ANFIS) algorithm, that is, running the ANFIS algorithm k times, each time the algorithm inputs O l The time data of the operation after evaluation is output l The time level L. For example, level 1 is mapped to 0.1-0.25 hours, so that each operation has an exact time level instead of a specific value.
[0050] In determining the time-consuming level, each layer of the ANFIS algorithm is improved. The first fuzzy layer is based on (x b Lower-public μ formula ba 2. If the input variable a is the fuzzy rule, then b is the input variable, x b The value of the property is indicated by M model ba :Fuzzy Rule M b but a b = 5·β fuzzy defined as 0. ba Focus on specific input variables. ba is the fuzzy rule b and the input variable x b The associated scaling factor or weight. ba is composed of fuzzy rule b and input variable x b The second layer determines the trigger strength ω of the fuzzy rule according to the following formula a :ω a =∑ b M ba , where M ba The first layer output is the membership value between the input variable and the fuzzy rule. The third layer is to perform weighted summation of the trigger intensity and defuzzify it. The improvement of this layer is to change the traditional multiplication operation into addition, which improves the calculation efficiency and numerical stability. The specific formula is as follows: in, is a linear combination of input variables, W ba is the connection weight. ais a regulatory constant. The fourth layer uses the Softmax function as the activation function to ensure the rationality of the output results.
[0051] Obviously, the above-described embodiments are only a part of the embodiments of the present application, not all of the embodiments. In order to better understand the above-mentioned method for determining the scheduling strategy, the above-mentioned process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application, specifically:
[0052] In an optional embodiment, in combination Figure 4 The method for determining the scheduling strategy of this application is further described. Figure 4 As shown, including the following:
[0053] This embodiment constructs a deep reinforcement learning environment that matches the actual operating environment. The construction of this environment is based on the operation database defined above, which contains all possible operations O, operation time level L, performance comparison table, and the latest completion time limit. At the same time, disturbance events (i.e., emergencies) existing in actual applications are added to the environment. Disturbance events are divided into two categories: inserting new tasks and machine unavailability. Among them, when a new task is added, the new task is added to the task pool and waits for resource allocation. The principle of machine unavailability is as follows: (1) If a machine is selected as unavailable, it will stop running until the available status is re-checked and resumes running; (2) When the machine is unavailable, a recovery time is given according to the reason for the unavailability (for example, when the reason for the unavailability is that the staff member who lent the computer returns to work, the recovery time is the next time this staff member takes vacation); (3) When the device is unavailable, the ongoing operation on the device is interrupted. When the device is available again, it will be restarted from the interrupted part; (4) When the device is unavailable, the interrupted operation and all operations in the buffer of this device will be put back into the task pool, waiting for machine allocation; (5) The device cannot be selected during the period of unavailability.
[0054] In the environment design, m, n, and u represent the number of high-performance computers, the number of ordinary computers, and the size of the job set, respectively. In order to reflect the actual situation of resource constraints, the number of high-performance computers m is set to be less than the number of jobs that require high-performance resources. At the same time, the total number of computers (i.e., m+n) will be less than the number of jobs to be allocated u most of the time to simulate a scenario of resource constraints. The environment's reward mechanism R is designed based on the principles of maximizing lead time and complying with the latest completion time limit. The calculation formula for R is as follows: R=PT x -CT x , among which, PT x Indicates the latest completion time of job x, CT xRepresents the actual completion time of job x. R can be a negative number, reflecting the system's pursuit of advance time and the penalty for job delays.
[0055] After the learning environment is built, the offline learning stage learns to optimize the scheduling strategy through the interaction between the deep reinforcement learning algorithm (Deep Q-Network, referred to as DQN) and the environment. In this embodiment, the DQN network architecture is not modified, but its action space (i.e., the action combination that the deep reinforcement learning algorithm model can choose) is designed through the constraints of the scheduling rules. Among them, the scheduling rules are shown in Table 1.
[0056] 1 Prioritize the job with the shortest remaining time in the task pool 2 Prioritize the job with the longest remaining time in the task pool 3 Prioritize the operation with the shortest processing time in the task pool 4 Prioritize the operations with the longest processing time in the task pool 5 Prioritize machines that require the shortest operation time 6 Prioritize machines that require the longest operation time
[0057] Table 1
[0058] Each general rule consists of two dispatch rules, which are combined into 8 general rules. i (i=1,...,8), optionally, the contents corresponding to sequence number 1 and sequence number 2 in Table 1 are the first group of rules, the contents corresponding to sequence number 3 and sequence number 4 are the second group of rules, and the contents corresponding to sequence number 5 and sequence number 6 are the third group of rules. By selecting any one of the three groups of rules for combination, 8 general rules can be obtained, namely (1) sequence number 1, sequence number 3, sequence number 5, (2) sequence number 1, sequence number 3, sequence number 6, (3) sequence number 1, sequence number 4, sequence number 5, (4) sequence number 1, sequence number 4, sequence number 6, (5) sequence number 2, sequence number 3, sequence number 5, (6) sequence number 2, sequence number 3, sequence number 6, (7) sequence number 2, sequence number 4, sequence number 5, (8) sequence number 2, sequence number 4, sequence number 6.
[0059] After establishing the general scheduling rules, the genetic programming algorithm (GP) is further used to comprehensively optimize the above 8 general rules to generate high-quality scheduling rules, namely GP rules. In the GP algorithm, the 8 general rules are used as terminal sets. At the same time, a function set is defined, which contains 6 mathematical operators: addition (+), subtraction (-), multiplication (*), division ( / ), minimum value (min) and maximum value (max). Among them, the division operator returns 1 when the divisor is 0, and performs normal division operations in other cases. The initial population of the GP algorithm, namely the initial rule set, is generated by the oblique half method, which provides a diverse starting point for subsequent evolutionary iterations. In the evolution process of each generation, the selection part is carried out in a roulette way. This means that the general rules are given different probabilities of being selected according to their evaluation (i.e. fitness) in the previous generation. General rules with high fitness have a higher chance of being selected as the root node of the next node, thereby promoting the inheritance of excellent characteristics. In the crossover part of the GP algorithm, a node is randomly selected as the crossover point, and two individuals exchange subtrees at this point. The exchanged subtree uses its intersection as the new root node. This operation is equivalent to recombining different parts of the general rule to generate individuals with new characteristics. The mutation part involves randomly selecting a node as the mutation point, and then generating a new subtree for the individual containing the node to replace the original subtree. During the evolution of GP rules, mathematical operations between general rules will produce incompatible or meaningless combinations, such as Rule1 / (Rule3+Rule8). In order to ensure the effectiveness and rationality of the rules, each time a combination rule is used, the priority will be normalized to avoid conflicts or invalid operations in the combination rule in practical applications. After a series of iterations, the GP algorithm finally selects the best 8 high-quality GP rules from the total of the last iteration.
[0060] In the online application phase, real-time computer resource allocation is performed based on the optimal strategy and action space obtained in offline learning. According to the current state of the task pool and the availability of the machine, computer resources are intelligently scheduled to ensure that all operations are completed within the latest completion time limit, while optimizing the lead time as much as possible to improve the efficiency and punctuality of overall project execution.
[0061] This process starts from the construction of the environment, to the training of the deep reinforcement learning model and the optimization of the rules, and finally to the online application of real-time scheduling, forming a closed-loop dynamic optimization process, which aims to solve the resource scheduling problem when multiple jobs are executed in parallel. Through the optimization of the rules in the offline learning stage, better decisions can be made in the online application stage, effectively responding to various emergencies and resource constraints, and improving the intelligent level of scheduling and the overall execution efficiency of the project.
[0062] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0063] In the present embodiment, a device for determining a scheduling strategy is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0064] Figure 5 is a structural block diagram of a device for determining a scheduling strategy according to an embodiment of the present application, the device comprising:
[0065] A first determining module 50 is used to determine a first scheduling rule of a computer resource according to the operation time of each of at least two tasks to be scheduled, wherein the computer resource is used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority order of the at least two tasks to be scheduled and a machine allocation rule for indicating an initial scheduling strategy of the computer resource;
[0066] A second determining module 52, configured to determine a second scheduling rule for the computer resources according to the multi-job sequencing rule and the machine allocation rule;
[0067] The third determination module 54 is used to adjust the second scheduling rule by a genetic programming algorithm to obtain a third scheduling rule, and determine the scheduling strategy of the computer resources according to the third scheduling rule.
[0068] Through the above device, the first scheduling rule of computer resources is determined according to the operation time of each of at least two tasks to be scheduled, wherein the computer resources are used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority of the at least two tasks to be scheduled and a machine allocation rule for indicating the initial scheduling strategy of the computer resources; the second scheduling rule of the computer resources is determined according to the multi-job sorting rule and the machine allocation rule; the second scheduling rule is adjusted by a genetic programming algorithm to obtain a third scheduling rule, and the scheduling strategy of the computer resources is determined according to the third scheduling rule. This solves the problem in the related art that the scheduling of computer resources is determined by manual judgment, resulting in an unreasonable scheduling strategy of computer resources.
[0069] In an exemplary embodiment, the first determination module 50 is also used to determine the first operation with the shortest operation time and the second operation with the longest operation time from the operation times of the at least two tasks to be scheduled, and determine the first task with the shortest remaining time and the second task with the longest remaining time among the at least two tasks to be scheduled based on the latest completion time of the at least two tasks to be scheduled and the current time; determine the multi-job sorting rule based on the first operation, the second operation, the first task to be scheduled and the second task to be scheduled, and determine the machine allocation rule based on the first computer resource with the slowest execution speed and the second computer resource with the fastest execution speed among the computer resources; determine the multi-job sorting rule and the machine allocation rule as the first scheduling rule.
[0070] In an exemplary embodiment, the second determination module 52 is also used to determine a first rule including the first operation and the second operation in the multi-job sorting rules, a second rule including the first task to be scheduled and the second task to be scheduled in the multi-job sorting rules, and a third rule including the first computer resource and the second computer resource in the machine allocation rules, wherein the first rule, the second rule and the third rule each contain at least two rules; a preset number of rules in the first rule, a preset number of rules in the second rule and a preset number of rules in the third rule are combined to obtain the second scheduling rule, wherein each rule in the second scheduling rule is not repeated.
[0071] In an exemplary embodiment, the third determination module 54 is further configured to stop allocating any of the at least two tasks to be scheduled to the target computer when the target computer is in an unavailable state, wherein the target computer is any computer in the computer resources.
[0072] In an exemplary embodiment, the third determination module 54 is further used to determine the reason why the target computer is unavailable when the target computer is in an unavailable state, and determine the time required for the target computer to recover to an available state based on the reason why the target computer is unavailable, wherein the target computer is any computer in the computer resources; when the difference between the current time and the time when the target computer is in an unavailable state reaches the time required for the target computer to recover to an available state, determine whether the target computer is in the available state; and when it is determined that the target computer is in the available state, continue to allocate the at least two tasks to be scheduled to the target computer according to the third scheduling rule.
[0073] In an exemplary embodiment, the third determination module 54 is also used to place the second task into the buffer of the third computer resource when the third computer resource is processing the first task and the third computer resource receives the second task, wherein the third computer resource is a computer in the computer resource determined according to the third scheduling rule for processing the first task and the second task, and the first task and the second task are the tasks to be processed by the third computer resource among the at least two tasks to be scheduled determined according to the third scheduling rule; after the third computer resource has processed the first task and the third computer resource is in an available state, determine whether the priority of the second task is higher than other tasks in the buffer, wherein the other tasks are the tasks to be scheduled in all the tasks to be scheduled in the buffer except the second task; when it is determined that the priority of the second task is higher than that of the other tasks, instruct the third computer resource to process the second task.
[0074] In an exemplary embodiment, the third determination module 54 is also used to place the first task into the cache area of the third computer resource when the third computer resource is processing the first task and the third computer resource is unavailable at the current time, wherein the third computer resource is a computer in the computer resource determined according to the third scheduling rule for processing the first task, and the first task is a task to be processed by the third computer resource among the at least two tasks to be scheduled determined according to the third scheduling rule; and continue to process the first task when the third computer resource resumes an available state.
[0075] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0076] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0077] S1, determining a first scheduling rule for computer resources according to the operation time of each of at least two tasks to be scheduled, wherein the computer resources are used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority order of the at least two tasks to be scheduled and a machine allocation rule for indicating an initial scheduling strategy for the computer resources;
[0078] S2, determining a second scheduling rule for the computer resources according to the multi-job sorting rule and the machine allocation rule;
[0079] S3, adjusting the second scheduling rule through a genetic programming algorithm to obtain a third scheduling rule, and determining a scheduling strategy for the computer resources according to the third scheduling rule.
[0080] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0081] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0082] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0083] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0084] S1, determining a first scheduling rule for computer resources according to the operation time of each of at least two tasks to be scheduled, wherein the computer resources are used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority order of the at least two tasks to be scheduled and a machine allocation rule for indicating an initial scheduling strategy for the computer resources;
[0085] S2, determining a second scheduling rule for the computer resources according to the multi-job sorting rule and the machine allocation rule;
[0086] S3, adjusting the second scheduling rule through a genetic programming algorithm to obtain a third scheduling rule, and determining a scheduling strategy for the computer resources according to the third scheduling rule.
[0087] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0088] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0089] Optionally, in this embodiment, the above computer program may be configured to implement the following steps when executed by a processor:
[0090] S1, determining a first scheduling rule for computer resources according to the operation time of each of at least two tasks to be scheduled, wherein the computer resources are used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority order of the at least two tasks to be scheduled and a machine allocation rule for indicating an initial scheduling strategy for the computer resources;
[0091] S2, determining a second scheduling rule for the computer resources according to the multi-job sorting rule and the machine allocation rule;
[0092] S3, adjusting the second scheduling rule through a genetic programming algorithm to obtain a third scheduling rule, and determining a scheduling strategy for the computer resources according to the third scheduling rule.
[0093] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0094] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0095] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for determining a scheduling strategy, characterized in that: include: Determining a first scheduling rule for computer resources according to the operation time consumption of each of at least two tasks to be scheduled, wherein the computer resources are used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority order of the at least two tasks to be scheduled and a machine allocation rule for indicating an initial scheduling strategy for the computer resources; Determine a second scheduling rule for the computer resources according to the multi-job sequencing rule and the machine allocation rule; The second scheduling rule is adjusted by a genetic programming algorithm to obtain a third scheduling rule, and the scheduling strategy of the computer resources is determined according to the third scheduling rule.
2. The method for determining a scheduling strategy according to claim 1, characterized in that: Determining a first scheduling rule for computer resources according to the operation time consumption of each of at least two tasks to be scheduled includes: Determine a first operation with the shortest operation time and a second operation with the longest operation time from the operation times of the at least two tasks to be scheduled, and determine the first task with the shortest remaining time and the second task with the longest remaining time among the at least two tasks to be scheduled according to the latest completion time of the at least two tasks to be scheduled and the current time; Determine the multi-job sorting rule according to the first operation, the second operation, the first task to be scheduled, and the second task to be scheduled, and determine the machine allocation rule according to the first computer resource with the slowest execution speed and the second computer resource with the fastest execution speed among the computer resources; The multi-job sequencing rule and the machine allocation rule are determined as the first scheduling rule.
3. The method for determining a scheduling strategy according to claim 2, characterized in that: Determining the second scheduling rule of the computer resources according to the multi-job sequencing rule and the machine allocation rule includes: Determine a first rule including the first operation and the second operation in the multi-job sorting rule, a second rule including the first task to be scheduled and the second task to be scheduled in the multi-job sorting rule, and a third rule including the first computer resource and the second computer resource in the machine allocation rule, wherein the first rule, the second rule and the third rule each include at least two rules; A preset number of rules in the first rule, a preset number of rules in the second rule and a preset number of rules in the third rule are combined to obtain the second scheduling rule, wherein each rule in the second scheduling rule is not repeated.
4. The method for determining a scheduling strategy according to claim 1, characterized in that: After determining the scheduling strategy of the computer resources according to the third scheduling rule, the method further includes: When a target computer is in an unavailable state, stop allocating any one of the at least two tasks to be scheduled to the target computer, wherein the target computer is any one of the computer resources.
5. The method for determining a scheduling strategy according to claim 1, characterized in that: After determining the scheduling strategy of the computer resources according to the third scheduling rule, the method further includes: In the case where the target computer is in an unavailable state, determining the reason why the target computer is unavailable, and determining the time required for the target computer to recover to an available state according to the reason why the target computer is unavailable, wherein the target computer is any computer in the computer resources; In the case where the difference between the current time and the time when the target computer is in the unavailable state reaches the time required for the target computer to recover to the available state, determining whether the target computer is in the available state; When it is determined that the target computer is in the available state, the at least two tasks to be scheduled continue to be allocated to the target computer according to the third scheduling rule.
6. The method for determining a scheduling strategy according to claim 1, characterized in that: After determining the scheduling strategy of the computer resources according to the third scheduling rule, the method further includes: When a third computer resource is processing a first task and the third computer resource receives a second task, the second task is placed in a buffer of the third computer resource, wherein the third computer resource is a computer in the computer resource determined according to the third scheduling rule for processing the first task and the second task, and the first task and the second task are tasks to be processed by the third computer resource in the at least two tasks to be scheduled determined according to the third scheduling rule; When the third computer resource has processed the first task and the third computer resource is in an available state, determining whether the priority of the second task is higher than other tasks in the buffer, wherein the other tasks are tasks to be scheduled in the buffer except the second task; In case it is determined that the priority of the second task is higher than that of the other tasks, the third computer resource is instructed to process the second task.
7. The method for determining a scheduling strategy according to claim 1, characterized in that: After determining the scheduling strategy of the computer resources according to the third scheduling rule, the method further includes: When a third computer resource is processing a first task and the third computer resource is unavailable at the current time, placing the first task into a cache area of the third computer resource, wherein the third computer resource is a computer in the computer resource determined according to the third scheduling rule for processing the first task, and the first task is a task to be processed by the third computer resource in the at least two tasks to be scheduled determined according to the third scheduling rule; When the third computer resource is restored to an available state, the first task continues to be processed.
8. A device for determining a scheduling strategy, characterized in that: include: A first determining module is used to determine a first scheduling rule of a computer resource according to the operation time consumption of each of at least two tasks to be scheduled, wherein the computer resource is used to schedule the at least two tasks to be scheduled, and the first scheduling rule includes: a multi-job sorting rule for indicating the priority order of the at least two tasks to be scheduled and a machine allocation rule for indicating an initial scheduling strategy of the computer resource; A second determining module, configured to determine a second scheduling rule for the computer resources according to the multi-job sorting rule and the machine allocation rule; The third determination module is used to adjust the second scheduling rule through a genetic programming algorithm to obtain a third scheduling rule, and determine the scheduling strategy of the computer resources according to the third scheduling rule.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.