Summary of the invention
The object of the present invention is to provide a kind of three value optical computer method for scheduling task and system based on NEH algorithm,
Cause average response time that cannot optimize to solve the task scheduling strategy of existing three values optical computer, task data processing
The problem of low efficiency.
To achieve the above object, the present invention provides following schemes:
A kind of three value optical computer method for scheduling task based on NEH algorithm, which comprises
Obtain the task time matrix of the multiple tasks to be processed such as the three values optical computer;The task time square
It include the corresponding machine M of task Δ (i) in battle arrayjProcess process time pJ, Δ (i);
Total processing response time of the task Δ (i) is determined according to the task time matrix;
According to total processing response time of the task Δ (i) determine initial arrangement Δ ';
According to the initial arrangement Δ ' determine optimal task schedule sequence;
Had according to the optimal task schedule sequence to multiple tasks to be processed such as the three values optical computers
Sequence processing.
Optionally, total processing response time that the task Δ (i) is determined according to the task time matrix, specifically
Include:
According to the corresponding machine M of the task Δ (i)jProcess process time pJ, Δ (i), using formulaIt determines
Total processing response time T of the task Δ (i)i;Wherein N is general assignment quantity.
Optionally, total processing response time according to the task Δ (i) determine initial arrangement Δ ', specifically include:
According to the corresponding total processing response time T of the task Δ (i)iN number of task drops in sequence from big to small
Sequence arrangement, generate the initial arrangement Δ '.
Optionally, described according to the initial arrangement Δ ' determine optimal task schedule sequence, it specifically includes:
Step (1): by the initial arrangement Δ ' preceding k-1 task composition part arrange Δp, by the initial arrangement
Δ ' k-th of task be inserted into the component arrangement ΔpK possible neutral gears, generate k temporary arrangement;Take the k
The smallest temporary arrangement of average response time is the component arrangement Δ that the k task is constituted in temporary arrangementp;
Step (2): enabling k=k+1, the process of repeating said steps (2), until all N number of tasks are all completed to sort, and makes
Obtain ∑ F (Δp)=minΔ∈Ω∑ F (Δ), the component arrangement Δ obtained at this timepThe as described optimal task schedule sequence Δopt;Its
Middle ∑ F (Δp) it is component arrangement ΔpCorresponding total flowing water response time;∑ F (Δ) is the corresponding total flowing water response of feasible solution Δ
Time;Ω is the feasible zone of feasible solution Δ;minΔ∈Ω∑ F (Δ) is the minimum of feasible solution Δ corresponding total flowing water response time
Value.
Optionally, described according to multiple to be processed to the three values optical computer etc. of the optimal task schedule sequence
Task is orderly handled, and is specifically included:
By the optimal task schedule sequence ΔoptIn i-th of task Δopt(i) data in are divided into n group;
The n group data are inputted in the continuous productive process model of the three values optical computer, sequentially to the n group data
It is handled;It include T and W converter, T ' and W ' converter and T converter in the continuous productive process model.
A kind of three value optical computer task scheduling systems based on NEH algorithm, the system comprises:
Task time matrix obtains module, for obtaining appointing for the multiple tasks to be processed such as the three values optical computer
Business time matrix;It include the corresponding machine M of task Δ (i) in the task time matrixjProcess process time pJ, Δ (i);
Total processing response time determining module, for determining the total of the task Δ (i) according to the task time matrix
The processing response time;
Initial arrangement determining module, for determining initial arrangement according to total processing response time of the task Δ (i)
Δ′;
Optimal task schedule sequence determining module, for according to the initial arrangement Δ ' determine optimal task schedule sequence;
Task scheduling processing module, for being waited according to the optimal task schedule sequence the three values optical computer
The multiple tasks of processing are orderly handled.
Optionally, total processing response time determining module specifically includes:
Total processing response time determination unit, for according to the corresponding machine M of the task Δ (i)jProcess process time
pJ, Δ (i), using formulaDetermine total processing response time T of the task Δ (i)i;Wherein N is general assignment number
Amount.
Optionally, the initial arrangement determining module specifically includes:
Initial arrangement determination unit, for according to the corresponding total processing response time T of the task Δ (i)iFrom big to small
Sequence to N number of task carry out descending arrangement, generate the initial arrangement Δ '.
Optionally, the optimal task schedule sequence determining module specifically includes:
Iterative processing unit, for by the initial arrangement Δ ' preceding k-1 task composition part arrange Δp, will be described
Initial arrangement Δ ' k-th of task be inserted into the component arrangement ΔpK possible neutral gears, generate k temporary arrangement;It takes
The smallest temporary arrangement of average response time is the component arrangement that the k task is constituted in the k temporary arrangement
Δp;
Optimal task schedule sequence determination unit returns to the iterative processing unit, until all N for enabling k=k+1
A task is all completed to sort, and makes ∑ F (Δp)=minΔ∈Ω∑ F (Δ), the component arrangement Δ obtained at this timepAs it is described most
Excellent task schedule sequence Δopt;Wherein ∑ F (Δp) it is component arrangement ΔpCorresponding total flowing water response time;∑ F (Δ) is feasible
Solve Δ corresponding total flowing water response time;Ω is the feasible zone of feasible solution Δ;minΔ∈Ω∑ F (Δ) is that feasible solution Δ is corresponding total
The minimum value of flowing water response time.
Optionally, the task scheduling processing module specifically includes:
Task data grouped element is used for the optimal task schedule sequence ΔoptIn i-th of task Δopt(i) in
Data be divided into n group;
Continuous productive process model treatment unit, the flowing water for the n group data to be inputted to the three values optical computer are made
In industry model, sequentially the n group data are handled;It include T and W converter, T ' and W ' change in the continuous productive process model
Parallel operation and T converter.
The specific embodiment provided according to the present invention, the invention discloses following technical effects:
The present invention provides a kind of three value optical computer method for scheduling task and system based on NEH algorithm, the method
The task time matrix of the multiple tasks to be processed such as three value optical computers is obtained first;It is true according to the task time matrix
Determine total processing response time of task Δ (i);According to total processing response time of the task Δ (i) determine initial arrangement Δ ';
According to the initial arrangement Δ ' determine optimal task schedule sequence;Finally according to the optimal task schedule sequence to described three
The multiple tasks to be processed such as value optical computer are orderly handled.The method of the present invention refers to by performance of average response time
Mark carries out task schedule optimization based on NEH algorithm, so that the task of three value optical computers be made to handle using pipelining
Efficiency is improved, and overall performance is advanced optimized.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The object of the present invention is to provide a kind of three value optical computer method for scheduling task and system based on NEH algorithm,
Cause average response time that cannot optimize to solve the task scheduling strategy of existing three values optical computer, task data processing
The problem of low efficiency.
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real
Applying mode, the present invention is described in further detail.
Pipeline schedule (flow-shop scheduling, FSS) problem is a kind of engineering problem for being worth research, master
Wanting task is exactly the processing sequence that each task is determined in limited resource constraint, process time, with being optimal
Productive target, i.e. average response time reaches minimum.Machine can only once handle a subtask, and subtask is once must
It must continue until completing.Assuming that the processing time needed for operation i on machine j is tij.Processing only on machine 1 is complete
Cheng Hou could handle operation by machine 2.Flow scheduling problem is the processing sequence of determining operation, so that average response timeReach minimum, wherein n is job task quantity, the response time refer to task waiting time and the processing time it
With.Simultaneous distillation-extractor is famous one of scheduling problem, wherein the same sequential flow water problems of two machines can be used
Johnson algorithm acquires optimal solution, but still is NP (non-deterministic polynomial) complete problem.
The solution space of np complete problem is related to multiple shot array, so the method for effectively solving np complete problem is not deposited at present
In.For problems, modern science mainly uses heuritic approach.Heuristic algorithm mainly includes tabu search algorithm, loses
Propagation algorithm, simulated annealing, artificial neural network etc..NEH (the Nawaz-Enscore- proposed by three people such as Nawaz
Ham) algorithm is considered optimal.The core concept of the NEH algorithm is mainly the task in the task time matrix that will be given,
Descending arrangement is carried out by the average response time of task, then takes the first two task in sequence, finds wherein the smallest average sound
Corresponding sequence results between seasonable.For k-th task k=3 ..., n, in k possible positions, insert it into so that
Thus the smallest position of the average response time of partial sequence obtains the minimum average B configuration response time corresponding of entire task-set
Business sequence.However, NEH algorithm is mainly used at present in Job-Shop and pipeline schedule, the present invention is quasi- with MSD
For (modified signed digit) adder calculator, three value optical computer task schedules are carried out using NEH algorithm
Optimization.
Fig. 1 is the flow chart of the three value optical computer method for scheduling task provided by the invention based on NEH algorithm.Referring to
Fig. 1, the three value optical computer method for scheduling task provided by the invention based on NEH algorithm specifically include:
Step 101: obtaining the task time matrix of the multiple tasks to be processed such as the three values optical computer.
The input of NEH algorithm of the present invention is task time matrix, and algorithm output is optimal task schedule sequence.Algorithm
In task refer to not entering three value optical computer processors in state of saving bit by bit etc. task to be processed.And this hair
Bright NEH algorithm is to use the task time matrix of N number of task as input, i.e., according to the tool for actually calculating each task
Body handles the time, so that task time matrix (prior art) is obtained, the input as entire algorithm.
It include the corresponding machine M of task Δ (i) in the task time matrix of algorithm inputjProcess process time
pJ, Δ (i).The process time of process can according to etc. the intrinsic property parameters of task amount combination machine to be processed be calculated.Its
Middle task Δ (i) is also a feasible solution of scheduling.MjIt refers to the machine in NEH algorithm, is in three value optical computers
Three parts (T and W converter, T ' and W ' converter and T converter) that processor is divided into are used as three machines, to ask
Solve the optimal task schedule sequence of three machines.
Step 102: total processing response time of the task Δ (i) is determined according to the task time matrix.
Machine M is corresponded to N number of taskjProcess process time pJ, Δ (i)Progress read group total obtains the total of task Δ (i) and adds
Work response time Ti, total processing response time TiCalculation formula it is as follows:
Wherein N is general assignment quantity, and task Δ (i) may be considered i-th of task in N number of task, machine MjIt can be with
The jth platform machine being considered in M platform machine.M=3 in the present invention.
Step 103: according to total processing response time of the task Δ (i) determine initial arrangement Δ '.
According to the corresponding total processing response time T of the task Δ (i)iN number of task drops in sequence from big to small
Sequence arrangement, generate the initial arrangement Δ '.The i.e. described initial arrangement Δ ' in include N number of task, the initial arrangement Δ ' in
1st task is to the corresponding total processing response time T of n-th taskiIt is sequentially reduced.
Step 104: according to the initial arrangement Δ ' determine optimal task schedule sequence.
The process for determining the optimal task schedule sequence is an iterative process, is specifically included:
Step (1): enabling k=1, at this time by the initial arrangement Δ ' preceding k-1 task composition part arrange Δp, by institute
State initial arrangement Δ ' k-th of task be inserted into the component arrangement ΔpK possible neutral gears in, generate k interim rows
Column;Taking the smallest temporary arrangement of average response time in the k temporary arrangement is that the part that the k task is constituted is arranged
Column Δp;(wherein a task is ranked up when k means for 1, k is that 2 representatives are ranked up second task, with this
Analogize).
Step (2): enabling k=k+1, the process of repeating said steps (2), until all N number of tasks are all completed to sort, and makes
Obtain ∑ F (Δp)=minΔ∈Ω∑ F (Δ), the component arrangement Δ obtained at this timepThe as described optimal task schedule sequence Δopt。
Wherein ∑ F (Δp) it is component arrangement ΔpCorresponding total flowing water response time.Δ=(Δ (1), Δ (2) ..., Δ
(n)) ∈ Ω is a feasible solution of scheduling, and n is the quantity for the solution for including in feasible solution Δ, and Ω is the feasible zone of feasible solution Δ.
∑ F (Δ) is feasible solution Δ corresponding total flowing water response time;minΔ∈Ω∑ F (Δ) is the corresponding total flowing water response of feasible solution Δ
The minimum value of time.
Export the optimal task schedule sequence Δopt, NEH algorithm of the present invention terminates.
Step 105: according to multiple times to be processed to the three values optical computer etc. of the optimal task schedule sequence
Business is orderly handled.
Adder is otherwise fully engaged when traditional electronic computer calculates, therefore can not use continuous productive process.And it is of the invention
3 steps of MSD (modified signed digit) addition point that embodiment provides: step 1, while carrying out T and W transformation;Step 2,
T ' and W ' transformation are carried out simultaneously;Step 3 carries out T transformation.3 step transformation is completed on 4 kinds of logical-arithmetic units, so three value light
Pipelining can be used in the MSD addition for learning computer.For this purpose, three value optical computer processors are carried out reasonable distribution first
And it is reconstructed into five independent logic units shown in Fig. 2 --- T and W converter, T ' and W ' converter and T transformation
Device.
When the optimal task schedule sequence ΔoptIn some task Δopt(i) when reaching, according to processor digit and
Task Δopt(i) digit of data is by task Δ inopt(i) data in are divided into many groups, such as are divided into n group.Assuming that completing 1
Secondary reconstitution time tre=100ns, optical processor digit are 80 000, and processing speed v is the speed v=for carrying out logical conversion
50GB/s, the calculation amount of task are 100GB.By every group of data d after grouped task2For 0.8kB, task is divided into g2=1.31 ×
108Group.
The n group data are inputted in the continuous productive process model of the three values optical computer, sequentially to the n group data
It is handled.It include T and W converter, T ' and W ' converter and T converter in the continuous productive process model.
Fig. 3 is the continuous productive process space-time of the continuous productive process model of the three values optical computer provided in an embodiment of the present invention
Figure.It include two tasks, task 1 and task 2 in Fig. 3.As shown in figure 3, the operation of MSD adder continuous productive process model of the present invention
Process is as follows:
T the and W converter described first is to first group of data D1 0T and W is carried out to convert to obtain D1 1;The T ' and W ' converter
To D1 1It carries out T ' and W ' transformation obtains D1 2While, T the and W converter is to second group of data D2 0Carry out T transformation and W transformation
Obtain D2 1;The T converter is to D1 2T is carried out to convert to obtain operation result R1While, the T ' and W ' converter are to D2 1It carries out
T ' and W ' transformation obtain D2 2, T the and W converter is to third group data D3 0It carries out T transformation and W converts to obtain D3 1... with
This analogizes, until the task Δopt(i) all data calculating finishes, and reprocesses next task Δopt(i+1) ... simple
It is as shown in Figure 3 to change process.
The present invention is by taking MSD add operation as an example, using average response time as performance indicator, using pipelining, is based on
NEH algorithm carries out the task schedule optimization of three value optical computers, so that the task of three value optical computer processors be made to handle
Efficiency is improved, and overall performance is advanced optimized.
Based on the three value optical computer method for scheduling task provided by the invention based on NEH algorithm, the present invention also provides
A kind of three value optical computer task scheduling systems based on NEH algorithm, as shown in figure 4, the system comprises:
Task time matrix obtains module 401, for obtaining the multiple tasks to be processed such as the three values optical computer
Task time matrix;It include the corresponding machine M of task Δ (i) in the task time matrixjProcess process time pJ, Δ (i);
Total processing response time determining module 402, for determining the task Δ (i) according to the task time matrix
Total processing response time;
Initial arrangement determining module 403, for determining initial arrangement according to total processing response time of the task Δ (i)
Δ′;
Optimal task schedule sequence determining module 404, for according to the initial arrangement Δ ' determine optimal task schedule sequence
Column;
Task scheduling processing module 405 is used for according to the optimal task schedule sequence to the three values optical computer
It is orderly handled etc. multiple tasks to be processed.
Wherein, total processing response time determining module 402 specifically includes:
Total processing response time determination unit, for according to the corresponding machine M of the task Δ (i)jProcess process time
pJ, Δ (i), using formulaDetermine total processing response time T of the task Δ (i)i;Wherein N is general assignment number
Amount.
The initial arrangement determining module 403 specifically includes:
Initial arrangement determination unit, for according to the corresponding total processing response time T of the task Δ (i)iFrom big to small
Sequence to N number of task carry out descending arrangement, generate the initial arrangement Δ '.
The optimal task schedule sequence determining module 404 specifically includes:
Iterative processing unit, for by the initial arrangement Δ ' preceding k-1 task composition part arrange Δp, will be described
Initial arrangement Δ ' k-th of task be inserted into the component arrangement ΔpK possible neutral gears, generate k temporary arrangement;It takes
The smallest temporary arrangement of average response time is the component arrangement that the k task is constituted in the k temporary arrangement
Δp;
Optimal task schedule sequence determination unit returns to the iterative processing unit, until all N for enabling k=k+1
A task is all completed to sort, and makes ∑ F (Δp)=minΔ∈Ω∑ F (Δ), the component arrangement Δ obtained at this timepAs it is described most
Excellent task schedule sequence Δopt;Wherein ∑ F (Δp) it is component arrangement ΔpCorresponding total flowing water response time;∑ F (Δ) is feasible
Solve Δ corresponding total flowing water response time;Ω is the feasible zone of feasible solution Δ;minΔ∈Ω∑ F (Δ) is that feasible solution Δ is corresponding total
The minimum value of flowing water response time.
The task scheduling processing module 405 specifically includes:
Task data grouped element is used for the optimal task schedule sequence ΔoptIn i-th of task Δopt(i) in
Data be divided into n group;
Continuous productive process model treatment unit, the flowing water for the n group data to be inputted to the three values optical computer are made
In industry model, sequentially the n group data are handled;It include T and W converter, T ' and W ' change in the continuous productive process model
Parallel operation and T converter.
The present invention proposes three value light by huge position property using three value optical computers and the characteristics such as multi-task parallel
Learn the continuous productive process model of computer.Since task-set all includes multiple tasks under actual job, propose to be based on NEH algorithm
Three value optical computer method for scheduling task and system.The method and system optimize traditional TOC service model, will
Its processing strategie for being improved to continuous productive process model, and task processing sequence is carried out with NEH algorithm into one on this basis
The optimization of step obtains optimal task schedule sequence, to enter continuous productive process model using optimal task schedule sequence, reaches most
The purpose of smallization average response time, so that entire model performance is greatly improved, and for model treatment knot
Fruit has certain reliability.The average response time for effectively shortening task processing improves appointing for three value optical computers
Business treatment effeciency.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment
For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part
It is bright.
Used herein a specific example illustrates the principle and implementation of the invention, and above embodiments are said
It is bright to be merely used to help understand method and its core concept of the invention;At the same time, for those skilled in the art, foundation
Thought of the invention, there will be changes in the specific implementation manner and application range.In conclusion the content of the present specification is not
It is interpreted as limitation of the present invention.