The adaptive approach of grid environment facing to proxy programming calculation task
Technical field
The present invention relates to solve the method for calculation task adaptive mesh environment, belong to the crossing domain of grid and mobile agent by mobile agent.
Background technology
Grid is the problem of coordinating, consulting, cooperate that solves the distributed system from different angles with the agency.Grid is to provide safe and reliable resource sharing architecture by a series of instruments for the dynamic geographical Virtual Organization that distributes of going up, so grid can be thought " skeleton " of distributed computing environment.And the agency is a kind of entity that can adapt to the autonomy of dynamic environment, realize their design object by the behavior of autonomy, wherein the mobile agent autonomy that not only has an agency also has movability, and therefore the agency can think " brain " of distributed computing environment.Grid lack of wisdom but it is safe and reliable is acted on behalf of then on the contrary, therefore can better solve large-scale distributed computational problem in conjunction with grid and agency's advantage separately.
The existing at present scheme that solves some problems in the grid environment that agent skill group is applied to, as utilize the scheduling agent gridding task, utilize the attribute prediction of agency to gridding resource and task, utilize mobile agent to obtain gridding resource information etc., yet in these schemes, grid and agency do not remedy defective separately mutually, agency's safety issue, monitoring resource, data transmission scheme still has a style of one's own, the complete independent operating of grid platform and agent platform.Therefore need platform new, that integrate be proposed in conjunction with both advantages.The MAG project of existing platform such as DEINF/UFMA proposes at grid middleware InteGrade and acts on behalf of the fault tolerant that middleware MAG of redevelopment on the basis of middleware Jade supports task, yet task agent itself does not have intelligently in this scheme, and the detecting of task mistake, the decision-making of mobile behavior are all acted on behalf of by other and finished.
In addition, gridding scheduling is the focus of grid research always.The dispatching algorithm of task derives from cluster mostly in the grid at present, yet grid environment and cluster environment difference are huge, the cluster resource variation is less and measurable as the gridding resource height is dynamic and unpredictable, and grid environment need consider that the network environment cluster then can be ignored.Therefore, except dispatching algorithm, the behavior that makes task can produce the adaptive mesh environmental change is to guarantee task key stable, that carry out fast.
Summary of the invention
Technical matters: the purpose of this invention is to provide a kind of adaptive approach of grid environment facing to proxy programming calculation task, solve the fusion problem efficiently of grid environment and mobile agent, the adaptive problem that the solution task agent can be under grid environment.
Technical scheme: the adaptive approach of the grid environment facing to proxy programming calculation task that the present invention proposes, it is characterized in that this method increases new homework type " AGENT ", make the constructive process compatibility fully of constructive process and existing gridding task of task agent; By disposing the G-A container, this container provides proxy management service and the proxy message service of satisfying FIPA standard and WSRF standard, supports moving and position fixing process of task agent, makes the variation that task agent can the adaptive mesh environment, the mobile decision-making of intelligence, its concrete process is as follows:
The first step: towards the Program design for calculation of proxy programming:
11. write the calculating behavior, it comprises the code of calculation task,
12. write the shift strategy behavior, it is carried out in being independent of agency's thread, the target that the variation of perception environment and selection are moved,
13. write the behavior of serializing intermediate data, need the data of serializing in the define program, regular or mobile preceding scheduling behavior execution,
Second step: creation task agency:
21. write task description file,
22. task scheduling,
23. task is submitted to:
I. the grid clients program is submitted to operation the task management factory service of resource;
Ii. the service verification user agent of task management factory certificate, and to this user's behavior mandate,
If authentication vs. authorization success then forward next step to, otherwise by the client secure authentication failed;
Iii. task description file is resolved in task management factory service, prepares data as need, then calls grid data transmission service the data of needs are passed to designated directory;
Iv. the type of task management factory service discovery operation is " AGENT ", transfers control to the proxy management service;
V. the proxy management service is written into agency's code, if be written into success then return the agent identification of the overall situation, creates agency's failure otherwise return;
Vi. proxy management service update agent information table, and with master agent management service synchronizing information;
Vii. task agent is created and is finished;
The 3rd step: mobile task agent:
31. triggering, agency's shift strategy behavior moves,
32. the agency is interrupted current execution, and carries out the behavior of serializing intermediate data,
33. agent advertisement local agent management service need move,
34. the local agent management service informs that by proxy message transmission service the remote agent management service will move an agency to him, calls grid data transmission service simultaneously and will arrive remote resource with acting on behalf of related data transmission,
35. receive the message of transmission success when the local agent service after, transmission starts agency's ACL command messages to the remote agent management service,
36. the remote agent management service is rebuild the agency according to the proxy information that transmits, if success then return success message, and the update agent information table; Otherwise, return failure,
37. the local agent management service is received the message of success, then with the information deletion of local agent, upgrades the local agent information table simultaneously; Otherwise reselect resource and forward step 34 to,
The 4th step: the location of task agent:
41. the user identifies according to task agent, at first to the proxy information table cache inquiry proxy position of user place main frame, if successful inquiring then forward 44 to; Otherwise forward next step to;
42. the user is according to the position of proxy management services request this task agent of task agent sign in main G-A container;
43. master agent management service inquiry proxy information table, if successful inquiring then return to the position of this task agent of user, otherwise would return failed message;
44. the user sends the request information on services according to the task agent position that obtains to this task agent, as asks success, then upgrades the proxy information table cache of user place main frame.Otherwise forward step 42 to.
The realization of the proxy management service of FIPA standard and WSRF standard and proxy message service and the step of deployment are as follows:
1. proxy management service: the characteristic of this service is that its function satisfies the FIPA standard, and the WSRF standard is satisfied in its realization, needs the function of realization as follows:
A. support that the agency creates, comprising:
A1. support calling of task management middleware, act on behalf of according to the task attribute creation task;
A2. support to recover the agency from the intermediate data of backup;
A3. support the reconstruction of mobile task agent;
B. support agency's deletion;
The deletion of the proxy data of B1. failing;
B2. after the agency moves successfully, with the proxy data deletion of this locality;
C. support automatic maintenance proxy information table;
C1. create the renewal of the proxy information after acting on behalf of,
C2. the renewal of the proxy information behind the deletion agency,
D. support the agent location inquiry;
2. dispose main G-A container, it is as host's container of primary resource monitoring and discovery service and master agent management service;
3. dispose sub-G-A container, they must be pointed out the primary resource monitoring and find host's container of service and master agent management service.
Beneficial effect: the adaptive approach of the grid environment facing to proxy programming calculation task that the present invention proposes has been compared following advantage with existing method by mobile agent solution calculation task adaptive mesh environment:
1. the G-A container of the present invention's proposition is with grid and agent skill group combination more closely, show as the agency and will directly utilize existing grid security infrastructure, grid data transmission service, gridding resource monitoring and find service, for agency's safety, data transmission, scheduling and decision-making provides direct support.
2. by realizing satisfying simultaneously the proxy management service and the proxy message transmission service of FIPA standard and WSRF standard, realize both in conjunction with comparing by the middleware of multilayer, simplified the complexity that grid is supported agent skill group with present.
3. by method planning grid task towards proxy programming, allow programming personnel's specified data preserve behavior and mobile decision behavior, the task that makes not only can intelligence decision-making opportunity of moving and also after moving to target container, can return to previous comparatively approaching executing state, stablizing of assurance task effectively carried out.
4. by the task type " AGENT " of redetermination, determine that submitting to of task will be a mobile agent.The task of existing other types is compatible fully as the submission process of " FORK ", " MPI ", " MULT " in the submission process of the definition of task description document and task and the grid, remain on like this under existing customer end and the situation serve end program minor modifications, support the management of new proxy task.
Description of drawings
Fig. 1 is a G-A containment system structural drawing;
Fig. 2 is that creation task is acted on behalf of process flow diagram;
Fig. 3 is mobile task agent process flow diagram;
Fig. 4 is that location tasks is acted on behalf of process flow diagram.
Embodiment
In order better to explain the reason that technique scheme produces and to realize details, now each step is described in detail as follows:
The realization and the deployment of step 1:G-A container (Grid-Agent Container):
Grid container such as Globus Toolkit4 are by realizing serving the function that various resource sharings are provided based on the WSRF standard web, comprise grid security infrastructure (GSI), grid data transmission, gridding resource monitoring and discovery, grid job management, other functions are still constantly perfect.Based on this open mesh services framework, will support that the service of mobile agent joins in this framework, directly support agency's management and be feasible alternately.Consider and only be concerned about that here a plurality of mobile agents solve the adaptive problem of large-scale distributed calculating, need to reduce the function of multi-agent system.The G-A container of exploitation is a mesh services framework based on opening, can hold the grid container of mobile agent.Concrete develop and field step is as follows:
4. development and agency management service, the function of this service satisfies the FIPA standard, and its implementation satisfies the WSRF standard, specifically need be achieved as follows function:
A. support that the agency creates, comprising:
A) support calling of task management middleware, act on behalf of according to the task attribute creation task;
B) support to recover the agency from the intermediate data of backup;
C) reconstruction of the task agent that support to move;
B. support agency's deletion;
A) deletion of failure proxy data;
B) after the agency moves successfully, with the proxy data deletion of this locality;
C. support automatic maintenance proxy information table;
A) renewal of the proxy information behind the establishment agency
B) renewal of the proxy information behind the deletion agency
D. support the agent location inquiry;
5. development and agency transmission of messages service, the function of this service satisfies the FIPA standard, and its implementation satisfies the WSRF standard, realizes supporting the processing procedure of ACL message;
6. dispose main G-A container.It is as host's container of primary resource monitoring and discovery service and master agent management service;
7. dispose sub-G-A container.They must be pointed out the primary resource monitoring and find host's container of service and master agent management service.
Step 2: towards the Program design for calculation of proxy programming
A shortcoming of carrying out in grid environment based on the program of object-oriented method is that it lacks effective migration means.Usually the migration of process or thread is of a high price, as supporting the migration of thread by using the Brakers framework among the JAVA.Because the procedure development personnel know that usually it is necessary that what data is carried out program recovery, therefore can by allowing programmer oneself specify which data to need serializing, can not recover to act on behalf of interruption fully based on these data and carry out preceding momentary status, but can return to " last one " consistent state.
Use for reference the notion of act of agency among the Jade, Jade is a Development Framework of acting on behalf of based on JAVA of increasing income.The step of writing task agent is as follows:
8. write the calculating behavior.It comprises the code of calculation task.
9. write the shift strategy behavior.It is carried out in being independent of agency's thread, the target that the variation of perception environment and selection are moved.
10. write the behavior of serializing intermediate data.The data that need serializing in the define program, regular or mobile preceding scheduling behavior execution.
Step 3: creation task agency
Be the compatibility of maintenance and existing grid job management middleware, it is identical with the process of operation submission that the constructive process of task agent keeps, and the type of operation also needs to support " AGENT " except " FORK ", " MULTI " and " MPI " in addition.When the operation homework type that service discovery submits to that directs a factory is " AGENT ", then give the proxy management service with the instantiation process of this operation, concrete step is as follows:
Write task description file.This document needs clear and definite two class job informations:
A. job property: homework type, program language, executive routine, program execution parameter, upload data file address, OPADD, mistake OPADD, letter of attorment etc. as a result;
B. demand is carried out in operation: architecture, CPU reason speed, CPU number, free memory size, available hard disk space etc.;
Task scheduling.Scheduler obtains the information of all resources in the grid environment from gridding resource monitoring and discovery service, and selects the resource of execution according to best match algorithm (being the highest resource of matching performance) according to operation execution demand.
A. the grid clients program is submitted to operation the task management factory service of resource;
B. the service verification user agent of task management factory certificate, and to this user's behavior mandate, if authentication vs. authorization success then forward next step to, otherwise by the client secure authentication failed;
C. task description file is resolved in task management factory service, prepares data as need, then calls grid data transmission service the data of needs are passed to designated directory;
D. the type of task management factory service discovery operation is " AGENT ", transfers control to the proxy management service;
E. the proxy management service is written into agency's code, if be written into success then return the agent identification (AID) of the overall situation, creates agency's failure otherwise return;
F. proxy management service update agent information table, and with master agent management service synchronizing information;
G. task agent is created and is finished.
Step 4: mobile task agent
Agency's shift strategy triggers moving of agency.And proxy management is included in the local resource information that makes the agency can visit the local resource monitoring easily in the grid container and find the service collection, provides support for acting on behalf of mobile decision-making.The step that the agency moves is as follows:
Agency's shift strategy behavior triggers moves
The agency is interrupted current execution, and carries out the behavior of serializing intermediate data
Agent advertisement local agent management service need move
The local agent management service informs that by proxy message transmission service the remote agent management service will move an agency to him, call simultaneously grid data transmission service will with act on behalf of related data transmission to remote resource.
Receive the message of transmission success when the local agent service after, the ACL command messages that sends the startup agency is to the remote agent management service.
The remote agent management service is rebuild the agency according to the proxy information that transmits, if success then return success message, and the update agent information table; Otherwise, return failure.
The local agent management service is received the message of success, then with the information deletion of local agent, upgrades the local agent information table simultaneously; Otherwise reselect resource and forward to 4..
Step 5: the location of task agent
Because task agent can move with the variation of environment, so the tracing task agent location is to guarantee to obtain the executing state of task agent and the key of execution result.The position fixing process of task agent and name server are sought the similar process of IP address, and concrete step is as follows:
21 users are according to task agent sign (AID), at first to the proxy information table cache inquiry proxy position of user place main frame, if successful inquiring then forward to 4.; Otherwise forward next step to;
22 users are according to the position of task agent sign (AID) this task agent of proxy management services request in main G-A container;
23 master agent management service inquiry proxy information tables, if successful inquiring then return to the position of this task agent of user, otherwise would return failed message;
24 users send the request information on services according to the task agent position that obtains to this task agent, as ask success, then upgrade the proxy information table cache of user place main frame.Otherwise forward to 2..
Step 6: the obtaining of task result
Task agent finally can be transferred to the result in the OPADD as a result of job property definition with the form of file, and the user can be directly according to this address data download.