Embodiment
Hereinafter with reference to accompanying drawing, also describe the present invention in detail in conjunction with the embodiments.It should be noted that, in the situation that not conflicting, embodiment and the feature in embodiment in the application can combine mutually.
Figure 1 shows that the process flow diagram of many data processing equipments collaboration working method that preferred embodiment according to the present invention provides.As shown in Figure 1, many data processing equipments collaboration working method that preferred embodiment of the present invention provides comprises step 101-105.
In step 101, a plurality of data processing equipments are processed respectively one or more tasks of its correspondence.
For example, 4 data processing equipments (GPU) are processed respectively its corresponding task, and the task that each GPU is corresponding is as shown in table 1.
Table 1
Wherein, data processing equipment refers to video card.
In step 102, if when the timeslice of the first data processing equipment is greater than the first preset value, will determine task to be migrated according to the priority of task.
For example, the first preset value of the timeslice of each data processing equipment is made as 8, and the priority of task is divided into: the first estate, the second grade and the tertiary gradient.Wherein, in priority, the first estate is higher than the second grade, and the second grade is higher than the tertiary gradient, and priority corresponding to each task is as shown in table 2.
Table 2
Task names |
Task grade |
A |
The first estate |
B |
The tertiary gradient |
C |
The first estate |
D |
The second grade |
E |
The first estate |
F |
The first estate |
G |
The second grade |
H |
The tertiary gradient |
I |
The first estate |
J |
The first estate |
K |
The tertiary gradient |
L |
The second grade |
Content based on table 1 and 2, and the first preset value of the timeslice of each data processing equipment is 8, in the first data processing equipment GPU1, the timeslice sum of existing task is greater than 8, the priority of task A and task C is the first estate, the priority of task B is the tertiary gradient, because the first estate in priority is higher than the tertiary gradient, therefore, determine that to be migrated is task B.
In step 103, described the first data processing equipment, according to the degree of correlation of task in described task to be migrated and other data processing equipments, is determined the second data processing equipment that described task immigration to be migrated arrives;
Described other data processing equipments are the data processing equipment that described task to be migrated was not accessed.
For example, task to be migrated is task B, and the data processing equipment that task B is corresponding is that GPU1 is also that task B accessed data processing equipment GPU1, thereby GPU2, GPU3 and GPU4 are called other data processing equipments.
In the present embodiment, if onrelevant between the processing procedure of task, between task, the degree of correlation is 0.
For example, task A is virus killing, and task C is collection, onrelevant between task A and task C, and the degree of correlation is 0.
In the present embodiment, the degree of correlation directly obtaining between the task of objective result and the task of processing target result is 1; Wherein, the task of described processing target result (being selectable) is inessential task.
For example, task D+ task H=objective result, task L is checking objective result, and task L is selectable inessential task, thereby between task L and task D, the degree of correlation is 1, and between task L and task H, the degree of correlation is 1.
In the present embodiment, the degree of correlation directly obtaining between the task of same objective result is 2.
For example, task D+ task H=objective result, can directly obtain objective result by task D and task H, thereby between task D and task H, the degree of correlation is 2.
In the present embodiment, according to the degree of correlation of task in described task to be migrated and other data processing equipments, determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments, by relatively obtaining the task that the degree of correlation is the highest, using its corresponding data processing equipment as the second data processing equipment.
For example, in task B to be migrated and GPU2, the degree of correlation of task D, E, F is followed successively by 0,2,0; In task B to be migrated and GPU3, the degree of correlation of task G, H, I, J is followed successively by 0,1,1,1; In task B to be migrated and GPU4, the degree of correlation of task K, L is followed successively by 0,1.
Can draw, in task B to be migrated and GPU2, the degree of correlation of task E is 2, and to compare the degree of correlation the highest with other tasks.Therefore the second data processing equipment that task B to be migrated moves to is GPU2, and task B is moved to GPU2.
In the present embodiment, according to the degree of correlation of task in described task to be migrated and other data processing equipments, determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments, by relatively obtaining the task that the degree of correlation is the highest, if the task that the degree of correlation is the highest is present in a plurality of data processing equipments, random selection of task to be migrated moved to one of them data processing equipment, and using it as the second data processing equipment.
For example, in task B to be migrated and GPU2, the degree of correlation of task D, E, F is followed successively by 0,2,0; In task B to be migrated and GPU3, the degree of correlation of task G, H, I, J is followed successively by 0,2,0,1; In task B to be migrated and GPU4, the degree of correlation of task K, L is followed successively by 0,1.
Can draw, in task B to be migrated and GPU2 the degree of correlation of task E and with GPU3 in the degree of correlation of task H be all 2, therefore, select at random GPU2 as the second data processing equipment, task B is moved to GPU2.
In the present embodiment, according to the degree of correlation of task in described task to be migrated and other data processing equipments, determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments, by relatively obtaining the task that the degree of correlation is the highest, if the task that the degree of correlation is the highest is present in a plurality of data processing equipments, using timeslice sum minimum in data processing equipment as the second data processing equipment, by task immigration to be migrated to the second data processing equipment.
For example, in task B to be migrated and GPU2, the degree of correlation of task D, E, F is followed successively by 0,2,0; In task B to be migrated and GPU3, the degree of correlation of task G, H, I, J is followed successively by 0,2,0,1; In task B to be migrated and GPU4, the degree of correlation of task K, L is followed successively by 0,1.
Can draw, in task B to be migrated and GPU2 the degree of correlation of task E and with GPU3 in the degree of correlation of task H be all 2, and the timeslice sum in GPU2 and GPU3 is respectively 6 and 7, the GPU2 that definite timeslice sum is less, as the second data processing equipment of task B to be migrated, moves to GPU2 by task B.
In the present embodiment, according to the degree of correlation of task in described task to be migrated and other data processing equipments, determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments, calculate the degree of correlation sum of task in each data processing equipment, by relatively obtaining the highest data processing equipment of degree of correlation sum, using it as the second data processing equipment.
For example, in task B to be migrated and GPU2, the degree of correlation of task D, E, F is followed successively by 0,2,0; In task B to be migrated and GPU3, the degree of correlation of task G, H, I, J is followed successively by 0,2,0,1; In task B to be migrated and GPU4, the degree of correlation of task K, L is followed successively by 0,1.
Can draw, in GPU2, GPU3 and GPU4, the degree of correlation sum of task is respectively 2,3 and 1, and that wherein degree of correlation sum is the highest is GPU3, thereby task B is moved to GPU3.
In the present embodiment, according to the degree of correlation of task in described task to be migrated and other data processing equipments, determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments, calculate the degree of correlation sum of task in each data processing equipment, by relatively obtaining the highest data processing equipment of degree of correlation sum, if there is the situation that in a plurality of data processing equipments, task equates with the degree of correlation sum of task to be migrated, the random selection of task to be migrated is moved to one of them data processing equipment, and using it as the second data processing equipment.
For example, in task B to be migrated and GPU2, the degree of correlation of task D, E, F is followed successively by 0,2,2; In task B to be migrated and GPU3, the degree of correlation of task G, H, I, J is followed successively by 0,2,1,1; In task B to be migrated and GPU4, the degree of correlation of task K, L is followed successively by 0,1.
Can draw, the degree of correlation sum of the task in GPU2, GPU3 and GPU4 and task B to be migrated is respectively 4,4 and 1, and that degree of correlation sum is the highest is GPU2 and GPU3.Therefore, select at random GPU2 as the second data processing equipment, task B is moved to GPU2.
In the present embodiment, according to the degree of correlation of task in described task to be migrated and other data processing equipments, determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments, calculate the degree of correlation sum of task in each data processing equipment, by relatively obtaining the highest data processing equipment of degree of correlation sum, if there is the situation that in a plurality of data processing equipments, task equates with the degree of correlation sum of task to be migrated, using timeslice sum minimum in data processing equipment as the second data processing equipment, by task immigration to be migrated to the second data processing equipment.
For example, in task B to be migrated and GPU2, the degree of correlation of task D, E, F is followed successively by 0,2,2; In task B to be migrated and GPU3, the degree of correlation of task G, H, I, J is followed successively by 0,2,1,1; In task B to be migrated and GPU4, the degree of correlation of task K, L is followed successively by 0,1.
Can draw, the degree of correlation sum of task in GPU2, GPU3 and GPU4 and task B to be migrated is respectively 4,4 and 1, that degree of correlation sum is the highest is GPU2 and GPU3, and the timeslice sum in GPU2 and GPU3 is respectively 6 and 7, the less GPU2 of timeslice sum is defined as to the second data processing equipment, task B is moved to GPU2.
In step 104, if described task immigration to be migrated is after described the second data processing equipment, the timeslice of described the second data processing equipment is greater than the first preset value, the degree of correlation according to task in described task to be migrated and the data processing equipment of not accessing is determined the 3rd data processing equipment moving to, and by described task immigration to the three data processing equipments to be migrated;
For example, the first preset value of data processing equipment timeslice is 8, and in task B to be migrated and GPU2, the degree of correlation of task D, E, F is followed successively by 0,2,0; In task B to be migrated and GPU3, the degree of correlation of task G, H, I, J is followed successively by 0,0,0,0; In task B to be migrated and GPU4, the degree of correlation of task K, L is followed successively by 0,1.
According to a preferred embodiment in step 103, be described to " according to the degree of correlation of task in described task to be migrated and other data processing equipments; determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments; by relatively obtaining the task that the degree of correlation is the highest, using its corresponding data processing equipment as the second data processing equipment." can draw, task B is moved to after the second data processing equipment GPU2, and the timeslice of GPU2 is 11, is greater than preset value 8; Except task E, that the degree of correlation is the highest is task L, determines that GPU4 is the 3rd data processing equipment, now the timeslice of GPU4 is 7, is less than preset value 8, task B is moved to GPU4.
According to another preferred embodiment in step 103, be described to " according to the degree of correlation of task in described task to be migrated and other data processing equipments; determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments; calculate the degree of correlation sum of task in each data processing equipment; by relatively obtaining the highest data processing equipment of degree of correlation sum, using it as the second data processing equipment." can draw, task B is moved to after the second data processing equipment GPU2, and the timeslice of GPU2 is 11, is greater than preset value 8; Except GPU2, that degree of correlation sum is the highest is GPU4, determines that GPU4 is the 3rd data processing equipment, and now the timeslice of GPU4 is 7, is less than preset value 8, task B is moved to GPU4.
In step 105, if when the migration number of times of described task to be migrated is more than or equal to the second preset value, described task immigration to be migrated is arrived to the minimum data processing equipment of timeslice.
For example, the first preset value of data processing equipment timeslice is 8, and the second preset value of migration number of times is 2, and in task B to be migrated and GPU2, the degree of correlation of task D, E, F is followed successively by 0,2,1; In task B to be migrated and GPU3, the degree of correlation of task G, H, I, J is followed successively by 0,1,0,0; In task B to be migrated and GPU4, the degree of correlation of task K, L is followed successively by 0,0.
According to a preferred embodiment in step 103, be described to " according to the degree of correlation of task in described task to be migrated and other data processing equipments; determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments; by relatively obtaining the task that the degree of correlation is the highest, using its corresponding data processing equipment as the second data processing equipment.”。Can draw, task B is moved to the second data processing equipment GPU2, and now the timeslice of GPU2 is 11, is greater than preset value 8; Task B is moved to the 3rd data processing equipment GPU3, now the timeslice of GPU3 is 12, is greater than preset value 8, now moves number of times and equals the second preset value 2, continues task B to move to the GPU4 that timeslice is minimum.
According to another preferred embodiment in step 103, be described to " according to the degree of correlation of task in described task to be migrated and other data processing equipments; determine described task immigration to be migrated to the process of the second data processing equipment be: the degree of correlation of obtaining each task and task to be migrated in other data processing equipments; calculate the degree of correlation sum of task in each data processing equipment; by relatively obtaining the highest data processing equipment of degree of correlation sum, using it as the second data processing equipment.”。Can draw, task B is moved to the second data processing equipment GPU2, and now the timeslice of GPU2 is 11, is greater than preset value 8; Task B is moved to the 3rd data processing equipment GPU3, now the timeslice of GPU3 is 12, is greater than preset value 8, now moves number of times and equals the second preset value 2, continues task B to move to the GPU4 that timeslice is minimum.
Figure 2 shows that the schematic diagram of many data processing equipments cooperative operation system that preferred embodiment according to the present invention provides.As shown in Figure 2, many data processing equipments cooperative operation system that preferred embodiment of the present invention provides, comprises controller and a plurality of data processing equipment; Described a plurality of data processing equipment is connected with controller respectively, between described a plurality of data processing equipments, interconnects; Described data processing equipment is for the treatment of one or more tasks of its correspondence; While being also greater than the first preset value for the timeslice when the first data processing equipment, according to the priority of task, determining task to be migrated, and task to be migrated is sent to controller; Described controller is for receiving the task to be migrated that described the first data processing equipment sends, and according to the degree of correlation of task in described task to be migrated and other data processing equipments, determine the second data processing equipment that described task immigration to be migrated arrives, and by described task immigration to be migrated to the second data processing equipment.
Many data processing equipments cooperative operation system that preferred embodiment of the present invention provides, described task immigration to be migrated is after the second data processing equipment, if the timeslice of described the second data processing equipment is greater than the first preset value, described the second data processing equipment is for sending to controller by described task to be migrated; Described controller is for receiving the task to be migrated that the second data processing equipment sends, and determine according to the degree of correlation of task in described task to be migrated and the data processing equipment of not accessing the 3rd data processing equipment moving to, and by described task immigration to the three data processing equipments to be migrated.
In addition, about the specific operation process of said system with described in said method, therefore repeat no more in this.
Compared to prior art, according to many data processing equipments collaboration working method provided by the invention and system, realized rational load sharing between a plurality of data processing equipments.
In addition, by following scheme: if described task immigration to be migrated is after described the second data processing equipment, the timeslice of described the second data processing equipment is greater than the first preset value, the degree of correlation according to task in described task to be migrated and the data processing equipment of not accessing is determined the 3rd data processing equipment moving to, and by described task immigration to the three data processing equipments to be migrated, realize the repeatedly migration of task to be migrated, realized accuracy, the rationality of task immigration target to be migrated.
In addition, by following scheme: if when the migration number of times of described task to be migrated is more than or equal to the second preset value, described task immigration to be migrated is arrived to the minimum data processing equipment of timeslice, saved system resource.The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.