CN111459655B - Deterministic method for solving optimal solution of multiprocessor overload scheduling problem - Google Patents
Deterministic method for solving optimal solution of multiprocessor overload scheduling problem Download PDFInfo
- Publication number
- CN111459655B CN111459655B CN202010141625.5A CN202010141625A CN111459655B CN 111459655 B CN111459655 B CN 111459655B CN 202010141625 A CN202010141625 A CN 202010141625A CN 111459655 B CN111459655 B CN 111459655B
- Authority
- CN
- China
- Prior art keywords
- task
- rule
- slice
- clause
- maxsat
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
The invention discloses a deterministic method for solving the optimal solution of multiprocessor overload scheduling problem, the algorithm comprises the steps of (S1) determining the scheduling problem, and coding the regular attribute of the scheduling problem into a MaxSAT hard clause; (S2) encoding the scheduling target as a MaxSAT soft clause; (S3) connecting the hard clause obtained in the step (S1) and the soft clause obtained in the step (S2) by a conjunction operator, thereby obtaining a MaxSAT problem; (S4) calculating an optimal solution of the MaxSAT problem by the MaxSAT solver. Through the scheme, the invention achieves the purpose of obtaining the optimal scheduling scheme of the multiprocessor scheduling system, and has strong expandability, practical value and popularization value.
Description
Technical Field
The invention belongs to the technical field of computer application, and particularly relates to a deterministic algorithm for solving an optimal solution of a multiprocessor overload scheduling problem.
Background
The scheduling problem on multiprocessors has long been studied extensively. Since Graham et al expressed the scheduling problem in the form of α | β | γ for processor attributes, task attributes, scheduling objectives in 1979, much research has been devoted to the complexity analysis of the scheduling problem, i.e., the complexity of the problem is analyzed by adjusting the α, β, γ attributes of the scheduling problem. For example: p | pmtn | Sigma Uj(preemptible scheduling on parallel processors, all tasks ready at the same time, with the goal of maximizing the number of tasks completed by the deadline) proved to be an NP-hard problem in 1983. If the tasks have different ready times, the problem is denoted as P | pmtn, rj|∑UjDu et al demonstrate that when the number of processors is 2, the problem is already an NP-hard problem. Assigning different weights to each task further increases the difficulty of the problem, for example: p | pmtn, Pj=p|∑Uj(preemptible scheduling on parallel processors, all tasks being ready at the same time and task processing being equal in duration, with the goal of maximizing the number of tasks completed before the deadline) is a polynomial solvable problem, and P | pmtn, Pj=p|∑wjUj(preemptible scheduling on parallel processors, all tasks being ready at the same time and task processing being equal in duration, with the goal of maximizing the sum of the task weights completed by the deadline) is an NP-hard problem. Due to the difficulty of the multiprocessor scheduling problem, there are currently many approaches to P | pmtn, rj|∑wjUj(preemptible scheduling on parallel processors, all tasks having different ready times, with the goal of maximizing the sum of the weights of the tasks completed before the deadline) problem, the solving algorithm only works onApproximate solutions to the problem are found which, while giving a more efficient scheduling scheme than the classical scheduling algorithm, do not ensure that the output approximate solution is stable close to the optimal solution.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a deterministic algorithm for solving the optimal solution of the multiprocessor overload scheduling problem, the scheduling is carried out in a preemptible mode according to different task ready times, and the aim is to maximize the sum of task weights completed before the deadline so as to determine the optimal solution of the scheduling problem.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a deterministic algorithm for solving an optimal solution of a multiprocessor overload scheduling problem comprises the following steps:
(S1) determining a scheduling problem, encoding a rule attribute of the scheduling problem into a MaxSAT hard clause;
(S2) encoding the scheduling target as a MaxSAT soft clause;
(S3) connecting the hard clause obtained in the step (S1) and the soft clause obtained in the step (S2) by a conjunction operator, thereby obtaining a MaxSAT problem;
(S4) calculating an optimal solution of the MaxSAT problem by the MaxSAT solver.
Further, the MaxSAT hard clause corresponding to the rule attribute coded in the step (S1) should satisfy the following rule at the same time;
rule one is as follows:
any task slicing must be performed by some single processor, encoding this rule attribute as a hard clause as shown in equation (1):
wherein the content of the first and second substances,is a Boolean variable representing the ith slice f of task ji jIs arranged in the processor MuExecuting;
rule two:
when the k-th slice of task iAnd the ith slice f of task jl jWhen there is an overlap in the execution time periods of the same processor, there is a possibility thatBefore fl jCarry out either ofl jPrior to the generation ofExecuting, encoding such rule attribute into a hard clause shown in formula (2):
wherein the content of the first and second substances,is a Boolean variable representing the kth slice of task iIs arranged in the processor MuThe upper side is executed in the upper part,is a Boolean variable representing the kth slice of task iThe ith slice f preceding task jl jThe execution is carried out in such a way that,is a boolean variable indicating that the ith slice of task j is executed before the kth slice of task i;
rule three:
the start time of the ith slice of task j is no earlier than the completion time of all task slices before it, and this rule attribute is encoded as a hard clause as shown in equation (3):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j starts executing after time t or t, pjIs the execution duration of the task j, and since any unit time gap of the task in the execution process can be preempted, pjAlso indicates the number of the fragments of the task j and the sequence number of the last fragment of the task, rjIs the ready time of task j, n is the total number of system tasks;
rule four:
the ith fragment of task j is executed before the (i + 1) th fragment of task j, and the rule attribute is encoded into a hard clause shown in formula (4):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j is executed before the (i + 1) th slice of task j;
rule five:
when task slicing fi jStarting at or after time t, it must start after t-1 or t-1, and encodes this rule attribute as a hard clause as shown in equation (5):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j begins execution after time t or t,is a Boolean variable which indicates that the ith slice of the task j starts to be executed after the time t-1 or t-1;
rule six:
when a task ends at t, its last slice must start at or before time t-1, and this rule attribute is encoded as a hard clause as shown in equation (6):
wherein, ebjIs a boolean variable that indicates that task j completes before its deadline,is a Boolean variable representing the pth of task jjThe slicing starts to be executed after time t or t.
Further, for the Boolean variables that occurred in rule two and rule fourIt is used to generate a hard clause represented by equation (7):
where t and t' should satisfy, ri+k(k-1)/2≤t≤di-(k+pi)(pi-k+1)/2+1,
Wherein r isjIs the ready time of task j, djIs the deadline for task j.
Specifically, in the step (S2), the scheduling objective maximizes the sum of the weights of tasks completed by the deadline, and is encoded as a MaxSAT weighted soft clause expressed by equation (8):
(ebj,wj)(1≤j≤n) (8)
wherein, wjIndicating the revenue obtained from completing task j.
Compared with the prior art, the invention has the following beneficial effects:
(1) the invention obtains the MaxSAT problem by encoding the task attribute and the scheduling target into the MaxSAT clause and connecting the maxSAT clause and the maxSAT clause by using the conjunction operator, and obtains the optimal scheduling scheme by using the MaxSAT solver. Compared with the prior art, the method can obtain the optimal scheduling scheme of the multiprocessor scheduling system, is suitable for occasions where the same scheduling problem repeatedly occurs, and has strong expandability, practical value and popularization value.
(2) The invention has strong expandability and execution efficiency, and can be used for solving the situation that the task attribute changes, such as: and the task ready time is changed, and the preemptive/non-preemptive scheduling method is switched.
Drawings
FIG. 1 is a flow chart of the operation of the present invention.
Detailed Description
The present invention is further illustrated by the following figures and examples, which include, but are not limited to, the following examples.
Examples
As shown in fig. 1, a deterministic algorithm for solving an optimal solution of a multiprocessor overload scheduling problem includes the following specific steps:
(S1) determining a scheduling problem, and encoding the task attribute of the scheduling problem into a MaxSAT hard clause corresponding to the task attribute, wherein the following rules are satisfied simultaneously during encoding;
rule one is as follows: any task slicing must be performed by some single processor, encoding this rule attribute as a hard clause as shown in equation (1):
wherein the content of the first and second substances,is a Boolean variable representing the ith slice f of task ji jIs arranged in the processor MuExecuting;
rule two: when the k-th slice of task iAnd the ith slice f of task jl jWhen there is an overlap in the execution time periods of the same processor, there is a possibility thatBefore fl jCarry out either ofl jPrior to the generation ofExecuting, encoding such rule attribute into a hard clause shown in formula (2):
wherein the content of the first and second substances,is a Boolean variable representing the kth slice of task iIs arranged in the processor MuThe upper side is executed in the upper part,is a Boolean variable representing the kth slice of task iThe ith slice f preceding task jl jThe execution is carried out in such a way that,is a boolean variable indicating that the ith slice of task j is executed before the kth slice of task i;
rule three: the start time of the ith slice of task j is no earlier than the completion time of all task slices before it, and this rule attribute is encoded as a hard clause as shown in equation (3):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j starts executing after time t or t, pjIs the execution duration of the task j, and since any unit time gap of the task in the execution process can be preempted, pjAlso indicates the number of the fragments of the task j and the sequence number of the last fragment of the task, rjIs the ready time of task j, n is the total number of system tasks;
rule four: the ith fragment of task j is executed before the (i + 1) th fragment of task j, and the rule attribute is encoded into a hard clause shown in formula (4):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j is executed before the (i + 1) th slice of task j;
rule five: when task slicing fi jStarting at or after time t, it must start after t-1 or t-1, and encodes this rule attribute as a hard clause as shown in equation (5):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j begins execution after time t or t,is a Boolean variable which indicates that the ith slice of the task j starts to be executed after the time t-1 or t-1;
rule six: when a task ends at t, its last slice must start at or before time t-1, and this rule attribute is encoded as a hard clause as shown in equation (6):
wherein, ebjIs a boolean variable that indicates that task j completes before its deadline,is a Boolean variable representing the pth of task jjOne slice (i.e., the last slice) starts to execute after time t or t.
For both the Boolean variables present in rule two and rule fourIt is used to generate a hard clause represented by equation (7):
where t and t' should satisfy, ri+k(k-1)/2≤t≤di-(k+pi)(pi-k+1)/2+1,
Wherein r isjIs the ready time of task j, djIs the deadline for task j.
(S2) encoding the scheduling objective as a MaxSAT weighted soft clause implementing the scheduling objective: maximizing the sum of the weights of tasks completed before the cutoff time is shown in equation (8):
(ebj,wj)(1≤j≤n) (8)
wherein, wjIndicating the revenue obtained from completing task j.
(S3) connecting the hard clause obtained in the step (S1) and the soft clause obtained in the step (S2) by a conjunction operator a, thereby obtaining a MaxSAT problem;
(S4) calculating an optimal solution of the MaxSAT problem by the MaxSAT solver, the optimal solution including the start execution time of each task slice, whereby an optimal scheduling scheme can be obtained.
The above embodiments are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention, but all changes that can be made by applying the principles of the present invention and performing non-inventive work on the basis of the principles shall fall within the scope of the present invention.
Claims (1)
1. A deterministic method for solving an optimal solution of a multiprocessor overload scheduling problem is characterized by comprising the following steps:
(S1) determining a scheduling problem, encoding a rule attribute of the scheduling problem into a MaxSAT hard clause; wherein, the rule attribute is coded into the MaxSAT hard clause corresponding to the rule attribute, and the MaxSAT hard clause simultaneously satisfies the following rules;
rule one is as follows:
any task slicing must be performed by some single processor, encoding this rule attribute as a hard clause as shown in equation (1):
wherein the content of the first and second substances,is a Boolean variable representing the ith slice f of task ji jIs arranged in the processor MuExecuting;
rule two:
when the k-th slice of task iAnd the ith slice f of task jl jWhen there is an overlap in the execution time periods of the same processor, there is a possibility thatBefore fl jCarry out either ofl jPrior to the generation ofExecuting, encoding such rule attribute into a hard clause shown in formula (2):
wherein the content of the first and second substances,is a Boolean variable representing the kth slice of task iIs arranged in the processor MuThe upper side is executed in the upper part,is a Boolean variable representing the kth slice of task iThe ith slice f preceding task jl jThe execution is carried out in such a way that,is a boolean variable indicating that the ith slice of task j is executed before the kth slice of task i;
rule three:
the start time of the ith slice of task j is no earlier than the completion time of all task slices before it, and this rule attribute is encoded as a hard clause as shown in equation (3):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j starts executing after time t or t, pjIs the execution duration of the task j, and since any unit time gap of the task in the execution process can be preempted, pjAlso indicates the number of the fragments of the task j and the sequence number of the last fragment of the task, rjIs the ready time of task j, n is the total number of system tasks;
rule four:
the ith fragment of task j is executed before the (i + 1) th fragment of task j, and the rule attribute is encoded into a hard clause shown in formula (4):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j is executed before the (i + 1) th slice of task j;
rule five:
when task slicing fi jStarting at or after time t, it must start after t-1 or t-1, and encodes this rule attribute as a hard clause as shown in equation (5):
wherein the content of the first and second substances,is a boolean variable indicating that the ith slice of task j begins execution after time t or t,is a Boolean variable which indicates that the ith slice of the task j starts to be executed after the time t-1 or t-1;
rule six:
when a task ends at t, its last slice must start at or before time t-1, and this rule attribute is encoded as a hard clause as shown in equation (6):
wherein, ebjIs a boolean variable that indicates that task j completes before its deadline,is a Boolean variable representing the pth of task jjThe slicing is started to be executed after t or t time;
rule seven:
for the saidBoolean variables present in rule two and rule fourIt is used to generate a hard clause represented by equation (7):
where t and t' should satisfy, ri+k(k-1)/2≤t≤di-(k+pi)(pi-k+1)/2+1,
Wherein r isjIs the ready time of task j, djIs the deadline for task j;
(S2) encoding the scheduling target as a MaxSAT soft clause; wherein, the scheduling objective maximizes the sum of the task weights completed before the deadline, and is encoded into a MaxSAT weighted soft clause shown in formula (8):
(ebj,Wj)(1≤j≤n) (8)
wherein, WjRepresenting the revenue gained by completing task j;
(S3) connecting the hard clause obtained in the step (S1) and the soft clause obtained in the step (S2) by a conjunction operator, thereby obtaining a MaxSAT problem;
(S4) calculating an optimal solution of the MaxSAT problem by the MaxSAT solver.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010141625.5A CN111459655B (en) | 2020-03-03 | 2020-03-03 | Deterministic method for solving optimal solution of multiprocessor overload scheduling problem |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010141625.5A CN111459655B (en) | 2020-03-03 | 2020-03-03 | Deterministic method for solving optimal solution of multiprocessor overload scheduling problem |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111459655A CN111459655A (en) | 2020-07-28 |
CN111459655B true CN111459655B (en) | 2022-02-25 |
Family
ID=71679213
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010141625.5A Active CN111459655B (en) | 2020-03-03 | 2020-03-03 | Deterministic method for solving optimal solution of multiprocessor overload scheduling problem |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111459655B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115904705B (en) * | 2022-11-09 | 2023-10-24 | 成都理工大学 | Optimal scheduling method for multiprocessor restricted preemption |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109358954A (en) * | 2018-09-21 | 2019-02-19 | 成都理工大学 | A kind of overload real-time system based on MaxSAT optimal solution can preemption scheduling method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109726362A (en) * | 2017-10-30 | 2019-05-07 | 中国科学院计算技术研究所 | Solve the local search method for solving and system for weighting maximum satisfiability problem |
-
2020
- 2020-03-03 CN CN202010141625.5A patent/CN111459655B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109358954A (en) * | 2018-09-21 | 2019-02-19 | 成都理工大学 | A kind of overload real-time system based on MaxSAT optimal solution can preemption scheduling method |
Also Published As
Publication number | Publication date |
---|---|
CN111459655A (en) | 2020-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108053028B (en) | Data fixed-point processing method and device, electronic equipment and computer storage medium | |
CN110378468A (en) | A kind of neural network accelerator quantified based on structuring beta pruning and low bit | |
CN111459655B (en) | Deterministic method for solving optimal solution of multiprocessor overload scheduling problem | |
Gaussier et al. | Online tuning of EASY-backfilling using queue reordering policies | |
CN106845991A (en) | A kind of rules process method and equipment | |
CN110322153A (en) | Monitor event processing method and system | |
CN112231081B (en) | PSO-AHP-based monotonic rate resource scheduling method and system in cloud environment | |
CN110377525B (en) | Parallel program performance prediction system based on runtime characteristics and machine learning | |
CN109977497B (en) | Parallel method for accelerating general radar signal processing flow based on CPU | |
CN109358954B (en) | Preemptive scheduling method of overload real-time system based on MaxSAT optimal solution | |
Macariu et al. | Timed automata model for component-based real-time systems | |
CN114924887A (en) | Micro-service resource configuration parameter optimization method for electric power trading platform | |
CN114021833A (en) | Line loss prediction method, system, storage medium and computing device | |
CN113961439A (en) | DAG task WCRT calculation method based on SMT method | |
CN109298999B (en) | Core software testing method and device based on data distribution characteristics | |
Dong et al. | A general analysis framework for soft real-time tasks | |
Wang et al. | An improved smt-based scheduling for overloaded real-time systems | |
CN111813512A (en) | High-energy-efficiency Spark task scheduling method based on dynamic partition | |
CN116880404B (en) | Production control method, device, equipment and medium based on constant model | |
CN113033798B (en) | Device and method for reducing precision loss | |
CN115904705B (en) | Optimal scheduling method for multiprocessor restricted preemption | |
CN116992597A (en) | Aeroengine grate flow coefficient design method and device based on GABP | |
CN116339981A (en) | GPU parallel computing method, device, equipment and medium for Prony analysis | |
Yang et al. | Improvement of lottery scheduling algorithm based on machine learning algorithm | |
Song et al. | Research on Parallel Algorithms of Uncertain Combinational Coding |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |